32 template<
typename J3type>
35 auto& jname = J3.getName();
41 std::string kidsname = (
char*)kids->name;
42 if (kidsname ==
"correlation")
46 std::string iSpecies, eSpecies1(
"u"), eSpecies2(
"u");
48 rAttrib.
add(iSpecies,
"ispecies");
49 rAttrib.
add(eSpecies1,
"especies1");
50 rAttrib.
add(eSpecies2,
"especies2");
51 rAttrib.
add(ee_cusp,
"ecusp");
52 rAttrib.
add(eI_cusp,
"icusp");
54 using FT =
typename J3type::FuncType;
57 std::make_unique<FT>(coef_id.empty() ? jname +
"_" + iSpecies + eSpecies1 + eSpecies2 : coef_id, ee_cusp, eI_cusp);
58 functor->iSpecies = iSpecies;
59 functor->eSpecies1 = eSpecies1;
60 functor->eSpecies2 = eSpecies2;
64 if (iNum == iSet.
size())
66 APP_ABORT(
"ion species " + iSpecies +
" requested for Jastrow " + jname +
" does not exist in ParticleSet " +
69 std::string illegal_eSpecies;
70 if (eNum1 == eSet.
size())
71 illegal_eSpecies = eSpecies1;
72 if (eNum2 == eSet.
size())
74 if (illegal_eSpecies.size())
75 illegal_eSpecies +=
" and ";
76 illegal_eSpecies += eSpecies2;
78 if (illegal_eSpecies.size())
79 APP_ABORT(
"electron species " + illegal_eSpecies +
" requested for Jastrow " + jname +
85 if (functor->cutoff_radius > WSRadius)
87 if (functor->cutoff_radius - WSRadius > 1
e-4)
89 APP_ABORT(
" The eeI Jastrow cutoff specified should not be larger than Wigner-Seitz radius.");
93 app_log() <<
" The eeI Jastrow cutoff specified is slightly larger than the Wigner-Seitz radius.";
94 app_log() <<
" Setting to Wigner-Seitz radius = " << WSRadius <<
".\n";
95 functor->cutoff_radius = WSRadius;
99 if (functor->cutoff_radius < 1.0e-6)
101 app_log() <<
" eeI functor rcut is currently zero.\n" 102 <<
" Setting to Wigner-Seitz radius = " << WSRadius << std::endl;
103 functor->cutoff_radius = WSRadius;
107 else if (functor->cutoff_radius < 1.0e-6)
109 APP_ABORT(
" eeI Jastrow cutoff unspecified. Cutoff must be given when using open boundary conditions");
111 J3.addFunc(iNum, eNum1, eNum2, std::move(functor));
123 xmlNodePtr kids = cur->xmlChildrenNode;
128 std::string ftype(
"polynomial");
130 tAttrib.
add(ftype,
"function");
134 std::string jname = input_name.empty() ?
"JeeI_" + ftype : input_name;
136 if (ftype ==
"polynomial")
145 std::ostringstream err_msg;
146 err_msg <<
"Unknown function \"" << ftype <<
"\" in" 147 <<
" eeI_JastrowBuilder. Aborting.\n";
152 APP_ABORT(
"You must specify the \"source\" particleset for a three-body Jastrow.\n");
const std::string & getName() const
return the name
helper functions for EinsplineSetBuilder
An abstract class for wave function builders.
bool put(xmlNodePtr cur)
assign attributes to the set
eeI_JastrowBuilder(Communicate *comm, ParticleSet &target, ParticleSet &source)
int size() const
return the number of species
ParticleSet & targetPtcl
reference to the particle set on which targetPsi is defined
Wrapping information on parallelism.
Specialized paritlce class for atomistic simulations.
bool putkids(xmlNodePtr kids, J3type &J3)
Final class and should not be derived.
class to handle a set of attributes of an xmlNode
declaration of ProgressReportEngine
std::string ClassName
class Name
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
std::string getXMLAttributeValue(const xmlNodePtr cur, const std::string_view name)
get the value string for attribute name if name is unfound in cur you get an empty string back this i...
WaveFunctionComponent::RealType RealType
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
const auto & getLattice() const
std::unique_ptr< WaveFunctionComponent > buildComponent(xmlNodePtr cur) override
process a xml node at cur
Custom container for set of attributes for a set of species.
int findSpecies(const std::string &name) const
if the input species is not found, add a new species
std::string extractCoefficientsID(xmlNodePtr cur)
return the id of the first coefficients. If not found, return an emtpy string
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
Specialization for three-body Jastrow function using multiple functors.