QMCPACK
LRHandlerTemp< Func, BreakupBasis > Class Template Reference
+ Inheritance diagram for LRHandlerTemp< Func, BreakupBasis >:
+ Collaboration diagram for LRHandlerTemp< Func, BreakupBasis >:

Public Types

using ParticleLayout = ParticleSet::ParticleLayout
 
using BreakupBasisType = BreakupBasis
 

Public Member Functions

 LRHandlerTemp (ParticleSet &ref, mRealType kc_in=-1.0)
 
 LRHandlerTemp (const LRHandlerTemp &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_ext) override
 
void resetTargetParticleSet (ParticleSet &ref) override
 
void resetTargetParticleSet (ParticleSet &ref, mRealType rs)
 
mRealType evaluate (mRealType r, mRealType rinv) const override
 
mRealType srDf (mRealType r, mRealType rinv) const override
 evaluate the first derivative of the short range part at r More...
 
mRealType evaluate_vlr_k (mRealType k) const override
 
mRealType evaluateLR (mRealType r) const override
 evaluate the contribution from the long-range part for for spline More...
 
mRealType lrDf (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 evaluateLR_r0 () const override
 evaluate $ v_s(r=0) $ for the self-interaction term 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 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
 

Public Attributes

bool FirstTime
 
mRealType rs
 
BreakupBasisType Basis
 
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...
 

Private Member Functions

mRealType evalFk (mRealType k) const
 
mRealType evalXk (mRealType k) const
 
void InitBreakup (const ParticleLayout &ref, int NumFunctions)
 Initialise the basis and coefficients for the long-range beakup. More...
 
void fillXk (std::vector< TinyVector< mRealType, 2 >> &KList)
 
void fillFk (const KContainer &KList)
 

Additional Inherited Members

- Protected Attributes inherited from LRHandlerBase
std::string ClassName
 

Detailed Description

template<class Func, class BreakupBasis = LPQHIBasis>
class qmcplusplus::LRHandlerTemp< Func, BreakupBasis >

Definition at line 40 of file LRHandlerTemp.h.

Member Typedef Documentation

◆ BreakupBasisType

using BreakupBasisType = BreakupBasis

Definition at line 45 of file LRHandlerTemp.h.

◆ ParticleLayout

Definition at line 44 of file LRHandlerTemp.h.

Constructor & Destructor Documentation

◆ LRHandlerTemp() [1/2]

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

Definition at line 54 of file LRHandlerTemp.h.

References LRHandlerBase::ClassName, and LRHandlerTemp< Func, BreakupBasis >::myFunc.

54  : LRHandlerBase(kc_in), FirstTime(true), Basis(ref.getLRBox())
55  {
56  LRHandlerBase::ClassName = "LRHandlerTemp";
57  myFunc.reset(ref);
58  }
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49

◆ LRHandlerTemp() [2/2]

LRHandlerTemp ( const LRHandlerTemp< Func, BreakupBasis > &  aLR,
ParticleSet ref 
)
inline

"copy" constructor

Parameters
aLRLRHandlerTemp
refParticleset

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

Definition at line 72 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::myFunc.

73  : LRHandlerBase(aLR), FirstTime(true), Basis(aLR.Basis, ref.getLRBox())
74  {
75  myFunc.reset(ref);
76  }
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49

Member Function Documentation

◆ Breakup()

void Breakup ( ParticleSet ref,
mRealType  rs_ext 
)
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 90 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerTemp< Func, BreakupBasis >::fillFk(), ParticleSet::getLRBox(), ParticleSet::getSimulationCell(), LRHandlerTemp< Func, BreakupBasis >::InitBreakup(), LRHandlerBase::LR_rc, LRHandlerTemp< Func, BreakupBasis >::myFunc, and LRHandlerTemp< Func, BreakupBasis >::rs.

91  {
92  //ref.getLRBox().Volume=ref.getTotalNum()*4.0*M_PI/3.0*rs*rs*rs;
93  rs = rs_ext;
94  myFunc.reset(ref, rs);
95  InitBreakup(ref.getLRBox(), 1);
96  fillFk(ref.getSimulationCell().getKLists());
97  LR_rc = Basis.get_rc();
98  }
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49
void fillFk(const KContainer &KList)
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39
void InitBreakup(const ParticleLayout &ref, int NumFunctions)
Initialise the basis and coefficients for the long-range beakup.

◆ evalFk()

mRealType evalFk ( mRealType  k) const
inlineprivate

Definition at line 183 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerBase::coefs, LRHandlerTemp< Func, BreakupBasis >::myFunc, and qmcplusplus::n.

Referenced by LRHandlerTemp< Func, BreakupBasis >::evaluate_vlr_k(), and LRHandlerTemp< Func, BreakupBasis >::fillFk().

184  {
185  //FatK = 4.0*M_PI/(Basis.get_CellVolume()*k*k)* std::cos(k*Basis.get_rc());
186  mRealType FatK = myFunc.Fk(k, Basis.get_rc());
187  for (int n = 0; n < Basis.NumBasisElem(); n++)
188  FatK += coefs[n] * Basis.c(n, k);
189  return FatK;
190  }
EwaldHandler3D::mRealType mRealType
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49

◆ evaluate()

mRealType evaluate ( mRealType  r,
mRealType  rinv 
) const
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 104 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerBase::coefs, LRHandlerBase::LR_rc, LRHandlerTemp< Func, BreakupBasis >::myFunc, and qmcplusplus::n.

Referenced by qmcplusplus::TEST_CASE().

105  {
106  mRealType v = 0.0;
107  if (r >= LR_rc)
108  return v;
109  v = myFunc(r, rinv);
110  for (int n = 0; n < coefs.size(); n++)
111  v -= coefs[n] * Basis.h(n, r);
112  return v;
113  }
EwaldHandler3D::mRealType mRealType
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39

◆ evaluate_vlr_k()

mRealType evaluate_vlr_k ( mRealType  k) const
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 133 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::evalFk().

133 { return evalFk(k); }
mRealType evalFk(mRealType k) const

◆ evaluateLR()

mRealType evaluateLR ( mRealType  r) const
inlineoverridevirtual

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

Implements LRHandlerBase.

Definition at line 138 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerBase::coefs, LRHandlerBase::LR_rc, LRHandlerTemp< Func, BreakupBasis >::myFunc, and qmcplusplus::n.

Referenced by qmcplusplus::TEST_CASE().

139  {
140  mRealType v = 0.0;
141  if (r >= LR_rc)
142  return myFunc(r, 1. / r);
143  for (int n = 0; n < coefs.size(); n++)
144  v += coefs[n] * Basis.h(n, r);
145  return v;
146  }
EwaldHandler3D::mRealType mRealType
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39

◆ evaluateLR_r0()

mRealType evaluateLR_r0 ( ) const
inlineoverridevirtual

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

Reimplemented from LRHandlerBase.

Definition at line 174 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerBase::coefs, and qmcplusplus::n.

175  {
176  mRealType v0 = 0.0;
177  for (int n = 0; n < coefs.size(); n++)
178  v0 += coefs[n] * Basis.h(n, 0.0);
179  return v0;
180  }
EwaldHandler3D::mRealType mRealType
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49

◆ 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 166 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerBase::coefs, LRHandlerTemp< Func, BreakupBasis >::myFunc, and qmcplusplus::n.

167  {
168  mRealType v0 = myFunc.integrate_r2(Basis.get_rc());
169  for (int n = 0; n < coefs.size(); n++)
170  v0 -= coefs[n] * Basis.hintr2(n);
171  return v0 * 2.0 * TWOPI / Basis.get_CellVolume();
172  }
EwaldHandler3D::mRealType mRealType
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49

◆ evalXk()

mRealType evalXk ( mRealType  k) const
inlineprivate

Definition at line 191 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::Basis, and LRHandlerTemp< Func, BreakupBasis >::myFunc.

Referenced by LRHandlerTemp< Func, BreakupBasis >::fillXk().

192  {
193  //RealType FatK;
194  //FatK = -4.0*M_PI/(Basis.get_CellVolume()*k*k)* std::cos(k*Basis.get_rc());
195  //return (FatK);
196  return myFunc.Xk(k, Basis.get_rc());
197  }
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49

◆ fillFk()

void fillFk ( const KContainer KList)
inlineprivate

Definition at line 268 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::evalFk(), LRHandlerBase::Fk, LRHandlerBase::Fk_symm, KContainer::kpts_cart, KContainer::kshell, KContainer::ksq, LRHandlerBase::MaxKshell, Vector< T, Alloc >::resize(), Vector< T, Alloc >::size(), and qmcplusplus::sqrt().

Referenced by LRHandlerTemp< Func, BreakupBasis >::Breakup(), and LRHandlerTemp< Func, BreakupBasis >::initBreakup().

269  {
270  Fk.resize(KList.kpts_cart.size());
271  const std::vector<int>& kshell(KList.kshell);
272  if (MaxKshell >= kshell.size())
273  MaxKshell = kshell.size() - 1;
275  for (int ks = 0, ki = 0; ks < Fk_symm.size(); ks++)
276  {
277  mRealType uk = evalFk(std::sqrt(KList.ksq[ki]));
278  Fk_symm[ks] = uk;
279  while (ki < KList.kshell[ks + 1] && ki < Fk.size())
280  Fk[ki++] = uk;
281  }
282  //for(int ki=0; ki<KList.kpts_cart.size(); ki++){
283  // RealType k=dot(KList.kpts_cart[ki],KList.kpts_cart[ki]);
284  // k=std::sqrt(k);
285  // Fk[ki] = evalFk(k); //Call derived fn.
286  //}
287  }
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
mRealType evalFk(mRealType k) const
size_type size() const
return the current size
Definition: OhmmsVector.h:162
Vector< mRealType > Fk
Fourier component for all the k-point.
Definition: LRHandlerBase.h:41
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
Vector< mRealType > Fk_symm
Fourier component for each k-shell.
Definition: LRHandlerBase.h:49

◆ fillXk()

void fillXk ( std::vector< TinyVector< mRealType, 2 >> &  KList)
inlineprivate

Definition at line 258 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::evalXk(), LRHandlerBase::Fk, and Vector< T, Alloc >::resize().

Referenced by LRHandlerTemp< Func, BreakupBasis >::InitBreakup().

259  {
260  Fk.resize(KList.size());
261  for (int ki = 0; ki < KList.size(); ki++)
262  {
263  mRealType k = KList[ki][0];
264  Fk[ki] = evalXk(k); //Call derived fn.
265  }
266  }
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
EwaldHandler3D::mRealType mRealType
Vector< mRealType > Fk
Fourier component for all the k-point.
Definition: LRHandlerBase.h:41
mRealType evalXk(mRealType k) const

◆ initBreakup()

void initBreakup ( ParticleSet ref)
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 83 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerTemp< Func, BreakupBasis >::fillFk(), ParticleSet::getLRBox(), ParticleSet::getSimulationCell(), LRHandlerTemp< Func, BreakupBasis >::InitBreakup(), and LRHandlerBase::LR_rc.

Referenced by qmcplusplus::TEST_CASE().

84  {
85  InitBreakup(ref.getLRBox(), 1);
86  fillFk(ref.getSimulationCell().getKLists());
87  LR_rc = Basis.get_rc();
88  }
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49
void fillFk(const KContainer &KList)
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39
void InitBreakup(const ParticleLayout &ref, int NumFunctions)
Initialise the basis and coefficients for the long-range beakup.

◆ InitBreakup()

void InitBreakup ( const ParticleLayout ref,
int  NumFunctions 
)
inlineprivate

Initialise the basis and coefficients for the long-range beakup.

We loocally create a breakup handler and pass in the basis that has been initialised here. We then discard the handler, leaving basis and coefs in a usable state. This method can be re-called later if lattice changes shape.

Definition at line 206 of file LRHandlerTemp.h.

References qmcplusplus::app_log(), LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerBase::coefs, Vector< T, Alloc >::data(), LRBreakup< BreakupBasis >::DoBreakup(), LRHandlerTemp< Func, BreakupBasis >::fillXk(), LRHandlerTemp< Func, BreakupBasis >::FirstTime, LRHandlerBase::Fk, LRBreakup< BreakupBasis >::KList, LRHandlerBase::LR_kc, LRHandlerBase::MaxKshell, qmcplusplus::pow(), and LRBreakup< BreakupBasis >::SetupKVecs().

Referenced by LRHandlerTemp< Func, BreakupBasis >::Breakup(), and LRHandlerTemp< Func, BreakupBasis >::initBreakup().

207  {
208  //First we send the new Lattice to the Basis, in case it has been updated.
209  Basis.set_Lattice(ref);
210  //Compute RC from box-size - in constructor?
211  //No here...need update if box changes
212  int NumKnots(15);
213  Basis.set_NumKnots(NumKnots);
214  Basis.set_rc(ref.LR_rc);
215  //Initialise the breakup - pass in basis.
216  LRBreakup<BreakupBasis> breakuphandler(Basis);
217  //Find size of basis from cutoffs
218  mRealType kc = (LR_kc < 0) ? ref.LR_kc : LR_kc;
219  LR_kc = kc; // set internal kc
220  //RealType kc(ref.LR_kc); //User cutoff parameter...
221  //kcut is the cutoff for switching to approximate k-point degeneracies for
222  //better performance in making the breakup. A good bet is 30*K-spacing so that
223  //there are 30 "boxes" in each direction that are treated with exact degeneracies.
224  //Assume orthorhombic cell just for deriving this cutoff - should be insensitive.
225  //K-Spacing = (kpt_vol)**1/3 = 2*pi/(cellvol**1/3)
226  mRealType kcut = 60 * M_PI * std::pow(Basis.get_CellVolume(), -1.0 / 3.0);
227  //Use 3000/LMax here...==6000/rc for non-ortho cells
228  mRealType kmax(6000.0 / ref.LR_rc);
229  MaxKshell = static_cast<int>(breakuphandler.SetupKVecs(kc, kcut, kmax));
230  if (FirstTime)
231  {
232  app_log() << " finding kc: " << ref.LR_kc << " , " << LR_kc << std::endl;
233  app_log() << " LRBreakp parameter Kc =" << kc << std::endl;
234  app_log() << " Continuum approximation in k = [" << kcut << "," << kmax << ")" << std::endl;
235  FirstTime = false;
236  }
237  //Set up x_k
238  //This is the FT of -V(r) from r_c to infinity.
239  //This is the only data that the breakup handler needs to do the breakup.
240  //We temporarily store it in Fk, which is replaced with the full FT (0->inf)
241  //of V_l(r) after the breakup has been done.
242  fillXk(breakuphandler.KList);
243  //Allocate the space for the coefficients.
244  coefs.resize(Basis.NumBasisElem()); //This must be after SetupKVecs.
245 
246  mRealType chisqr(0.0);
247  chisqr = breakuphandler.DoBreakup(Fk.data(), coefs.data()); //Fill array of coefficients.
248  //I want this in scientific notation, but I don't want to mess up formatting flags elsewhere.
249  //Save stream state.
250  std::ios_base::fmtflags app_log_flags(app_log().flags());
251  app_log() << std::scientific;
252  app_log().precision(5);
253  app_log() << "\n LR Breakup chi^2 = " << chisqr << std::endl;
254 
255  app_log().flags(app_log_flags);
256  }
mRealType LR_kc
Maximum k cutoff.
Definition: LRHandlerBase.h:37
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
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)
void fillXk(std::vector< TinyVector< mRealType, 2 >> &KList)
Vector< mRealType > Fk
Fourier component for all the k-point.
Definition: LRHandlerBase.h:41

◆ lrDf()

mRealType lrDf ( mRealType  r) const
inlineoverridevirtual

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

Reimplemented from LRHandlerBase.

Definition at line 150 of file LRHandlerTemp.h.

References APP_ABORT, LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerBase::coefs, LRHandlerBase::gcoefs, LRHandlerBase::LR_rc, LRHandlerTemp< Func, BreakupBasis >::myFunc, and qmcplusplus::n.

151  {
152  APP_ABORT("LRHandlerTemp::lrDF not implemented (missing gcoefs)");
153  mRealType dv = 0.0;
154  if (r < LR_rc)
155  {
156  for (int n = 0; n < coefs.size(); n++)
157  dv += gcoefs[n] * Basis.dh_dr(n, r);
158  }
159  else
160  dv = myFunc.df(r);
161 
162  return dv;
163  }
EwaldHandler3D::mRealType mRealType
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27
std::vector< mRealType > gcoefs
Coefficient for gradient fit.
Definition: LRHandlerBase.h:55

◆ makeClone()

LRHandlerBase* makeClone ( ParticleSet ref) const
inlineoverridevirtual

make clone

Implements LRHandlerBase.

Definition at line 78 of file LRHandlerTemp.h.

79  {
80  return new LRHandlerTemp<Func, BreakupBasis>(*this, ref);
81  }

◆ resetTargetParticleSet() [1/2]

void resetTargetParticleSet ( ParticleSet ref)
inlineoverridevirtual

Implements LRHandlerBase.

Definition at line 100 of file LRHandlerTemp.h.

References LRHandlerTemp< Func, BreakupBasis >::myFunc.

100 { myFunc.reset(ref); }

◆ resetTargetParticleSet() [2/2]

void resetTargetParticleSet ( ParticleSet ref,
mRealType  rs 
)
inline

◆ 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 120 of file LRHandlerTemp.h.

References APP_ABORT, LRHandlerTemp< Func, BreakupBasis >::Basis, LRHandlerBase::coefs, LRHandlerBase::gcoefs, LRHandlerBase::LR_rc, LRHandlerTemp< Func, BreakupBasis >::myFunc, and qmcplusplus::n.

121  {
122  APP_ABORT("LRHandlerTemp::srDF not implemented (missing gcoefs)");
123  mRealType df = 0.0;
124  if (r >= LR_rc)
125  return df;
126  df = myFunc.df(r);
127  //RealType df = myFunc.df(r, rinv);
128  for (int n = 0; n < coefs.size(); n++)
129  df -= gcoefs[n] * Basis.dh_dr(n, r);
130  return df;
131  }
EwaldHandler3D::mRealType mRealType
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
BreakupBasisType Basis
Definition: LRHandlerTemp.h:49
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27
std::vector< mRealType > gcoefs
Coefficient for gradient fit.
Definition: LRHandlerBase.h:55

Member Data Documentation

◆ Basis

◆ FirstTime

bool FirstTime

Definition at line 47 of file LRHandlerTemp.h.

Referenced by LRHandlerTemp< Func, BreakupBasis >::InitBreakup().

◆ myFunc

◆ rs


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