Chaste Commit::30a3e656d4b131f8c595cc6eb2becd297337570f
EllipticBoxDomainPdeModifier< DIM > Class Template Reference

#include <EllipticBoxDomainPdeModifier.hpp>

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

Public Member Functions

 EllipticBoxDomainPdeModifier (boost::shared_ptr< AbstractLinearPde< DIM, DIM > > pPde=boost::shared_ptr< AbstractLinearPde< DIM, DIM > >(), boost::shared_ptr< AbstractBoundaryCondition< DIM > > pBoundaryCondition=boost::shared_ptr< AbstractBoundaryCondition< DIM > >(), bool isNeumannBoundaryCondition=true, boost::shared_ptr< ChasteCuboid< DIM > > pMeshCuboid=boost::shared_ptr< ChasteCuboid< DIM > >(), double stepSize=1.0, Vec solution=nullptr)
 
 ~EllipticBoxDomainPdeModifier () override=default
 
void UpdateAtEndOfTimeStep (AbstractCellPopulation< DIM, DIM > &rCellPopulation) override
 
void SetupSolve (AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory) override
 
virtual std::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 1 > > ConstructBoundaryConditionsContainer (AbstractCellPopulation< DIM, DIM > &rCellPopulation)
 
void OutputSimulationModifierParameters (out_stream &rParamsFile) override
 
- Public Member Functions inherited from AbstractBoxDomainPdeModifier< DIM >
 AbstractBoxDomainPdeModifier (boost::shared_ptr< AbstractLinearPde< DIM, DIM > > pPde=boost::shared_ptr< AbstractLinearPde< DIM, DIM > >(), boost::shared_ptr< AbstractBoundaryCondition< DIM > > pBoundaryCondition=boost::shared_ptr< AbstractBoundaryCondition< DIM > >(), bool isNeumannBoundaryCondition=true, boost::shared_ptr< ChasteCuboid< DIM > > pMeshCuboid=boost::shared_ptr< ChasteCuboid< DIM > >(), double stepSize=1.0, Vec solution=nullptr)
 
 ~AbstractBoxDomainPdeModifier () override=default
 
double GetStepSize () const
 
void SetBcsOnBoxBoundary (bool setBcsOnBoxBoundary)
 
bool AreBcsSetOnBoxBoundary () const
 
void SetBcsOnBoundingSphere (bool setBcsOnBoundingSphere)
 
bool AreBcsSetOnBoundingSphere () const
 
void SetUseVoronoiCellsForInterpolation (bool useVoronoiCellsForInterpolation)
 
bool GetUseVoronoiCellsForInterpolation () const
 
void SetTypicalCellRadius (double typicalCellRadius)
 
double GetTypicalCellRadius () const
 
void ConstructBoundaryConditionsContainerHelper (AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 1 > > pBcc)
 
void SetupSolve (AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory) override
 
void GenerateFeMesh (boost::shared_ptr< ChasteCuboid< DIM > > pMeshCuboid, double stepSize)
 
void GenerateAndReturnFeMesh (boost::shared_ptr< ChasteCuboid< DIM > > pMeshCuboid, double stepSize, TetrahedralMesh< DIM, DIM > *pMesh)
 
void UpdateCellData (AbstractCellPopulation< DIM, DIM > &rCellPopulation)
 
void InitialiseCellPdeElementMap (AbstractCellPopulation< DIM, DIM > &rCellPopulation)
 
void UpdateCellPdeElementMap (AbstractCellPopulation< DIM, DIM > &rCellPopulation)
 
- Public Member Functions inherited from AbstractPdeModifier< DIM >
 AbstractPdeModifier (boost::shared_ptr< AbstractLinearPde< DIM, DIM > > pPde=NULL, boost::shared_ptr< AbstractBoundaryCondition< DIM > > pBoundaryCondition=boost::shared_ptr< AbstractBoundaryCondition< DIM > >(), bool isNeumannBoundaryCondition=true, Vec solution=nullptr)
 
 ~AbstractPdeModifier () override
 
boost::shared_ptr< AbstractLinearPde< DIM, DIM > > GetPde ()
 
boost::shared_ptr< AbstractBoundaryCondition< DIM > > GetBoundaryCondition ()
 
bool IsNeumannBoundaryCondition () const
 
void SetDependentVariableName (const std::string &rName)
 
std::string & rGetDependentVariableName ()
 
bool HasAveragedSourcePde ()
 
void SetUpSourceTermsForAveragedSourcePde (TetrahedralMesh< DIM, DIM > *pMesh, std::map< CellPtr, unsigned > *pCellPdeElementMap=nullptr)
 
Vec GetSolution ()
 
Vec GetSolution () const
 
TetrahedralMesh< DIM, DIM > * GetFeMesh () const
 
void SetupSolve (AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory) override
 
void UpdateAtEndOfOutputTimeStep (AbstractCellPopulation< DIM, DIM > &rCellPopulation) override
 
void UpdateAtEndOfSolve (AbstractCellPopulation< DIM, DIM > &rCellPopulation) override
 
bool GetOutputGradient () const
 
void SetOutputGradient (bool outputGradient)
 
void SetOutputSolutionAtPdeNodes (bool outputSolutionAtPdeNodes)
 
- Public Member Functions inherited from AbstractCellBasedSimulationModifier< DIM, DIM >
 AbstractCellBasedSimulationModifier ()
 
virtual ~AbstractCellBasedSimulationModifier ()
 
virtual void UpdateAtEndOfTimeStep (AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > &rCellPopulation)=0
 
virtual void UpdateAtEndOfOutputTimeStep (AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > &rCellPopulation)
 
virtual void SetupSolve (AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > &rCellPopulation, std::string outputDirectory)=0
 
virtual void UpdateAtEndOfSolve (AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > &rCellPopulation)
 
void OutputSimulationModifierInfo (out_stream &rParamsFile)
 
- Public Member Functions inherited from Identifiable
virtual ~Identifiable ()
 
std::string GetIdentifier () const
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Friends

class TestEllipticBoxDomainPdeModifier
 
class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from AbstractBoxDomainPdeModifier< DIM >
std::map< CellPtr, unsignedmCellPdeElementMap
 
boost::shared_ptr< ChasteCuboid< DIM > > mpMeshCuboid
 
double mStepSize
 
bool mSetBcsOnBoxBoundary
 
bool mSetBcsOnBoundingSphere
 
bool mUseVoronoiCellsForInterpolation
 
double mTypicalCellRadius
 
- Protected Attributes inherited from AbstractPdeModifier< DIM >
boost::shared_ptr< AbstractLinearPde< DIM, DIM > > mpPde
 
boost::shared_ptr< AbstractBoundaryCondition< DIM > > mpBoundaryCondition
 
bool mIsNeumannBoundaryCondition
 
std::string mDependentVariableName
 
Vec mSolution = nullptr
 
TetrahedralMesh< DIM, DIM > * mpFeMesh = nullptr
 
std::string mOutputDirectory {}
 
bool mOutputGradient = false
 
bool mOutputSolutionAtPdeNodes = false
 
out_stream mpVizPdeSolutionResultsFile
 
bool mDeleteFeMesh = false
 
std::vector< doublemIsDirichletBoundaryNode
 

Detailed Description

template<unsigned DIM>
class EllipticBoxDomainPdeModifier< DIM >

A modifier class in which a linear elliptic PDE coupled to a cell-based simulation is solved on a coarse domain.

The finite element mesh used to solve the PDE numerically is a fixed tessellation of a cuboid (box), which must be supplied to the constructor. The value of the dependent variable is interpolated between coarse mesh nodes to obtain a value at each cell, which is stored and updated in a CellData item.

At each time step the boundary condition supplied to the constructor may be imposed either on the boundary of the box domain, or on the boundary of the cell population (which is assumed to lie within the box domain). This choice can be made using the AbstractBoxDomainPdeModifier method SetBcsOnBoxBoundary(), which is inherited by this class.

Examples of PDEs in the source folder that can be solved using this class are AveragedSourceEllipticPde and UniformSourceEllipticPde.

Definition at line 65 of file EllipticBoxDomainPdeModifier.hpp.

Constructor & Destructor Documentation

◆ EllipticBoxDomainPdeModifier()

template<unsigned DIM>
EllipticBoxDomainPdeModifier< DIM >::EllipticBoxDomainPdeModifier ( boost::shared_ptr< AbstractLinearPde< DIM, DIM > >  pPde = boost::shared_ptr<AbstractLinearPde<DIM,DIM> >(),
boost::shared_ptr< AbstractBoundaryCondition< DIM > >  pBoundaryCondition = boost::shared_ptr<AbstractBoundaryCondition<DIM> >(),
bool  isNeumannBoundaryCondition = true,
boost::shared_ptr< ChasteCuboid< DIM > >  pMeshCuboid = boost::shared_ptr<ChasteCuboid<DIM> >(),
double  stepSize = 1.0,
Vec  solution = nullptr 
)

Constructor.

Parameters
pPdeA shared pointer to a linear PDE object (defaults to NULL)
pBoundaryConditionA shared pointer to an abstract boundary condition (defaults to NULL, corresponding to a constant boundary condition with value zero)
isNeumannBoundaryConditionWhether the boundary condition is Neumann (defaults to true)
pMeshCuboidA shared pointer to a ChasteCuboid specifying the outer boundary for the FE mesh (defaults to NULL)
stepSizestep size to be used in the FE mesh (defaults to 1.0, i.e. the default cell size)
solutionsolution vector (defaults to NULL)

Definition at line 40 of file EllipticBoxDomainPdeModifier.cpp.

◆ ~EllipticBoxDomainPdeModifier()

template<unsigned DIM>
EllipticBoxDomainPdeModifier< DIM >::~EllipticBoxDomainPdeModifier ( )
overridedefault

Destructor.

Member Function Documentation

◆ ConstructBoundaryConditionsContainer()

template<unsigned DIM>
std::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 1 > > EllipticBoxDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer ( AbstractCellPopulation< DIM, DIM > &  rCellPopulation)
virtual

Helper method to construct the boundary conditions container for the PDE.

Parameters
rCellPopulationreference to the cell population
Returns
the full boundary conditions container
Todo:
Replace this assertion with an exception in the constructor

Definition at line 95 of file EllipticBoxDomainPdeModifier.cpp.

◆ OutputSimulationModifierParameters()

template<unsigned DIM>
void EllipticBoxDomainPdeModifier< DIM >::OutputSimulationModifierParameters ( out_stream &  rParamsFile)
overridevirtual

Overridden OutputSimulationModifierParameters() method. Output any simulation modifier parameters to file.

Parameters
rParamsFilethe file stream to which the parameters are output

Reimplemented from AbstractBoxDomainPdeModifier< DIM >.

Definition at line 110 of file EllipticBoxDomainPdeModifier.cpp.

References AbstractBoxDomainPdeModifier< DIM >::OutputSimulationModifierParameters().

◆ serialize()

template<unsigned DIM>
template<class Archive >
void EllipticBoxDomainPdeModifier< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Boost Serialization method for archiving/checkpointing. Archives the object and its member variables.

Parameters
archiveThe boost archive.
versionThe current version of this class.

Definition at line 81 of file EllipticBoxDomainPdeModifier.hpp.

◆ SetupSolve()

template<unsigned DIM>
void EllipticBoxDomainPdeModifier< DIM >::SetupSolve ( AbstractCellPopulation< DIM, DIM > &  rCellPopulation,
std::string  outputDirectory 
)
override

Overridden SetupSolve() method.

Specifies what to do in the simulation before the start of the time loop.

Parameters
rCellPopulationreference to the cell population
outputDirectorythe output directory, relative to where Chaste output is stored

Definition at line 85 of file EllipticBoxDomainPdeModifier.cpp.

References AbstractBoxDomainPdeModifier< DIM >::SetupSolve().

◆ UpdateAtEndOfTimeStep()

template<unsigned DIM>
void EllipticBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep ( AbstractCellPopulation< DIM, DIM > &  rCellPopulation)
overridevirtual

Overridden UpdateAtEndOfTimeStep() method.

Specifies what to do in the simulation at the end of each time step.

Parameters
rCellPopulationreference to the cell population
Todo:
allow other PDE classes to be used with this modifier
Todo:
Use solution at previous time step as an initial guess for Solve()

Implements AbstractPdeModifier< DIM >.

Definition at line 56 of file EllipticBoxDomainPdeModifier.cpp.

References PetscTools::Destroy(), and AbstractStaticLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<unsigned DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 72 of file EllipticBoxDomainPdeModifier.hpp.

◆ TestEllipticBoxDomainPdeModifier

template<unsigned DIM>
friend class TestEllipticBoxDomainPdeModifier
friend

Definition at line 67 of file EllipticBoxDomainPdeModifier.hpp.


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