#include <BidomainDg0Assembler.hpp>
Public Member Functions | |
BidomainDg0Assembler (AbstractMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, BidomainPde< SPACE_DIM > *pPde, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 2 > *pBcc, unsigned numQuadPoints=2) | |
void | SetFixedExtracellularPotentialNodes (std::vector< unsigned > fixedExtracellularPotentialNodes) |
void | SetRowForAverageOfPhiZeroed (unsigned rowMeanPhiEZero) |
Static Public Attributes | |
static const unsigned | E_DIM = ELEMENT_DIM |
static const unsigned | S_DIM = SPACE_DIM |
static const unsigned | P_DIM = 2u |
Protected Types | |
typedef BidomainDg0Assembler < ELEMENT_DIM, SPACE_DIM > | SelfType |
typedef AbstractLinearAssembler < ELEMENT_DIM, SPACE_DIM, 2, false, SelfType > | BaseClassType |
Protected Member Functions | |
void | ResetInterpolatedQuantities (void) |
void | InitialiseForSolve (Vec initialSolution) |
void | IncrementInterpolatedQuantities (double phi_i, const Node< SPACE_DIM > *pNode) |
virtual c_matrix< double, 2 *(ELEMENT_DIM+1), 2 *(ELEMENT_DIM+1)> | ComputeMatrixTerm (c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, ELEMENT_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, 2 > &u, c_matrix< double, 2, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement) |
virtual c_vector< double, 2 *(ELEMENT_DIM+1)> | ComputeVectorTerm (c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, ELEMENT_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, 2 > &u, c_matrix< double, 2, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement) |
virtual c_vector< double, 2 *ELEMENT_DIM > | ComputeVectorSurfaceTerm (const BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > &rSurfaceElement, c_vector< double, ELEMENT_DIM > &rPhi, ChastePoint< SPACE_DIM > &rX) |
virtual void | PrepareForAssembleSystem (Vec currentSolution, double time) |
virtual void | FinaliseAssembleSystem (Vec currentSolution, double currentTime) |
Protected Attributes | |
BidomainPde< SPACE_DIM > * | mpBidomainPde |
HeartConfig * | mpConfig |
double | mIionic |
double | mIIntracellularStimulus |
double | mIExtracellularStimulus |
bool | mNullSpaceCreated |
Vec | mExternalVoltageMask |
std::vector< unsigned > | mFixedExtracellularPotentialNodes |
unsigned | mRowForAverageOfPhiZeroed |
Friends | |
class | AbstractStaticAssembler< ELEMENT_DIM, SPACE_DIM, 2, false, SelfType > |
Allow the AbstractStaticAssembler to call our private/protected methods using static polymorphism. |
The 2 unknowns are voltage and extracellular potential.
This assembler interpolates quantities such as ionic currents and stimuli from their nodal values (obtained from a BidomainPde) onto a gauss point, and uses the interpolated values in assembly. The assembler also creates boundary conditions, which are zero-Neumann boundary conditions on the surface unless SetFixedExtracellularPotentialNodes() is called.
The user should call Solve() from the superclass AbstractDynamicAssemblerMixin.
NOTE: if any cells have a non-zero extracellular stimulus, phi_e must be fixed at some nodes (using SetFixedExtracellularPotentialNodes() ), else no solution is possible.
Definition at line 68 of file BidomainDg0Assembler.hpp.
BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::BidomainDg0Assembler | ( | AbstractMesh< ELEMENT_DIM, SPACE_DIM > * | pMesh, | |
BidomainPde< SPACE_DIM > * | pPde, | |||
BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 2 > * | pBcc, | |||
unsigned | numQuadPoints = 2 | |||
) | [inline] |
Constructor stores the mesh and pde and sets up boundary conditions.
Definition at line 294 of file BidomainDg0Assembler.cpp.
References AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditions, and AbstractStaticAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, NON_HEART, BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM > >::SetMesh().
void BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::ResetInterpolatedQuantities | ( | void | ) | [inline, protected, virtual] |
The concrete subclass can overload this and IncrementInterpolatedQuantities() if there are some quantities which need to be computed at each Gauss point. They are called in AssembleOnElement()
Reimplemented from AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Definition at line 37 of file BidomainDg0Assembler.cpp.
void BidomainDg0Assembler< 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.
Reimplemented from AbstractLinearAssembler< ELEMENT_DIM, SPACE_DIM, 2, false, BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM > >.
Definition at line 44 of file BidomainDg0Assembler.cpp.
References AbstractLinearAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, NON_HEART, CONCRETE >::InitialiseForSolve(), AbstractStaticAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, NON_HEART, BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM > >::mpLinearSystem, LinearSystem::SetAbsoluteTolerance(), LinearSystem::SetKspType(), LinearSystem::SetPcType(), and LinearSystem::SetRelativeTolerance().
void BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::IncrementInterpolatedQuantities | ( | double | phi_i, | |
const Node< SPACE_DIM > * | pNode | |||
) | [inline, protected, virtual] |
The concrete subclass can overload this and ResetInterpolatedQuantities() if there are some quantities which need to be computed at each Gauss point. They are called in AssembleOnElement()
Reimplemented from AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Definition at line 65 of file BidomainDg0Assembler.cpp.
References Node< SPACE_DIM >::GetIndex().
c_matrix< double, 2 *(ELEMENT_DIM+1), 2 *(ELEMENT_DIM+1)> BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::ComputeMatrixTerm | ( | c_vector< double, ELEMENT_DIM+1 > & | rPhi, | |
c_matrix< double, ELEMENT_DIM, ELEMENT_DIM+1 > & | rGradPhi, | |||
ChastePoint< SPACE_DIM > & | rX, | |||
c_vector< double, 2 > & | u, | |||
c_matrix< double, 2, SPACE_DIM > & | rGradU, | |||
Element< ELEMENT_DIM, SPACE_DIM > * | pElement | |||
) | [inline, protected, virtual] |
This method is called by AssembleOnElement() and tells the assembler the contribution to add to the element stiffness matrix.
Definition at line 75 of file BidomainDg0Assembler.cpp.
c_vector< double, 2 *(ELEMENT_DIM+1)> BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::ComputeVectorTerm | ( | c_vector< double, ELEMENT_DIM+1 > & | rPhi, | |
c_matrix< double, ELEMENT_DIM, ELEMENT_DIM+1 > & | rGradPhi, | |||
ChastePoint< SPACE_DIM > & | rX, | |||
c_vector< double, 2 > & | u, | |||
c_matrix< double, 2, SPACE_DIM > & | rGradU, | |||
Element< ELEMENT_DIM, SPACE_DIM > * | pElement | |||
) | [inline, protected, virtual] |
This method is called by AssembleOnElement() and tells the assembler the contribution to add to the element stiffness vector.
Definition at line 131 of file BidomainDg0Assembler.cpp.
c_vector< double, 2 *ELEMENT_DIM > BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::ComputeVectorSurfaceTerm | ( | const BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > & | rSurfaceElement, | |
c_vector< double, ELEMENT_DIM > & | rPhi, | |||
ChastePoint< SPACE_DIM > & | rX | |||
) | [inline, protected, virtual] |
This method returns the vector to be added to element stiffness vector for a given gauss point in BoundaryElement. The arguments are the bases, x and current solution computed at the Gauss point. The returned vector will be multiplied by the gauss weight and jacobian determinent and added to the element stiffness matrix (see AssembleOnElement()).
--This method has to be implemented in the concrete class--
rSurfaceElement | the element which is being considered. | |
rPhi | The basis functions, rPhi(i) = phi_i, i=1..numBases | |
rX | The point in space |
Implements AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Definition at line 160 of file BidomainDg0Assembler.cpp.
References BoundaryConditionsContainer< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::GetNeumannBCValue(), and AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditions.
void BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::PrepareForAssembleSystem | ( | Vec | currentSolution, | |
double | time | |||
) | [inline, protected, virtual] |
PrepareForAssembleSystem
Called at the beginning of AbstractLinearAssembler::AssembleSystem() after the system. Here, used to integrate cell odes.
Reimplemented from AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Definition at line 182 of file BidomainDg0Assembler.cpp.
void BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::FinaliseAssembleSystem | ( | Vec | currentSolution, | |
double | currentTime | |||
) | [inline, protected, virtual] |
FinaliseAssembleSystem
Called by AbstractLinearAssmebler::AssembleSystem() after the system has been assembled. 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.
Reimplemented from AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
Definition at line 188 of file BidomainDg0Assembler.cpp.
References LinearSystem::AssembleFinalLhsMatrix(), LinearSystem::AssembleRhsVector(), DistributedVector::Begin(), DistributedVector::CreateVec(), DistributedVector::End(), LinearSystem::GetSize(), AbstractStaticAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, NON_HEART, BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM > >::mpLinearSystem, DistributedVector::Restore(), LinearSystem::SetMatrixElement(), LinearSystem::SetNullBasis(), LinearSystem::SetRhsVectorElement(), and LinearSystem::ZeroMatrixRow().
void BidomainDg0Assembler< 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.
the | nodes to be fixed. |
Definition at line 331 of file BidomainDg0Assembler.cpp.
References BoundaryConditionsContainer< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::AddDirichletBoundaryCondition(), AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditions, and AbstractStaticAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, NON_HEART, BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM > >::mpMesh.
Referenced by BidomainProblem< DIM >::CreateAssembler().