MFEM  v3.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mfem::VisItDataCollection Class Reference

Data collection with VisIt I/O routines. More...

#include <datacollection.hpp>

Inheritance diagram for mfem::VisItDataCollection:
[legend]
Collaboration diagram for mfem::VisItDataCollection:
[legend]

Public Member Functions

 VisItDataCollection (const char *collection_name)
 
 VisItDataCollection (const char *collection_name, Mesh *_mesh)
 Initialize the collection with its mesh, fill-in the extra VisIt data. More...
 
virtual void SetMesh (Mesh *new_mesh)
 Set/change the mesh associated with the collection. More...
 
virtual void RegisterField (const char *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...
 
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 char *collection_name, Mesh *_mesh)
 Initialize the collection with its name and Mesh. More...
 
GridFunctionGetField (const char *field_name)
 
bool HasField (const char *name)
 Check if a grid function is part of the collection. More...
 
MeshGetMesh ()
 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...
 
int GetCycle ()
 Get time cycle (for time-dependent simulations) More...
 
double GetTime ()
 Get physical time (for time-dependent simulations) More...
 
const char * GetCollectionName ()
 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 the cycle and MPI rank in filenames. More...
 
virtual void SaveMesh ()
 Save the mesh, creating the collection directory. More...
 
virtual void SaveField (const char *field_name)
 Save one 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 Member Functions

std::string GetVisItRootString ()
 Prepare the VisIt root file in JSON format for the current collection. More...
 
void ParseVisItRootString (std::string json)
 Read in a VisIt root file in JSON format. More...
 
void LoadVisItRootFile (std::string root_name)
 
void LoadMesh ()
 
void LoadFields ()
 
- Protected Member Functions inherited from mfem::DataCollection
 DataCollection (const char *collection_name)
 Create an empty collection with the given name. More...
 
void DeleteData ()
 Delete data owned by the DataCollection keeping field information. More...
 
void DeleteAll ()
 Delete data owned by the DataCollection including field information. More...
 
void SaveOneField (const std::map< std::string, GridFunction * >::iterator &it)
 Save one 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::map< std::string,
GridFunction * > 
field_map
 The fields and their names (used when saving) More...
 
Meshmesh
 The (common) mesh for the collected fields. More...
 
int cycle
 
double time
 Physical time (for time-dependent simulations) More...
 
bool serial
 Serial or parallel run? If false, append rank (myid) to 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
 Number of digits used for the cycle and MPI rank in filenames. 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...
 
- 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...
 

Detailed Description

Data collection with VisIt I/O routines.

Definition at line 146 of file datacollection.hpp.

Constructor & Destructor Documentation

mfem::VisItDataCollection::VisItDataCollection ( const char *  collection_name)

Create an empty collection with the given name, that will be filled in later with the Load() function. Currently this only works in serial!

Definition at line 288 of file datacollection.cpp.

mfem::VisItDataCollection::VisItDataCollection ( const char *  collection_name,
Mesh _mesh 
)

Initialize the collection with its mesh, fill-in the extra VisIt data.

Definition at line 299 of file datacollection.cpp.

virtual mfem::VisItDataCollection::~VisItDataCollection ( )
inlinevirtual

We will delete the mesh and fields if we own them.

Definition at line 195 of file datacollection.hpp.

Member Function Documentation

void mfem::VisItDataCollection::DeleteAll ( )

Delete all data owned by VisItDataCollection including field data information.

Definition at line 331 of file datacollection.cpp.

string mfem::VisItDataCollection::GetVisItRootString ( )
protected

Prepare the VisIt root file in JSON format for the current collection.

Definition at line 441 of file datacollection.cpp.

void mfem::VisItDataCollection::Load ( int  _cycle = 0)

Load the collection based on its VisIt data (described in its root file)

Definition at line 359 of file datacollection.cpp.

void mfem::VisItDataCollection::LoadFields ( )
protected

Definition at line 418 of file datacollection.cpp.

void mfem::VisItDataCollection::LoadMesh ( )
protected

Definition at line 400 of file datacollection.cpp.

void mfem::VisItDataCollection::LoadVisItRootFile ( std::string  root_name)
protected

Definition at line 384 of file datacollection.cpp.

void mfem::VisItDataCollection::ParseVisItRootString ( std::string  json)
protected

Read in a VisIt root file in JSON format.

Definition at line 483 of file datacollection.cpp.

void mfem::VisItDataCollection::RegisterField ( const char *  field_name,
GridFunction gf 
)
virtual

Add a grid function to the collection and update the root file.

Reimplemented from mfem::DataCollection.

Definition at line 320 of file datacollection.cpp.

void mfem::VisItDataCollection::Save ( )
virtual

Save the collection and a VisIt root file.

Reimplemented from mfem::DataCollection.

Definition at line 337 of file datacollection.cpp.

void mfem::VisItDataCollection::SaveRootFile ( )

Save a VisIt root file for the collection.

Definition at line 343 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 326 of file datacollection.cpp.

void mfem::VisItDataCollection::SetMesh ( Mesh new_mesh)
virtual

Set/change the mesh associated with the collection.

Reimplemented from mfem::DataCollection.

Definition at line 311 of file datacollection.cpp.

Member Data Documentation

std::map<std::string, VisItFieldInfo> mfem::VisItDataCollection::field_info_map
protected

Definition at line 153 of file datacollection.hpp.

int mfem::VisItDataCollection::spatial_dim
protected

Definition at line 151 of file datacollection.hpp.

int mfem::VisItDataCollection::topo_dim
protected

Definition at line 151 of file datacollection.hpp.

int mfem::VisItDataCollection::visit_max_levels_of_detail
protected

Definition at line 152 of file datacollection.hpp.


The documentation for this class was generated from the following files: