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

#include <AbstractHdf5Converter.hpp>

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

Public Member Functions

 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 ()
 

Protected Member Functions

bool MoveOntoNextDataset ()
 

Protected Attributes

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
 

Private Member Functions

void GenerateListOfDatasets (const FileFinder &rH5Folder, const std::string &rFileName)
 

Detailed Description

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

The derived children of this class convert output from Hdf5 format to a range of other formats for postprocessing.

Definition at line 50 of file AbstractHdf5Converter.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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 
)

Constructor, which does the conversion and writes the .info file.

Note
This method is collective, and must be called by all processes.
Parameters
rInputDirectoryThe input directory, where the .h5 file to post-process is.
rFileBaseNameThe base name of the data file.
pMeshPointer to the mesh.
rSubdirectoryNameName for the output directory to be created (relative to inputDirectory).
precisionThe number of digits to use in numerical output to file.

Definition at line 50 of file AbstractHdf5Converter.cpp.

References AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::GenerateListOfDatasets(), AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mFileBaseName, AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::MoveOntoNextDataset(), AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mRelativeSubdirectory, and AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mrH5Folder.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::~AbstractHdf5Converter ( )

Destructor.

Definition at line 109 of file AbstractHdf5Converter.cpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::GenerateListOfDatasets ( const FileFinder rH5Folder,
const std::string &  rFileName 
)
private

Have a look in the HDF5 file and generate a list of the datasets that it contains.

Parameters
rH5FolderThe directory the h5 file is in.
rFileNameThe name of the h5 file.

Definition at line 157 of file AbstractHdf5Converter.cpp.

References FileFinder::GetAbsolutePath().

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::GetSubdirectory ( )
Returns
the relative path of the sub-directory in which the converted output is stored.

Definition at line 115 of file AbstractHdf5Converter.cpp.

Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::MoveOntoNextDataset ( )
protected

Close the existing dataset and open a new one.

This method deletes the existing mpDataReader, and opens a new one for the new dataset.

Returns
whether a new dataset is open, false if we have run out of them.

Definition at line 121 of file AbstractHdf5Converter.cpp.

References EXCEPTION, and UNSIGNED_UNSET.

Referenced by AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::AbstractHdf5Converter(), Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter(), Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToMeshalyzerConverter(), and Hdf5ToVtkConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToVtkConverter().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::WriteInfoFile ( )

Wrtie the unlimited dimension information to file.

Definition at line 72 of file AbstractHdf5Converter.cpp.

References PetscTools::AmMaster(), DOUBLE_UNSET, and ChasteBuildInfo::GetProvenanceString().

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<std::string> AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mDatasetNames
protected

The datasets that we are working with.

'Data' is a special case and handled slightly differently as all variables use the same 'time'.

Definition at line 81 of file AbstractHdf5Converter.hpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mFileBaseName
protected

Base name for the files: [basename].vtu, [basename].dat etc.

Definition at line 73 of file AbstractHdf5Converter.hpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mNumVariables
protected

Number of variables to output. Read from the reader.

Definition at line 70 of file AbstractHdf5Converter.hpp.

Referenced by Hdf5ToTxtConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToTxtConverter(), and Hdf5ToVtkConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToVtkConverter().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mOpenDatasetIndex
protected

The index of the dataset that is currently open.

Definition at line 86 of file AbstractHdf5Converter.hpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpMesh
protected
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
OutputFileHandler* AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler
protected

Initialised as the directory in which to store the results.

Definition at line 92 of file AbstractHdf5Converter.hpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mPrecision
protected

The precision with which to write files: that is, the number of digits to use in numerical output.

Definition at line 104 of file AbstractHdf5Converter.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mRelativeSubdirectory
protected
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
const FileFinder& AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::mrH5Folder
protected

Folder that the h5 file to convert resides in

Definition at line 64 of file AbstractHdf5Converter.hpp.

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


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