AbstractBidomainSolver.hpp
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
00031
00032
00033
00034
00035
00036 #ifndef ABSTRACTBIDOMAINSOLVER_HPP_
00037 #define ABSTRACTBIDOMAINSOLVER_HPP_
00038
00039 #include "AbstractDynamicLinearPdeSolver.hpp"
00040 #include "BidomainTissue.hpp"
00041 #include "HeartConfig.hpp"
00042
00048 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00049 class AbstractBidomainSolver : public AbstractDynamicLinearPdeSolver<ELEMENT_DIM,SPACE_DIM,2>
00050 {
00051 protected:
00053 bool mBathSimulation;
00054
00056 BidomainTissue<SPACE_DIM>* mpBidomainTissue;
00057
00059 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* mpBoundaryConditions;
00060
00062 bool mNullSpaceCreated;
00063
00065 HeartConfig* mpConfig;
00066
00070 std::vector<unsigned> mFixedExtracellularPotentialNodes;
00071
00077 unsigned mRowForAverageOfPhiZeroed;
00078
00085 void InitialiseForSolve(Vec initialSolution);
00086
00098 virtual void CheckCompatibilityCondition();
00099
00107 void PrepareForSetupLinearSystem(Vec existingSolution);
00108
00125 virtual void FinaliseLinearSystem(Vec existingSolution);
00126
00133 virtual Vec GenerateNullBasis() const;
00134
00148 void FinaliseForBath(bool computeMatrix, bool computeVector);
00149
00150 public:
00159 AbstractBidomainSolver(bool bathSimulation,
00160 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00161 BidomainTissue<SPACE_DIM>* pTissue,
00162 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBoundaryConditions);
00163
00167 virtual ~AbstractBidomainSolver();
00168
00179 void SetFixedExtracellularPotentialNodes(std::vector<unsigned> fixedExtracellularPotentialNodes);
00180
00187 void SetRowForAverageOfPhiZeroed(unsigned rowMeanPhiEZero);
00188
00192 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* GetBoundaryConditions()
00193 {
00194 return mpBoundaryConditions;
00195 }
00196
00202 void ResetBoundaryConditionsContainer(BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBcc)
00203 {
00204 assert(pBcc);
00205 mpBoundaryConditions = pBcc;
00206
00207
00208
00209 }
00210 };
00211
00212
00213
00214
00215 #endif