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 #ifndef _MONODOMAINMATRIXBASEDASSEMBLER_HPP_
00031 #define _MONODOMAINMATRIXBASEDASSEMBLER_HPP_
00032
00033
00034 #include "MonodomainDg0Assembler.hpp"
00035 #include "AbstractLinearAssembler.hpp"
00036
00037
00038
00039
00052 template<unsigned ELEM_DIM, unsigned SPACE_DIM>
00053 class MonodomainRhsMatrixAssembler
00054 : public AbstractLinearAssembler<ELEM_DIM, SPACE_DIM, 1, false, MonodomainRhsMatrixAssembler<ELEM_DIM, SPACE_DIM> >
00055 {
00056 public:
00057 static const unsigned E_DIM = ELEM_DIM;
00058 static const unsigned S_DIM = SPACE_DIM;
00059 static const unsigned P_DIM = 1u;
00061 public:
00072 virtual c_matrix<double,1*(ELEM_DIM+1),1*(ELEM_DIM+1)> ComputeMatrixTerm(
00073 c_vector<double, ELEM_DIM+1> &rPhi,
00074 c_matrix<double, SPACE_DIM, ELEM_DIM+1> &rGradPhi,
00075 ChastePoint<SPACE_DIM> &rX,
00076 c_vector<double,1> &rU,
00077 c_matrix<double,1,SPACE_DIM> &rGradU ,
00078 Element<ELEM_DIM,SPACE_DIM>* pElement);
00079
00091 virtual c_vector<double,1*(ELEM_DIM+1)> ComputeVectorTerm(
00092 c_vector<double, ELEM_DIM+1> &rPhi,
00093 c_matrix<double, SPACE_DIM, ELEM_DIM+1> &rGradPhi,
00094 ChastePoint<SPACE_DIM> &rX,
00095 c_vector<double,1> &rU,
00096 c_matrix<double, 1, SPACE_DIM> &rGradU ,
00097 Element<ELEM_DIM,SPACE_DIM>* pElement);
00098
00108 virtual c_vector<double, ELEM_DIM> ComputeVectorSurfaceTerm(
00109 const BoundaryElement<ELEM_DIM-1,SPACE_DIM> &rSurfaceElement,
00110 c_vector<double, ELEM_DIM> &rPhi,
00111 ChastePoint<SPACE_DIM> &rX);
00112
00113 public:
00114
00120 MonodomainRhsMatrixAssembler(AbstractTetrahedralMesh<ELEM_DIM,SPACE_DIM>* pMesh);
00121
00125 ~MonodomainRhsMatrixAssembler();
00126
00130 Mat* GetMatrix();
00131 };
00132
00133
00139 template<unsigned ELEM_DIM, unsigned SPACE_DIM>
00140 struct AssemblerTraits<MonodomainRhsMatrixAssembler<ELEM_DIM, SPACE_DIM> >
00141 {
00143 typedef MonodomainRhsMatrixAssembler<ELEM_DIM,SPACE_DIM> CVT_CLS;
00145 typedef MonodomainRhsMatrixAssembler<ELEM_DIM,SPACE_DIM> CMT_CLS;
00147 typedef AbstractAssembler<ELEM_DIM, SPACE_DIM, 1> INTERPOLATE_CLS;
00148 };
00149
00150
00151
00166 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00167 class MonodomainMatrixBasedAssembler
00168 : public MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM>
00169 {
00170 protected:
00171
00173 MonodomainRhsMatrixAssembler<ELEMENT_DIM, SPACE_DIM>* mpMonodomainRhsMatrixAssembler;
00174
00175 public:
00176
00185 MonodomainMatrixBasedAssembler(AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00186 MonodomainPde<ELEMENT_DIM,SPACE_DIM>* pPde,
00187 BoundaryConditionsContainer<ELEMENT_DIM, SPACE_DIM, 1>* pBcc,
00188 unsigned numQuadPoints = 2);
00189
00193 ~MonodomainMatrixBasedAssembler();
00194
00201 void ConstructVectorForMatrixBasedRhsAssembly(Vec existingSolution);
00202 };
00203
00211 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00212 struct AssemblerTraits<MonodomainMatrixBasedAssembler<ELEMENT_DIM, SPACE_DIM> >
00213 {
00215 typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> CVT_CLS;
00217 typedef SimpleDg0ParabolicAssembler<ELEMENT_DIM, SPACE_DIM, false, MonodomainMatrixBasedAssembler<ELEMENT_DIM, SPACE_DIM> >
00218 CMT_CLS;
00220 typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> INTERPOLATE_CLS;
00221 };
00222
00223 #endif //_MONODOMAINMATRIXBASEDASSEMBLER_HPP_