BidomainCorrectionTermAssembler.cpp
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
00031
00032
00033
00034
00035
00036
00037 #include "BidomainCorrectionTermAssembler.hpp"
00038 #include "UblasIncludes.hpp"
00039 #include <boost/numeric/ublas/vector_proxy.hpp>
00040
00041 template<unsigned ELEM_DIM, unsigned SPACE_DIM>
00042 BidomainCorrectionTermAssembler<ELEM_DIM,SPACE_DIM>::BidomainCorrectionTermAssembler(
00043 AbstractTetrahedralMesh<ELEM_DIM,SPACE_DIM>* pMesh,
00044 BidomainTissue<SPACE_DIM>* pTissue)
00045 : AbstractCorrectionTermAssembler<ELEM_DIM,SPACE_DIM,2>(pMesh,pTissue)
00046 {
00047 mpConfig = HeartConfig::Instance();
00048 assert(mpConfig->GetUseStateVariableInterpolation());
00049 }
00050
00051 template<unsigned ELEM_DIM, unsigned SPACE_DIM>
00052 c_vector<double,2*(ELEM_DIM+1)> BidomainCorrectionTermAssembler<ELEM_DIM,SPACE_DIM>::ComputeVectorTerm(
00053 c_vector<double, ELEM_DIM+1> &rPhi,
00054 c_matrix<double, SPACE_DIM, ELEM_DIM+1> &rGradPhi ,
00055 ChastePoint<SPACE_DIM> &rX ,
00056 c_vector<double,2> &rU,
00057 c_matrix<double, 2, SPACE_DIM> &rGradU ,
00058 Element<ELEM_DIM,SPACE_DIM>* pElement )
00059 {
00060 double Am = mpConfig->GetSurfaceAreaToVolumeRatio();
00061
00062
00063
00064
00065 unsigned node_global_index = pElement->GetNodeGlobalIndex(0);
00066 AbstractCardiacCellInterface* p_any_cell = this->mpCardiacTissue->GetCardiacCellOrHaloCell(node_global_index);
00067 double ionic_sv_interp = p_any_cell->GetIIonic(&(this->mStateVariablesAtQuadPoint));
00068
00069 c_vector<double,2*(ELEM_DIM+1)> ret;
00070
00071 ublas::vector_slice<c_vector<double, 2*(ELEM_DIM+1)> > slice_V (ret, slice (0, 2, ELEM_DIM+1));
00072 ublas::vector_slice<c_vector<double, 2*(ELEM_DIM+1)> > slice_Phi(ret, slice (1, 2, ELEM_DIM+1));
00073
00074
00075
00076
00077 noalias(slice_V) = rPhi * (-Am) * ( ionic_sv_interp - this->mIionicInterp );
00078
00079 noalias(slice_Phi) = zero_vector<double>(ELEM_DIM+1);
00080
00081 return ret;
00082 }
00083
00084
00086
00088
00089 template class BidomainCorrectionTermAssembler<1,1>;
00090 template class BidomainCorrectionTermAssembler<2,2>;
00091 template class BidomainCorrectionTermAssembler<3,3>;