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 #ifndef ABSTRACTBIDOMAINSOLVER_HPP_
00030 #define ABSTRACTBIDOMAINSOLVER_HPP_
00031
00032 #include "AbstractDynamicLinearPdeSolver.hpp"
00033 #include "BidomainTissue.hpp"
00034 #include "HeartConfig.hpp"
00035 #include "BidomainAssembler.hpp"
00036
00042 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00043 class AbstractBidomainSolver : public AbstractDynamicLinearPdeSolver<ELEMENT_DIM,SPACE_DIM,2>
00044 {
00045 protected:
00047 bool mBathSimulation;
00048
00050 BidomainTissue<SPACE_DIM>* mpBidomainTissue;
00051
00053 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* mpBoundaryConditions;
00054
00060 BidomainAssembler<ELEMENT_DIM,SPACE_DIM>* mpBidomainAssembler;
00061
00066 unsigned mNumQuadPoints;
00067
00069 bool mNullSpaceCreated;
00070
00072 HeartConfig* mpConfig;
00073
00077 std::vector<unsigned> mFixedExtracellularPotentialNodes;
00078
00084 unsigned mRowForAverageOfPhiZeroed;
00085
00092 void InitialiseForSolve(Vec initialSolution);
00093
00105 virtual void CheckCompatibilityCondition();
00106
00114 void PrepareForSetupLinearSystem(Vec existingSolution);
00115
00132 virtual void FinaliseLinearSystem(Vec existingSolution);
00133
00140 virtual Vec GenerateNullBasis() const;
00141
00155 void FinaliseForBath(bool computeMatrix, bool computeVector);
00156
00157 public:
00167 AbstractBidomainSolver(bool bathSimulation,
00168 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00169 BidomainTissue<SPACE_DIM>* pTissue,
00170 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBoundaryConditions,
00171 unsigned numQuadPoints = 2);
00172
00176 virtual ~AbstractBidomainSolver();
00177
00188 void SetFixedExtracellularPotentialNodes(std::vector<unsigned> fixedExtracellularPotentialNodes);
00189
00196 void SetRowForAverageOfPhiZeroed(unsigned rowMeanPhiEZero);
00197
00201 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* GetBoundaryConditions()
00202 {
00203 return mpBoundaryConditions;
00204 }
00205
00211 void ResetBoundaryConditionsContainer(BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBcc)
00212 {
00213 assert(pBcc);
00214 mpBoundaryConditions = pBcc;
00215
00216
00217
00218
00219
00220
00221
00222 }
00223 };
00224
00225
00226
00227
00228 #endif