12 #include "../config/config.hpp"
17 #include "../general/text.hpp"
41 const std::string& coll_name,
47 MPI_Comm_rank(comm, &
myid);
69 FmsDataCollectionDestroy(&dc);
72 MFEM_ABORT(
"Error creating FMS file: " << root);
77 MFEM_ABORT(
"Error converting data collection");
108 std::vector<std::string> names;
111 names.push_back(pair.first);
114 for (
const auto &name : names)
122 names.push_back(pair.first);
125 for (
const auto &name : names)
136 FmsDataCollectionDestroy(&dc);
140 MFEM_ABORT(
"Error reading data collection: " << root);
void SetCycle(int c)
Set time cycle (for time-dependent simulations)
double GetTime() const
Get physical time (for time-dependent simulations)
bool appendRankToFileName
Append rank to any output file names.
virtual void Save()
Save the collection and a FMS blueprint root file.
virtual void RegisterQField(const std::string &q_field_name, QuadratureFunction *qf)
Add a QuadratureFunction to the collection.
void DeleteAll()
Delete data owned by the DataCollection including field information.
int pad_digits_cycle
Number of digits used for the cycle and MPI rank in filenames.
const std::string & GetCollectionName() const
Get the name of the collection.
double GetTimeStep() const
Get the simulation time step (for time-dependent simulations)
MPI_Comm m_comm
Associated MPI communicator.
const QFieldMapType & GetQFieldMap() const
Get a const reference to the internal q-field map.
virtual void RegisterField(const std::string &field_name, GridFunction *gf)
Add a grid function to the collection.
int cycle
Time cycle; for time-dependent simulations cycle >= 0, otherwise = -1.
virtual void Load(int cycle=0)
Load the collection based blueprint data.
std::string to_padded_string(int i, int digits)
Convert an integer to a 0-padded string with the given number of digits.
const FieldMapType & GetFieldMap() const
Get a const reference to the internal field map.
int GetCycle() const
Get time cycle (for time-dependent simulations)
int DataCollectionToFmsDataCollection(DataCollection *mfem_dc, FmsDataCollection *dc)
int FmsDataCollectionToDataCollection(FmsDataCollection dc, DataCollection **mfem_dc)
void SetTime(double t)
Set physical time (for time-dependent simulations)
void SetOwnData(bool o)
Set the ownership of collection data.
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
int myid
MPI rank (in parallel)
std::string RootFileName()
Returns file name for the current cycle.
void SetTimeStep(double ts)
Set the simulation time step (for time-dependent simulations)
void SetProtocol(const std::string &protocol)
Set the FMS relay i/o protocol to use.
std::string prefix_path
A path where the directory with results is saved. If not empty, it has '/' at the end...
virtual void DeregisterField(const std::string &field_name)
Remove a grid function from the collection.
Mesh * GetMesh()
Get a pointer to the mesh in the collection.
FMSDataCollection(const std::string &collection_name, Mesh *mesh=NULL)
Constructor. The collection name is used when saving the data.
virtual void SetMesh(Mesh *new_mesh)
Set/change the mesh associated with the collection.
std::string name
Name of the collection, used as a directory name when saving.
int num_procs
Number of MPI ranks (in parallel)
virtual ~FMSDataCollection()
We will delete the mesh and fields if we own them.