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 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 /* not used */,
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 /* not used */,
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_

Generated on Tue Aug 4 16:10:22 2009 for Chaste by  doxygen 1.5.5