MFEM
v3.3.2
Finite element discretization library
|
Data collection with VisIt I/O routines. More...
#include <datacollection.hpp>
Public Member Functions | |
VisItDataCollection (const std::string &collection_name, Mesh *mesh_=NULL) | |
Constructor. The collection name is used when saving the data. More... | |
virtual void | SetMesh (Mesh *new_mesh) |
Set/change the mesh associated with the collection. More... | |
virtual void | RegisterField (const std::string &field_name, GridFunction *gf) |
Add a grid function to the collection and update the root file. More... | |
void | SetMaxLevelsOfDetail (int max_levels_of_detail) |
Set VisIt parameter: maximum levels of detail for the MultiresControl. More... | |
void | DeleteAll () |
virtual void | Save () |
Save the collection and a VisIt root file. More... | |
void | SaveRootFile () |
Save a VisIt root file for the collection. More... | |
virtual void | Load (int cycle_=0) |
Load the collection based on its VisIt data (described in its root file) More... | |
virtual | ~VisItDataCollection () |
We will delete the mesh and fields if we own them. More... | |
Public Member Functions inherited from mfem::DataCollection | |
DataCollection (const std::string &collection_name, Mesh *mesh_=NULL) | |
Initialize the collection with its name and Mesh. More... | |
virtual void | DeregisterField (const std::string &field_name) |
Remove a grid function from the collection. More... | |
virtual void | RegisterQField (const std::string &q_field_name, QuadratureFunction *qf) |
Add a QuadratureFunction to the collection. More... | |
virtual void | DeregisterQField (const std::string &field_name) |
Remove a QuadratureFunction from the collection. More... | |
bool | HasField (const std::string &name) const |
Check if a grid function is part of the collection. More... | |
GridFunction * | GetField (const std::string &field_name) |
Get a pointer to a grid function in the collection. More... | |
ParGridFunction * | GetParField (const std::string &field_name) |
Get a pointer to a parallel grid function in the collection. More... | |
bool | HasQField (const std::string &q_field_name) const |
Check if a QuadratureFunction with the given name is in the collection. More... | |
QuadratureFunction * | GetQField (const std::string &q_field_name) |
Get a pointer to a QuadratureFunction in the collection. More... | |
const FieldMapType & | GetFieldMap () const |
Get a const reference to the internal field map. More... | |
const QFieldMapType & | GetQFieldMap () const |
Get a const reference to the internal q-field map. More... | |
Mesh * | GetMesh () |
Get a pointer to the mesh in the collection. More... | |
void | SetCycle (int c) |
Set time cycle (for time-dependent simulations) More... | |
void | SetTime (double t) |
Set physical time (for time-dependent simulations) More... | |
void | SetTimeStep (double ts) |
Set the simulation time step (for time-dependent simulations) More... | |
int | GetCycle () const |
Get time cycle (for time-dependent simulations) More... | |
double | GetTime () const |
Get physical time (for time-dependent simulations) More... | |
double | GetTimeStep () const |
Get the simulation time step (for time-dependent simulations) More... | |
const std::string & | GetCollectionName () const |
Get the name of the collection. More... | |
void | SetOwnData (bool o) |
Set the ownership of collection data. More... | |
void | SetPrecision (int prec) |
Set the precision (number of digits) used for the text output of doubles. More... | |
void | SetPadDigits (int digits) |
Set the number of digits used for both the cycle and the MPI rank. More... | |
void | SetPadDigitsCycle (int digits) |
Set the number of digits used for the cycle. More... | |
void | SetPadDigitsRank (int digits) |
Set the number of digits used for the MPI rank in filenames. More... | |
void | SetFormat (int fmt) |
Set the desired output mesh format: 0 - serial format (default), 1 - parallel format. More... | |
void | SetPrefixPath (const std::string &prefix) |
Set the path where the DataCollection will be saved. More... | |
const std::string & | GetPrefixPath () const |
Get the path where the DataCollection will be saved. More... | |
virtual void | SaveMesh () |
Save the mesh, creating the collection directory. More... | |
virtual void | SaveField (const std::string &field_name) |
Save one field, assuming the collection directory already exists. More... | |
virtual void | SaveQField (const std::string &q_field_name) |
Save one q-field, assuming the collection directory already exists. More... | |
virtual | ~DataCollection () |
Delete the mesh and fields if owned by the collection. More... | |
int | Error () const |
Get the current error state. More... | |
void | ResetError (int err=NO_ERROR) |
Reset the error state. More... | |
Protected Types | |
typedef std::map< std::string, VisItFieldInfo >::iterator | FieldInfoMapIterator |
Protected Types inherited from mfem::DataCollection | |
typedef FieldMapType::iterator | FieldMapIterator |
The fields and their names (used when saving) More... | |
typedef FieldMapType::const_iterator | FieldMapConstIterator |
typedef QFieldMapType::iterator | QFieldMapIterator |
typedef QFieldMapType::const_iterator | QFieldMapConstIterator |
Protected Member Functions | |
std::string | GetVisItRootString () |
Prepare the VisIt root file in JSON format for the current collection. More... | |
void | ParseVisItRootString (const std::string &json) |
Read in a VisIt root file in JSON format. More... | |
void | LoadVisItRootFile (const std::string &root_name) |
void | LoadMesh () |
void | LoadFields () |
Protected Member Functions inherited from mfem::DataCollection | |
void | DeleteData () |
Delete data owned by the DataCollection keeping field information. More... | |
void | DeleteAll () |
Delete data owned by the DataCollection including field information. More... | |
std::string | GetFieldFileName (const std::string &field_name) |
void | SaveOneField (const FieldMapIterator &it) |
Save one field to disk, assuming the collection directory exists. More... | |
void | SaveOneQField (const QFieldMapIterator &it) |
Save one q-field to disk, assuming the collection directory exists. More... | |
Protected Attributes | |
int | spatial_dim |
int | topo_dim |
int | visit_max_levels_of_detail |
std::map< std::string, VisItFieldInfo > | field_info_map |
Protected Attributes inherited from mfem::DataCollection | |
std::string | name |
Name of the collection, used as a directory name when saving. More... | |
std::string | prefix_path |
FieldMapType | field_map |
QFieldMapType | q_field_map |
Mesh * | mesh |
The (common) mesh for the collected fields. More... | |
int | cycle |
double | time |
Physical time (for time-dependent simulations) More... | |
double | time_step |
Time step i.e. delta_t (for time-dependent simulations) More... | |
bool | serial |
Serial or parallel run? More... | |
bool | appendRankToFileName |
Append rank to any output file names. More... | |
int | myid |
MPI rank (in parallel) More... | |
int | num_procs |
Number of MPI ranks (in parallel) More... | |
int | precision |
Precision (number of digits) used for the text output of doubles. More... | |
int | pad_digits_cycle |
Number of digits used for the cycle and MPI rank in filenames. More... | |
int | pad_digits_rank |
int | format |
Output mesh format: 0 - serial format (default), 1 - parallel format. More... | |
bool | own_data |
Should the collection delete its mesh and fields. More... | |
int | error |
Error state. More... | |
Additional Inherited Members | |
Public Types inherited from mfem::DataCollection | |
enum | { NO_ERROR = 0, READ_ERROR = 1, WRITE_ERROR = 2 } |
Errors returned by Error() More... | |
typedef std::map< std::string, GridFunction * > | FieldMapType |
typedef std::map< std::string, QuadratureFunction * > | QFieldMapType |
Static Protected Member Functions inherited from mfem::DataCollection | |
static int | create_directory (const std::string &dir_name, const Mesh *mesh, int myid) |
Static Protected Attributes inherited from mfem::DataCollection | |
static const int | precision_default = 6 |
Default value for precision. More... | |
static const int | pad_digits_default = 6 |
Default value for pad_digits_*. More... | |
Data collection with VisIt I/O routines.
Definition at line 247 of file datacollection.hpp.
|
protected |
Definition at line 255 of file datacollection.hpp.
mfem::VisItDataCollection::VisItDataCollection | ( | const std::string & | collection_name, |
Mesh * | mesh_ = NULL |
||
) |
Constructor. The collection name is used when saving the data.
If mesh_ is NULL, then the mesh can be set later by calling either SetMesh() or Load(). The latter works only in serial.
Definition at line 358 of file datacollection.cpp.
|
inlinevirtual |
We will delete the mesh and fields if we own them.
Definition at line 296 of file datacollection.hpp.
void mfem::VisItDataCollection::DeleteAll | ( | ) |
Delete all data owned by VisItDataCollection including field data information.
Definition at line 398 of file datacollection.cpp.
|
protected |
Prepare the VisIt root file in JSON format for the current collection.
Definition at line 511 of file datacollection.cpp.
|
virtual |
Load the collection based on its VisIt data (described in its root file)
Reimplemented from mfem::DataCollection.
Definition at line 426 of file datacollection.cpp.
|
protected |
Definition at line 487 of file datacollection.cpp.
|
protected |
Definition at line 468 of file datacollection.cpp.
|
protected |
Definition at line 452 of file datacollection.cpp.
|
protected |
Read in a VisIt root file in JSON format.
Definition at line 555 of file datacollection.cpp.
|
virtual |
Add a grid function to the collection and update the root file.
Reimplemented from mfem::DataCollection.
Definition at line 386 of file datacollection.cpp.
|
virtual |
Save the collection and a VisIt root file.
Reimplemented from mfem::DataCollection.
Definition at line 404 of file datacollection.cpp.
void mfem::VisItDataCollection::SaveRootFile | ( | ) |
Save a VisIt root file for the collection.
Definition at line 410 of file datacollection.cpp.
void mfem::VisItDataCollection::SetMaxLevelsOfDetail | ( | int | max_levels_of_detail | ) |
Set VisIt parameter: maximum levels of detail for the MultiresControl.
Definition at line 393 of file datacollection.cpp.
|
virtual |
Set/change the mesh associated with the collection.
Reimplemented from mfem::DataCollection.
Definition at line 378 of file datacollection.cpp.
|
protected |
Definition at line 254 of file datacollection.hpp.
|
protected |
Definition at line 252 of file datacollection.hpp.
|
protected |
Definition at line 252 of file datacollection.hpp.
|
protected |
Definition at line 253 of file datacollection.hpp.