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 #ifndef _BIDOMAINMATRIXBASEDASSEMBLER_HPP_
00033 #define _BIDOMAINMATRIXBASEDASSEMBLER_HPP_
00034
00035 #include "BidomainDg0Assembler.hpp"
00036
00054 template<unsigned DIM>
00055 class BidomainRhsMatrixAssembler
00056 : public AbstractLinearAssembler<DIM, DIM, 2, false, BidomainRhsMatrixAssembler<DIM> >
00057 {
00058 public:
00059 static const unsigned E_DIM = DIM;
00060 static const unsigned S_DIM = DIM;
00061 static const unsigned P_DIM = 2u;
00062
00063 public:
00067 virtual c_matrix<double,2*(DIM+1),2*(DIM+1)> ComputeMatrixTerm(
00068 c_vector<double, DIM+1> &rPhi,
00069 c_matrix<double, DIM, DIM+1> &rGradPhi,
00070 ChastePoint<DIM> &rX,
00071 c_vector<double,2> &u,
00072 c_matrix<double,2,DIM> &rGradU ,
00073 Element<DIM,DIM>* pElement);
00074
00079 virtual c_vector<double,2*(DIM+1)> ComputeVectorTerm(
00080 c_vector<double, DIM+1> &rPhi,
00081 c_matrix<double, DIM, DIM+1> &rGradPhi,
00082 ChastePoint<DIM> &rX,
00083 c_vector<double,2> &u,
00084 c_matrix<double, 2, DIM> &rGradU ,
00085 Element<DIM,DIM>* pElement);
00086
00092 virtual c_vector<double, 2*DIM> ComputeVectorSurfaceTerm(
00093 const BoundaryElement<DIM-1,DIM> &rSurfaceElement,
00094 c_vector<double, DIM> &rPhi,
00095 ChastePoint<DIM> &rX );
00096
00097 public:
00101 BidomainRhsMatrixAssembler(AbstractMesh<DIM,DIM>* pMesh);
00102
00103 ~BidomainRhsMatrixAssembler();
00104
00108 Mat* GetMatrix();
00109 };
00110
00111
00117 template<unsigned DIM>
00118 struct AssemblerTraits<BidomainRhsMatrixAssembler<DIM> >
00119 {
00120 typedef BidomainRhsMatrixAssembler<DIM> CVT_CLS;
00121 typedef BidomainRhsMatrixAssembler<DIM> CMT_CLS;
00122 typedef AbstractAssembler<DIM, DIM, 2> INTERPOLATE_CLS;
00123 };
00124
00125
00126
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00160 class BidomainMatrixBasedAssembler
00161 : public virtual BidomainDg0Assembler<ELEMENT_DIM, SPACE_DIM>
00162 {
00163 protected:
00164 BidomainRhsMatrixAssembler<SPACE_DIM>* mpBidomainRhsMatrixAssembler;
00165
00166 public:
00170 BidomainMatrixBasedAssembler(AbstractMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00171 BidomainPde<SPACE_DIM>* pPde,
00172 BoundaryConditionsContainer<ELEMENT_DIM, SPACE_DIM, 2>* pBcc,
00173 unsigned numQuadPoints = 2);
00174
00175 ~BidomainMatrixBasedAssembler();
00176
00177
00182 virtual void ConstructVectorForMatrixBasedRhsAssembly(Vec currentSolution);
00183 };
00184
00191 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00192 struct AssemblerTraits<BidomainMatrixBasedAssembler<ELEMENT_DIM, SPACE_DIM> >
00193 {
00195 typedef BidomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> CVT_CLS;
00197 typedef BidomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> CMT_CLS;
00199 typedef BidomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> INTERPOLATE_CLS;
00200 };
00201
00202 #endif //_BIDOMAINMATRIXBASEDASSEMBLER_HPP_