37 #include "BidomainAssembler.hpp"
38 #include "PdeSimulationTime.hpp"
42 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
43 c_matrix<double,2*(ELEMENT_DIM+1),2*(ELEMENT_DIM+1)>
45 c_vector<double, ELEMENT_DIM+1> &rPhi,
46 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1> &rGradPhi,
48 c_vector<double,2> &rU,
49 c_matrix<double, 2, SPACE_DIM> &rGradU ,
53 double Am = this->mpConfig->GetSurfaceAreaToVolumeRatio();
54 double Cm = this->mpConfig->GetCapacitance();
56 const c_matrix<double, SPACE_DIM, SPACE_DIM>& sigma_i = this->mpCardiacTissue->rGetIntracellularConductivityTensor(pElement->
GetIndex());
57 const c_matrix<double, SPACE_DIM, SPACE_DIM>& sigma_e = this->mpCardiacTissue->rGetExtracellularConductivityTensor(pElement->
GetIndex());
60 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1> temp = prod(sigma_i, rGradPhi);
61 c_matrix<double, ELEMENT_DIM+1, ELEMENT_DIM+1> grad_phi_sigma_i_grad_phi =
62 prod(trans(rGradPhi), temp);
64 c_matrix<double, ELEMENT_DIM+1, ELEMENT_DIM+1> basis_outer_prod =
65 outer_prod(rPhi, rPhi);
67 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1> temp2 = prod(sigma_e, rGradPhi);
68 c_matrix<double, ELEMENT_DIM+1, ELEMENT_DIM+1> grad_phi_sigma_e_grad_phi =
69 prod(trans(rGradPhi), temp2);
72 c_matrix<double,2*(ELEMENT_DIM+1),2*(ELEMENT_DIM+1)> ret;
75 matrix_slice<c_matrix<double, 2*ELEMENT_DIM+2, 2*ELEMENT_DIM+2> >
76 slice00(ret, slice (0, 2, ELEMENT_DIM+1), slice (0, 2, ELEMENT_DIM+1));
80 matrix_slice<c_matrix<double, 2*ELEMENT_DIM+2, 2*ELEMENT_DIM+2> >
81 slice10(ret, slice (1, 2, ELEMENT_DIM+1), slice (0, 2, ELEMENT_DIM+1));
82 slice10 = grad_phi_sigma_i_grad_phi;
85 matrix_slice<c_matrix<double, 2*ELEMENT_DIM+2, 2*ELEMENT_DIM+2> >
86 slice01(ret, slice (0, 2, ELEMENT_DIM+1), slice (1, 2, ELEMENT_DIM+1));
87 slice01 = grad_phi_sigma_i_grad_phi;
90 matrix_slice<c_matrix<double, 2*ELEMENT_DIM+2, 2*ELEMENT_DIM+2> >
91 slice11(ret, slice (1, 2, ELEMENT_DIM+1), slice (1, 2, ELEMENT_DIM+1));
92 slice11 = grad_phi_sigma_i_grad_phi + grad_phi_sigma_e_grad_phi;
97 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
103 assert(pTissue != NULL);
virtual c_matrix< double, 2 *(ELEMENT_DIM+1), 2 *(ELEMENT_DIM+1)> ComputeMatrixTerm(c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, 2 > &rU, c_matrix< double, 2, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
BidomainAssembler(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, BidomainTissue< SPACE_DIM > *pTissue)
static double GetPdeTimeStepInverse()
unsigned GetIndex() const