QMCPACK
QMCAppBase.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) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #ifndef QMCPLUSPLUS_QMCAPPLICATIONBASE_H
16 #define QMCPLUSPLUS_QMCAPPLICATIONBASE_H
17 
19 #include "OhmmsData/Libxml2Doc.h"
20 #include "ProjectData.h"
21 #include "RandomNumberControl.h"
22 #include <stack>
23 /**@defgroup qmcapp QMC Application Group
24  * @brief Application-level classes to manage QMC simulations.
25  *
26  * The classes in this group are responsble for handling of major xml elements
27  * under <simulation>.
28  */
29 namespace qmcplusplus
30 {
31 /** @ingroup qmcapp
32  * @brief Base class for QMC applications and utilities
33  */
35 {
36 public:
37  ///constructor
38  QMCAppBase();
39 
40  ///destructor
41  virtual ~QMCAppBase();
42 
43  /** parse an input file
44  * @param infile file to be parsed.
45  * @return true if the input file is a valid xml file
46  */
47  bool parse(const std::string& infile);
48 
49  /** save the xml document
50  *
51  */
52  void saveXml();
53 
54  /** validate the input file */
55  virtual bool validateXML() = 0;
56 
57  /** execute the main function */
58  virtual bool execute() = 0;
59 
60  const std::string& getTitle() const;
61 
62 protected:
63  ///stack of xml document
64  std::stack<Libxml2Document*> xml_doc_stack_;
65 
66  ///project description
68 
69  ///random number controller
71 
72  ///open a new document
73  bool pushDocument(const std::string& infile);
74  ///close the current document
75  void popDocument();
76 };
77 } // namespace qmcplusplus
78 #endif
bool parse(const std::string &infile)
parse an input file
Definition: QMCAppBase.cpp:64
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
class ProjectData
Definition: ProjectData.h:36
void saveXml()
save the xml document
Definition: QMCAppBase.cpp:70
virtual bool execute()=0
execute the main function
Declaration of OhmmsElementBase and define xml-related macros.
virtual bool validateXML()=0
validate the input file
ProjectData my_project_
project description
Definition: QMCAppBase.h:67
bool pushDocument(const std::string &infile)
open a new document
Definition: QMCAppBase.cpp:30
class RandomNumberControl
RandomNumberControl my_random_control_
random number controller
Definition: QMCAppBase.h:70
const std::string & getTitle() const
Definition: QMCAppBase.cpp:82
QMCAppBase()
constructor
void popDocument()
close the current document
Definition: QMCAppBase.cpp:46
Base class for QMC applications and utilities.
Definition: QMCAppBase.h:34
virtual ~QMCAppBase()
destructor
Definition: QMCAppBase.cpp:22
std::stack< Libxml2Document * > xml_doc_stack_
stack of xml document
Definition: QMCAppBase.h:64