QMCPACK
CompositeSPOSetBuilder Struct Reference
+ Inheritance diagram for CompositeSPOSetBuilder:
+ Collaboration diagram for CompositeSPOSetBuilder:

Public Member Functions

 CompositeSPOSetBuilder (Communicate *comm, const SPOSetBuilderFactory &factory)
 
std::unique_ptr< SPOSet > createSPOSetFromXML (xmlNodePtr cur) override
 create an sposet from xml (legacy) More...
 
std::unique_ptr< SPOSet > createSPOSet (xmlNodePtr cur, SPOSetInputInfo &input) override
 create an sposet from a general xml request More...
 
- Public Member Functions inherited from SPOSetBuilder
 SPOSetBuilder (const std::string &type_name, Communicate *comm)
 
virtual ~SPOSetBuilder ()
 
void reserve_states (int nsets=1)
 reserve space for states (usually only one set, multiple for e.g. spin dependent einspline) More...
 
void modify_states (int index=0)
 allow modification of state information More...
 
void clear_states (int index=0)
 clear state information More...
 
std::unique_ptr< SPOSet > createSPOSet (xmlNodePtr cur)
 create an sposet from xml and save the resulting SPOSet More...
 
std::unique_ptr< SPOSet > createRotatedSPOSet (xmlNodePtr cur)
 create orbital rotation transformation from xml and save the resulting SPOSet More...
 
const std::string & getTypeName () const
 
- Public Member Functions inherited from MPIObjectBase
 MPIObjectBase (Communicate *c)
 constructor with communicator More...
 
int rank () const
 return the rank of the communicator More...
 
int getGroupID () const
 return the group id of the communicator More...
 
Communicate * getCommunicator () const
 return myComm More...
 
Communicate & getCommRef () const
 return a TEMPORARY reference to Communicate More...
 
mpi_comm_type getMPI () const
 return MPI communicator if one wants to use MPI directly More...
 
bool is_manager () const
 return true if the rank == 0 More...
 
const std::string & getName () const
 return the name More...
 
void setName (const std::string &aname)
 

Public Attributes

const SPOSetBuilderFactory & sposet_builder_factory_
 reference to the sposet_builder_factory More...
 
- Public Attributes inherited from SPOSetBuilder
bool legacy
 whether implementation conforms only to legacy standard More...
 
std::vector< std::unique_ptr< SPOSetInfo > > states
 state info of all possible states available in the basis More...
 

Additional Inherited Members

- Public Types inherited from SPOSetBuilder
using indices_t = std::vector< int >
 
using energies_t = std::vector< RealType >
 
- Public Types inherited from QMCTraits
enum  { DIM = OHMMS_DIM, DIM_VGL = OHMMS_DIM + 2 }
 
using QTBase = QMCTypes< OHMMS_PRECISION, DIM >
 
using QTFull = QMCTypes< OHMMS_PRECISION_FULL, DIM >
 
using RealType = QTBase::RealType
 
using ComplexType = QTBase::ComplexType
 
using ValueType = QTBase::ValueType
 
using PosType = QTBase::PosType
 
using GradType = QTBase::GradType
 
using TensorType = QTBase::TensorType
 
using IndexType = OHMMS_INDEXTYPE
 define other types More...
 
using FullPrecRealType = QTFull::RealType
 
using FullPrecValueType = QTFull::ValueType
 
using PropertySetType = RecordNamedProperty< FullPrecRealType >
 define PropertyList_t More...
 
using PtclGrpIndexes = std::vector< std::pair< int, int > >
 
- Public Types inherited from MPIObjectBase
using mpi_comm_type = Communicate::mpi_comm_type
 
- Protected Attributes inherited from SPOSetBuilder
const std::string type_name_
 type name of the SPO objects built by this builder. More...
 
- Protected Attributes inherited from MPIObjectBase
Communicate * myComm
 pointer to Communicate More...
 
std::string ClassName
 class Name More...
 
std::string myName
 name of the object More...
 

Detailed Description

Definition at line 98 of file CompositeSPOSet.h.

Constructor & Destructor Documentation

◆ CompositeSPOSetBuilder()

CompositeSPOSetBuilder ( Communicate *  comm,
const SPOSetBuilderFactory &  factory 
)
inline

Definition at line 100 of file CompositeSPOSet.h.

101  : SPOSetBuilder("Composite", comm), sposet_builder_factory_(factory)
102  {}
const SPOSetBuilderFactory & sposet_builder_factory_
reference to the sposet_builder_factory
SPOSetBuilder(const std::string &type_name, Communicate *comm)

Member Function Documentation

◆ createSPOSet()

std::unique_ptr< SPOSet > createSPOSet ( xmlNodePtr  cur,
SPOSetInputInfo &  input_info 
)
overridevirtual

create an sposet from a general xml request

Reimplemented from SPOSetBuilder.

Definition at line 217 of file CompositeSPOSet.cpp.

References CompositeSPOSetBuilder::createSPOSetFromXML().

218 {
219  return createSPOSetFromXML(cur);
220 }
std::unique_ptr< SPOSet > createSPOSetFromXML(xmlNodePtr cur) override
create an sposet from xml (legacy)

◆ createSPOSetFromXML()

std::unique_ptr< SPOSet > createSPOSetFromXML ( xmlNodePtr  cur)
overridevirtual

create an sposet from xml (legacy)

Implements SPOSetBuilder.

Definition at line 198 of file CompositeSPOSet.cpp.

References SPOSetBuilderFactory::getSPOSet(), getXMLAttributeValue(), SPOSet::makeClone(), putContent(), and CompositeSPOSetBuilder::sposet_builder_factory_.

Referenced by CompositeSPOSetBuilder::createSPOSet().

199 {
200  std::vector<std::string> spolist;
201  putContent(spolist, cur);
202  if (spolist.empty())
203  {
204  return nullptr;
205  }
206 
207  auto spo_now = std::make_unique<CompositeSPOSet>(getXMLAttributeValue(cur, "name"));
208  for (int i = 0; i < spolist.size(); ++i)
209  {
210  const SPOSet* spo = sposet_builder_factory_.getSPOSet(spolist[i]);
211  if (spo)
212  spo_now->add(spo->makeClone());
213  }
214  return (spo_now->size()) ? std::unique_ptr<SPOSet>{std::move(spo_now)} : nullptr;
215 }
const SPOSetBuilderFactory & sposet_builder_factory_
reference to the sposet_builder_factory
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...
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...
bool putContent(T &a, xmlNodePtr cur)
replaces a&#39;s value with the first "element" in the "string" returned by XMLNodeString{cur}.
Definition: libxmldefs.h:88

Member Data Documentation

◆ sposet_builder_factory_

const SPOSetBuilderFactory& sposet_builder_factory_

reference to the sposet_builder_factory

Definition at line 110 of file CompositeSPOSet.h.

Referenced by CompositeSPOSetBuilder::createSPOSetFromXML().


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