GEOS
Public Member Functions | List of all members
geos::GeosxState Class Reference

Holds the global GEOSX state. This is a singleton class, no more than one instance exists at at time. After construction the instance can be accessed from anywhere by the free function getGlobalState(). More...

#include <GeosxState.hpp>

Public Member Functions

 GeosxState (std::unique_ptr< CommandLineOptions > &&commandLineOptions)
 Construct a new state from command line options. More...
 
 ~GeosxState ()
 Destructor. More...
 
 GeosxState (GeosxState const &)=delete
 
 GeosxState (GeosxState &&)=delete
 
GeosxStateoperator= (GeosxState const &)=delete
 
GeosxStateoperator= (GeosxState &&)=delete
 
bool initializeDataRepository ()
 Initialize the Data Repository from the input file. More...
 
void applyInitialConditions ()
 Apply initial conditions and if performing a restart overwrites the data repository. More...
 
void run ()
 Run the simulation. More...
 
State getState () const
 Return the current State. More...
 
CommandLineOptions const & getCommandLineOptions ()
 Return the command line options. More...
 
conduit::Node & getRootConduitNode ()
 Return the root conduit node. More...
 
ProblemManagergetProblemManager ()
 Return the ProblemManager. More...
 
dataRepository::GroupgetProblemManagerAsGroup ()
 Return the ProblemManager but as a dataRepository::Group. More...
 
FieldSpecificationManagergetFieldSpecificationManager ()
 Return the FieldSpecificationManager. More...
 
FunctionManagergetFunctionManager ()
 Return the FunctionManager. More...
 
CommunicationTools & getCommunicationTools ()
 Return the CommunicationTools. More...
 
std::chrono::system_clock::duration getInitTime () const
 Return the time taken to setup the problem. More...
 
std::chrono::system_clock::duration getRunTime () const
 Return the time taken to run the problem. More...
 

Detailed Description

Holds the global GEOSX state. This is a singleton class, no more than one instance exists at at time. After construction the instance can be accessed from anywhere by the free function getGlobalState().

Definition at line 93 of file GeosxState.hpp.

Constructor & Destructor Documentation

◆ GeosxState()

geos::GeosxState::GeosxState ( std::unique_ptr< CommandLineOptions > &&  commandLineOptions)
explicit

Construct a new state from command line options.

Parameters
commandLineOptionsThe command line options.

Loads in the restart file if applicable, and allocates the ProblemManager.

Postcondition
After this call getState() is State::UNINITIALIZED.

◆ ~GeosxState()

geos::GeosxState::~GeosxState ( )

Destructor.

Note
This is the default constructor but it must be specified in the cpp, otherwise the use of std::unique_ptr with forward declared types won't work.

Member Function Documentation

◆ applyInitialConditions()

void geos::GeosxState::applyInitialConditions ( )

Apply initial conditions and if performing a restart overwrites the data repository.

Precondition
This must be called after initializeDataRepository() when getState() is State::INITIALIZED.
Postcondition
After this call getState() is State::READY_TO_RUN.

◆ getCommandLineOptions()

CommandLineOptions const& geos::GeosxState::getCommandLineOptions ( )
inline

Return the command line options.

Returns
The command line options.

Definition at line 152 of file GeosxState.hpp.

◆ getCommunicationTools()

CommunicationTools& geos::GeosxState::getCommunicationTools ( )
inline

Return the CommunicationTools.

Returns
The CommunicationTools.

Definition at line 202 of file GeosxState.hpp.

◆ getFieldSpecificationManager()

FieldSpecificationManager& geos::GeosxState::getFieldSpecificationManager ( )

◆ getFunctionManager()

FunctionManager& geos::GeosxState::getFunctionManager ( )

Return the FunctionManager.

Returns
The FunctionManager.

◆ getInitTime()

std::chrono::system_clock::duration geos::GeosxState::getInitTime ( ) const
inline

Return the time taken to setup the problem.

Returns
The time taken to setup the problem.

Definition at line 212 of file GeosxState.hpp.

◆ getProblemManager()

ProblemManager& geos::GeosxState::getProblemManager ( )
inline

Return the ProblemManager.

Returns
The ProblemManager.

Definition at line 172 of file GeosxState.hpp.

◆ getProblemManagerAsGroup()

dataRepository::Group& geos::GeosxState::getProblemManagerAsGroup ( )

Return the ProblemManager but as a dataRepository::Group.

Returns
The ProblemManager but as a dataRepository::Group.
Note
This is useful if you only need at dataRepository::Group and don't want to include ProblemManager.hpp.

◆ getRootConduitNode()

conduit::Node& geos::GeosxState::getRootConduitNode ( )
inline

Return the root conduit node.

Returns
The root conduit node.

Definition at line 162 of file GeosxState.hpp.

◆ getRunTime()

std::chrono::system_clock::duration geos::GeosxState::getRunTime ( ) const
inline

Return the time taken to run the problem.

Returns
The time taken to run the problem.

Definition at line 219 of file GeosxState.hpp.

◆ getState()

State geos::GeosxState::getState ( ) const
inline

Return the current State.

Returns
The current state.

Definition at line 145 of file GeosxState.hpp.

◆ initializeDataRepository()

bool geos::GeosxState::initializeDataRepository ( )

Initialize the Data Repository from the input file.

Returns
True iff the problem is ready to be run.
Precondition
This must be called after construction when getState() is State::UNINITIALIZED.
Postcondition
After this call getState() is State::INITIALIZED.

◆ run()

void geos::GeosxState::run ( )

Run the simulation.

Precondition
This must be called after applyInitialConditions() when getState() is State::READY_TO_RUN.
Postcondition
Iff the simulation ran to completion then getState() is State::COMPLETED, otherwise if there is still stuff left to do getState() is State::READY_TO_RUN.

The documentation for this class was generated from the following file: