LifeV
|
Class derived from ExporterHDF5 to provide I/O for the mesh partitions (RegionMesh only) More...
#include <ExporterHDF5Mesh3D.hpp>
Private Attributes | |
serialMeshPtr_Type | M_serialMesh |
meshPtr_Type | M_parallelMesh |
graphPtr_Type | M_graph |
std::vector< interfaceVectorPtr_Type > | M_DOFInterfaces |
std::vector< std::string > | M_interfaceTypes |
std::vector< Int > | M_firstInterfaceFlags |
std::vector< Int > | M_secondInterfaceFlags |
std::shared_ptr< Epetra_Comm > | M_comm |
Constructor & Destructor | |
ExporterHDF5Mesh3D () | |
Empty Constructor for ExporterHDF5Mesh3D. More... | |
ExporterHDF5Mesh3D (const GetPot &dataFile, meshPtr_Type mesh, const std::string &prefix, const Int &procId) | |
Constructor for ExporterHDF5Mesh3D. More... | |
ExporterHDF5Mesh3D (const GetPot &dataFile, const std::string &prefix) | |
Constructor for ExporterHDF5Mesh3D without prefix and procID. More... | |
virtual | ~ExporterHDF5Mesh3D () |
Destructor for ExporterHDF5Mesh3D. More... | |
Pubic Methods | |
virtual void | postProcess (const Real &time) |
Post-process the variables added to the list. More... | |
void | addPartitionGraph (const graphPtr_Type &graph, std::shared_ptr< Epetra_Comm > &comm) |
Add the partition graph to the post processing data file. More... | |
void | addMeshPartitionAll (const serialMeshPtr_Type &meshPointer, std::shared_ptr< Epetra_Comm > &comm) |
Add all of the mesh partitions to the post processing data file (serial operation) More... | |
void | addMyMeshPartition (const meshPtr_Type &, std::shared_ptr< Epetra_Comm > &) |
Add to HDF5 file the mesh partition that belongs to the current process (parallel operation) More... | |
void | addDOFInterface (const interfaceVectorPtr_Type &interfaces, const std::string &type, const Int &firstInterfaceFlag, const Int &secondInterfaceFlag, const std::shared_ptr< Epetra_Comm > &comm) |
Add a DOF interface for writing to file. More... | |
Int | queryStoredInterfaceNumber () |
Get the number of stored DOF interfaces. More... | |
std::vector< std::string > | queryStoredInterfaceTypes () |
Get the types of the stored DOF interfaces. More... | |
graphPtr_Type | getGraph () |
Return a pointer to the graph. More... | |
meshPtr_Type | getMeshPartition () |
Return a pointer to the mesh partition that corresponds to the current MPI rank. More... | |
std::shared_ptr< std::map< UInt, UInt > > | getStoredInterface (Int k) |
Return a pointer to the k-th interface stored inside the file. More... | |
void | setComm (const std::shared_ptr< Epetra_Comm > &comm) |
Set the M_comm data member. More... | |
Private methods | |
void | writeGraph () |
void | writePartition (meshPtr_Type partition, std::string &suffix) |
void | writeParallelMesh () |
void | writeSerialMesh () |
void | writeInterfaces () |
Additional Inherited Members | |
Public Member Functions inherited from ExporterHDF5< MeshType > | |
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... | |
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... | |
void | setDataFromGetPot (const GetPot &dataFile, const std::string §ion="exporter") |
Set data from file. More... | |
MapEpetraType | mapType () const |
returns the type of the map to use for the VectorEpetra More... | |
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... | |
Static Public Attributes inherited from ExporterHDF5< MeshType > | |
static MapEpetraType const | MapType |
returns the type of the map to use for the VectorEpetra More... | |
Protected Member Functions inherited from ExporterHDF5< MeshType > | |
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 Member Functions inherited from Exporter< MeshType > | |
void | computePostfix () |
compute postfix More... | |
Protected Attributes inherited from ExporterHDF5< MeshType > | |
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... | |
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... | |
Class derived from ExporterHDF5 to provide I/O for the mesh partitions (RegionMesh only)
Usage: two steps
Guidelines when operating with partition information:
Definition at line 76 of file ExporterHDF5Mesh3D.hpp.
Definition at line 79 of file ExporterHDF5Mesh3D.hpp.
typedef ExporterHDF5<MeshType> base |
Definition at line 80 of file ExporterHDF5Mesh3D.hpp.
typedef base::meshPtr_Type meshPtr_Type |
Definition at line 81 of file ExporterHDF5Mesh3D.hpp.
typedef base::vector_Type vector_Type |
Definition at line 82 of file ExporterHDF5Mesh3D.hpp.
typedef base::vectorPtr_Type vectorPtr_Type |
Definition at line 83 of file ExporterHDF5Mesh3D.hpp.
Definition at line 84 of file ExporterHDF5Mesh3D.hpp.
typedef EpetraExt::HDF5 hdf5_Type |
Definition at line 86 of file ExporterHDF5Mesh3D.hpp.
typedef std::shared_ptr<hdf5_Type> hdf5Ptr_Type |
Definition at line 87 of file ExporterHDF5Mesh3D.hpp.
typedef std::vector<std::vector<Int> > graph_Type |
Definition at line 88 of file ExporterHDF5Mesh3D.hpp.
typedef std::shared_ptr<graph_Type> graphPtr_Type |
Definition at line 89 of file ExporterHDF5Mesh3D.hpp.
typedef std::shared_ptr<std::vector<meshPtr_Type> > serialMeshPtr_Type |
Definition at line 90 of file ExporterHDF5Mesh3D.hpp.
typedef DOFInterface3Dto3D interface_Type |
Definition at line 92 of file ExporterHDF5Mesh3D.hpp.
typedef std::shared_ptr<interface_Type> interfacePtr_Type |
Definition at line 93 of file ExporterHDF5Mesh3D.hpp.
typedef std::vector<interfacePtr_Type> interfaceVector_Type |
Definition at line 94 of file ExporterHDF5Mesh3D.hpp.
typedef std::shared_ptr<interfaceVector_Type> interfaceVectorPtr_Type |
Definition at line 97 of file ExporterHDF5Mesh3D.hpp.
|
inline |
Empty Constructor for ExporterHDF5Mesh3D.
Definition at line 104 of file ExporterHDF5Mesh3D.hpp.
ExporterHDF5Mesh3D | ( | const GetPot & | dataFile, |
meshPtr_Type | mesh, | ||
const std::string & | prefix, | ||
const Int & | procId | ||
) |
Constructor for ExporterHDF5Mesh3D.
dataFile | 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 244 of file ExporterHDF5Mesh3D.hpp.
ExporterHDF5Mesh3D | ( | const GetPot & | dataFile, |
const std::string & | prefix | ||
) |
Constructor for ExporterHDF5Mesh3D without prefix and procID.
dataFile | 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 252 of file ExporterHDF5Mesh3D.hpp.
|
inlinevirtual |
Destructor for ExporterHDF5Mesh3D.
Definition at line 129 of file ExporterHDF5Mesh3D.hpp.
|
virtual |
Post-process the variables added to the list.
time | the solver time |
Reimplemented from ExporterHDF5< MeshType >.
Definition at line 277 of file ExporterHDF5Mesh3D.hpp.
|
inline |
Add the partition graph to the post processing data file.
Add the partition graph to the post processing data file.
graph | - shared_ptr<vector<vector<Int> > > - shared pointer to the partition graph data structure (as returned by partitionMesh::graph() ) |
comm | - Epetra_Comm* - raw pointer to the Epetra communicator to be used |
Definition at line 144 of file ExporterHDF5Mesh3D.hpp.
|
inline |
Add all of the mesh partitions to the post processing data file (serial operation)
Add all of the mesh partitions to the post processing data file.
meshPointer | - shared_ptr<vector<shared_ptr<MeshType> > > - shared pointer to the vector storing pointers to the mesh partitions (as returned by partitionMesh::meshAllPartitions() ) |
comm | - Epetra_Comm* - raw pointer to the Epetra communicator to be used |
Definition at line 157 of file ExporterHDF5Mesh3D.hpp.
|
inline |
Add to HDF5 file the mesh partition that belongs to the current process (parallel operation)
After the mesh partition is loaded from the HDF5 file, the simulation is run and ExporterHDF5Mesh3D::postProcess() is called, the original contents of the HDF5 will be lost. To keep mesh partition, call: ExporterHDF5Mesh3D::addMyMeshPartition() before calling ExporterHDF5Mesh3D::postProcess();
meshPointer | - shared_ptr<Mesh> - shared pointer to a mesh partition (as returned by partitionMesh::mesh() ) |
comm | - Epetra_Comm* - raw pointer to the Epetra communicator to be used |
Definition at line 174 of file ExporterHDF5Mesh3D.hpp.
void addDOFInterface | ( | const interfaceVectorPtr_Type & | interfaces, |
const std::string & | type, | ||
const Int & | firstInterfaceFlag, | ||
const Int & | secondInterfaceFlag, | ||
const std::shared_ptr< Epetra_Comm > & | comm | ||
) |
Add a DOF interface for writing to file.
Add a DOF interface to the member vector M_interfaceData, for writing to the HDF5 file. Call once for each interface that is to be written.
Definition at line 262 of file ExporterHDF5Mesh3D.hpp.
int queryStoredInterfaceNumber | ( | ) |
Get the number of stored DOF interfaces.
Definition at line 367 of file ExporterHDF5Mesh3D.hpp.
std::vector< std::string > queryStoredInterfaceTypes | ( | ) |
Get the types of the stored DOF interfaces.
Definition at line 385 of file ExporterHDF5Mesh3D.hpp.
ExporterHDF5Mesh3D< MeshType >::graphPtr_Type getGraph | ( | ) |
Return a pointer to the graph.
Definition at line 411 of file ExporterHDF5Mesh3D.hpp.
ExporterHDF5Mesh3D< MeshType >::meshPtr_Type getMeshPartition | ( | ) |
Return a pointer to the mesh partition that corresponds to the current MPI rank.
Definition at line 454 of file ExporterHDF5Mesh3D.hpp.
Return a pointer to the k-th interface stored inside the file.
Definition at line 710 of file ExporterHDF5Mesh3D.hpp.
|
inline |
Set the M_comm data member.
Definition at line 208 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 752 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 795 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 1035 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 1015 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 1047 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 227 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 228 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 229 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 231 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 232 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 233 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 234 of file ExporterHDF5Mesh3D.hpp.
|
private |
Definition at line 235 of file ExporterHDF5Mesh3D.hpp.