QMCPACK
WalkerConsumer.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2019 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File created by: Peter Doak, , doakpw@ornl.gov, Oak Ridge National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef QMCPLUSPLUS_WALKERCONSUMER_H
13 #define QMCPLUSPLUS_WALKERCONSUMER_H
14 
15 #include <vector>
16 
17 #include "Particle/Walker.h"
18 
19 namespace qmcplusplus
20 {
21 class ResourceCollection;
22 
23 namespace testing
24 {
25 /** mock class to avoid testing dependency between Crowd and MCPopulation
26  *
27  * Also example of minimum client of MCPopulation::redistributeWalkers
28  */
30 {
31 public:
32  std::vector<std::reference_wrapper<Walker<QMCTraits, PtclOnLatticeTraits>>> walkers;
33  std::vector<std::reference_wrapper<ParticleSet>> walker_elecs_;
34  std::vector<std::reference_wrapper<TrialWaveFunction>> walker_twfs_;
35  std::vector<std::reference_wrapper<QMCHamiltonian>> walker_hamiltonians_;
36 
37  void initializeResources(const ResourceCollection& twf_resource) {}
38 
40  ParticleSet& elecs,
42  QMCHamiltonian& hamiltonian)
43  {
44  walkers.push_back(walker);
45  walker_elecs_.push_back(elecs);
46  walker_twfs_.push_back(twf);
47  walker_hamiltonians_.push_back(hamiltonian);
48  }
49 
50  void clearWalkers()
51  {
52  // We're clearing the refs to the objects not the referred to objects.
53  walkers.clear();
54  walker_elecs_.clear();
55  walker_twfs_.clear();
56  walker_hamiltonians_.clear();
57  }
58 };
59 
60 } // namespace testing
61 } // namespace qmcplusplus
62 #endif
std::vector< std::reference_wrapper< QMCHamiltonian > > walker_hamiltonians_
std::vector< std::reference_wrapper< ParticleSet > > walker_elecs_
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
void addWalker(Walker< QMCTraits, PtclOnLatticeTraits > &walker, ParticleSet &elecs, TrialWaveFunction &twf, QMCHamiltonian &hamiltonian)
Collection of Local Energy Operators.
std::vector< std::reference_wrapper< Walker< QMCTraits, PtclOnLatticeTraits > > > walkers
mock class to avoid testing dependency between Crowd and MCPopulation
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
std::vector< std::reference_wrapper< TrialWaveFunction > > walker_twfs_
void initializeResources(const ResourceCollection &twf_resource)
Class to represent a many-body trial wave function.
A container class to represent a walker.
Definition: Walker.h:49