QMCPACK
DummyLRHandler< Func > Struct Template Reference

LRHandler without breakup. More...

+ Inheritance diagram for DummyLRHandler< Func >:
+ Collaboration diagram for DummyLRHandler< Func >:

Public Member Functions

 DummyLRHandler (mRealType kc=-1.0)
 
 DummyLRHandler (const DummyLRHandler &aLR)
 
void initBreakup (ParticleSet &ref) override
 
mRealType evaluate_vlr_k (mRealType k) const override
 
mRealType evaluate (mRealType r, mRealType rinv) const override
 
mRealType evaluateLR (mRealType r) const override
 
mRealType srDf (mRealType r, mRealType rinv) const override
 
void Breakup (ParticleSet &ref, mRealType rs_in) override
 
void resetTargetParticleSet (ParticleSet &ref) override
 
LRHandlerBasemakeClone (ParticleSet &ref) const override
 make clone 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...
 
virtual mRealType evaluateSR_k0 () const
 evaluate $ v_{s}(k=0) = \frac{4\pi}{V}\int_0^{r_c} r^2 v_s(r) dr $ More...
 
virtual mRealType evaluateLR_r0 () const
 evaluate $ v_s(r=0) $ for the self-interaction term More...
 
virtual SymTensor< mRealType, OHMMS_DIMevaluateLR_r0_dstrain () const
 These functions return the strain derivatives of all corresponding quantities in total energy. More...
 
virtual SymTensor< mRealType, OHMMS_DIMevaluateSR_k0_dstrain () const
 
virtual SymTensor< mRealType, OHMMS_DIMevaluateLR_dstrain (TinyVector< pRealType, OHMMS_DIM > k, pRealType kmag) const
 
virtual SymTensor< mRealType, OHMMS_DIMevaluateSR_dstrain (TinyVector< pRealType, OHMMS_DIM > r, pRealType rmag) const
 
virtual mRealType lrDf (mRealType r) const
 

Public Attributes

Func myFunc
 
- 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...
 

Additional Inherited Members

- Protected Attributes inherited from LRHandlerBase
std::string ClassName
 

Detailed Description

template<class Func>
struct qmcplusplus::DummyLRHandler< Func >

LRHandler without breakup.

The template parameter Func should impelement operator()(kk) which returns the Fourier component of a long-range function. Here kk is $|{\bf k}|^2$.

Definition at line 214 of file LRHandlerBase.h.

Constructor & Destructor Documentation

◆ DummyLRHandler() [1/2]

DummyLRHandler ( mRealType  kc = -1.0)
inline

Definition at line 218 of file LRHandlerBase.h.

218 : LRHandlerBase(kc) {}

◆ DummyLRHandler() [2/2]

DummyLRHandler ( const DummyLRHandler< Func > &  aLR)
inline

Definition at line 220 of file LRHandlerBase.h.

220 : LRHandlerBase(aLR) {}

Member Function Documentation

◆ Breakup()

void Breakup ( ParticleSet ref,
mRealType  rs_in 
)
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 252 of file LRHandlerBase.h.

252 {}

◆ evaluate()

mRealType evaluate ( mRealType  r,
mRealType  rinv 
) const
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 249 of file LRHandlerBase.h.

249 { return 0.0; }

◆ evaluate_vlr_k()

mRealType evaluate_vlr_k ( mRealType  k) const
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 248 of file LRHandlerBase.h.

248 { return 0.0; }

◆ evaluateLR()

mRealType evaluateLR ( mRealType  r) const
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 250 of file LRHandlerBase.h.

250 { return 0.0; }

◆ initBreakup()

void initBreakup ( ParticleSet ref)
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 222 of file LRHandlerBase.h.

References LRHandlerBase::Fk, LRHandlerBase::Fk_symm, ParticleSet::getLattice(), ParticleSet::getSimulationCell(), LRHandlerBase::LR_kc, LRHandlerBase::MaxKshell, DummyLRHandler< Func >::myFunc, norm(), and Vector< T, Alloc >::resize().

Referenced by qmcplusplus::TEST_CASE().

223  {
224  mRealType norm = 4.0 * M_PI / ref.getLattice().Volume;
225  mRealType kcsq = LR_kc * LR_kc;
226  auto& KList(ref.getSimulationCell().getKLists());
227  int maxshell = KList.kshell.size() - 1;
228  const auto& kk(KList.ksq);
229  int ksh = 0, ik = 0;
230  while (ksh < maxshell)
231  {
232  if (kk[ik] > kcsq)
233  break; //exit
234  ik = KList.kshell[++ksh];
235  }
236  MaxKshell = ksh;
238  Fk.resize(KList.kpts_cart.size());
239  for (ksh = 0, ik = 0; ksh < MaxKshell; ksh++, ik++)
240  {
241  mRealType v = norm * myFunc(kk[KList.kshell[ksh]]); //rpa=u0/kk[ik];
242  Fk_symm[ksh] = v;
243  for (; ik < KList.kshell[ksh + 1]; ik++)
244  Fk[ik] = v;
245  }
246  }
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
mRealType LR_kc
Maximum k cutoff.
Definition: LRHandlerBase.h:37
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
Definition: LRHandlerBase.h:35
EwaldHandler3D::mRealType mRealType
double norm(const zVec &c)
Definition: VectorOps.h:118
Vector< mRealType > Fk
Fourier component for all the k-point.
Definition: LRHandlerBase.h:41
Vector< mRealType > Fk_symm
Fourier component for each k-shell.
Definition: LRHandlerBase.h:49

◆ makeClone()

LRHandlerBase* makeClone ( ParticleSet ref) const
inlineoverridevirtual

make clone

Implements LRHandlerBase.

Definition at line 254 of file LRHandlerBase.h.

References LRHandlerBase::LR_kc.

254 { return new DummyLRHandler<Func>(LR_kc); }
mRealType LR_kc
Maximum k cutoff.
Definition: LRHandlerBase.h:37

◆ resetTargetParticleSet()

void resetTargetParticleSet ( ParticleSet ref)
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 253 of file LRHandlerBase.h.

253 {}

◆ srDf()

mRealType srDf ( mRealType  r,
mRealType  rinv 
) const
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 251 of file LRHandlerBase.h.

251 { return 0.0; }

Member Data Documentation

◆ myFunc

Func myFunc

Definition at line 216 of file LRHandlerBase.h.

Referenced by DummyLRHandler< Func >::initBreakup().


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