QMCPACK
LRCoulombSingleton Struct Reference
+ Collaboration diagram for LRCoulombSingleton:

Public Types

enum  lr_type {
  ESLER = 0, EWALD, NATOLI, QUASI2D,
  STRICT2D
}
 
using LRHandlerType = LRHandlerBase
 
using GridType = LinearGrid< pRealType >
 
using RadFunctorType = OneDimCubicSpline< pRealType >
 

Static Public Member Functions

static std::unique_ptr< LRHandlerTypegetHandler (ParticleSet &ref)
 This returns an energy optimized LR handler. If non existent, it creates one. More...
 
static std::unique_ptr< LRHandlerTypegetDerivHandler (ParticleSet &ref)
 This returns a force/stress optimized LR handler. If non existent, it creates one. More...
 
static bool isQuasi2D ()
 return true if quasi 2D is selected More...
 
static std::unique_ptr< RadFunctorTypecreateSpline4RbyVs (const LRHandlerType *aLR, mRealType rcut, const GridType &agrid)
 create a linear spline function More...
 
static std::unique_ptr< RadFunctorTypecreateSpline4RbyVsDeriv (const LRHandlerType *aLR, mRealType rcut, const GridType &agrid)
 create a linear spline of the derivative of short-range potential More...
 

Static Public Attributes

static lr_type this_lr_type = ESLER
 
static std::unique_ptr< LRHandlerTypeCoulombHandler
 Stores the energ optimized LR handler. More...
 
static std::unique_ptr< LRHandlerTypeCoulombDerivHandler
 Stores the force/stress optimized LR handler. More...
 

Detailed Description

Definition at line 32 of file LRCoulombSingleton.h.

Member Typedef Documentation

◆ GridType

Definition at line 37 of file LRCoulombSingleton.h.

◆ LRHandlerType

Definition at line 36 of file LRCoulombSingleton.h.

◆ RadFunctorType

Definition at line 38 of file LRCoulombSingleton.h.

Member Enumeration Documentation

◆ lr_type

Member Function Documentation

◆ createSpline4RbyVs()

std::unique_ptr< LRCoulombSingleton::RadFunctorType > createSpline4RbyVs ( const LRHandlerType aLR,
mRealType  rcut,
const GridType agrid 
)
static

create a linear spline function

Parameters
aLRLRHandler
rcutcutoff radius
agridpointer to a grid
Returns
a RadFunctorType

The spline function is the short-range term after breaking up $r V_{S} = r \times (V(r)-V_{L})$

Definition at line 191 of file LRCoulombSingleton.cpp.

References qmcplusplus::createSpline4RbyVs_temp().

Referenced by QMCFiniteSize::initBreakup(), CoulombPBCAA::initBreakup(), and CoulombPBCAB::initBreakup().

194 {
195  return createSpline4RbyVs_temp(aLR, static_cast<pRealType>(rcut), agrid);
196 }
std::unique_ptr< OneDimCubicSpline< T > > createSpline4RbyVs_temp(const LRHandlerBase *aLR, T rcut, const LinearGrid< T > &agrid)

◆ createSpline4RbyVsDeriv()

std::unique_ptr< LRCoulombSingleton::RadFunctorType > createSpline4RbyVsDeriv ( const LRHandlerType aLR,
mRealType  rcut,
const GridType agrid 
)
static

create a linear spline of the derivative of short-range potential

Parameters
aLRLRHandler
rcutcutoff radius
agridpointer to a grid
Returns
a RadFunctorType

The spline function is the short-range term after breaking up $r \frac{d}{dr} V_{S} = \frac{d}{dr}\left(r \times (V(r)-V_{L})\right)$

Definition at line 198 of file LRCoulombSingleton.cpp.

References qmcplusplus::createSpline4RbyVsDeriv_temp().

Referenced by CoulombPBCAB::initBreakup().

202 {
203  return createSpline4RbyVsDeriv_temp(aLR, static_cast<pRealType>(rcut), agrid);
204 }
std::unique_ptr< OneDimCubicSpline< T > > createSpline4RbyVsDeriv_temp(const LRHandlerBase *aLR, T rcut, const LinearGrid< T > &agrid)

◆ getDerivHandler()

std::unique_ptr< LRCoulombSingleton::LRHandlerType > getDerivHandler ( ParticleSet ref)
static

This returns a force/stress optimized LR handler. If non existent, it creates one.

Definition at line 103 of file LRCoulombSingleton.cpp.

References APP_ABORT, qmcplusplus::app_log(), LRCoulombSingleton::CoulombDerivHandler, LRCoulombSingleton::ESLER, LRCoulombSingleton::EWALD, LRCoulombSingleton::NATOLI, and LRCoulombSingleton::this_lr_type.

Referenced by ForceChiesaPBCAA::initBreakup(), StressPBC::initBreakup(), CoulombPBCAA::initBreakup(), and CoulombPBCAB::initBreakup().

104 {
105  //APP_ABORT("SR Coulomb Basis Handler has cloning issues. Stress also has some kinks");
106  if (CoulombDerivHandler == 0)
107  {
108  if (this_lr_type == EWALD)
109  {
110  app_log() << "\n Creating CoulombDerivHandler with the 3D Ewald Breakup. " << std::endl;
111  CoulombDerivHandler = std::make_unique<EwaldHandler3D>(ref);
112  }
113  else if (this_lr_type == NATOLI)
114  {
115  app_log() << "\n Creating CoulombDerivHandler with the Natoli Optimized Breakup. " << std::endl;
116  CoulombDerivHandler = std::make_unique<LRHandlerSRCoulomb<CoulombFunctor<mRealType>, LPQHISRCoulombBasis>>(ref);
117  }
118  else if (this_lr_type == ESLER)
119  {
120  APP_ABORT("\n Derivatives are not supported with Esler Optimized Breakup.\n");
121  }
122  else
123  {
124  APP_ABORT("\n Long range breakup method for derivatives not recognized.\n");
125  }
126  CoulombDerivHandler->initBreakup(ref);
127  return std::unique_ptr<LRHandlerType>(CoulombDerivHandler->makeClone(ref));
128  }
129  else
130  {
131  app_log() << " Clone CoulombDerivHandler. " << std::endl;
132  return std::unique_ptr<LRHandlerType>(CoulombDerivHandler->makeClone(ref));
133  }
134 }
static std::unique_ptr< LRHandlerType > CoulombDerivHandler
Stores the force/stress optimized LR handler.
std::ostream & app_log()
Definition: OutputManager.h:65
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ getHandler()

std::unique_ptr< LRCoulombSingleton::LRHandlerType > getHandler ( ParticleSet ref)
static

This returns an energy optimized LR handler. If non existent, it creates one.

Definition at line 60 of file LRCoulombSingleton.cpp.

References APP_ABORT, qmcplusplus::app_log(), LRCoulombSingleton::CoulombHandler, LRCoulombSingleton::ESLER, LRCoulombSingleton::EWALD, LRCoulombSingleton::NATOLI, LRCoulombSingleton::QUASI2D, LRCoulombSingleton::STRICT2D, and LRCoulombSingleton::this_lr_type.

Referenced by QMCFiniteSize::initBreakup(), CoulombPBCAA::initBreakup(), and CoulombPBCAB::initBreakup().

61 {
62  if (CoulombHandler == 0)
63  {
64  if (this_lr_type == ESLER)
65  {
66  app_log() << "\n Creating CoulombHandler with the Esler Optimized Breakup. " << std::endl;
67  CoulombHandler = std::make_unique<LRHandlerTemp<CoulombFunctor<mRealType>, LPQHIBasis>>(ref);
68  }
69  else if (this_lr_type == EWALD)
70  {
71  app_log() << "\n Creating CoulombHandler with the 3D Ewald Breakup. " << std::endl;
72  CoulombHandler = std::make_unique<EwaldHandler3D>(ref);
73  }
74  else if (this_lr_type == NATOLI)
75  {
76  app_log() << "\n Creating CoulombHandler with the Natoli Optimized Breakup. " << std::endl;
77  CoulombHandler = std::make_unique<LRHandlerSRCoulomb<CoulombFunctor<mRealType>, LPQHISRCoulombBasis>>(ref);
78  }
79  else if (this_lr_type == STRICT2D)
80  {
81  app_log() << "\n Creating CoulombHandler with the 2D Ewald Breakup. " << std::endl;
82  CoulombHandler = std::make_unique<EwaldHandler2D>(ref);
83  }
84  else if (this_lr_type == QUASI2D)
85  {
86  app_log() << "\n Creating CoulombHandler using quasi-2D Ewald method for the slab. " << std::endl;
87  CoulombHandler = std::make_unique<EwaldHandlerQuasi2D>(ref);
88  }
89  else
90  {
91  APP_ABORT("\n Long range breakup method not recognized.\n");
92  }
93  CoulombHandler->initBreakup(ref);
94  return std::unique_ptr<LRHandlerType>(CoulombHandler->makeClone(ref));
95  }
96  else
97  {
98  app_log() << " Clone CoulombHandler. " << std::endl;
99  return std::unique_ptr<LRHandlerType>(CoulombHandler->makeClone(ref));
100  }
101 }
std::ostream & app_log()
Definition: OutputManager.h:65
static std::unique_ptr< LRHandlerType > CoulombHandler
Stores the energ optimized LR handler.
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ isQuasi2D()

Member Data Documentation

◆ CoulombDerivHandler

std::unique_ptr< LRCoulombSingleton::LRHandlerType > CoulombDerivHandler
static

Stores the force/stress optimized LR handler.

Definition at line 52 of file LRCoulombSingleton.h.

Referenced by LRCoulombSingleton::getDerivHandler(), and qmcplusplus::TEST_CASE().

◆ CoulombHandler

std::unique_ptr< LRCoulombSingleton::LRHandlerType > CoulombHandler
static

Stores the energ optimized LR handler.

Definition at line 50 of file LRCoulombSingleton.h.

Referenced by LRCoulombSingleton::getHandler(), qmcplusplus::TEST_CASE(), and qmcplusplus::test_CoulombPBCAA_3p().

◆ this_lr_type


The documentation for this struct was generated from the following files: