![]() |
Chaste Commit::333233612e3dcc941d260418acd7b5ccdc30390e
|
#include <BidomainSolver.hpp>
Private Member Functions | |
void | SetupLinearSystem (Vec currentSolution, bool computeMatrix) |
Private Attributes | |
Mat | mMassMatrix |
Vec | mVecForConstructingRhs |
BidomainAssembler< ELEMENT_DIM, SPACE_DIM > * | mpBidomainAssembler |
BidomainNeumannSurfaceTermAssembler< ELEMENT_DIM, SPACE_DIM > * | mpBidomainNeumannSurfaceTermAssembler |
BidomainCorrectionTermAssembler< ELEMENT_DIM, SPACE_DIM > * | mpBidomainCorrectionTermAssembler |
A bidomain solver, which uses various assemblers to set up the bidomain FEM linear system.
The discretised bidomain equation leads to the linear system (see FEM implementations document)
[ (chi*C/dt) M + K1 K1 ] [ V^{n+1} ] = [ (chi*C/dt) M V^{n} + M F^{n} + c1_surf ] [ K1 K2 ] [ PhiE^{n+1}] [ c2_surf ]
where chi is the surface-area to volume ratio, C the capacitance, dt the timestep M the mass matrix, K1 and K2 stiffness matrices, V^{n} and PhiE^{n} the vector of voltages and phi_e at time n, F^{n} the vector of (chi*Iionic + Istim) at each node, and c1_surf and c2_surf vectors arising from any surface stimuli (usually zero).
This solver uses two assemblers, one to assemble the whole LHS matrix, and also to compute c1_surf and c2_surf, and one to assemble the mass matrix M.
Also allows state variable interpolation (SVI) to be used on elements for which it will be needed, if the appropriate HeartConfig boolean is set. See https://chaste.github.io/docs/user-guides/state-variable-interpolation/ for more details on this. In this case the vector [c_correction, 0] is added to the above, and another assembler is used to create the c_correction.
Definition at line 80 of file BidomainSolver.hpp.
BidomainSolver< ELEMENT_DIM, SPACE_DIM >::BidomainSolver | ( | bool | bathSimulation, |
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * | pMesh, | ||
BidomainTissue< SPACE_DIM > * | pTissue, | ||
BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 2 > * | pBoundaryConditions | ||
) |
Constructor
bathSimulation | Whether the simulation involves a perfusing bath |
pMesh | pointer to the mesh |
pTissue | pointer to the tissue |
pBoundaryConditions | pointer to the boundary conditions |
Definition at line 200 of file BidomainSolver.cpp.
References HeartConfig::Instance(), BidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpBidomainAssembler, BidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpBidomainCorrectionTermAssembler, BidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpBidomainNeumannSurfaceTermAssembler, AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::mpBidomainTissue, AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, BidomainSolver< ELEMENT_DIM, SPACE_DIM >::mVecForConstructingRhs, and AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::SetCacheReplication().
BidomainSolver< ELEMENT_DIM, SPACE_DIM >::~BidomainSolver | ( | ) |
Definition at line 238 of file BidomainSolver.cpp.
|
virtual |
Overloaded InitialiseForSolve() which calls base version but also initialises mMassMatrix and mVecForConstructingRhs
initialSolution | initial solution |
Reimplemented from AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >.
Definition at line 43 of file BidomainSolver.cpp.
References AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), and PetscTools::SetupMat().
|
privatevirtual |
Implementation of SetupLinearSystem() which uses the assembler to compute the LHS matrix, but sets up the RHS vector using the mass-matrix (constructed using a separate assembler) multiplied by a vector
currentSolution | Solution at current time |
computeMatrix | Whether to compute the matrix of the linear system |
Implements AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Definition at line 65 of file BidomainSolver.cpp.
References AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::Assemble(), DistributedVector::Begin(), GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), DistributedVectorFactory::CreateDistributedVector(), DistributedVector::End(), GenericEventHandler< 16, HeartEventHandler >::EndEvent(), PetscMatTools::Finalise(), HeartConfig::GetCapacitance(), PdeSimulationTime::GetPdeTimeStepInverse(), HeartConfig::GetSurfaceAreaToVolumeRatio(), HeartConfig::Instance(), HeartRegionCode::IsRegionBath(), DistributedVector::Restore(), and AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::SetMatrixToAssemble().
|
private |
Mass matrix, used to computing the RHS vector (actually: mass-matrix in voltage-voltage block, zero elsewhere)
Definition at line 86 of file BidomainSolver.hpp.
|
private |
The bidomain assembler, used to set up the LHS matrix
Definition at line 95 of file BidomainSolver.hpp.
Referenced by BidomainSolver< ELEMENT_DIM, SPACE_DIM >::BidomainSolver().
|
private |
If using state variable interpolation, points to an assembler to use in computing the correction term to apply to the RHS.
Definition at line 104 of file BidomainSolver.hpp.
Referenced by BidomainSolver< ELEMENT_DIM, SPACE_DIM >::BidomainSolver().
|
private |
Assembler for surface integrals coming from any non-zero Neumann boundary conditions
Definition at line 98 of file BidomainSolver.hpp.
Referenced by BidomainSolver< ELEMENT_DIM, SPACE_DIM >::BidomainSolver().
|
private |
The vector multiplied by the mass matrix. Ie, if the linear system to be solved is Ax=b, this vector is z where b=Mz.
Definition at line 92 of file BidomainSolver.hpp.
Referenced by BidomainSolver< ELEMENT_DIM, SPACE_DIM >::BidomainSolver().