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