#include <PseudoEcgCalculator.hpp>
Inherits AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Public Member Functions | |
PseudoEcgCalculator (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, const ChastePoint< SPACE_DIM > &rProbeElectrode, std::string directory, std::string hdf5File, std::string variableName="V", bool makeAbsolute=true) | |
~PseudoEcgCalculator () | |
void | SetDiffusionCoefficient (double diffusionCoefficient) |
void | WritePseudoEcg () |
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) |
Private Attributes | |
Hdf5DataReader * | mpDataReader |
unsigned | mNumberOfNodes |
unsigned | mNumTimeSteps |
AbstractTetrahedralMesh < ELEMENT_DIM, SPACE_DIM > & | mrMesh |
ChastePoint< SPACE_DIM > | mProbeElectrode |
double | mDiffusionCoefficient |
std::string | mVariableName |
Friends | |
class | TestPseudoEcgCalculator |
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:
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 54 of file PseudoEcgCalculator.hpp.
PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PseudoEcgCalculator | ( | AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > & | rMesh, | |
const ChastePoint< SPACE_DIM > & | rProbeElectrode, | |||
std::string | directory, | |||
std::string | hdf5File, | |||
std::string | variableName = "V" , |
|||
bool | makeAbsolute = true | |||
) | [inline] |
Constructor
rMesh | A reference to the mesh | |
rProbeElectrode | The location of the recording electrode | |
directory | The directory where the simulation results are stored | |
hdf5File | The file name where the simulation results are stored | |
variableName | The name of the voltage variable (is V by default) | |
makeAbsolute | whether to make the path of directory absolute (using the OutputFileHandler) |
Definition at line 54 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.
PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~PseudoEcgCalculator | ( | ) | [inline] |
Destructor.
Definition at line 75 of file PseudoEcgCalculator.cpp.
References PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpDataReader.
double PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep | ( | unsigned | timeStep | ) | [inline, private] |
Calculates the pseudo-ECG and returns its value at the given time step.
timeStep | the time step where we want to calculate the pseudoecg |
Definition at line 88 of file PseudoEcgCalculator.cpp.
References AbstractFunctionalCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Calculate(), PetscTools::CreateVec(), Hdf5DataReader::GetVariableOverNodes(), PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNumberOfNodes, 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.
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WritePseudoEcg().
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 | |||
) | [inline, private, virtual] |
Get the integrand. The pseudo-ECG is defined as the integral over the mesh of the following integrand:
rX | The point in space | |
rU | The unknown as a vector, u(i) = u_i | |
rGradU | The 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 36 of file PseudoEcgCalculator.cpp.
References EXCEPTION, PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDiffusionCoefficient, PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mProbeElectrode, and ChastePoint< DIM >::rGetLocation().
void PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetDiffusionCoefficient | ( | double | diffusionCoefficient | ) | [inline] |
Sets the value of the diffusion coefficient (D)
diffusionCoefficient | The desired value of the diffusion coefficient |
Definition at line 81 of file PseudoEcgCalculator.cpp.
References PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDiffusionCoefficient.
void PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WritePseudoEcg | ( | ) | [inline] |
Calculates and writes the pseudo-ECG to file. the file will be named PseudoEcgFromElectrodeAt_x_y_z.dat, where x,y,z are replaced by the location of the electrode. It will contain one column of numbers, each being the pseudoECG at each time step. It will be created by the master processor into /output relaitive to where the output directory is set (by the HeartConfig or by default)
Definition at line 108 of file PseudoEcgCalculator.cpp.
References PetscTools::AmMaster(), PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep(), ChasteBuildInfo::GetProvenanceString(), ChastePoint< DIM >::GetWithDefault(), HeartConfig::Instance(), PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNumTimeSteps, PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mProbeElectrode, and OutputFileHandler::OpenOutputFile().
Referenced by PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WritePostProcessingFiles().
double PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDiffusionCoefficient [private] |
The diffusion coefficient D
Definition at line 65 of file PseudoEcgCalculator.hpp.
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetIntegrand(), PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PseudoEcgCalculator(), and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetDiffusionCoefficient().
unsigned PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNumberOfNodes [private] |
Number of nodes in the mesh (got from the data reader)
Definition at line 61 of file PseudoEcgCalculator.hpp.
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep(), and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PseudoEcgCalculator().
unsigned PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNumTimeSteps [private] |
Number of time steps in the simulation (got from the data reader)
Definition at line 62 of file PseudoEcgCalculator.hpp.
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PseudoEcgCalculator(), and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WritePseudoEcg().
Hdf5DataReader* PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpDataReader [private] |
An HDF5 reader from which to get the solution
Definition at line 60 of file PseudoEcgCalculator.hpp.
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep(), PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PseudoEcgCalculator(), and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~PseudoEcgCalculator().
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 64 of file PseudoEcgCalculator.hpp.
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetIntegrand(), and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WritePseudoEcg().
AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>& PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mrMesh [private] |
A mesh used by the calculator
Definition at line 63 of file PseudoEcgCalculator.hpp.
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep(), and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PseudoEcgCalculator().
std::string PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mVariableName [private] |
the variable for which we want to calculate the pseudo ecg, defaults to "V"
Definition at line 66 of file PseudoEcgCalculator.hpp.
Referenced by PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputePseudoEcgAtOneTimeStep(), and PseudoEcgCalculator< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PseudoEcgCalculator().