#include <Hdf5ToCmguiConverter.hpp>
Inherits AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >.
Public Member Functions | |
Hdf5ToCmguiConverter (std::string inputDirectory, std::string fileBaseName, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh) | |
Private Member Functions | |
void | Write (std::string type) |
This class converts from Hdf5 format to Cmgui format. The output will be one .exnode file per time step. The format that cmgui accepts is (after the headers):
Node: 1 Value_at_node_1 Node:2 Value_at_node_2 .....
For bidomain simulations, we will have two fields, one for Vm and one for Phie. The Cmgui format for two fields is as follows:
Node: 1 Vm_node_1 Phie_at_node_1 Node:2 Vm_at_node_2 Phie_at_node_2 .....
Definition at line 57 of file Hdf5ToCmguiConverter.hpp.
Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter | ( | std::string | inputDirectory, | |
std::string | fileBaseName, | |||
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * | pMesh | |||
) | [inline] |
Constructor, which does the conversion.
inputDirectory | The input directory, relative to CHASTE_TEST_OUTPUT, where the .h5 file has been written | |
fileBaseName | The base name of the data file. | |
pMesh | Pointer to the mesh. |
Definition at line 126 of file Hdf5ToCmguiConverter.cpp.
References PetscTools::Barrier(), HeartConfig::GetOutputDirectory(), HeartConfig::Instance(), AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mNumVariables, AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpMesh, CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetAdditionalFieldNames(), Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Write(), and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
void Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Write | ( | std::string | type | ) | [inline, private] |
A helper method which takes in a string, which must be 'Mono' or 'Bi' and reads the data from the hdf5 file, writing it out in Cmgui format.
type | - the type of simulation (Mono or Bi) |
Definition at line 45 of file Hdf5ToCmguiConverter.cpp.
References PetscTools::AmMaster(), DistributedVectorFactory::CreateVec(), Hdf5DataReader::GetNumberOfRows(), ChasteBuildInfo::GetProvenanceString(), ReplicatableVector::GetSize(), Hdf5DataReader::GetUnlimitedDimensionValues(), Hdf5DataReader::GetVariableOverNodes(), AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mFileBaseName, AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpReader, and OutputFileHandler::OpenOutputFile().
Referenced by Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter().