00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "MonodomainCorrectionTermAssembler.hpp"
00031
00032 template<unsigned ELEM_DIM, unsigned SPACE_DIM>
00033 MonodomainCorrectionTermAssembler<ELEM_DIM,SPACE_DIM>::MonodomainCorrectionTermAssembler(
00034 AbstractTetrahedralMesh<ELEM_DIM,SPACE_DIM>* pMesh,
00035 MonodomainTissue<ELEM_DIM,SPACE_DIM>* pTissue,
00036 unsigned numQuadPoints)
00037 : AbstractCorrectionTermAssembler<ELEM_DIM,SPACE_DIM,1>(pMesh,pTissue,numQuadPoints)
00038 {
00039 mpConfig = HeartConfig::Instance();
00040 assert(mpConfig->GetUseStateVariableInterpolation());
00041 }
00042
00043 template<unsigned ELEM_DIM, unsigned SPACE_DIM>
00044 c_vector<double,1*(ELEM_DIM+1)> MonodomainCorrectionTermAssembler<ELEM_DIM,SPACE_DIM>::ComputeVectorTerm(
00045 c_vector<double, ELEM_DIM+1> &rPhi,
00046 c_matrix<double, SPACE_DIM, ELEM_DIM+1> &rGradPhi ,
00047 ChastePoint<SPACE_DIM> &rX ,
00048 c_vector<double,1> &rU,
00049 c_matrix<double, 1, SPACE_DIM> &rGradU ,
00050 Element<ELEM_DIM,SPACE_DIM>* pElement)
00051 {
00052 double Am = mpConfig->GetSurfaceAreaToVolumeRatio();
00053
00054
00055
00056
00057 unsigned node_global_index = pElement->GetNodeGlobalIndex(0);
00058 AbstractCardiacCell* p_any_cell = this->mpCardiacTissue->GetCardiacCellOrHaloCell(node_global_index);
00059 double ionic_sv_interp = p_any_cell->GetIIonic(&(this->mStateVariablesAtQuadPoint));
00060
00061
00062
00063
00064 return rPhi * (-Am) * ( ionic_sv_interp - this->mIionicInterp );
00065 }
00066
00067
00068
00069
00071
00073
00074 template class MonodomainCorrectionTermAssembler<1,1>;
00075 template class MonodomainCorrectionTermAssembler<1,2>;
00076 template class MonodomainCorrectionTermAssembler<1,3>;
00077 template class MonodomainCorrectionTermAssembler<2,2>;
00078 template class MonodomainCorrectionTermAssembler<3,3>;