28 first_time(firsttime),
29 d_aa_ID(ions.addTable(ions)),
30 d_ei_ID(elns.addTable(ions))
32 ReportEngine PRE(
"ForceChiesaPBCAA",
"ForceChiesaPBCAA");
33 name_ =
"Chiesa_Force_Base_PBCAB";
49 app_log() <<
"IonIon Force" << std::endl;
60 for (
int k = 0; k <
N_basis; k++)
63 for (
int j = 0; j <
N_basis; j++)
78 int ChargeAttribIndxA = tspeciesA.
addAttribute(
"charge");
79 int ChargeAttribIndxB = tspeciesB.addAttribute(
"charge");
91 Zspec[spec] = tspeciesA(ChargeAttribIndxA, spec);
95 Qspec[spec] = tspeciesB(ChargeAttribIndxB, spec);
97 for (
int iat = 0; iat <
NptclA; iat++)
109 for (
int iat = 0; iat < grad.size(); iat++)
112 for (
int iat = 0; iat < grad.size(); iat++)
122 for (
size_t jat = 0; jat <
NptclB; ++jat)
124 const auto& dist = d_ab.getDistRow(jat);
125 const auto& displ = d_ab.getDisplRow(jat);
126 for (
size_t iat = 0; iat <
NptclA; ++iat)
132 PosType drhat = rinv * displ[iat];
141 for (
size_t ipart = 1; ipart <
NptclA; ipart++)
143 const auto& dist = d_aa.getDistRow(ipart);
144 const auto& displ = d_aa.getDisplRow(ipart);
145 for (
size_t jpart = 0; jpart < ipart; ++jpart)
148 PosType grad = -
Zat[jpart] *
Zat[ipart] * V / dist[jpart] * displ[jpart];
161 for (
int iat = 0; iat < grad.size(); iat++)
165 for (
int iat = 0; iat < grad.size(); iat++)
192 for (
int q = 0; q <
N_basis; q++)
203 std::string ionionforce(
"yes");
206 attr.
add(ionionforce,
"add_ion_ion_");
208 add_ion_ion_ = (ionionforce ==
"yes") || (ionionforce ==
"true");
209 app_log() <<
"ionionforce = " << ionionforce << std::endl;
212 fcep_param_set.
add(
Rcut,
"rcut");
214 fcep_param_set.
add(
m_exp,
"weight_exp");
215 fcep_param_set.
put(cur);
216 app_log() <<
" ForceChiesaPBCAA Parameters" << std::endl;
217 app_log() <<
" ForceChiesaPBCAA::Rcut=" <<
Rcut << std::endl;
218 app_log() <<
" ForceChiesaPBCAA::N_basis=" <<
N_basis << std::endl;
219 app_log() <<
" ForceChiesaPBCAA::m_exp=" <<
m_exp << std::endl;
234 std::unique_ptr<ForceChiesaPBCAA> tmp = std::make_unique<ForceChiesaPBCAA>(
PtclA, qp,
false);
246 tmp->initBreakup(qp);
void resize(size_type n, Type_t val=Type_t())
Resize the container.
MatrixA::value_type invert_matrix(MatrixA &M, bool getdet=true)
invert a matrix
static std::unique_ptr< LRHandlerType > getDerivHandler(ParticleSet &ref)
This returns a force/stress optimized LR handler. If non existent, it creates one.
std::unique_ptr< LRHandlerType > dAB
long-range Handler
ParticleSet & PtclA
source particle set
helper functions for EinsplineSetBuilder
const DistanceTableAA & getDistTableAA(int table_ID) const
get a distance table by table_ID and dyanmic_cast to DistanceTableAA
QTBase::RealType RealType
ParticleSet::ParticlePos forces_
size_t getTotalNum() const
int my_index_
starting index of this object
int NptclA
number of particles of A
void evaluateSR(ParticleSet &)
bool put(xmlNodePtr cur)
assign attributes to the set
std::vector< RealType > Zat
Zat[iat] charge for the iat-th particle of A.
void addObservablesF(QMCTraits::PropertySetType &plist)
Vectorized record engine for scalar properties.
void resize(size_type n, size_type m)
Resize the container.
void update(bool skipSK=false)
update the internal data
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
bool put(std::istream &is) override
read from std::istream
ParticleIndex GroupID
Species ID.
for(int i=0;i< size_test;++i) CHECK(Approx(gauss_random_vals[offset_for_rs+i])
const DistanceTableAB & getDistTableAB(int table_ID) const
get a distance table by table_ID and dyanmic_cast to DistanceTableAB
void turnOnPerParticleSK()
Turn on per particle storage in Structure Factor.
void initBreakup(ParticleSet &P)
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)
int NumSpeciesB
number of species of B particle set
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
std::string name_
name of this object
Specialized paritlce class for atomistic simulations.
void addObservables(PropertySetType &plist, BufferType &collectables) override
named values to the property list Default implementaton uses addValue(plist_)
class to handle a set of parameters
int NptclB
number of particles of B
bool add_ion_ion_
Determines if ion-ion force will be added to electron-ion force in derived force estimators. If false, forces_ion_ion_=0.0.
void product(const Matrix< T > &A, const Matrix< T > &B, Matrix< T > &C)
static function to perform C=AB for real matrices
int add(const std::string &aname)
Final class and should not be derived.
class to handle a set of attributes of an xmlNode
declaration of ProgressReportEngine
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
std::vector< RealType > Qat
Qat[iat] charge for the iat-th particle of B.
int NumSpeciesA
number of species of A particle set
void add(PDT &aparam, const std::string &aname_in, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new parameter corresponding to an xmlNode <parameter>
FullPrecRealType Return_t
type of return value of evaluate
Define determinant operators.
Class to represent a many-body trial wave function.
void evaluateLR(ParticleSet &)
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) final
Custom container for set of attributes for a set of species.
ParticleSet::ParticlePos forces_ion_ion_
Return_t g_filter(RealType r)
std::vector< RealType > Zspec
Zspec[spec] charge for the spec-th species of A.
bool put(xmlNodePtr cur) override
Read the input parameter.
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
ForceChiesaPBCAA(ParticleSet &ions, ParticleSet &elns, bool firsttime=true)
std::vector< RealType > Qspec
Qspec[spec] charge for the spec-th species of B.