#include <AbstractExtendedBidomainSolver.hpp>
Inherits AbstractDynamicLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, 3 >.
Abstract class with shared functionalities for different extended bidomain solvers.
Definition at line 43 of file AbstractExtendedBidomainSolver.hpp.
AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::AbstractExtendedBidomainSolver | ( | bool | bathSimulation, | |
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * | pMesh, | |||
ExtendedBidomainTissue< SPACE_DIM > * | pTissue, | |||
BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 3 > * | pBcc, | |||
unsigned | numQuadPoints = 2 | |||
) | [inline] |
Constructor stores the mesh and pde and sets up boundary conditions.
bathSimulation | Whether the simulation has a perfusing bath | |
pMesh | pointer to the mesh | |
pTissue | pointer to the PDE | |
pBcc | pointer to the boundary conditions container | |
numQuadPoints | number of quadrature points (defaults to 2) |
Definition at line 198 of file AbstractExtendedBidomainSolver.cpp.
References HeartConfig::Instance(), AbstractDynamicLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, 3 >::mMatrixIsConstant, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mNullSpaceCreated, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpConfig, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpExtendedBidomainAssembler, and AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mRowForAverageOfPhiZeroed.
AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::~AbstractExtendedBidomainSolver | ( | ) | [inline, virtual] |
Destructor.
Definition at line 225 of file AbstractExtendedBidomainSolver.cpp.
void AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition | ( | ) | [inline, protected, virtual] |
Checks whether the linear system will have a solution (if so, infinite solutions) instead of zero solutions. The condition is, if the linear system is Ax=b, that sum b_i over for all the PHI_E components (ie i=2,5,8,..) is zero.
This check is not made if running in parallel, or in debug mode.
The reason why the sum must be zero: the Fredholm alternative states that a singular system Ax=b has a solution if and only if v.b=0 for all v in ker(A) (ie all v such that Av=b). The nullspace ker(A) is one dimensional with basis vector v = (0,0,1,0,0,1....0,0,1), so v.b = sum_{i=2,5,8..} b_i.
Definition at line 162 of file AbstractExtendedBidomainSolver.cpp.
References DistributedVector::Begin(), DistributedVector::End(), EXCEPTION, AbstractBoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::HasDirichletBoundaryConditions(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpBoundaryConditions, AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpLinearSystem, AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mRowForAverageOfPhiZeroed, and LinearSystem::rGetRhsVector().
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseLinearSystem().
void AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseLinearSystem | ( | Vec | existingSolution | ) | [inline, protected, virtual] |
FinaliseAssembleSystem
Called at the end of SetupLinearSystem(), before the system is solver Here, used to avoid problems with phi_e drifting by one of 3 methods: pinning nodes, using a null space, or using an "average phi_e = 0" row.
existingSolution | Solution at current time |
Reimplemented from AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Definition at line 108 of file AbstractExtendedBidomainSolver.cpp.
References AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), LinearSystem::FinaliseLhsMatrix(), LinearSystem::FinaliseRhsVector(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), LinearSystem::GetSize(), AbstractBoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::HasDirichletBoundaryConditions(), AbstractDynamicLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, 3 >::mMatrixIsAssembled, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mNullSpaceCreated, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpBoundaryConditions, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpConfig, AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpLinearSystem, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mRowForAverageOfPhiZeroed, HeartConfig::SetKSPSolver(), LinearSystem::SetKspType(), LinearSystem::SetMatrixElement(), LinearSystem::SetNullBasis(), LinearSystem::SetRhsVectorElement(), and LinearSystem::ZeroMatrixRowsWithValueOnDiagonal().
Vec AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis | ( | ) | const [inline, protected, virtual] |
GenerateNullBasis
Called by FinaliseAssembleSystem to get the null basis to use for the particular formulation of the extended idomain equations used.
Definition at line 82 of file AbstractExtendedBidomainSolver.cpp.
References DistributedVector::Begin(), DistributedVectorFactory::CreateDistributedVector(), DistributedVectorFactory::CreateVec(), DistributedVector::End(), AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, and DistributedVector::Restore().
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseLinearSystem().
BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,3>* AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GetBoundaryConditions | ( | ) | [inline] |
Get the boundary conditions being used
Definition at line 187 of file AbstractExtendedBidomainSolver.hpp.
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetFixedExtracellularPotentialNodes().
void AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve | ( | Vec | initialSolution | ) | [inline, protected, virtual] |
Create the linear system object if it hasn't been already. Can use an initial solution as PETSc template, or base it on the mesh size.
initialSolution | an initial guess |
Reimplemented from AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Reimplemented in ExtendedBidomainSolver< ELEM_DIM, SPACE_DIM >.
Definition at line 32 of file AbstractExtendedBidomainSolver.cpp.
References HeartConfig::GetAbsoluteTolerance(), HeartConfig::GetRelativeTolerance(), HeartConfig::Instance(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpConfig, AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpLinearSystem, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mRowForAverageOfPhiZeroed, LinearSystem::SetAbsoluteTolerance(), LinearSystem::SetKspType(), LinearSystem::SetMatrixIsSymmetric(), LinearSystem::SetPcType(), and LinearSystem::SetRelativeTolerance().
void AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::PrepareForSetupLinearSystem | ( | Vec | existingSolution | ) | [inline, protected, virtual] |
PrepareForSetupLinearSystem
Called at the beginning of SetupLinearSystem(). Here, used to integrate cell model odes.
existingSolution | is the voltage to feed into the cell models |
Reimplemented from AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Definition at line 74 of file AbstractExtendedBidomainSolver.cpp.
References PdeSimulationTime::GetPdeTimeStep(), PdeSimulationTime::GetTime(), and AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpExtendedBidomainTissue.
void AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetFixedExtracellularPotentialNodes | ( | std::vector< unsigned > | fixedExtracellularPotentialNodes | ) | [inline] |
Set the nodes at which phi_e (the extracellular potential) is fixed to zero. This does not necessarily have to be called. If it is not, phi_e is only defined up to a constant.
fixedExtracellularPotentialNodes | the nodes to be fixed. |
NOTE: currently, the value of phi_e at the fixed nodes cannot be set to be anything other than zero.
Definition at line 230 of file AbstractExtendedBidomainSolver.cpp.
References BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AddDirichletBoundaryCondition(), EXCEPTION, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GetBoundaryConditions(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mFixedExtracellularPotentialNodes, AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpBoundaryConditions, AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, and AbstractBoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ResetDirichletCommunication().
Referenced by ExtendedBidomainProblem< DIM >::CreateSolver().
void AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetRowForAverageOfPhiZeroed | ( | unsigned | rowMeanPhiEZero | ) | [inline] |
Used when removing a single row to resolve singularity and replacing it with a constraint on the average phi_e being zero. It is set from the problem class.
rowMeanPhiEZero | indicates the row of the matrix to be replaced. |
Definition at line 262 of file AbstractExtendedBidomainSolver.cpp.
References EXCEPTION, and AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mRowForAverageOfPhiZeroed.
Referenced by ExtendedBidomainProblem< DIM >::CreateSolver().
bool AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mBathSimulation [protected] |
Whether the simulation involves a perfusing bath
Definition at line 50 of file AbstractExtendedBidomainSolver.hpp.
std::vector<unsigned> AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mFixedExtracellularPotentialNodes [protected] |
Used when pinning nodes to resolve singularity. This vector indicates the global indices of the nodes to be pinned
Definition at line 81 of file AbstractExtendedBidomainSolver.hpp.
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetFixedExtracellularPotentialNodes().
bool AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mNullSpaceCreated [protected] |
Used when intialising null-space solver to resolve singularity
Definition at line 75 of file AbstractExtendedBidomainSolver.hpp.
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::AbstractExtendedBidomainSolver(), and AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseLinearSystem().
unsigned AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mNumQuadPoints [protected] |
Number of quadrature points per dimension (only saved so it can be passed to the assembler)
Definition at line 63 of file AbstractExtendedBidomainSolver.hpp.
BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,3>* AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpBoundaryConditions [protected] |
Boundary conditions
Definition at line 57 of file AbstractExtendedBidomainSolver.hpp.
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseLinearSystem(), AbstractExtendedBidomainSolver< DIM, DIM >::GetBoundaryConditions(), and AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetFixedExtracellularPotentialNodes().
HeartConfig* AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpConfig [protected] |
Local cache of the configuration singleton instance
Definition at line 72 of file AbstractExtendedBidomainSolver.hpp.
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::AbstractExtendedBidomainSolver(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseLinearSystem(), and AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve().
ExtendedBidomainAssembler<ELEMENT_DIM,SPACE_DIM>* AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpExtendedBidomainAssembler [protected] |
The extended bidomain assembler, used to set up the LHS matrix, (but not used to set uo the RHS)
Reimplemented in ExtendedBidomainSolver< ELEM_DIM, SPACE_DIM >.
Definition at line 69 of file AbstractExtendedBidomainSolver.hpp.
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::AbstractExtendedBidomainSolver().
ExtendedBidomainTissue<SPACE_DIM>* AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpExtendedBidomainTissue [protected] |
The tissue object over which to solve the equation
Definition at line 54 of file AbstractExtendedBidomainSolver.hpp.
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::PrepareForSetupLinearSystem().
unsigned AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mRowForAverageOfPhiZeroed [protected] |
Used when removing a single row to resolve singularity and replacing it with a constraint on the average phi_e being zero. This number indicates the row of the matrix to be replaced. This is INT_MAX if unset. It is set from the problem class.
Definition at line 89 of file AbstractExtendedBidomainSolver.hpp.
Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::AbstractExtendedBidomainSolver(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseLinearSystem(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), and AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetRowForAverageOfPhiZeroed().