QMCPACK
test_clone_manager.cpp
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) 2018 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "catch.hpp"
14 
15 
16 #include "Configuration.h"
17 #include "Message/Communicate.h"
20 #include "OhmmsData/Libxml2Doc.h"
21 #include "OhmmsPETE/OhmmsMatrix.h"
22 #include "Particle/ParticleSet.h"
27 
28 
29 #include <stdio.h>
30 #include <string>
31 #include <random>
32 
33 
34 using std::string;
35 
36 namespace qmcplusplus
37 {
38 class FakeUpdate : public QMCUpdateBase
39 {
40 public:
42  TrialWaveFunction& psi,
43  QMCHamiltonian& h,
45  : QMCUpdateBase(w, psi, h, rg)
46  {}
47 
48  void advanceWalker(Walker_t& thisWalker, bool recompute) override {}
49 };
50 
51 TEST_CASE("QMCUpdate", "[drivers]")
52 {
54 
55  const SimulationCell simulation_cell;
56  MCWalkerConfiguration elec(simulation_cell);
57  elec.setName("e");
58  elec.create({1});
59  elec.createWalkers(1);
60 
61  SpeciesSet& tspecies = elec.getSpeciesSet();
62  int upIdx = tspecies.addSpecies("u");
63  int chargeIdx = tspecies.addAttribute("charge");
64  int massIdx = tspecies.addAttribute("mass");
65  tspecies(chargeIdx, upIdx) = -1;
66  tspecies(massIdx, upIdx) = 1.0;
67 
68  FakeRandom rg;
69 
71  RuntimeOptions runtime_options;
72  TrialWaveFunction psi(runtime_options);
73  FakeUpdate update(elec, psi, h, rg);
74 
75  update.put(NULL);
76 
77  //update.resetRun(brancher, estimator_manager);
78 }
79 
80 
81 TEST_CASE("CloneManager", "[drivers]")
82 {
84 
85  CloneManager cm;
86 }
87 
88 } // namespace qmcplusplus
void advanceWalker(Walker_t &thisWalker, bool recompute) override
move a walker
void setName(const std::string &aname)
Definition: ParticleSet.h:237
Base class for update methods for each step.
Definition: QMCUpdateBase.h:41
A set of walkers that are to be advanced by Metropolis Monte Carlo.
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
Definition: SpeciesSet.cpp:33
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Manager clones for threaded applications.
Definition: CloneManager.h:34
TEST_CASE("complex_helper", "[type_traits]")
virtual bool put(xmlNodePtr cur)
process options
Collection of Local Energy Operators.
Communicate * Controller
Global Communicator for a process.
Definition: Communicate.cpp:35
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
Definition: SpeciesSet.cpp:45
Wrapping information on parallelism.
Definition: Communicate.h:68
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
Definition: ParticleSet.h:231
void create(const std::vector< int > &agroup)
create grouped particles
Declaration of HamiltonianPool.
Class to represent a many-body trial wave function.
Manager class to handle multiple threads.
Custom container for set of attributes for a set of species.
Definition: SpeciesSet.h:33
void createWalkers(int numWalkers)
create numWalkers Walkers
Declare QMCUpdateBase class.
Declare a global Random Number Generator.
Declaration of a MCWalkerConfiguration.
A container class to represent a walker.
Definition: Walker.h:49
FakeUpdate(MCWalkerConfiguration &w, TrialWaveFunction &psi, QMCHamiltonian &h, FakeRandom< QMCTraits::FullPrecRealType > &rg)