LifeV
|
Hdf5 data exporter, implementation of Exporter. More...
#include <ExporterHDF5.hpp>
Public typedefs | |
typedef MeshType | mesh_Type |
typedef Exporter< MeshType > | super |
typedef super::meshPtr_Type | meshPtr_Type |
typedef super::vector_Type | vector_Type |
typedef super::vectorPtr_Type | vectorPtr_Type |
typedef super::exporterData_Type | exporterData_Type |
typedef EpetraExt::HDF5 | hdf5_Type |
typedef std::shared_ptr< hdf5_Type > | hdf5Ptr_Type |
typedef std::vector< std::vector< Int > > | graph_Type |
typedef std::shared_ptr< graph_Type > | graphPtr_Type |
typedef std::shared_ptr< std::vector< meshPtr_Type > > | serial_meshPtr_Type |
Static members | |
static MapEpetraType const | MapType |
returns the type of the map to use for the VectorEpetra More... | |
Constructor & Destructor | |
ExporterHDF5 () | |
Empty Constructor for ExporterHDF5. More... | |
ExporterHDF5 (const GetPot &dfile, meshPtr_Type mesh, const std::string &prefix, const Int &procId) | |
Constructor for ExporterHDF5. More... | |
ExporterHDF5 (const GetPot &dfile, const std::string &prefix) | |
Constructor for ExporterHDF5 without prefix and procID. More... | |
virtual | ~ExporterHDF5 () |
Destructor for ExporterHDF5. More... | |
Public Methods | |
virtual void | postProcess (const Real &time) |
Post-process the variables added to the list. More... | |
UInt | importFromTime (const Real &Time) |
Import data from previous simulations at a certain time. More... | |
Real | importFromIter (const UInt &) |
Import data from previous simulations at a certain time. More... | |
void | import (const Real &startTime, const Real &dt) |
Import data from previous simulations. More... | |
void | import (const Real &time) |
Import data from previous simulations. More... | |
void | closeFile () |
Close the Hdf5 file. More... | |
void | readVariable (exporterData_Type &dvar) |
Read variable. More... | |
Set Methods | |
void | setDataFromGetPot (const GetPot &dataFile, const std::string §ion="exporter") |
Set data from file. More... | |
Get Methods | |
MapEpetraType | mapType () const |
returns the type of the map to use for the VectorEpetra More... | |
Protected Methods | |
void | defineShape () |
Define the shape of the elements. More... | |
void | writeInitXdmf () |
write empty xdmf file More... | |
void | writeXdmf (const Real &time) |
append to xdmf file More... | |
void | writeCloseLinesXdmf () |
save position and write closing lines More... | |
void | removeCloseLinesXdmf () |
remove closing lines More... | |
void | writeTopology (std::ofstream &xdmf) |
void | writeGeometry (std::ofstream &xdmf) |
void | writeAttributes (std::ofstream &xdmf) |
void | writeScalarDatastructure (std::ofstream &xdmf, const exporterData_Type &dvar) |
void | writeVectorDatastructure (std::ofstream &xdmf, const exporterData_Type &dvar) |
void | writeVariable (const exporterData_Type &dvar) |
void | writeScalar (const exporterData_Type &dvar) |
void | writeVector (const exporterData_Type &dvar) |
void | writeGeometry () |
void | readScalar (exporterData_Type &dvar) |
A method to read a scalar field (to be implemented in derived classes) More... | |
void | readVector (exporterData_Type &dvar) |
A method to read a vector field (to be implemented in derived classes) More... | |
Protected data members | |
hdf5Ptr_Type | M_HDF5 |
std::ofstream | M_xdmf |
const std::string | M_closingLines |
std::streampos | M_closingLinesPosition |
std::string | M_outputFileName |
bool | M_printConnectivity |
do we want to write on file the connectivity? More... | |
Additional Inherited Members | |
Public Types inherited from Exporter< MeshType > | |
typedef MeshType | mesh_Type |
typedef std::shared_ptr< MeshType > | meshPtr_Type |
typedef Epetra_Comm | comm_Type |
typedef std::shared_ptr< comm_Type > | commPtr_Type |
typedef ExporterData< mesh_Type > | exporterData_Type |
typedef exporterData_Type::vector_Type | vector_Type |
typedef exporterData_Type::vectorPtr_Type | vectorPtr_Type |
typedef exporterData_Type::feSpace_Type | feSpace_Type |
typedef exporterData_Type::feSpacePtr_Type | feSpacePtr_Type |
typedef exporterData_Type::WhereEnum | WhereEnum |
typedef exporterData_Type::FieldTypeEnum | FieldTypeEnum |
typedef exporterData_Type::FieldRegimeEnum | FieldRegimeEnum |
typedef std::vector< exporterData_Type > | dataVector_Type |
typedef dataVector_Type::iterator | dataVectorIterator_Type |
typedef std::multimap< WhereEnum, UInt > | whereToDataIdMap_Type |
typedef std::multimap< FE_TYPE, UInt > | feTypeToDataIdMap_Type |
Public Member Functions inherited from Exporter< MeshType > | |
Exporter () | |
Empty constructor for Exporter. More... | |
Exporter (const GetPot &dfile, const std::string &prefix) | |
Constructor for Exporter without prefix and procID. More... | |
virtual | ~Exporter () |
Destructor. More... | |
void | addVariable (const FieldTypeEnum &type, const std::string &variableName, const feSpacePtr_Type &feSpacePtr, const vectorPtr_Type &vectorPtr, const UInt &start, const FieldRegimeEnum ®ime=exporterData_Type::UnsteadyRegime, const WhereEnum &where=exporterData_Type::Node) |
Adds a new variable to be post-processed. More... | |
virtual void | exportPID (meshPtr_Type &mesh, commPtr_Type &comm, const bool binaryFormat=false) |
Export the Processor ID as P0 variable. More... | |
void | exportRegionMarkerID (std::shared_ptr< MeshType > mesh, std::shared_ptr< Epetra_Comm > comm) |
Export the region marker ID as P0 variable. More... | |
virtual void | exportFlags (std::shared_ptr< MeshType > mesh, std::shared_ptr< Epetra_Comm > comm, flag_Type const &flag=EntityFlags::ALL) |
Export entity flags. More... | |
void | setPrefix (const std::string &prefix) |
Set prefix. More... | |
void | setPostDir (const std::string &Directory) |
Set the folder for pre/postprocessing. More... | |
void | setTimeIndex (const UInt &timeIndex) |
Set the current time index. More... | |
void | setTimeIndexStart (const UInt &timeIndexStart) |
Set the time index of the first file. More... | |
void | setSave (const UInt &save) |
Set how many time step between two snapshots. More... | |
void | setMultimesh (const bool &multimesh) |
Set if to save the mesh at each time step. More... | |
virtual void | setMeshProcId (const meshPtr_Type mesh, const int &procId) |
const UInt & | save () const |
returns how many time steps between two snapshots More... | |
const UInt & | timeIndexStart () const |
returns the time index of the first snapshot More... | |
const UInt & | timeIndex () const |
returns the time index of the current snapshot More... | |
Protected Member Functions inherited from Exporter< MeshType > | |
void | computePostfix () |
compute postfix More... | |
Protected Attributes inherited from Exporter< MeshType > | |
std::string | M_prefix |
the file prefix More... | |
std::string | M_postDir |
the name of the folder where to read or write files More... | |
UInt | M_timeIndexStart |
the time index of the first snapshot More... | |
UInt | M_timeIndex |
the time index of the current snapshot More... | |
UInt | M_save |
how many time steps between subsequent snapshots More... | |
bool | M_multimesh |
do we want to save the mesh with each snapshot? More... | |
UInt | M_timeIndexWidth |
how many digits (in the file suffix) for the time index More... | |
meshPtr_Type | M_mesh |
a pointer to the mesh More... | |
Int | M_procId |
the ID of the process More... | |
std::string | M_postfix |
the file suffix More... | |
UInt | M_numImportProc |
how many processes produced the data that we want to import More... | |
whereToDataIdMap_Type | M_whereToDataIdMap |
a map to retrieve all data located in the same geo entities (node or element) More... | |
feTypeToDataIdMap_Type | M_feTypeToDataIdMap |
a map to retrieve all data defined in the same FE space More... | |
dataVector_Type | M_dataVector |
the vector of ExporterData objects More... | |
std::list< Real > | M_timeSteps |
the list of time steps (for use in import procedures) More... | |
Hdf5 data exporter, implementation of Exporter.
Usage: two steps
Definition at line 83 of file ExporterHDF5.hpp.
Definition at line 89 of file ExporterHDF5.hpp.
Definition at line 90 of file ExporterHDF5.hpp.
typedef super::meshPtr_Type meshPtr_Type |
Definition at line 91 of file ExporterHDF5.hpp.
typedef super::vector_Type vector_Type |
Definition at line 92 of file ExporterHDF5.hpp.
typedef super::vectorPtr_Type vectorPtr_Type |
Definition at line 93 of file ExporterHDF5.hpp.
Definition at line 94 of file ExporterHDF5.hpp.
typedef EpetraExt::HDF5 hdf5_Type |
Definition at line 96 of file ExporterHDF5.hpp.
typedef std::shared_ptr<hdf5_Type> hdf5Ptr_Type |
Definition at line 97 of file ExporterHDF5.hpp.
typedef std::vector<std::vector<Int> > graph_Type |
Definition at line 98 of file ExporterHDF5.hpp.
typedef std::shared_ptr<graph_Type> graphPtr_Type |
Definition at line 99 of file ExporterHDF5.hpp.
typedef std::shared_ptr<std::vector<meshPtr_Type> > serial_meshPtr_Type |
Definition at line 100 of file ExporterHDF5.hpp.
ExporterHDF5 | ( | ) |
Empty Constructor for ExporterHDF5.
Definition at line 261 of file ExporterHDF5.hpp.
ExporterHDF5 | ( | const GetPot & | dfile, |
meshPtr_Type | mesh, | ||
const std::string & | prefix, | ||
const Int & | procId | ||
) |
Constructor for ExporterHDF5.
dfile | the GetPot data file where you must provide an [exporter] section with: "start" (start index for sections in the hdf5 data structure 0 for 000, 1 for 001 etc.), "save" (how many time steps per postprocessing) "multimesh" ( = true if the mesh has to be saved at each post-processing step) |
mesh | the mesh |
the | prefix for the case file (ex. "test" for test.case) |
the | procId determines de CPU id. if negative, it ussemes there is only one processor |
Definition at line 271 of file ExporterHDF5.hpp.
ExporterHDF5 | ( | const GetPot & | dfile, |
const std::string & | prefix | ||
) |
Constructor for ExporterHDF5 without prefix and procID.
dfile | the GetPot data file where you must provide an [exporter] section with: "start" (start index for sections in the hdf5 data structure 0 for 000, 1 for 001 etc.), "save" (how many time steps per postprocessing) "multimesh" ( = true if the mesh has to be saved at each post-processing step) |
mesh | the mesh |
Definition at line 283 of file ExporterHDF5.hpp.
|
inlinevirtual |
Destructor for ExporterHDF5.
Definition at line 139 of file ExporterHDF5.hpp.
|
virtual |
Post-process the variables added to the list.
time | the solver time |
Implements Exporter< MeshType >.
Reimplemented in ExporterHDF5Mesh3D< MeshType >.
Definition at line 297 of file ExporterHDF5.hpp.
Import data from previous simulations at a certain time.
Time | the time of the data to be imported |
Implements Exporter< MeshType >.
Definition at line 355 of file ExporterHDF5.hpp.
Import data from previous simulations at a certain time.
Time | the time of the data to be imported |
Definition at line 424 of file ExporterHDF5.hpp.
Import data from previous simulations.
time | the solver time |
Implements Exporter< MeshType >.
Definition at line 512 of file ExporterHDF5.hpp.
|
virtual |
Import data from previous simulations.
time | the solver time |
! Simone
!!! Simone
Implements Exporter< MeshType >.
Definition at line 529 of file ExporterHDF5.hpp.
|
inlinevirtual |
Close the Hdf5 file.
Close the HDF5 file.
Reimplemented from Exporter< MeshType >.
Definition at line 177 of file ExporterHDF5.hpp.
|
virtual |
Read variable.
! Simone
Reimplemented from Exporter< MeshType >.
Definition at line 562 of file ExporterHDF5.hpp.
|
virtual |
Set data from file.
dataFile | data file. |
section | section in the data file. |
Reimplemented from Exporter< MeshType >.
Definition at line 576 of file ExporterHDF5.hpp.
|
virtual |
returns the type of the map to use for the VectorEpetra
Implements Exporter< MeshType >.
Definition at line 586 of file ExporterHDF5.hpp.
|
protected |
Define the shape of the elements.
Definition at line 595 of file ExporterHDF5.hpp.
|
protected |
write empty xdmf file
Definition at line 601 of file ExporterHDF5.hpp.
|
protected |
append to xdmf file
Definition at line 632 of file ExporterHDF5.hpp.
|
protected |
save position and write closing lines
Definition at line 704 of file ExporterHDF5.hpp.
|
protected |
remove closing lines
Definition at line 717 of file ExporterHDF5.hpp.
|
protected |
Definition at line 723 of file ExporterHDF5.hpp.
|
protected |
Definition at line 770 of file ExporterHDF5.hpp.
|
protected |
Definition at line 811 of file ExporterHDF5.hpp.
|
protected |
Definition at line 840 of file ExporterHDF5.hpp.
|
protected |
Definition at line 882 of file ExporterHDF5.hpp.
|
protected |
Definition at line 918 of file ExporterHDF5.hpp.
|
protected |
Definition at line 933 of file ExporterHDF5.hpp.
|
protected |
Definition at line 967 of file ExporterHDF5.hpp.
|
protected |
Definition at line 1030 of file ExporterHDF5.hpp.
|
protectedvirtual |
A method to read a scalar field (to be implemented in derived classes)
dvar | the ExporterData object |
Implements Exporter< MeshType >.
Definition at line 1216 of file ExporterHDF5.hpp.
|
protectedvirtual |
A method to read a vector field (to be implemented in derived classes)
dvar | the ExporterData object |
Implements Exporter< MeshType >.
Definition at line 1240 of file ExporterHDF5.hpp.
|
static |
returns the type of the map to use for the VectorEpetra
Definition at line 105 of file ExporterHDF5.hpp.
|
protected |
Definition at line 240 of file ExporterHDF5.hpp.
|
protected |
Definition at line 241 of file ExporterHDF5.hpp.
|
protected |
Definition at line 243 of file ExporterHDF5.hpp.
|
protected |
Definition at line 244 of file ExporterHDF5.hpp.
|
protected |
Definition at line 245 of file ExporterHDF5.hpp.
|
protected |
do we want to write on file the connectivity?
Definition at line 248 of file ExporterHDF5.hpp.