Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
CellBasedEllipticPdeSolver< DIM > Class Template Reference

#include <CellBasedEllipticPdeSolver.hpp>

+ Inheritance diagram for CellBasedEllipticPdeSolver< DIM >:
+ Collaboration diagram for CellBasedEllipticPdeSolver< DIM >:

Public Member Functions

 CellBasedEllipticPdeSolver (TetrahedralMesh< DIM, DIM > *pMesh, AbstractLinearEllipticPde< DIM, DIM > *pPde, BoundaryConditionsContainer< DIM, DIM, 1 > *pBoundaryConditions)
 
virtual ~CellBasedEllipticPdeSolver ()
 
- Public Member Functions inherited from SimpleLinearEllipticSolver< DIM, DIM >
 SimpleLinearEllipticSolver (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, AbstractLinearEllipticPde< ELEMENT_DIM, SPACE_DIM > *pPde, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 1 > *pBoundaryConditions)
 
void InitialiseForSolve (Vec initialSolution=nullptr)
 
- Public Member Functions inherited from AbstractAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, 1, NORMAL >
 AbstractAssemblerSolverHybrid (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > *pBoundaryConditions)
 
virtual ~AbstractAssemblerSolverHybrid ()
 
void SetupGivenLinearSystem (Vec currentSolution, bool computeMatrix, LinearSystem *pLinearSystem)
 
- Public Member Functions inherited from AbstractFeVolumeIntegralAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, true, true, INTERPOLATION_LEVEL >
 AbstractFeVolumeIntegralAssembler (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)
 
virtual ~AbstractFeVolumeIntegralAssembler ()
 
- Public Member Functions inherited from AbstractFeAssemblerCommon< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX, INTERPOLATION_LEVEL >
 AbstractFeAssemblerCommon ()
 
void SetCurrentSolution (Vec currentSolution)
 
virtual ~AbstractFeAssemblerCommon ()
 
- Public Member Functions inherited from AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >
 AbstractFeAssemblerInterface ()
 
void SetMatrixToAssemble (Mat &rMatToAssemble, bool zeroMatrixBeforeAssembly=true)
 
void SetVectorToAssemble (Vec &rVecToAssemble, bool zeroVectorBeforeAssembly)
 
void Assemble ()
 
void AssembleMatrix ()
 
void AssembleVector ()
 
virtual ~AbstractFeAssemblerInterface ()
 
- Public Member Functions inherited from AbstractStaticLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, 1 >
 AbstractStaticLinearPdeSolver (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)
 
Vec Solve (Vec initialGuess=nullptr)
 
- Public Member Functions inherited from AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >
 AbstractLinearPdeSolver (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)
 
virtual ~AbstractLinearPdeSolver ()
 
virtual void PrepareForSetupLinearSystem (Vec currentSolution)
 
virtual void FinaliseLinearSystem (Vec currentSolution)
 
virtual void FollowingSolveLinearSystem (Vec currentSolution)
 
LinearSystemGetLinearSystem ()
 

Protected Member Functions

virtual c_vector< double, 1 *(DIM+1)> ComputeVectorTerm (c_vector< double, DIM+1 > &rPhi, c_matrix< double, DIM, DIM+1 > &rGradPhi, ChastePoint< DIM > &rX, c_vector< double, 1 > &rU, c_matrix< double, 1, DIM > &rGradU, Element< DIM, DIM > *pElement)
 
virtual c_matrix< double, 1 *(DIM+1), 1 *(DIM+1)> ComputeMatrixTerm (c_vector< double, DIM+1 > &rPhi, c_matrix< double, DIM, DIM+1 > &rGradPhi, ChastePoint< DIM > &rX, c_vector< double, 1 > &rU, c_matrix< double, 1, DIM > &rGradU, Element< DIM, DIM > *pElement)
 
void ResetInterpolatedQuantities ()
 
void IncrementInterpolatedQuantities (double phiI, const Node< DIM > *pNode)
 
void InitialiseForSolve (Vec initialSolution)
 
- Protected Member Functions inherited from SimpleLinearEllipticSolver< DIM, DIM >
virtual c_matrix< double, 1 *(ELEMENT_DIM+1), 1 *(ELEMENT_DIM+1)> ComputeMatrixTerm (c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, 1 > &rU, c_matrix< double, 1, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
 
virtual c_vector< double, 1 *(ELEMENT_DIM+1)> ComputeVectorTerm (c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, 1 > &rU, c_matrix< double, 1, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
 
void SetupLinearSystem (Vec currentSolution, bool computeMatrix)
 
- Protected Member Functions inherited from AbstractFeVolumeIntegralAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, true, true, INTERPOLATION_LEVEL >
void ComputeTransformedBasisFunctionDerivatives (const ChastePoint< ELEMENT_DIM > &rPoint, const c_matrix< double, ELEMENT_DIM, SPACE_DIM > &rInverseJacobian, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rReturnValue)
 
void DoAssemble ()
 
virtual c_matrix< double, PROBLEM_DIM *(ELEMENT_DIM+1), PROBLEM_DIM *(ELEMENT_DIM+1)> ComputeMatrixTerm (c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, PROBLEM_DIM > &rU, c_matrix< double, PROBLEM_DIM, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
 
virtual c_vector< double, PROBLEM_DIM *(ELEMENT_DIM+1)> ComputeVectorTerm (c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, PROBLEM_DIM > &rU, c_matrix< double, PROBLEM_DIM, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
 
virtual void AssembleOnElement (Element< ELEMENT_DIM, SPACE_DIM > &rElement, c_matrix< double, PROBLEM_DIM *(ELEMENT_DIM+1), PROBLEM_DIM *(ELEMENT_DIM+1) > &rAElem, c_vector< double, PROBLEM_DIM *(ELEMENT_DIM+1)> &rBElem)
 
virtual bool ElementAssemblyCriterion (Element< ELEMENT_DIM, SPACE_DIM > &rElement)
 
- Protected Member Functions inherited from AbstractFeAssemblerCommon< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX, INTERPOLATION_LEVEL >
virtual double GetCurrentSolutionOrGuessValue (unsigned nodeIndex, unsigned indexOfUnknown)
 
virtual void IncrementInterpolatedQuantities (double phiI, const Node< SPACE_DIM > *pNode)
 
virtual void IncrementInterpolatedGradientQuantities (const c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, unsigned phiIndex, const Node< SPACE_DIM > *pNode)
 

Private Attributes

double mConstantInUSourceTerm
 
double mLinearInUCoeffInSourceTerm
 

Additional Inherited Members

- Protected Types inherited from AbstractFeVolumeIntegralAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, true, true, INTERPOLATION_LEVEL >
typedef LinearBasisFunction< ELEMENT_DIM > BasisFunction
 
- Protected Attributes inherited from SimpleLinearEllipticSolver< DIM, DIM >
AbstractLinearEllipticPde< ELEMENT_DIM, SPACE_DIM > * mpEllipticPde
 
- Protected Attributes inherited from AbstractAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, 1, NORMAL >
NaturalNeumannSurfaceTermAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > mNaturalNeumannSurfaceTermAssembler
 
BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > * mpBoundaryConditions
 
- Protected Attributes inherited from AbstractFeVolumeIntegralAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, true, true, INTERPOLATION_LEVEL >
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
 
GaussianQuadratureRule< ELEMENT_DIM > * mpQuadRule
 
- Protected Attributes inherited from AbstractFeAssemblerCommon< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX, INTERPOLATION_LEVEL >
ReplicatableVector mCurrentSolutionOrGuessReplicated
 
- Protected Attributes inherited from AbstractFeAssemblerInterface< CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >
Vec mVectorToAssemble
 
Mat mMatrixToAssemble
 
bool mAssembleMatrix
 
bool mAssembleVector
 
bool mZeroMatrixBeforeAssembly
 
bool mZeroVectorBeforeAssembly
 
PetscInt mOwnershipRangeLo
 
PetscInt mOwnershipRangeHi
 
- Protected Attributes inherited from AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >
LinearSystemmpLinearSystem
 
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
 

Detailed Description

template<unsigned DIM>
class CellBasedEllipticPdeSolver< DIM >

A purpose-made elliptic solver that interpolates the source terms from node onto Gauss points, as for a cell-based simulation with PDEs the source will only be known at the cells (nodes), not the Gauss points.

Definition at line 48 of file CellBasedEllipticPdeSolver.hpp.

Constructor & Destructor Documentation

◆ CellBasedEllipticPdeSolver()

template<unsigned DIM>
CellBasedEllipticPdeSolver< DIM >::CellBasedEllipticPdeSolver ( TetrahedralMesh< DIM, DIM > *  pMesh,
AbstractLinearEllipticPde< DIM, DIM > *  pPde,
BoundaryConditionsContainer< DIM, DIM, 1 > *  pBoundaryConditions 
)

Constructor.

Parameters
pMeshpointer to the mesh
pPdepointer to the PDE
pBoundaryConditionspointer to the boundary conditions

Definition at line 39 of file CellBasedEllipticPdeSolver.cpp.

◆ ~CellBasedEllipticPdeSolver()

Destructor.

Definition at line 47 of file CellBasedEllipticPdeSolver.cpp.

Member Function Documentation

◆ ComputeMatrixTerm()

template<unsigned DIM>
c_matrix< double, 1 *(DIM+1), 1 *(DIM+1)> CellBasedEllipticPdeSolver< DIM >::ComputeMatrixTerm ( c_vector< double, DIM+1 > &  rPhi,
c_matrix< double, DIM, DIM+1 > &  rGradPhi,
ChastePoint< DIM > &  rX,
c_vector< double, 1 > &  rU,
c_matrix< double, 1, DIM > &  rGradU,
Element< DIM, DIM > *  pElement 
)
protectedvirtual

The SimpleLinearEllipticSolver version of this method is overloaded using the interpolated source term.

Parameters
rPhiThe basis functions, rPhi(i) = phi_i, i=1..numBases
rGradPhiBasis gradients, rGradPhi(i,j) = d(phi_j)/d(X_i)
rXThe point in space
rUThe unknown as a vector, u(i) = u_i
rGradUThe gradient of the unknown as a matrix, rGradU(i,j) = d(u_i)/d(X_j)
pElementPointer to the element
Returns
The matrix term for the stiffness matrix

Definition at line 64 of file CellBasedEllipticPdeSolver.cpp.

◆ ComputeVectorTerm()

template<unsigned DIM>
c_vector< double, 1 *(DIM+1)> CellBasedEllipticPdeSolver< DIM >::ComputeVectorTerm ( c_vector< double, DIM+1 > &  rPhi,
c_matrix< double, DIM, DIM+1 > &  rGradPhi,
ChastePoint< DIM > &  rX,
c_vector< double, 1 > &  rU,
c_matrix< double, 1, DIM > &  rGradU,
Element< DIM, DIM > *  pElement 
)
protectedvirtual

The SimpleLinearEllipticSolver version of this method is overloaded using the interpolated source term.

Parameters
rPhiThe basis functions, rPhi(i) = phi_i, i=1..numBases
rGradPhiBasis gradients, rGradPhi(i,j) = d(phi_j)/d(X_i)
rXThe point in space
rUThe unknown as a vector, u(i) = u_i
rGradUThe gradient of the unknown as a matrix, rGradU(i,j) = d(u_i)/d(X_j)
pElementPointer to the element
Returns
vector term.

Definition at line 52 of file CellBasedEllipticPdeSolver.cpp.

◆ IncrementInterpolatedQuantities()

template<unsigned DIM>
void CellBasedEllipticPdeSolver< DIM >::IncrementInterpolatedQuantities ( double  phiI,
const Node< DIM > *  pNode 
)
protected

Overridden IncrementInterpolatedQuantities() method.

Parameters
phiI
pNode

Definition at line 94 of file CellBasedEllipticPdeSolver.cpp.

◆ InitialiseForSolve()

template<unsigned DIM>
void CellBasedEllipticPdeSolver< DIM >::InitialiseForSolve ( Vec  initialSolution)
protectedvirtual

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.

Parameters
initialSolutionan initial guess

Reimplemented from AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

Definition at line 101 of file CellBasedEllipticPdeSolver.cpp.

References SimpleLinearEllipticSolver< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve().

◆ ResetInterpolatedQuantities()

template<unsigned DIM>
void CellBasedEllipticPdeSolver< DIM >::ResetInterpolatedQuantities ( void  )
protectedvirtual

Member Data Documentation

◆ mConstantInUSourceTerm

template<unsigned DIM>
double CellBasedEllipticPdeSolver< DIM >::mConstantInUSourceTerm
private

The constant in u part of the source term, interpolated onto the current point.

Definition at line 53 of file CellBasedEllipticPdeSolver.hpp.

◆ mLinearInUCoeffInSourceTerm

template<unsigned DIM>
double CellBasedEllipticPdeSolver< DIM >::mLinearInUCoeffInSourceTerm
private

The linear in u part of the source term, interpolated onto the current point.

Definition at line 56 of file CellBasedEllipticPdeSolver.hpp.


The documentation for this class was generated from the following files: