AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
State.hpp
Go to the documentation of this file.
1/*
2 * This file is part of AQUAgpusph, a free CFD program based on SPH.
3 * Copyright (C) 2012 Jose Luis Cercos Pita <jl.cercos@upm.es>
4 *
5 * AQUAgpusph is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * AQUAgpusph is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with AQUAgpusph. If not, see <http://www.gnu.org/licenses/>.
17 */
18
23
24#ifndef STATE_H_INCLUDED
25#define STATE_H_INCLUDED
26
28#include "InputOutput.hpp"
29#include "Particles.hpp"
30
31#include <xercesc/dom/DOM.hpp>
32#include <xercesc/dom/DOMDocument.hpp>
33#include <xercesc/dom/DOMDocumentType.hpp>
34#include <xercesc/dom/DOMElement.hpp>
35#include <xercesc/dom/DOMImplementation.hpp>
36#include <xercesc/dom/DOMImplementationLS.hpp>
37#include <xercesc/dom/DOMNodeIterator.hpp>
38#include <xercesc/dom/DOMNodeList.hpp>
39#include <xercesc/dom/DOMText.hpp>
40#include <xercesc/parsers/XercesDOMParser.hpp>
41#include <xercesc/framework/StdOutFormatTarget.hpp>
42#include <xercesc/framework/LocalFileFormatTarget.hpp>
43#include <xercesc/util/XMLUni.hpp>
44
45#include <string>
46#include <vector>
47
48namespace Aqua {
49namespace InputOutput {
50
72{
73 public:
76 State();
77
79 ~State();
80
96 void save(ProblemSetup& sim_data, std::vector<Particles*> savers);
97
103 void load(std::string input_file, ProblemSetup& sim_data);
104
105 protected:
122 const std::string findPath(const std::string& path,
123 ProblemSetup& sim_data);
124
136 void parse(std::string filepath,
137 ProblemSetup& sim_data,
138 std::string prefix = "");
139
147 void parseSettings(xercesc::DOMElement* root,
148 ProblemSetup& sim_data,
149 std::string prefix = "");
150
158 void parseVariables(xercesc::DOMElement* root,
159 ProblemSetup& sim_data,
160 std::string prefix = "");
161
169 void parseDefinitions(xercesc::DOMElement* root,
170 ProblemSetup& sim_data,
171 std::string prefix = "");
172
180 void parseTools(xercesc::DOMElement* root,
181 ProblemSetup& sim_data,
182 std::string prefix = "");
183
191 void parseTiming(xercesc::DOMElement* root,
192 ProblemSetup& sim_data,
193 std::string prefix = "");
194
202 void parseSets(xercesc::DOMElement* root,
203 ProblemSetup& sim_data,
204 std::string prefix = "");
205
213 void parseReports(xercesc::DOMElement* root,
214 ProblemSetup& sim_data,
215 std::string prefix = "");
216
223 void write(std::string filepath,
224 ProblemSetup& sim_data,
225 std::vector<Particles*> savers);
226
234 void writeSettings(xercesc::DOMDocument* doc,
235 xercesc::DOMElement* root,
236 ProblemSetup& sim_data);
237
245 void writeVariables(xercesc::DOMDocument* doc,
246 xercesc::DOMElement* root,
247 ProblemSetup& sim_data);
248
256 void writeDefinitions(xercesc::DOMDocument* doc,
257 xercesc::DOMElement* root,
258 ProblemSetup& sim_data);
259
267 void writeTools(xercesc::DOMDocument* doc,
268 xercesc::DOMElement* root,
269 ProblemSetup& sim_data);
270
278 void writeTiming(xercesc::DOMDocument* doc,
279 xercesc::DOMElement* root,
280 ProblemSetup& sim_data);
281
290 void writeSets(xercesc::DOMDocument* doc,
291 xercesc::DOMElement* root,
292 ProblemSetup& sim_data,
293 std::vector<Particles*> savers);
294
302 void writeReports(xercesc::DOMDocument* doc,
303 xercesc::DOMElement* root,
304 ProblemSetup& sim_data);
305
306 private:
308 std::string _output_file;
310 std::vector<std::string> _xml_paths;
311}; // class InputOutput
312
313}
314} // namespaces
315
316#endif // STATE_H_INCLUDED
Base class for all the input/output file managers. (See Aqua::InputOutput::InputOutput for details)
Particles files manager. (See Aqua::InputOutput::Particles for details)
Simulation configuration data structures. (See Aqua::InputOutput::ProblemSetup for details)
Simulation configuration data.
Definition ProblemSetup.hpp:91
void parseSettings(xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="")
Parse the general settings sections.
Definition State.cpp:392
void writeDefinitions(xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data)
Write the definitions section.
Definition State.cpp:1712
void parseSets(xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="")
Definition State.cpp:1307
void parseDefinitions(xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="")
Parse the definitions sections.
Definition State.cpp:594
void parseTools(xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="")
Parse the tools sections.
Definition State.cpp:739
void save(ProblemSetup &sim_data, std::vector< Particles * > savers)
Save the configuration file.
Definition State.cpp:229
void writeSets(xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data, std::vector< Particles * > savers)
Write the particles set sections.
Definition State.cpp:1851
void load(std::string input_file, ProblemSetup &sim_data)
Load the simulation XML definition files.
Definition State.cpp:235
void parse(std::string filepath, ProblemSetup &sim_data, std::string prefix="")
Parse the XML file.
Definition State.cpp:276
void write(std::string filepath, ProblemSetup &sim_data, std::vector< Particles * > savers)
Write the XML file.
Definition State.cpp:1517
const std::string findPath(const std::string &path, ProblemSetup &sim_data)
Search for a file.
Definition State.cpp:241
void parseVariables(xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="")
Parse the variables sections.
Definition State.cpp:536
void writeSettings(xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data)
Write the settings section.
Definition State.cpp:1595
void parseTiming(xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="")
Parse the time control sections.
Definition State.cpp:1220
void writeTools(xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data)
Write the tools section.
Definition State.cpp:1739
void writeReports(xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data)
Write the reports section.
Definition State.cpp:1768
void writeTiming(xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data)
Write the time control section.
Definition State.cpp:1792
void writeVariables(xercesc::DOMDocument *doc, xercesc::DOMElement *root, ProblemSetup &sim_data)
Write the variables section.
Definition State.cpp:1667
void parseReports(xercesc::DOMElement *root, ProblemSetup &sim_data, std::string prefix="")
Parse the reports sections.
Definition State.cpp:1376
Input/Output data interfaces.
Definition ArgumentsManager.cpp:51
Main AQUAgpusph namespace.
Definition ArgumentsManager.cpp:50
Definition State.py:1
#define DECLDIR
Prefix to export C functions on the compiled library.
Definition sphPrerequisites.hpp:65