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 DIM>
00053 class MonodomainRhsMatrixAssembler
00054 : public AbstractLinearAssembler<DIM, DIM, 1, false, MonodomainRhsMatrixAssembler<DIM> >
00055 {
00056 public:
00057 static const unsigned E_DIM = DIM;
00058 static const unsigned S_DIM = DIM;
00059 static const unsigned P_DIM = 1u;
00060
00061 public:
00065 virtual c_matrix<double,1*(DIM+1),1*(DIM+1)> ComputeMatrixTerm(
00066 c_vector<double, DIM+1> &rPhi,
00067 c_matrix<double, DIM, DIM+1> &rGradPhi,
00068 ChastePoint<DIM> &rX,
00069 c_vector<double,1> &u,
00070 c_matrix<double,1,DIM> &rGradU ,
00071 Element<DIM,DIM>* pElement);
00072
00077 virtual c_vector<double,1*(DIM+1)> ComputeVectorTerm(
00078 c_vector<double, DIM+1> &rPhi,
00079 c_matrix<double, DIM, DIM+1> &rGradPhi,
00080 ChastePoint<DIM> &rX,
00081 c_vector<double,1> &u,
00082 c_matrix<double, 1, DIM> &rGradU ,
00083 Element<DIM,DIM>* pElement);
00084
00085
00091 virtual c_vector<double, DIM> ComputeVectorSurfaceTerm(
00092 const BoundaryElement<DIM-1,DIM> &rSurfaceElement,
00093 c_vector<double, DIM> &rPhi,
00094 ChastePoint<DIM> &rX );
00095
00096
00097 public:
00101 MonodomainRhsMatrixAssembler(AbstractMesh<DIM,DIM>* pMesh);
00102
00103 ~MonodomainRhsMatrixAssembler();
00104
00108 Mat* GetMatrix();
00109 };
00110
00111
00117 template<unsigned DIM>
00118 struct AssemblerTraits<MonodomainRhsMatrixAssembler<DIM> >
00119 {
00120 typedef MonodomainRhsMatrixAssembler<DIM> CVT_CLS;
00121 typedef MonodomainRhsMatrixAssembler<DIM> CMT_CLS;
00122 typedef AbstractAssembler<DIM, DIM, 1> INTERPOLATE_CLS;
00123 };
00124
00125
00126
00141 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00142 class MonodomainMatrixBasedAssembler
00143 : public MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM>
00144 {
00145 protected:
00146 MonodomainRhsMatrixAssembler<SPACE_DIM>* mpMonodomainRhsMatrixAssembler;
00147
00148 public:
00152 MonodomainMatrixBasedAssembler(AbstractMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00153 MonodomainPde<SPACE_DIM>* pPde,
00154 BoundaryConditionsContainer<ELEMENT_DIM, SPACE_DIM, 1>* pBcc,
00155 unsigned numQuadPoints = 2);
00156
00157 ~MonodomainMatrixBasedAssembler();
00158
00163 void ConstructVectorForMatrixBasedRhsAssembly(Vec currentSolution);
00164 };
00165
00173 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00174 struct AssemblerTraits<MonodomainMatrixBasedAssembler<ELEMENT_DIM, SPACE_DIM> >
00175 {
00176 typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> CVT_CLS;
00177 typedef SimpleDg0ParabolicAssembler<ELEMENT_DIM, SPACE_DIM, false, MonodomainMatrixBasedAssembler<ELEMENT_DIM, SPACE_DIM> >
00178 CMT_CLS;
00179 typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> INTERPOLATE_CLS;
00180 };
00181
00182 #endif //_MONODOMAINMATRIXBASEDASSEMBLER_HPP_