QMCPACK
QMCDriverInterface.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 refactored from VMC.h
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef QMCPLUSPLUS_QMCDRIVERINTERFACE_H
13 #define QMCPLUSPLUS_QMCDRIVERINTERFACE_H
14 
15 #include <string>
16 #include <vector>
17 #include <libxml/parser.h>
20 #include "QMCDrivers/SFNBranch.h"
22 
23 namespace qmcplusplus
24 {
25 class QMCHamiltonian;
26 class TrialWaveFunction;
27 
28 /** Creates a common base class pointer for QMCDriver and QMCDriverNew
29  * to share.
30  *
31  * Once the "unified" driver is done this should be refactored away
32  */
34 {
35 public:
38  virtual bool run() = 0;
39  virtual bool put(xmlNodePtr cur) = 0;
40  virtual void recordBlock(int block) = 0;
41 
42  ///return the i-th random generator
43  virtual RandomBase<FullPrecRealType>& getRng(int i) = 0;
44 
45  virtual void setStatus(const std::string& aname, const std::string& h5name, bool append) = 0;
46 
47  virtual void setUpdateMode(bool pbyp) = 0;
48  virtual void add_H_and_Psi(QMCHamiltonian* h, TrialWaveFunction* psi) = 0;
49  virtual void putWalkers(std::vector<xmlNodePtr>& wset) = 0;
50  virtual void putTraces(xmlNodePtr txml) = 0;
51  virtual void requestTraces(bool allow_traces) = 0;
52  virtual void putWalkerLogs(xmlNodePtr wlxml) = 0;
53  virtual void requestWalkerLogs(bool allow_walker_logs_) = 0;
54  virtual void process(xmlNodePtr cur) = 0;
55  virtual QMCRunType getRunType() = 0;
56  virtual std::string getEngineName() = 0;
57  virtual unsigned long getDriverMode() = 0;
58  virtual ~QMCDriverInterface() {}
59 
60  virtual void setBranchEngine(std::unique_ptr<BranchEngineType>&& be) {}
61  virtual std::unique_ptr<BranchEngineType> getBranchEngine() { return nullptr; }
62 
63 protected:
64  virtual const std::string& get_root_name() const = 0;
65 };
66 
67 } // namespace qmcplusplus
68 
69 #endif
virtual unsigned long getDriverMode()=0
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QMCTraits::FullPrecRealType FullPrecRealType
virtual void setStatus(const std::string &aname, const std::string &h5name, bool append)=0
Collection of Local Energy Operators.
virtual void setUpdateMode(bool pbyp)=0
virtual const std::string & get_root_name() const =0
virtual bool put(xmlNodePtr cur)=0
virtual void process(xmlNodePtr cur)=0
Creates a common base class pointer for QMCDriver and QMCDriverNew to share.
virtual void putTraces(xmlNodePtr txml)=0
Manages the state of QMC sections and handles population control for DMCs.
virtual void recordBlock(int block)=0
virtual void requestWalkerLogs(bool allow_walker_logs_)=0
virtual QMCRunType getRunType()=0
virtual void setBranchEngine(std::unique_ptr< BranchEngineType > &&be)
virtual RandomBase< FullPrecRealType > & getRng(int i)=0
return the i-th random generator
virtual std::string getEngineName()=0
virtual std::unique_ptr< BranchEngineType > getBranchEngine()
Class to represent a many-body trial wave function.
virtual void putWalkerLogs(xmlNodePtr wlxml)=0
virtual void putWalkers(std::vector< xmlNodePtr > &wset)=0
declare a handler of DMC branching
QTFull::RealType FullPrecRealType
Definition: Configuration.h:66
virtual void add_H_and_Psi(QMCHamiltonian *h, TrialWaveFunction *psi)=0
Declare a global Random Number Generator.
virtual void requestTraces(bool allow_traces)=0