Chaste  Release::2017.1
PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > Class Template Reference

#include <PseudoEcgCalculator.hpp>

+ Inheritance diagram for PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >:
+ Collaboration diagram for PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >:

Public Member Functions

 PseudoEcgCalculator (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, const ChastePoint< SPACE_DIM > &rProbeElectrode, const FileFinder &rDirectory, const std::string &rHdf5FileName, const std::string &rVariableName="V", unsigned timestepStride=1)
 
 ~PseudoEcgCalculator ()
 
void SetDiffusionCoefficient (double diffusionCoefficient)
 
void WritePseudoEcg ()
 
- Public Member Functions inherited from AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >
virtual ~AbstractFunctionalCalculator ()
 
double Calculate (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, Vec solution)
 
double CalculateOnElement (Element< ELEMENT_DIM, SPACE_DIM > &rElement)
 

Private Member Functions

double GetIntegrand (ChastePoint< SPACE_DIM > &rX, c_vector< double, PROBLEM_DIM > &rU, c_matrix< double, PROBLEM_DIM, SPACE_DIM > &rGradU)
 
double ComputePseudoEcgAtOneTimeStep (unsigned timeStep)
 
bool ShouldSkipThisElement (Element< ELEMENT_DIM, SPACE_DIM > &rElement)
 

Private Attributes

Hdf5DataReadermpDataReader
 
unsigned mNumberOfNodes
 
unsigned mNumTimeSteps
 
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > & mrMesh
 
ChastePoint< SPACE_DIM > mProbeElectrode
 
double mDiffusionCoefficient
 
std::string mVariableName
 
unsigned mTimestepStride
 

Friends

class TestPseudoEcgCalculator
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
class PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >

This class implements a pseudo-ECG calculator. It is a concrete class of AbstractFunctionalCalculator. The pseudo-ECG is defined as the integral over the mesh of the following integrand:

  • D * grad (solution) dot grad (1/r)

    where D is a diffusion coefficient and r is the distance between a recording electrode and a given point in the mesh.

    References for the formula that defines the pseudo-ECG:

    Gima K, Rudy Y Circ Res (2002) 90:889-896 (equation 1) Baher et al. Am J Physiol (2007) 292:H180-H189 (equation 5)

Definition at line 71 of file PseudoEcgCalculator.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PseudoEcgCalculator ( AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh,
const ChastePoint< SPACE_DIM > &  rProbeElectrode,
const FileFinder rDirectory,
const std::string &  rHdf5FileName,
const std::string &  rVariableName = "V",
unsigned  timestepStride = 1 
)

Constructor

Parameters
rMeshA reference to the mesh
rProbeElectrodeThe location of the recording electrode
rDirectoryThe directory where the simulation results are stored
rHdf5FileNameThe file name where the simulation results are stored
rVariableNameThe name of the voltage variable (is V by default)
timestepStrideThe number of timesteps in a stride (so that we don't have to compute all the ECGs). This defaults to 1.

Definition at line 62 of file PseudoEcgCalculator.cpp.

References Hdf5DataReader::GetNumberOfRows(), Hdf5DataReader::GetVariableOverTime(), PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDiffusionCoefficient, PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNumberOfNodes, PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNumTimeSteps, PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpDataReader, PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mrMesh, and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mVariableName.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~PseudoEcgCalculator ( )

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep ( unsigned  timeStep)
private
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetIntegrand ( ChastePoint< SPACE_DIM > &  rX,
c_vector< double, PROBLEM_DIM > &  rU,
c_matrix< double, PROBLEM_DIM, SPACE_DIM > &  rGradU 
)
privatevirtual
Returns
the integrand. The pseudo-ECG is defined as the integral over the mesh of the following integrand:
  • D * grad (solution) dot grad (1/r)
Parameters
rXThe point in space
rUThe unknown as a vector, u(i) = u_i
rGradUThe gradient of the unknown as a matrix, rGradU(i,j) = d(u_i)/d(X_j)

Implements AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

Definition at line 44 of file PseudoEcgCalculator.cpp.

References EXCEPTION, ChastePoint< DIM >::rGetLocation(), and SmallPow().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetDiffusionCoefficient ( double  diffusionCoefficient)

Sets the value of the diffusion coefficient (D)

Parameters
diffusionCoefficientThe desired value of the diffusion coefficient

Definition at line 100 of file PseudoEcgCalculator.cpp.

References PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDiffusionCoefficient.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ShouldSkipThisElement ( Element< ELEMENT_DIM, SPACE_DIM > &  rElement)
privatevirtual

Whether we should not calculate the Pseudo ECG on this element.

This method returns true if we are integrating voltage and the tissue element is in the bath.

Parameters
rElementthe element of interest
Returns
whether we should skip this element.

Reimplemented from AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

Definition at line 82 of file PseudoEcgCalculator.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetUnsignedAttribute(), HeartRegionCode::IsRegionBath(), and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mVariableName.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WritePseudoEcg ( )

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDiffusionCoefficient
private
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
unsigned PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNumberOfNodes
private
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
unsigned PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNumTimeSteps
private
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
ChastePoint<SPACE_DIM> PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mProbeElectrode
private

The point from where we want to calculate the pseudoECG

Definition at line 81 of file PseudoEcgCalculator.hpp.

Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WritePseudoEcg().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>& PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mrMesh
private
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
unsigned PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTimestepStride
private

The number of timesteps in a stride (so that we don't have to compute all the ECGs). This defaults to 1.

Definition at line 84 of file PseudoEcgCalculator.hpp.

Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WritePseudoEcg().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::string PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mVariableName
private

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