QMCPACK
SetupSimpleFixedNodeBranch Class Reference
+ Collaboration diagram for SetupSimpleFixedNodeBranch:

Public Member Functions

 SetupSimpleFixedNodeBranch (Communicate *comm)
 
 SetupSimpleFixedNodeBranch ()
 
SimpleFixedNodeBranch operator() ()
 

Private Member Functions

void createMyNode (SimpleFixedNodeBranch &sfnb, const char *xml)
 

Private Attributes

Communicatecomm_
 
UPtr< EstimatorManagerBaseemb_
 
UPtr< MCPopulationpop_
 
UPtr< Libxml2Documentdoc_
 
RealType tau_ = 1.0
 
int num_global_walkers_ = 16
 
UPtr< MCWalkerConfigurationmcwc_
 

Detailed Description

Definition at line 34 of file test_SimpleFixedNodeBranch.cpp.

Constructor & Destructor Documentation

◆ SetupSimpleFixedNodeBranch() [1/2]

Definition at line 37 of file test_SimpleFixedNodeBranch.cpp.

References qmcplusplus::comm, SetupSimpleFixedNodeBranch::comm_, and SetupSimpleFixedNodeBranch::emb_.

38  {
39  comm_ = comm;
40  emb_ = std::make_unique<EstimatorManagerBase>(comm_);
41  emb_->add(std::make_unique<FakeEstimator>(), "fake");
42  }

◆ SetupSimpleFixedNodeBranch() [2/2]

Definition at line 44 of file test_SimpleFixedNodeBranch.cpp.

References SetupSimpleFixedNodeBranch::comm_, OHMMS::Controller, and SetupSimpleFixedNodeBranch::emb_.

45  {
47  emb_ = std::make_unique<EstimatorManagerBase>(comm_);
48  emb_->add(std::make_unique<FakeEstimator>(), "fake");
49  }
Communicate * Controller
Global Communicator for a process.
Definition: Communicate.cpp:35

Member Function Documentation

◆ createMyNode()

void createMyNode ( SimpleFixedNodeBranch sfnb,
const char *  xml 
)
inlineprivate

Definition at line 90 of file test_SimpleFixedNodeBranch.cpp.

References SetupSimpleFixedNodeBranch::doc_, and qmcplusplus::sfnb.

Referenced by SetupSimpleFixedNodeBranch::operator()().

91  {
92  doc_ = std::make_unique<Libxml2Document>();
93  doc_->parseFromString(xml);
94  sfnb.myNode = doc_->getRoot();
95  }
std::unique_ptr< SFNBranch > sfnb

◆ operator()()

SimpleFixedNodeBranch operator() ( )
inline

Definition at line 51 of file test_SimpleFixedNodeBranch.cpp.

References SetupSimpleFixedNodeBranch::createMyNode(), SetupSimpleFixedNodeBranch::emb_, SetupSimpleFixedNodeBranch::mcwc_, SetupSimpleFixedNodeBranch::num_global_walkers_, Walker< t_traits, p_traits >::R, qmcplusplus::sfnb, SetupSimpleFixedNodeBranch::tau_, qmcplusplus::testing::valid_dmc_input_dmc_index, and qmcplusplus::testing::valid_dmc_input_sections.

52  {
53  const SimulationCell simulation_cell;
54  mcwc_ = std::make_unique<MCWalkerConfiguration>(simulation_cell);
55  mcwc_->setName("electrons");
56 
57  mcwc_->create({1});
58  mcwc_->R[0][0] = 0.0;
59  mcwc_->R[0][1] = 1.0;
60  mcwc_->R[0][2] = 2.0;
61 
62  MCPWalker w1(1);
63  w1.R[0] = 1.0;
64  MCPWalker w2(1);
65  w2.R[0] = 0.5;
66 
67  mcwc_->createWalkers(2);
68  (*mcwc_)[0]->R = w1.R;
69  (*mcwc_)[1]->R = w2.R;
70 
71  SimpleFixedNodeBranch sfnb(tau_, num_global_walkers_);
72 
73  sfnb.setEstimatorManager(std::move(emb_));
74 
76 
77  // WalkerController is created as a side effect.
78  sfnb.initWalkerController(*mcwc_, false, false);
79 
80  sfnb.checkParameters(*mcwc_);
81 
82  sfnb.branch(0, *mcwc_);
83 
84  return sfnb;
85  }
constexpr int valid_dmc_input_dmc_index
void createMyNode(SimpleFixedNodeBranch &sfnb, const char *xml)
std::unique_ptr< SFNBranch > sfnb
Walker< QMCTraits, PtclOnLatticeTraits > MCPWalker
Definition: test_walker.cpp:31
constexpr std::array< const char *, 3 > valid_dmc_input_sections

Member Data Documentation

◆ comm_

◆ doc_

UPtr<Libxml2Document> doc_
private

◆ emb_

◆ mcwc_

◆ num_global_walkers_

int num_global_walkers_ = 16
private

◆ pop_

UPtr<MCPopulation> pop_
private

Definition at line 99 of file test_SimpleFixedNodeBranch.cpp.

◆ tau_

RealType tau_ = 1.0
private

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