MonodomainMatrixBasedAssembler.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2009
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 _MONODOMAINMATRIXBASEDASSEMBLER_HPP_
00031 #define _MONODOMAINMATRIXBASEDASSEMBLER_HPP_
00032 
00033 
00034 #include "MonodomainDg0Assembler.hpp"
00035 #include "AbstractLinearAssembler.hpp"
00036 
00037 // NOTE: MonodomainMatrixBasedAssembler is defined after MonodomainRhsMatrixAssembler
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 /* not used */,
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 /* not used */,
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_

Generated on Wed Mar 18 12:51:52 2009 for Chaste by  doxygen 1.5.5