Chaste Commit::675f9facbe008c5eacb9006feaeb6423206579ea
VoltageInterpolaterOntoMechanicsMesh< DIM > Class Template Reference

#include <VoltageInterpolaterOntoMechanicsMesh.hpp>

+ Collaboration diagram for VoltageInterpolaterOntoMechanicsMesh< DIM >:

Public Member Functions

 VoltageInterpolaterOntoMechanicsMesh (TetrahedralMesh< DIM, DIM > &rElectricsMesh, QuadraticMesh< DIM > &rMechanicsMesh)
 
 ~VoltageInterpolaterOntoMechanicsMesh ()
 
void InterpolateOnCoarseMesh (std::vector< double > &rValuesOnCoarseMesh, ReplicatableVector &rValuesOnFineMesh)
 
void OutputToCmgui (std::vector< std::string > &rVariableNames, std::string directory, std::string inputFileNamePrefix)
 

Private Attributes

TetrahedralMesh< DIM, DIM > & mrElectricsMesh
 
QuadraticMesh< DIM > & mrMechanicsMesh
 
FineCoarseMeshPair< DIM > * mpMeshPair
 

Detailed Description

template<unsigned DIM>
class VoltageInterpolaterOntoMechanicsMesh< DIM >

A class which can be used to convert the voltage from an electrics (or electromechanics) simulation onto a coarser mechanics mesh, by interpolation. The class provides a method to interpolate values from the fine mesh onto the coarse mesh and the main method to output a HDF5 file corresponding to nodes on the mechanics mesh, and convert it to CMGUI output.

Definition at line 55 of file VoltageInterpolaterOntoMechanicsMesh.hpp.

Constructor & Destructor Documentation

◆ VoltageInterpolaterOntoMechanicsMesh()

template<unsigned DIM>
VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh ( TetrahedralMesh< DIM, DIM > &  rElectricsMesh,
QuadraticMesh< DIM > &  rMechanicsMesh 
)

Constructor. Sets up the Mesh Pair object used for the interpolation later.

Parameters
rElectricsMeshThe electrics mesh
rMechanicsMeshThe mechanics mesh

Definition at line 45 of file VoltageInterpolaterOntoMechanicsMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and VoltageInterpolaterOntoMechanicsMesh< DIM >::mpMeshPair.

◆ ~VoltageInterpolaterOntoMechanicsMesh()

Member Function Documentation

◆ InterpolateOnCoarseMesh()

template<unsigned DIM>
void VoltageInterpolaterOntoMechanicsMesh< DIM >::InterpolateOnCoarseMesh ( std::vector< double > &  rValuesOnCoarseMesh,
ReplicatableVector rValuesOnFineMesh 
)

Does the actual interpolation.

Parameters
rValuesOnCoarseMeshIt will be filled with the interpolated values. Memory must have been allocated before (this method checks): the vector must be of the same size as the number of nodes of the coarser mesh
rValuesOnFineMeshThe values on the fine mesh to be interpolated onto the coarser mesh

Definition at line 66 of file VoltageInterpolaterOntoMechanicsMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

◆ OutputToCmgui()

template<unsigned DIM>
void VoltageInterpolaterOntoMechanicsMesh< DIM >::OutputToCmgui ( std::vector< std::string > &  rVariableNames,
std::string  directory,
std::string  inputFileNamePrefix 
)

The main method of the class. It reads the h5 files in directory (filename prefix inputFileNamePrefix) It then considers all the variables whose name is specified in rVariableNames, does the interplation using InterpolateOnCoarseMesh, and creates output for all the variables over all the time steps included in the h5 file. It does so by first writing out to h5 and then converting to CMGUI.

Parameters
rVariableNamesvector of names of variables contained in the input h5 file and that you want to be interpolated.
directoryDirectory the voltage file is in
inputFileNamePrefixFilename (without ".h5") of the electrics solution HDF5 file

Definition at line 84 of file VoltageInterpolaterOntoMechanicsMesh.cpp.

References Hdf5DataWriter::AdvanceAlongUnlimitedDimension(), RelativeTo::ChasteTestOutput, DistributedVectorFactory::CreateVec(), PetscTools::CreateVec(), Hdf5DataWriter::DefineFixedDimension(), Hdf5DataWriter::DefineUnlimitedDimension(), Hdf5DataWriter::DefineVariable(), PetscTools::Destroy(), Hdf5DataWriter::EndDefineMode(), HeartConfig::GetOutputDirectory(), Hdf5DataReader::GetUnlimitedDimensionValues(), Hdf5DataReader::GetVariableOverNodes(), HeartConfig::Instance(), Hdf5DataWriter::PutUnlimitedVariable(), Hdf5DataWriter::PutVector(), and HeartConfig::SetOutputDirectory().

Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve().

Member Data Documentation

◆ mpMeshPair

template<unsigned DIM>
FineCoarseMeshPair<DIM>* VoltageInterpolaterOntoMechanicsMesh< DIM >::mpMeshPair
private

Mesh pair object. Initialized by the constructor using the two meshes passed in

Definition at line 65 of file VoltageInterpolaterOntoMechanicsMesh.hpp.

Referenced by VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh().

◆ mrElectricsMesh

template<unsigned DIM>
TetrahedralMesh<DIM,DIM>& VoltageInterpolaterOntoMechanicsMesh< DIM >::mrElectricsMesh
private

The fine mesh (values will be interpolated from this one)

Definition at line 61 of file VoltageInterpolaterOntoMechanicsMesh.hpp.

◆ mrMechanicsMesh

template<unsigned DIM>
QuadraticMesh<DIM>& VoltageInterpolaterOntoMechanicsMesh< DIM >::mrMechanicsMesh
private

The coarse mesh (values will be interpolated onto this one)

Definition at line 63 of file VoltageInterpolaterOntoMechanicsMesh.hpp.


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