QMCPACK
EwaldHandler3D Class Reference
+ Inheritance diagram for EwaldHandler3D:
+ Collaboration diagram for EwaldHandler3D:

Public Member Functions

 EwaldHandler3D (ParticleSet &ref, mRealType kc_in=-1.0)
 Constructor. More...
 
 EwaldHandler3D (const EwaldHandler3D &aLR, ParticleSet &ref)
 "copy" constructor More...
 
LRHandlerBasemakeClone (ParticleSet &ref) const override
 make clone More...
 
void initBreakup (ParticleSet &ref) override
 
void Breakup (ParticleSet &ref, mRealType rs_in) override
 
void resetTargetParticleSet (ParticleSet &ref) override
 
mRealType evaluate (mRealType r, mRealType rinv) const override
 
mRealType evaluateLR (mRealType r) const override
 evaluate the contribution from the long-range part for for spline More...
 
mRealType evaluateSR_k0 () const override
 evaluate $ v_{s}(k=0) = \frac{4\pi}{V}\int_0^{r_c} r^2 v_s(r) dr $ More...
 
mRealType evaluate_vlr_k (mRealType k) const override
 
mRealType evaluateLR_r0 () const override
 evaluate $ v_s(r=0) $ for the self-interaction term More...
 
mRealType srDf (mRealType r, mRealType rinv) const override
 evaluate the first derivative of the short range part at r More...
 
mRealType lrDf (mRealType r) const override
 evaluate the first derivative of the long range part (in real space) at r More...
 
void fillFk (const KContainer &KList)
 
void fillYkgstrain (const KContainer &KList)
 
void filldFk_dk (const KContainer &KList)
 
SymTensor< mRealType, OHMMS_DIMevaluateLR_dstrain (TinyVector< pRealType, OHMMS_DIM > k, pRealType kmag) const override
 
SymTensor< mRealType, OHMMS_DIMevaluateSR_dstrain (TinyVector< pRealType, OHMMS_DIM > r, pRealType rmag) const override
 
SymTensor< mRealType, OHMMS_DIMevaluateSR_k0_dstrain () const override
 
mRealType evaluateLR_r0_dstrain (int i, int j) const
 
SymTensor< mRealType, OHMMS_DIMevaluateLR_r0_dstrain () const override
 These functions return the strain derivatives of all corresponding quantities in total energy. More...
 
- Public Member Functions inherited from LRHandlerBase
 LRHandlerBase (mRealType kc)
 
virtual ~LRHandlerBase ()=default
 
mRealType get_rc () const
 
mRealType get_kc () const
 
mRealType evaluate_w_sk (const std::vector< int > &kshell, const pRealType *restrict sk) const
 
mRealType evaluate (const std::vector< int > &kshell, const pRealType *restrict rk1_r, const pRealType *restrict rk1_i, const pRealType *restrict rk2_r, const pRealType *restrict rk2_i) const
 evaluate $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$ More...
 
virtual mRealType evaluate_slab (pRealType z, const std::vector< int > &kshell, const pRealType *restrict rk1_r, const pRealType *restrict rk1_i, const pRealType *restrict rk2_r, const pRealType *restrict rk2_i) const
 Evaluate the long-range potential with the open BC for the D-1 direction. More...
 
void evaluateGrad (const ParticleSet &A, const ParticleSet &B, int specB, std::vector< pRealType > &Zat, std::vector< TinyVector< pRealType, OHMMS_DIM >> &grad1) const
 evaluate $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$ and $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$ More...
 
SymTensor< pRealType, OHMMS_DIMevaluateStress (const std::vector< int > &kshell, const pRealType *rhokA_r, const pRealType *rhokA_i, const pRealType *rhokB_r, const pRealType *rhokB_i) const
 FIX_PRECISION. More...
 

Public Attributes

int SuperCellEnum
 type of supercell More...
 
mRealType Sigma
 Related to the Gaussian width: $ v_l = v(r)erf(\sigma r)$. More...
 
mRealType Volume
 Volume of the supercell. More...
 
mRealType Area
 Area of the supercell: always z is the slab direction. More...
 
TinyVector< mRealType, 4 > PreFactors
 
std::vector< mRealTypekMag
 store |k| More...
 
- Public Attributes inherited from LRHandlerBase
DECLARE_COULOMB_TYPES int MaxKshell
 Maxkimum Kshell for the given Kc. More...
 
mRealType LR_kc
 Maximum k cutoff. More...
 
mRealType LR_rc
 Maximum r cutoff. More...
 
Vector< mRealTypeFk
 Fourier component for all the k-point. More...
 
Vector< mRealTypeFkg
 Fourier component of the LR part, fit to optimize the gradients. More...
 
std::vector< SymTensor< mRealType, OHMMS_DIM > > dFk_dstrain
 Fourier component of the LR part of strain tensor, by optimized breakup. More...
 
Vector< mRealTypeFkgstrain
 Vector of df_k/dk, fit as to optimize strains. More...
 
Vector< mRealTypeFk_symm
 Fourier component for each k-shell. More...
 
std::vector< mRealTypecoefs
 Fourier component for each k-shell Coefficient. More...
 
std::vector< mRealTypegcoefs
 Coefficient for gradient fit. More...
 
std::vector< mRealTypegstraincoefs
 Coefficient for strain fit. More...
 

Private Member Functions

mRealType evalYkgstrain (mRealType k) const
 
mRealType evaldYkgstrain (mRealType k) const
 

Additional Inherited Members

- Protected Attributes inherited from LRHandlerBase
std::string ClassName
 

Detailed Description

Definition at line 27 of file EwaldHandler3D.h.

Constructor & Destructor Documentation

◆ EwaldHandler3D() [1/2]

EwaldHandler3D ( ParticleSet ref,
mRealType  kc_in = -1.0 
)
inline

Constructor.

Definition at line 43 of file EwaldHandler3D.h.

References LRHandlerBase::ClassName, ParticleSet::getLattice(), LRHandlerBase::LR_kc, and EwaldHandler3D::Sigma.

Referenced by EwaldHandler3D::makeClone().

43  : LRHandlerBase(kc_in)
44  {
45  LRHandlerBase::ClassName = "EwaldHandler3D";
46  Sigma = LR_kc = ref.getLattice().LR_kc;
47  }
mRealType LR_kc
Maximum k cutoff.
Definition: LRHandlerBase.h:37
mRealType Sigma
Related to the Gaussian width: .

◆ EwaldHandler3D() [2/2]

EwaldHandler3D ( const EwaldHandler3D aLR,
ParticleSet ref 
)

"copy" constructor

Parameters
aLRLRHandlerTemp
refParticleset

Copy the content of aLR References to ParticleSet or ParticleLayoutout_t are not copied.

Definition at line 48 of file EwaldHandler3D.cpp.

References EwaldHandler3D::SuperCellEnum.

49  : LRHandlerBase(aLR), Sigma(aLR.Sigma), Volume(aLR.Volume), Area(aLR.Area), PreFactors(aLR.PreFactors)
50 {
51  SuperCellEnum = aLR.SuperCellEnum;
52 }
mRealType Sigma
Related to the Gaussian width: .
mRealType Area
Area of the supercell: always z is the slab direction.
mRealType Volume
Volume of the supercell.
int SuperCellEnum
type of supercell
TinyVector< mRealType, 4 > PreFactors

Member Function Documentation

◆ Breakup()

void Breakup ( ParticleSet ref,
mRealType  rs_in 
)
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 62 of file EwaldHandler3D.h.

References EwaldHandler3D::initBreakup().

62 { initBreakup(ref); }
void initBreakup(ParticleSet &ref) override

◆ evaldYkgstrain()

mRealType evaldYkgstrain ( mRealType  k) const
inlineprivate

Definition at line 193 of file EwaldHandler3D.h.

References qmcplusplus::exp(), norm(), EwaldHandler3D::Sigma, and EwaldHandler3D::Volume.

Referenced by EwaldHandler3D::evaluateLR_dstrain().

194  {
195  mRealType norm = 4.0 * M_PI / Volume;
196  mRealType denom = 4.0 * Sigma * Sigma;
197  mRealType sigma2 = Sigma * Sigma;
198  mRealType k2 = k * k;
199  return -norm * std::exp(-k2 / denom) * (denom + k2) / (k * k2 * 2.0 * sigma2);
200  }
EwaldHandler3D::mRealType mRealType
mRealType Sigma
Related to the Gaussian width: .
mRealType Volume
Volume of the supercell.
double norm(const zVec &c)
Definition: VectorOps.h:118
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)

◆ evaluate()

mRealType evaluate ( mRealType  r,
mRealType  rinv 
) const
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 66 of file EwaldHandler3D.h.

References EwaldHandler3D::Sigma.

Referenced by qmcplusplus::TEST_CASE().

66 { return erfc(r * Sigma) * rinv; }
mRealType Sigma
Related to the Gaussian width: .

◆ evaluate_vlr_k()

EwaldHandler3D::mRealType evaluate_vlr_k ( mRealType  k) const
overridevirtual

Implements LRHandlerBase.

Definition at line 82 of file EwaldHandler3D.cpp.

References qmcplusplus::exp(), EwaldHandler3D::Sigma, and EwaldHandler3D::Volume.

83 {
84  mRealType kgauss = 1.0 / (4 * Sigma * Sigma);
85  mRealType knorm = 4 * M_PI / Volume;
86  mRealType k2 = k * k;
87  return knorm * std::exp(-k2 * kgauss) / k2;
88 }
EwaldHandler3D::mRealType mRealType
mRealType Sigma
Related to the Gaussian width: .
mRealType Volume
Volume of the supercell.
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)

◆ evaluateLR()

mRealType evaluateLR ( mRealType  r) const
inlineoverridevirtual

evaluate the contribution from the long-range part for for spline

Implements LRHandlerBase.

Definition at line 70 of file EwaldHandler3D.h.

References EwaldHandler3D::Sigma.

Referenced by qmcplusplus::TEST_CASE().

70 { return erf(r * Sigma) / r; }
mRealType Sigma
Related to the Gaussian width: .

◆ evaluateLR_dstrain()

SymTensor<mRealType, OHMMS_DIM> evaluateLR_dstrain ( TinyVector< pRealType, OHMMS_DIM k,
pRealType  kmag 
) const
inlineoverridevirtual

Reimplemented from LRHandlerBase.

Definition at line 128 of file EwaldHandler3D.h.

References EwaldHandler3D::evaldYkgstrain(), EwaldHandler3D::evalYkgstrain(), and OHMMS_DIM.

Referenced by EwaldHandler3D::filldFk_dk().

130  {
131  SymTensor<mRealType, OHMMS_DIM> deriv_tensor = 0;
132 
133  for (int dim1 = 0; dim1 < OHMMS_DIM; dim1++)
134  for (int dim2 = dim1; dim2 < OHMMS_DIM; dim2++)
135  {
136  deriv_tensor(dim1, dim2) =
137  -evaldYkgstrain(kmag) * k[dim1] * k[dim2] / kmag; //- evaldFk_dk(kmag)*k[dim1]*k[dim2]/kmag ;
138 
139  if (dim1 == dim2)
140  deriv_tensor(dim1, dim2) -= evalYkgstrain(kmag); //+ derivconst;
141  }
142 
143 
144  return deriv_tensor;
145  }
#define OHMMS_DIM
Definition: config.h:64
mRealType evalYkgstrain(mRealType k) const
mRealType evaldYkgstrain(mRealType k) const

◆ evaluateLR_r0()

mRealType evaluateLR_r0 ( ) const
inlineoverridevirtual

evaluate $ v_s(r=0) $ for the self-interaction term

Reimplemented from LRHandlerBase.

Definition at line 80 of file EwaldHandler3D.h.

References EwaldHandler3D::Sigma, and qmcplusplus::sqrt().

80 { return 2.0 * Sigma / std::sqrt(M_PI); }
mRealType Sigma
Related to the Gaussian width: .
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ evaluateLR_r0_dstrain() [1/2]

mRealType evaluateLR_r0_dstrain ( int  i,
int  j 
) const
inline

Definition at line 176 of file EwaldHandler3D.h.

176 { return 0.0; }

◆ evaluateLR_r0_dstrain() [2/2]

SymTensor<mRealType, OHMMS_DIM> evaluateLR_r0_dstrain ( ) const
inlineoverridevirtual

These functions return the strain derivatives of all corresponding quantities in total energy.

See documentation (forthcoming).

Reimplemented from LRHandlerBase.

Definition at line 178 of file EwaldHandler3D.h.

179  {
180  SymTensor<mRealType, OHMMS_DIM> stress;
181  return stress;
182  }

◆ evaluateSR_dstrain()

SymTensor<mRealType, OHMMS_DIM> evaluateSR_dstrain ( TinyVector< pRealType, OHMMS_DIM r,
pRealType  rmag 
) const
inlineoverridevirtual

Reimplemented from LRHandlerBase.

Definition at line 148 of file EwaldHandler3D.h.

References OHMMS_DIM, and EwaldHandler3D::srDf().

150  {
151  SymTensor<mRealType, OHMMS_DIM> deriv_tensor = 0;
152 
153  mRealType Sr_r = srDf(rmag, 1.0 / mRealType(rmag)) / mRealType(rmag);
154 
155  for (int dim1 = 0; dim1 < OHMMS_DIM; dim1++)
156  {
157  for (int dim2 = dim1; dim2 < OHMMS_DIM; dim2++)
158  {
159  deriv_tensor(dim1, dim2) = r[dim1] * r[dim2] * Sr_r;
160  }
161  }
162 
163  return deriv_tensor;
164  }
EwaldHandler3D::mRealType mRealType
#define OHMMS_DIM
Definition: config.h:64
mRealType srDf(mRealType r, mRealType rinv) const override
evaluate the first derivative of the short range part at r

◆ evaluateSR_k0()

mRealType evaluateSR_k0 ( ) const
inlineoverridevirtual

evaluate $ v_{s}(k=0) = \frac{4\pi}{V}\int_0^{r_c} r^2 v_s(r) dr $

Reimplemented from LRHandlerBase.

Definition at line 72 of file EwaldHandler3D.h.

References EwaldHandler3D::Sigma, and EwaldHandler3D::Volume.

73  {
74  mRealType v0 = M_PI / Sigma / Sigma / Volume;
75  return v0;
76  }
EwaldHandler3D::mRealType mRealType
mRealType Sigma
Related to the Gaussian width: .
mRealType Volume
Volume of the supercell.

◆ evaluateSR_k0_dstrain()

SymTensor<mRealType, OHMMS_DIM> evaluateSR_k0_dstrain ( ) const
inlineoverridevirtual

Reimplemented from LRHandlerBase.

Definition at line 166 of file EwaldHandler3D.h.

References OHMMS_DIM, EwaldHandler3D::Sigma, and EwaldHandler3D::Volume.

167  {
168  mRealType v0 = -M_PI / Sigma / Sigma / Volume;
169  SymTensor<mRealType, OHMMS_DIM> stress;
170  for (int i = 0; i < OHMMS_DIM; i++)
171  stress(i, i) = v0;
172 
173  return stress;
174  }
EwaldHandler3D::mRealType mRealType
mRealType Sigma
Related to the Gaussian width: .
mRealType Volume
Volume of the supercell.
#define OHMMS_DIM
Definition: config.h:64

◆ evalYkgstrain()

mRealType evalYkgstrain ( mRealType  k) const
inlineprivate

Definition at line 185 of file EwaldHandler3D.h.

References qmcplusplus::exp(), norm(), EwaldHandler3D::Sigma, and EwaldHandler3D::Volume.

Referenced by EwaldHandler3D::evaluateLR_dstrain(), and EwaldHandler3D::fillYkgstrain().

186  {
187  mRealType norm = 4.0 * M_PI / Volume;
188  mRealType denom = 4.0 * Sigma * Sigma;
189  mRealType k2 = k * k;
190  return norm * std::exp(-k2 / denom) / k2;
191  }
EwaldHandler3D::mRealType mRealType
mRealType Sigma
Related to the Gaussian width: .
mRealType Volume
Volume of the supercell.
double norm(const zVec &c)
Definition: VectorOps.h:118
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)

◆ filldFk_dk()

void filldFk_dk ( const KContainer KList)
inline

Definition at line 117 of file EwaldHandler3D.h.

References LRHandlerBase::dFk_dstrain, EwaldHandler3D::evaluateLR_dstrain(), KContainer::kpts_cart, KContainer::ksq, and qmcplusplus::sqrt().

Referenced by EwaldHandler3D::initBreakup().

118  {
119  dFk_dstrain.resize(KList.kpts_cart.size());
120 
121  for (int ki = 0; ki < dFk_dstrain.size(); ki++)
122  {
123  dFk_dstrain[ki] = evaluateLR_dstrain(KList.kpts_cart[ki], std::sqrt(KList.ksq[ki]));
124  }
125  }
std::vector< SymTensor< mRealType, OHMMS_DIM > > dFk_dstrain
Fourier component of the LR part of strain tensor, by optimized breakup.
Definition: LRHandlerBase.h:45
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
SymTensor< mRealType, OHMMS_DIM > evaluateLR_dstrain(TinyVector< pRealType, OHMMS_DIM > k, pRealType kmag) const override

◆ fillFk()

void fillFk ( const KContainer KList)

Definition at line 54 of file EwaldHandler3D.cpp.

References qmcplusplus::app_log(), qmcplusplus::exp(), LRHandlerBase::Fk, LRHandlerBase::Fk_symm, LRHandlerBase::Fkg, EwaldHandler3D::kMag, KContainer::kpts_cart, KContainer::kshell, KContainer::ksq, LRHandlerBase::MaxKshell, EwaldHandler3D::PreFactors, Vector< T, Alloc >::resize(), EwaldHandler3D::Sigma, Vector< T, Alloc >::size(), and EwaldHandler3D::Volume.

Referenced by EwaldHandler3D::initBreakup().

55 {
56  Fk.resize(KList.kpts_cart.size());
57  Fkg.resize(KList.kpts_cart.size());
58  const std::vector<int>& kshell(KList.kshell);
59 
60  MaxKshell = kshell.size() - 1;
61 
63  kMag.resize(MaxKshell);
64  mRealType kgauss = 1.0 / (4 * Sigma * Sigma);
65  mRealType knorm = 4 * M_PI / Volume;
66  for (int ks = 0, ki = 0; ks < Fk_symm.size(); ks++)
67  {
68  mRealType t2e = KList.ksq[ki] * kgauss;
69  mRealType uk = knorm * std::exp(-t2e) / KList.ksq[ki];
70  Fk_symm[ks] = uk;
71  while (ki < KList.kshell[ks + 1] && ki < Fk.size())
72  Fk[ki++] = uk;
73  }
74 
75  for (int ki = 0; ki < Fk.size(); ki++)
76  Fkg[ki] = Fk[ki];
77 
78  PreFactors[3] = 0.0;
79  app_log().flush();
80 }
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
std::ostream & app_log()
Definition: OutputManager.h:65
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
Definition: LRHandlerBase.h:35
EwaldHandler3D::mRealType mRealType
mRealType Sigma
Related to the Gaussian width: .
mRealType Volume
Volume of the supercell.
std::vector< mRealType > kMag
store |k|
size_type size() const
return the current size
Definition: OhmmsVector.h:162
Vector< mRealType > Fkg
Fourier component of the LR part, fit to optimize the gradients.
Definition: LRHandlerBase.h:43
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
Vector< mRealType > Fk
Fourier component for all the k-point.
Definition: LRHandlerBase.h:41
TinyVector< mRealType, 4 > PreFactors
Vector< mRealType > Fk_symm
Fourier component for each k-shell.
Definition: LRHandlerBase.h:49

◆ fillYkgstrain()

void fillYkgstrain ( const KContainer KList)
inline

Definition at line 104 of file EwaldHandler3D.h.

References EwaldHandler3D::evalYkgstrain(), LRHandlerBase::Fkgstrain, KContainer::kpts_cart, KContainer::kshell, KContainer::ksq, LRHandlerBase::MaxKshell, Vector< T, Alloc >::resize(), Vector< T, Alloc >::size(), and qmcplusplus::sqrt().

Referenced by EwaldHandler3D::initBreakup().

105  {
106  Fkgstrain.resize(KList.kpts_cart.size());
107  const std::vector<int>& kshell(KList.kshell);
108  MaxKshell = kshell.size() - 1;
109  for (int ks = 0, ki = 0; ks < MaxKshell; ks++)
110  {
111  mRealType uk = evalYkgstrain(std::sqrt(KList.ksq[ki]));
112  while (ki < KList.kshell[ks + 1] && ki < Fkgstrain.size())
113  Fkgstrain[ki++] = uk;
114  }
115  }
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
Definition: LRHandlerBase.h:35
EwaldHandler3D::mRealType mRealType
Vector< mRealType > Fkgstrain
Vector of df_k/dk, fit as to optimize strains.
Definition: LRHandlerBase.h:47
mRealType evalYkgstrain(mRealType k) const
size_type size() const
return the current size
Definition: OhmmsVector.h:162
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ initBreakup()

void initBreakup ( ParticleSet ref)
overridevirtual

Implements LRHandlerBase.

Definition at line 17 of file EwaldHandler3D.cpp.

References qmcplusplus::app_log(), EwaldHandler3D::filldFk_dk(), EwaldHandler3D::fillFk(), EwaldHandler3D::fillYkgstrain(), ParticleSet::getLattice(), ParticleSet::getSimulationCell(), LRHandlerBase::LR_kc, LRHandlerBase::LR_rc, EwaldHandler3D::PreFactors, EwaldHandler3D::Sigma, qmcplusplus::sqrt(), EwaldHandler3D::SuperCellEnum, and EwaldHandler3D::Volume.

Referenced by EwaldHandler3D::Breakup(), and qmcplusplus::TEST_CASE().

18 {
19  SuperCellEnum = ref.getLattice().SuperCellEnum;
20  LR_rc = ref.getLattice().LR_rc;
21  LR_kc = ref.getLattice().LR_kc;
22 
23  // Sigma=3.5;
24  //We provide two means of choosing sigma here...
25  //
26  //This condition on Sigma is based on the real space cutoff of the potential at r_c for the potential.
27  //while(erfc(Sigma)/LR_rc>1e-10)
28  //
29  //This condition on Sigma is based on the magnitude of the force at r_c for the potential.
30  // while( (erfc(Sigma)+std::exp(-Sigma*Sigma)*2*Sigma/std::sqrt(M_PI))/LR_rc/LR_rc>1e-14)
31  // {
32  // Sigma+=0.1;
33  // }
34  //
35  // app_log() << " EwaldHandler3D Sigma/LR_rc = " << Sigma ;
36  // Sigma/=ref.getLattice().LR_rc;
37 
38  //This heuristic for choosing Sigma is from the 1992 Natoli Ceperley Optimized Breakup Paper.
39  Sigma = std::sqrt(LR_kc / (2.0 * LR_rc));
40  app_log() << " Sigma=" << Sigma << std::endl;
41  Volume = ref.getLattice().Volume;
42  PreFactors = 0.0;
43  fillFk(ref.getSimulationCell().getKLists());
44  fillYkgstrain(ref.getSimulationCell().getKLists());
45  filldFk_dk(ref.getSimulationCell().getKLists());
46 }
mRealType LR_kc
Maximum k cutoff.
Definition: LRHandlerBase.h:37
std::ostream & app_log()
Definition: OutputManager.h:65
void fillYkgstrain(const KContainer &KList)
mRealType Sigma
Related to the Gaussian width: .
mRealType Volume
Volume of the supercell.
void filldFk_dk(const KContainer &KList)
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39
int SuperCellEnum
type of supercell
void fillFk(const KContainer &KList)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
TinyVector< mRealType, 4 > PreFactors

◆ lrDf()

mRealType lrDf ( mRealType  r) const
inlineoverridevirtual

evaluate the first derivative of the long range part (in real space) at r

Parameters
rradius

Reimplemented from LRHandlerBase.

Definition at line 96 of file EwaldHandler3D.h.

References qmcplusplus::exp(), EwaldHandler3D::Sigma, and qmcplusplus::sqrt().

Referenced by qmcplusplus::TEST_CASE().

97  {
98  mRealType rinv = 1.0 / r;
99  return 2.0 * Sigma * std::exp(-Sigma * Sigma * r * r) / (std::sqrt(M_PI) * r) - erf(Sigma * r) * rinv * rinv;
100  }
EwaldHandler3D::mRealType mRealType
mRealType Sigma
Related to the Gaussian width: .
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ makeClone()

LRHandlerBase* makeClone ( ParticleSet ref) const
inlineoverridevirtual

make clone

Implements LRHandlerBase.

Definition at line 58 of file EwaldHandler3D.h.

References EwaldHandler3D::EwaldHandler3D().

58 { return new EwaldHandler3D(*this, ref); }
EwaldHandler3D(ParticleSet &ref, mRealType kc_in=-1.0)
Constructor.

◆ resetTargetParticleSet()

void resetTargetParticleSet ( ParticleSet ref)
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 64 of file EwaldHandler3D.h.

64 {}

◆ srDf()

mRealType srDf ( mRealType  r,
mRealType  rinv 
) const
inlineoverridevirtual

evaluate the first derivative of the short range part at r

Parameters
rradius
rinv1/r

Implements LRHandlerBase.

Definition at line 87 of file EwaldHandler3D.h.

References qmcplusplus::exp(), EwaldHandler3D::Sigma, and qmcplusplus::sqrt().

Referenced by EwaldHandler3D::evaluateSR_dstrain(), and qmcplusplus::TEST_CASE().

88  {
89  return -2.0 * Sigma * std::exp(-Sigma * Sigma * r * r) / (std::sqrt(M_PI) * r) - erfc(Sigma * r) * rinv * rinv;
90  }
mRealType Sigma
Related to the Gaussian width: .
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

Member Data Documentation

◆ Area

mRealType Area

Area of the supercell: always z is the slab direction.

Definition at line 37 of file EwaldHandler3D.h.

◆ kMag

std::vector<mRealType> kMag

store |k|

Definition at line 41 of file EwaldHandler3D.h.

Referenced by EwaldHandler3D::fillFk().

◆ PreFactors

TinyVector<mRealType, 4> PreFactors

Definition at line 39 of file EwaldHandler3D.h.

Referenced by EwaldHandler3D::fillFk(), and EwaldHandler3D::initBreakup().

◆ Sigma

◆ SuperCellEnum

int SuperCellEnum

type of supercell

Definition at line 31 of file EwaldHandler3D.h.

Referenced by EwaldHandler3D::EwaldHandler3D(), and EwaldHandler3D::initBreakup().

◆ Volume


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