Chaste  Release::2018.1
Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <Hdf5ToMeshalyzerConverter.hpp>

+ Inheritance diagram for Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >:

Public Member Functions

 Hdf5ToMeshalyzerConverter (const FileFinder &rInputDirectory, const std::string &rFileBaseName, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, bool usingOriginalNodeOrdering, unsigned precision=0)
 
- Public Member Functions inherited from AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >
 AbstractHdf5Converter (const FileFinder &rInputDirectory, const std::string &rFileBaseName, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, const std::string &rSubdirectoryName, unsigned precision)
 
void WriteInfoFile ()
 
 ~AbstractHdf5Converter ()
 
std::string GetSubdirectory ()
 

Private Member Functions

void Write (std::string type)
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >
bool MoveOntoNextDataset ()
 
- Protected Attributes inherited from AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >
const FileFindermrH5Folder
 
boost::shared_ptr< Hdf5DataReadermpReader
 
unsigned mNumVariables
 
std::string mFileBaseName
 
std::vector< std::string > mDatasetNames
 
unsigned mOpenDatasetIndex
 
AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > * 
mpMesh
 
OutputFileHandlermpOutputFileHandler
 
std::string mRelativeSubdirectory
 
unsigned mPrecision
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >

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 61 of file Hdf5ToMeshalyzerConverter.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToMeshalyzerConverter ( const FileFinder rInputDirectory,
const std::string &  rFileBaseName,
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *  pMesh,
bool  usingOriginalNodeOrdering,
unsigned  precision = 0 
)

Constructor, which does the conversion.

Note
This method is collective, and hence must be called by all processes.
Parameters
rInputDirectoryThe input directory, relative to CHASTE_TEST_OUTPUT, where the .h5 file has been written
rFileBaseNameThe base name of the data file.
pMeshPointer to the mesh.
usingOriginalNodeOrderingWhether HDF5 output was written using the original node ordering
precisionThe precision (number of digits) to use in writing numerical data to file.
Todo:
What if the mesh has been scaled, translated or rotated?

Definition at line 102 of file Hdf5ToMeshalyzerConverter.cpp.

References PetscTools::Barrier(), RelativeTo::ChasteTestOutput, FileFinder::GetRelativePath(), FileFinder::IsFile(), AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::MoveOntoNextDataset(), AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpMesh, AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpReader, AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mRelativeSubdirectory, Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Write(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), and AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMeshReader().

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Write ( std::string  type)
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.

Parameters
typethe type of data stored in this file (V/Phi_e)

Definition at line 48 of file Hdf5ToMeshalyzerConverter.cpp.

References PetscTools::AmMaster(), DistributedVectorFactory::CreateVec(), PetscTools::Destroy(), ChasteBuildInfo::GetProvenanceString(), ReplicatableVector::GetSize(), and ReplicatableVector::ReplicatePetscVector().

Referenced by Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToMeshalyzerConverter().


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