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