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
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00042
00043 #ifndef _BIDOMAINMATRIXBASEDASSEMBLER_HPP_
00044 #define _BIDOMAINMATRIXBASEDASSEMBLER_HPP_
00045
00046 #include "BidomainDg0Assembler.hpp"
00047
00065 template<unsigned DIM>
00066 class BidomainRhsMatrixAssembler
00067 : public AbstractLinearAssembler<DIM, DIM, 2, false, BidomainRhsMatrixAssembler<DIM> >
00068 {
00069 public:
00070 static const unsigned E_DIM = DIM;
00071 static const unsigned S_DIM = DIM;
00072 static const unsigned P_DIM = 2u;
00084 virtual c_matrix<double,2*(DIM+1),2*(DIM+1)> ComputeMatrixTerm(
00085 c_vector<double, DIM+1> &rPhi,
00086 c_matrix<double, DIM, DIM+1> &rGradPhi,
00087 ChastePoint<DIM> &rX,
00088 c_vector<double,2> &rU,
00089 c_matrix<double,2,DIM> &rGradU ,
00090 Element<DIM,DIM>* pElement);
00091
00103 virtual c_vector<double,2*(DIM+1)> ComputeVectorTerm(
00104 c_vector<double, DIM+1> &rPhi,
00105 c_matrix<double, DIM, DIM+1> &rGradPhi,
00106 ChastePoint<DIM> &rX,
00107 c_vector<double,2> &u,
00108 c_matrix<double, 2, DIM> &rGradU ,
00109 Element<DIM,DIM>* pElement);
00110
00120 virtual c_vector<double, 2*DIM> ComputeVectorSurfaceTerm(
00121 const BoundaryElement<DIM-1,DIM> &rSurfaceElement,
00122 c_vector<double, DIM> &rPhi,
00123 ChastePoint<DIM> &rX);
00124
00129 BidomainRhsMatrixAssembler(AbstractTetrahedralMesh<DIM,DIM>* pMesh);
00130
00134 ~BidomainRhsMatrixAssembler();
00135
00139 Mat* GetMatrix();
00140 };
00141
00142
00148 template<unsigned DIM>
00149 struct AssemblerTraits<BidomainRhsMatrixAssembler<DIM> >
00150 {
00152 typedef BidomainRhsMatrixAssembler<DIM> CVT_CLS;
00154 typedef BidomainRhsMatrixAssembler<DIM> CMT_CLS;
00156 typedef AbstractAssembler<DIM, DIM, 2> INTERPOLATE_CLS;
00157 };
00158
00159
00160
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00194 class BidomainMatrixBasedAssembler
00195 : public virtual BidomainDg0Assembler<ELEMENT_DIM, SPACE_DIM>
00196 {
00197 protected:
00199 BidomainRhsMatrixAssembler<SPACE_DIM>* mpBidomainRhsMatrixAssembler;
00200
00201 public:
00202
00211 BidomainMatrixBasedAssembler(AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00212 BidomainPde<SPACE_DIM>* pPde,
00213 BoundaryConditionsContainer<ELEMENT_DIM, SPACE_DIM, 2>* pBcc,
00214 unsigned numQuadPoints = 2);
00215
00219 ~BidomainMatrixBasedAssembler();
00220
00227 virtual void ConstructVectorForMatrixBasedRhsAssembly(Vec existingSolution);
00228 };
00229
00236 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00237 struct AssemblerTraits<BidomainMatrixBasedAssembler<ELEMENT_DIM, SPACE_DIM> >
00238 {
00240 typedef BidomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> CVT_CLS;
00242 typedef BidomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> CMT_CLS;
00244 typedef BidomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> INTERPOLATE_CLS;
00245 };
00246
00247 #endif //_BIDOMAINMATRIXBASEDASSEMBLER_HPP_