AQUAgpusph 4.1.2
|
Load/Save the XML simulation definition files. More...
#include <InputOutput/State.h>
Public Member Functions | |
State () | |
Constructor. | |
~State () | |
Destructor. | |
void | save (ProblemSetup &sim_data, std::vector< Particles * > savers) |
Save the configuration file. | |
void | load (std::string input_file, ProblemSetup &sim_data) |
Load the simulation XML definition files. | |
Protected Member Functions | |
void | parse (std::string filepath, ProblemSetup &sim_data, std::string prefix="") |
Parse the XML file. | |
void | parseSettings (xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="") |
Parse the general settings sections. | |
void | parseVariables (xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="") |
Parse the variables sections. | |
void | parseDefinitions (xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="") |
Parse the definitions sections. | |
void | parseTools (xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="") |
Parse the tools sections. | |
void | parseTiming (xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="") |
Parse the time control sections. | |
void | parseSets (xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="") |
void | parseReports (xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="") |
Parse the reports sections. | |
void | write (std::string filepath, ProblemSetup &sim_data, std::vector< Particles * > savers) |
Write the XML file. | |
void | writeSettings (xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data) |
Write the settings section. | |
void | writeVariables (xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data) |
Write the variables section. | |
void | writeDefinitions (xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data) |
Write the definitions section. | |
void | writeTools (xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data) |
Write the tools section. | |
void | writeTiming (xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data) |
Write the time control section. | |
void | writeSets (xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data, std::vector< Particles * > savers) |
Write the particles set sections. | |
void | writeReports (xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data) |
Write the reports section. | |
Load/Save the XML simulation definition files.
In AQUAgpusph the input/output managers are divided in 3 different types:
This class is based in the xerces-c library, to learn more please visit the following web page:
http://xerces.apache.org/xerces-c
You can find more information about how to create simulation configuration files in the examples provided with the package and in the Aqua::InputOutput::ProblemSetup class documentation.
Aqua::InputOutput::State::State | ( | ) |
Constructor.
Aqua::InputOutput::State::~State | ( | ) |
Destructor.
void Aqua::InputOutput::State::load | ( | std::string | input_file, |
ProblemSetup & | sim_data | ||
) |
Load the simulation XML definition files.
input_file | XML file to load |
sim_data | Simulation data |
|
protected |
Parse the XML file.
filepath | file to be parsed. |
sim_data | Simulation data |
prefix | String to be inserted before the variable names defined in the file. |
<Include>
tag found, conveniently changing filepath and prefix. If no prefix is specified in the <Include>
tag, the same received prefix will be used.
|
protected |
Parse the definitions sections.
root | root XML node. |
sim_data | Simulation data |
prefix | String to be inserted before the variable names. |
|
protected |
Parse the reports sections.
root | root XML node. |
sim_data | Simulation data |
prefix | String to be inserted before the variable names. |
|
protected |
Look for particles set sections.
root | Root XML node. |
sim_data | Simulation data |
prefix | String to be inserted before the variable names. |
|
protected |
Parse the general settings sections.
root | root XML node. |
sim_data | Simulation data |
prefix | String to be inserted before the variable names. |
|
protected |
Parse the time control sections.
root | Root XML node. |
sim_data | Simulation data |
prefix | String to be inserted before the variable names. |
|
protected |
Parse the tools sections.
root | root XML node. |
sim_data | Simulation data |
prefix | String to be inserted before the variable names. |
|
protected |
Parse the variables sections.
root | root XML node. |
sim_data | Simulation data |
prefix | String to be inserted before the variable names. |
void Aqua::InputOutput::State::save | ( | ProblemSetup & | sim_data, |
std::vector< Particles * > | savers | ||
) |
Save the configuration file.
The saved XML file can be used to continue the simulation from the last saved time instant.
The output XML file will be the first non existing file named "AQUAgpusph.save.%d.xml"
, where "%d"
is an unsigned integer.
Of course, to can load a saved simulation, the output particles file should be saved as well.
sim_data | Simulation data |
savers | Particles savers list |
|
protected |
Write the XML file.
filepath | file to be written. |
sim_data | Simulation data |
savers | Particles savers list |
|
protected |
Write the definitions section.
doc | XML generated document. |
root | Root XML node. |
sim_data | Simulation data |
|
protected |
Write the reports section.
doc | XML generated document. |
root | Root XML node. |
sim_data | Simulation data |
|
protected |
Write the particles set sections.
doc | XML generated document. |
root | Root XML node. |
sim_data | Simulation data |
savers | Particles savers list |
|
protected |
Write the settings section.
doc | XML generated document. |
root | root XML node. |
sim_data | Simulation data |
|
protected |
Write the time control section.
doc | XML generated document. |
root | Root XML node. |
sim_data | Simulation data |
|
protected |
Write the tools section.
doc | XML generated document. |
root | Root XML node. |
sim_data | Simulation data |
|
protected |
Write the variables section.
doc | XML generated document. |
root | Root XML node. |
sim_data | Simulation data |