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 _MONODOMAINDG0ASSEMBLER_HPP_
00031 #define _MONODOMAINDG0ASSEMBLER_HPP_
00032
00033
00034 #include "UblasIncludes.hpp"
00035
00036
00037 #include <vector>
00038 #include <petscvec.h>
00039
00040 #include "AbstractDynamicAssemblerMixin.hpp"
00041 #include "AbstractLinearAssembler.hpp"
00042
00043 #include "MonodomainPde.hpp"
00044 #include "HeartConfig.hpp"
00045 #include "Element.hpp"
00046 #include "BoundaryElement.hpp"
00047 #include "ChastePoint.hpp"
00048 #include "AbstractTetrahedralMesh.hpp"
00049 #include "BoundaryConditionsContainer.hpp"
00050
00051
00065 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00066 class MonodomainDg0Assembler
00067 : public AbstractLinearAssembler<ELEMENT_DIM, SPACE_DIM, 1, false, MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> >,
00068 public AbstractDynamicAssemblerMixin<ELEMENT_DIM, SPACE_DIM, 1>
00069 {
00070 public:
00071 static const unsigned E_DIM = ELEMENT_DIM;
00072 static const unsigned S_DIM = SPACE_DIM;
00073 static const unsigned P_DIM = 1u;
00075 protected:
00076
00078 HeartConfig* mpConfig;
00079
00081 double mIionic;
00083 double mIIntracellularStimulus;
00084
00085
00087 MonodomainPde<ELEMENT_DIM,SPACE_DIM>* mpMonodomainPde;
00088
00089
00090 typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> SelfType;
00091 typedef AbstractLinearAssembler<ELEMENT_DIM, SPACE_DIM, 1, false, SelfType> BaseClassType;
00093
00094 friend class AbstractStaticAssembler<ELEMENT_DIM, SPACE_DIM, 1u, false, SelfType>;
00095
00096 protected:
00097
00111 virtual c_matrix<double,1*(ELEMENT_DIM+1),1*(ELEMENT_DIM+1)> ComputeMatrixTerm(
00112 c_vector<double, ELEMENT_DIM+1> &rPhi,
00113 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1> &rGradPhi,
00114 ChastePoint<SPACE_DIM> &rX,
00115 c_vector<double,1> &rU,
00116 c_matrix<double, 1, SPACE_DIM> &rGradU ,
00117 Element<ELEMENT_DIM,SPACE_DIM>* pElement);
00118
00135 virtual c_vector<double,1*(ELEMENT_DIM+1)> ComputeVectorTerm(
00136 c_vector<double, ELEMENT_DIM+1> &rPhi,
00137 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1> &rGradPhi,
00138 ChastePoint<SPACE_DIM> &rX,
00139 c_vector<double,1> &rU,
00140 c_matrix<double, 1, SPACE_DIM> &rGradU ,
00141 Element<ELEMENT_DIM,SPACE_DIM>* pElement);
00142
00154 virtual c_vector<double, 1*ELEMENT_DIM> ComputeVectorSurfaceTerm(
00155 const BoundaryElement<ELEMENT_DIM-1,SPACE_DIM> &rSurfaceElement,
00156 c_vector<double,ELEMENT_DIM> &rPhi,
00157 ChastePoint<SPACE_DIM> &rX);
00158
00159
00163 void ResetInterpolatedQuantities();
00164
00171 void IncrementInterpolatedQuantities(double phiI, const Node<SPACE_DIM>* pNode);
00172
00182 virtual void PrepareForAssembleSystem(Vec existingSolutionOrGuess, double time);
00183
00190 void InitialiseForSolve(Vec initialSolution);
00191
00192
00193 public:
00194
00203 MonodomainDg0Assembler(AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00204 MonodomainPde<ELEMENT_DIM,SPACE_DIM>* pPde,
00205 BoundaryConditionsContainer<ELEMENT_DIM, SPACE_DIM, 1>* pBcc,
00206 unsigned numQuadPoints = 2);
00207
00211 ~MonodomainDg0Assembler();
00212 };
00213
00220 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00221 struct AssemblerTraits<MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> >
00222 {
00224 typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> CVT_CLASS;
00226 typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> CMT_CLASS;
00228 typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> INTERPOLATE_CLASS;
00229 };
00230
00231 #endif //_MONODOMAINDG0ASSEMBLER_HPP_