28 #if defined(QMC_COMPLEX) 33 #if defined(HAVE_EINSPLINE) 55 return spoit->second.get();
74 std::string sourceOpt(
"ion0");
78 aAttrib.
add(sourceOpt,
"source");
79 aAttrib.
add(type,
"type");
80 aAttrib.
add(name,
"name");
83 aAttrib.
put(rootNode);
85 std::string type_in = type;
92 std::unique_ptr<SPOSetBuilder> bb;
94 if (type ==
"composite")
96 app_log() <<
"Composite SPO set with existing SPOSets." << std::endl;
97 bb = std::make_unique<CompositeSPOSetBuilder>(
myComm, *
this);
99 else if (type ==
"jellium" || type ==
"heg" || type ==
"free")
101 app_log() <<
"Free-particle SPO set" << std::endl;
104 else if (type ==
"sho")
106 app_log() <<
"Harmonic Oscillator SPO set" << std::endl;
109 else if (type ==
"PWBasis" || type ==
"PW" || type ==
"pw")
111 app_log() <<
"Planewave basis SPO set" << std::endl;
115 else if (type.find(
"spline") < type.size())
120 app_log() <<
"Einspline Spinor Set\n";
123 PRE.
error(
"Use of einspline spinors requires QMC_COMPLEX=1. Rebuild with this option");
128 #if defined(HAVE_EINSPLINE) 129 PRE <<
"EinsplineSetBuilder: using libeinspline for B-spline orbitals.\n";
132 PRE.
error(
"Einspline is missing for B-spline orbitals",
true);
136 else if (type ==
"molecularorbital" || type ==
"mo")
142 PRE.
error(
"Missing basisset/@source.",
true);
144 ions = pit->second.
get();
147 bb = std::make_unique<LCAOSpinorBuilder>(
targetPtcl, *ions,
myComm, rootNode);
149 PRE.
error(
"Use of lcao spinors requires QMC_COMPLEX=1. Rebuild with this option");
152 bb = std::make_unique<LCAOrbitalBuilder>(
targetPtcl, *ions,
myComm, rootNode);
154 #endif //OHMMS_DIM==3 160 app_log() <<
" Created SPOSet builder named '" << name <<
"' of type " << type << std::endl;
167 std::string collection_name;
168 std::string collection_type;
170 attrib.
add(collection_name,
"name");
171 attrib.
add(collection_type,
"type");
175 if (collection_name.empty())
176 collection_name = collection_type;
179 app_summary() <<
" Single particle orbitals (SPO) collection" << std::endl;
180 app_summary() <<
" -----------------------------------------" << std::endl;
181 app_summary() <<
" Name: " << collection_name <<
" Type input: " << collection_type << std::endl;
189 processChildren(cur, [&](
const std::string& cname,
const xmlNodePtr element) {
190 if (cname ==
"sposet")
192 addSPOSet(std::unique_ptr<SPOSet>(bb->createSPOSet(element)));
195 if (cname ==
"rotated_sposet")
197 addSPOSet(std::unique_ptr<SPOSet>(bb->createRotatedSPOSet(element)));
206 processChildren(cur, [&](
const std::string& cname,
const xmlNodePtr element) {
207 if (cname ==
"spo_scanner")
211 ascanner.
put(element);
218 if (spo->getName().empty())
224 sposets.emplace(spo->getName(), std::move(spo));
base class for Single-particle orbital sets
const PSetMap & ptclPool
reference to the particle pool
Base class for any object which needs to know about a MPI communicator.
std::map< std::string, const std::unique_ptr< ParticleSet > > PSetMap
helper functions for EinsplineSetBuilder
int rank() const
return the rank
void buildSPOSetCollection(xmlNodePtr cur)
std::ostream & app_summary()
bool put(xmlNodePtr cur)
assign attributes to the set
Builder class for einspline-based SPOSet objects.
Derives EinsplineSetBuilder.
declaration of MPIObjectBase
const SPOSet * getSPOSet(const std::string &name) const
returns a named sposet from the pool only use in serial portion of execution ie during initialization...
SPOSetBuilderFactory(Communicate *comm, ParticleSet &els, const PSetMap &psets)
constructor
Wrapping information on parallelism.
void addSPOSet(std::unique_ptr< SPOSet >)
add an SPOSet to sposets map.
Specialized paritlce class for atomistic simulations.
Final class and should not be derived.
Communicate * myComm
pointer to Communicate
class to handle a set of attributes of an xmlNode
static std::string basisset_tag
declaration of ProgressReportEngine
a scanner for all the SPO sets.
std::string lowerCase(const std::string_view s)
++17
std::string ClassName
class Name
ParticleSet & targetPtcl
reference to the target particle
#define DEBUG_MEMORY(msg)
void processChildren(const xmlNodePtr cur, const F &functor)
process through all the children of an XML element F is a lambda or functor void F/[](const std::stri...
void error(const std::string &msg, bool fatal=false)
SPOMap sposets
list of all sposets created by the builders of this factory
Declaration of a builder class for PWOrbitalSet.
std::unique_ptr< SPOSetBuilder > createSPOSetBuilder(xmlNodePtr rootNode)
void barrier_and_abort(const std::string &msg) const
bool get(std::ostream &os) const override
dummy. For satisfying OhmmsElementBase.
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute