#include <Hdf5ToMeshalyzerConverter.hpp>
Inherits AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >.
Public Member Functions | |
Hdf5ToMeshalyzerConverter (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 meshalyzer format, ie, for voltage, one file, which looks like
V_node_0_time_0 .. V_node_N_time_0 V_node_0_time_1 .. V_node_N_time_1 V_node_0_time_2 .. V_node_N_time_M
The files that are written are [base_name]_V.dat or [base_name]_Phi_e.dat, where [base_name] is the base name of the original .h5 file. The new files are written in the same directory as the .h5 file. All paths are relative to the CHASTE_TEST_OUTPUT directory.
Definition at line 54 of file Hdf5ToMeshalyzerConverter.hpp.
Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToMeshalyzerConverter | ( | 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 86 of file Hdf5ToMeshalyzerConverter.cpp.
References PetscTools::Barrier(), HeartConfig::GetOutputDirectory(), HeartConfig::Instance(), AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mNumVariables, AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpMesh, Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Write(), and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
void Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Write | ( | std::string | type | ) | [inline, private] |
A helper method which takes in a string, which must be 'V' or 'Phi_e' and reads the data corresponding to that string, writing it out in meshalyzer format.
type | - the type of data stored in this file (V/Phi_e) |
Definition at line 44 of file Hdf5ToMeshalyzerConverter.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 Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToMeshalyzerConverter().