WARPXM v1.10.0
Loading...
Searching...
No Matches
wmsimulation.h
Go to the documentation of this file.
1#ifndef wmsimulation_h
2#define wmsimulation_h
3
4// WarpX lib includes
5#include "lib/wxobject.h"
6
7// Mpi includes
8#include <utility>
9#include <mpi.h>
10#include "lib/wxmpimsg.h"
11
12#include "lib/wxhdf5io.h"
13
14#include <petsc.h>
15
16// forward declarations
17class WmSolver;
18
27class WmSimulation : public WxObject
28{
29public:
32
37 WmSimulation(MPI_Comm comm);
38
40 virtual ~WmSimulation();
41
47 const std::string& getInpFileName() const;
48
51
57 const std::string& getRunName() const
58 {
59 return runName;
60 }
61
67 bool isRestarting() const
68 {
69 return restartSim;
70 }
71
77 std::string getRestartFile() const
78 {
79 return restartFile;
80 }
81
87 int getRestartFrame() const
88 {
89 return restartFrame;
90 }
91
97 virtual void setup(const WxCryptSet& wmc);
98
106 void setInputFileText(const std::string& str);
107
115 const std::string& getInputFileText() const;
116
118 void simulate();
119
124 {
125 return solver;
126 }
127
129 {
130 return msg;
131 }
132
133private:
135 WmSolver* solver;
139 std::string inpFileName;
141 std::string runName;
143 bool restartSim;
145 std::string restartFile;
147 int restartFrame;
149 std::string _inputFileContentsArchival;
150
151 WxHdf5Io* p_io;
152 MPI_Comm cloned_world;
153 WxMpiMsg msg;
154
156 PetscErrorCode usage();
157
159 std::string stripName(const std::string& nm);
160};
161
164#endif // wmsimulation_h
Top level class for WARPXM simulations.
Definition: wmsimulation.h:28
WxMpiMsg & getMsg()
Definition: wmsimulation.h:128
std::string getRestartFile() const
Get file from which to restart the simulation.
Definition: wmsimulation.h:77
int getRestartFrame() const
Get frame from which to restart the simulation.
Definition: wmsimulation.h:87
void simulate()
Run simulation.
const std::string & getInpFileName() const
Return name of input file including absolute or relative path as specified.
bool parseCmdLine()
Parse command line parameters.
bool isRestarting() const
Return true if we are restarting simulation.
Definition: wmsimulation.h:67
WmSolver * get_solver()
Get access to the underlying WmSolver.
Definition: wmsimulation.h:123
virtual void setup(const WxCryptSet &wmc)
Setup simulation using supplied crypset.
WmSimulation(MPI_Comm comm)
constructs a WmSimulation with a given MPI Communicator.
void setInputFileText(const std::string &str)
Set string representing the input file contents used to build this simulation.
virtual ~WmSimulation()
Destroy simulation.
const std::string & getInputFileText() const
Get string representing the input file contents used to build this simulation.
WmSimulation()
Construct a new simulation object.
const std::string & getRunName() const
Return name of run.
Definition: wmsimulation.h:57
Provides many vital functionality to building and executing a sequence of simulation code.
Definition: wmsolver.h:36
WxCryptSet extends WxCrypt by providing, in addition to name-value pairs, an set of named WxCryptSets...
Definition: wxcryptset.h:35
WxHdf5Io is the interface for the HDF5 implementation of HDF5.
Definition: wxhdf5io.h:24
MPI Messenger.
Definition: wxmpimsg.h:23
WxObject is a base class for WarpX classes which need to go through a creation/destruction cycle with...
Definition: wxobject.h:54