12 #ifndef MFEM_DATACOLLECTION
13 #define MFEM_DATACOLLECTION
15 #include "../config/config.hpp"
170 void Load(
int _cycle = 0);
std::map< std::string, GridFunction * > field_map
The fields and their names (used when saving)
Class for grid function - Vector with associated FE space.
bool HasField(const char *name)
Check if a grid function is part of the collection.
void SetCycle(int c)
Set time cycle (for time-dependent simulations)
virtual void RegisterField(const char *field_name, GridFunction *gf)
Add a grid function to the collection and update the root file.
void DeleteAll()
Delete data owned by the DataCollection including field information.
Helper class for VisIt visualization data.
double GetTime()
Get physical time (for time-dependent simulations)
virtual void Save()
Save the collection and a VisIt root file.
int Error() const
Get the current error state.
bool own_data
Should the collection delete its mesh and fields.
double time
Physical time (for time-dependent simulations)
void ResetError(int err=NO_ERROR)
Reset the error state.
Mesh * mesh
The (common) mesh for the collected fields.
void SetPadDigits(int digits)
Set the number of digits used for the cycle and MPI rank in filenames.
VisItFieldInfo(std::string _association, int _num_components)
bool serial
Serial or parallel run? If false, append rank (myid) to file names.
void ParseVisItRootString(std::string json)
Read in a VisIt root file in JSON format.
Data collection with VisIt I/O routines.
int visit_max_levels_of_detail
GridFunction * GetField(const char *field_name)
Get a pointer to a grid function in the collection.
void DeleteData()
Delete data owned by the DataCollection keeping field information.
static const int pad_digits_default
Default value for pad_digits.
void Load(int _cycle=0)
Load the collection based on its VisIt data (described in its root file)
void SetTime(double t)
Set physical time (for time-dependent simulations)
void SetOwnData(bool o)
Set the ownership of collection data.
virtual ~VisItDataCollection()
We will delete the mesh and fields if we own them.
std::map< std::string, VisItFieldInfo > field_info_map
void LoadVisItRootFile(std::string root_name)
int myid
MPI rank (in parallel)
const char * GetCollectionName()
Get the name of the collection.
void SetMaxLevelsOfDetail(int max_levels_of_detail)
Set VisIt parameter: maximum levels of detail for the MultiresControl.
virtual ~DataCollection()
Delete the mesh and fields if owned by the collection.
int GetCycle()
Get time cycle (for time-dependent simulations)
VisItDataCollection(const char *collection_name)
virtual void RegisterField(const char *field_name, GridFunction *gf)
Add a grid function to the collection.
DataCollection(const char *collection_name)
Create an empty collection with the given name.
Mesh * GetMesh()
Get a pointer to the mesh in the collection.
int pad_digits
Number of digits used for the cycle and MPI rank in filenames.
std::string name
Name of the collection, used as a directory name when saving.
int num_procs
Number of MPI ranks (in parallel)
std::string GetVisItRootString()
Prepare the VisIt root file in JSON format for the current collection.