MonodomainDg0Assembler.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 
00029 
00030 #ifndef _MONODOMAINDG0ASSEMBLER_HPP_
00031 #define _MONODOMAINDG0ASSEMBLER_HPP_
00032 
00033 
00034 #include "UblasIncludes.hpp"
00035 
00036 //#include <iostream>
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     // Save typing
00090     typedef MonodomainDg0Assembler<ELEMENT_DIM, SPACE_DIM> SelfType; 
00091     typedef AbstractLinearAssembler<ELEMENT_DIM, SPACE_DIM, 1, false, SelfType> BaseClassType; 
00093     // Allow the AbstractStaticAssembler to call our private/protected methods using static polymorphism.
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 /* not used */,
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 /* not used */,
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_

Generated by  doxygen 1.6.2