Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
AbstractPdeModifier< DIM > Class Template Referenceabstract

#include <AbstractPdeModifier.hpp>

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

Public Member Functions

 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)
 
virtual ~AbstractPdeModifier ()
 
boost::shared_ptr< AbstractLinearPde< DIM, DIM > > GetPde ()
 
boost::shared_ptr< AbstractBoundaryCondition< DIM > > GetBoundaryCondition ()
 
bool IsNeumannBoundaryCondition ()
 
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
 
virtual void SetupSolve (AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory)
 
virtual void UpdateAtEndOfTimeStep (AbstractCellPopulation< DIM, DIM > &rCellPopulation)=0
 
virtual void UpdateAtEndOfOutputTimeStep (AbstractCellPopulation< DIM, DIM > &rCellPopulation)
 
virtual void UpdateAtEndOfSolve (AbstractCellPopulation< DIM, DIM > &rCellPopulation)
 
bool GetOutputGradient ()
 
void SetOutputGradient (bool outputGradient)
 
void SetOutputSolutionAtPdeNodes (bool outputSolutionAtPdeNodes)
 
void OutputSimulationModifierParameters (out_stream &rParamsFile)
 
- 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
 

Protected Attributes

boost::shared_ptr< AbstractLinearPde< DIM, DIM > > mpPde
 
boost::shared_ptr< AbstractBoundaryCondition< DIM > > mpBoundaryCondition
 
bool mIsNeumannBoundaryCondition
 
std::string mDependentVariableName
 
Vec mSolution
 
TetrahedralMesh< DIM, DIM > * mpFeMesh
 
std::string mOutputDirectory
 
bool mOutputGradient
 
bool mOutputSolutionAtPdeNodes
 
out_stream mpVizPdeSolutionResultsFile
 
bool mDeleteFeMesh
 

Private Member Functions

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

Friends

class boost::serialization::access
 

Detailed Description

template<unsigned DIM>
class AbstractPdeModifier< DIM >

An abstract modifier class containing functionality common to AbstractBoxDomainPdeModifier, AbstractGrowingDomainPdeModifier and their subclasses, which solve a linear elliptic or parabolic PDE coupled to a cell-based simulation.

Definition at line 54 of file AbstractPdeModifier.hpp.

Constructor & Destructor Documentation

◆ AbstractPdeModifier()

template<unsigned DIM>
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 
)

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)
solutionsolution vector (defaults to NULL)

Definition at line 43 of file AbstractPdeModifier.cpp.

References AbstractPdeModifier< DIM >::mSolution.

◆ ~AbstractPdeModifier()

template<unsigned DIM>
AbstractPdeModifier< DIM >::~AbstractPdeModifier ( )
virtual

Destructor.

Definition at line 64 of file AbstractPdeModifier.cpp.

References PetscTools::Destroy().

Member Function Documentation

◆ GetBoundaryCondition()

template<unsigned DIM>
boost::shared_ptr< AbstractBoundaryCondition< DIM > > AbstractPdeModifier< DIM >::GetBoundaryCondition ( )
Returns
mpBoundaryCondition

Definition at line 83 of file AbstractPdeModifier.cpp.

◆ GetFeMesh()

template<unsigned DIM>
TetrahedralMesh< DIM, DIM > * AbstractPdeModifier< DIM >::GetFeMesh ( ) const
Returns
mpFeMesh.

Definition at line 140 of file AbstractPdeModifier.cpp.

◆ GetOutputGradient()

template<unsigned DIM>
bool AbstractPdeModifier< DIM >::GetOutputGradient ( )

Set whether to calculate and save the gradient of the solution to CellData.

Returns
mOutputGradient

Definition at line 226 of file AbstractPdeModifier.cpp.

◆ GetPde()

template<unsigned DIM>
boost::shared_ptr< AbstractLinearPde< DIM, DIM > > AbstractPdeModifier< DIM >::GetPde ( )
Returns
mpPde

Definition at line 77 of file AbstractPdeModifier.cpp.

◆ GetSolution() [1/2]

template<unsigned DIM>
Vec AbstractPdeModifier< DIM >::GetSolution ( )
Returns
mSolution.

Definition at line 128 of file AbstractPdeModifier.cpp.

◆ GetSolution() [2/2]

template<unsigned DIM>
Vec AbstractPdeModifier< DIM >::GetSolution ( ) const
Returns
mSolution (used in archiving)

Definition at line 134 of file AbstractPdeModifier.cpp.

◆ HasAveragedSourcePde()

template<unsigned DIM>
bool AbstractPdeModifier< DIM >::HasAveragedSourcePde ( )
Returns
whether the PDE has an averaged source

Definition at line 107 of file AbstractPdeModifier.cpp.

◆ IsNeumannBoundaryCondition()

template<unsigned DIM>
bool AbstractPdeModifier< DIM >::IsNeumannBoundaryCondition ( )
Returns
mIsNeumannBoundaryCondition

Definition at line 89 of file AbstractPdeModifier.cpp.

◆ OutputSimulationModifierParameters()

◆ rGetDependentVariableName()

template<unsigned DIM>
std::string & AbstractPdeModifier< DIM >::rGetDependentVariableName ( )

Get the name of the dependent variable.

Returns
the name

Definition at line 101 of file AbstractPdeModifier.cpp.

◆ serialize()

template<unsigned DIM>
template<class Archive >
void AbstractPdeModifier< 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 68 of file AbstractPdeModifier.hpp.

References AbstractPdeModifier< DIM >::mDependentVariableName, AbstractPdeModifier< DIM >::mIsNeumannBoundaryCondition, AbstractPdeModifier< DIM >::mOutputDirectory, AbstractPdeModifier< DIM >::mOutputGradient, AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes, AbstractPdeModifier< DIM >::mpBoundaryCondition, and AbstractPdeModifier< DIM >::mpPde.

◆ SetDependentVariableName()

template<unsigned DIM>
void AbstractPdeModifier< DIM >::SetDependentVariableName ( const std::string &  rName)

Set the name of the dependent variable.

Parameters
rNamethe name.

Definition at line 95 of file AbstractPdeModifier.cpp.

◆ SetOutputGradient()

template<unsigned DIM>
void AbstractPdeModifier< DIM >::SetOutputGradient ( bool  outputGradient)

Set whether to calculate and save the gradient of the solution to CellData.

Parameters
outputGradientwhether to output the gradient

Definition at line 232 of file AbstractPdeModifier.cpp.

◆ SetOutputSolutionAtPdeNodes()

template<unsigned DIM>
void AbstractPdeModifier< DIM >::SetOutputSolutionAtPdeNodes ( bool  outputSolutionAtPdeNodes)

Set mOutputSolutionAtPdeNodes.

Parameters
outputSolutionAtPdeNodeswhether to output the PDE solution at each node of the FE mesh at output time steps

Definition at line 238 of file AbstractPdeModifier.cpp.

◆ SetupSolve()

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

Overridden SetupSolve() method.

Set mOutputDirectory and, if mOutputSolutionAtPdeNodes is set to true, open mpVizPdeSolutionResultsFile. This method is overridden in subclasses.

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

Reimplemented in AbstractBoxDomainPdeModifier< DIM >, EllipticBoxDomainPdeModifier< DIM >, EllipticGrowingDomainPdeModifier< DIM >, ParabolicBoxDomainPdeModifier< DIM >, and ParabolicGrowingDomainPdeModifier< DIM >.

Definition at line 146 of file AbstractPdeModifier.cpp.

References PetscTools::AmMaster(), and OutputFileHandler::OpenOutputFile().

Referenced by AbstractBoxDomainPdeModifier< DIM >::SetupSolve(), EllipticGrowingDomainPdeModifier< DIM >::SetupSolve(), and ParabolicGrowingDomainPdeModifier< DIM >::SetupSolve().

◆ SetUpSourceTermsForAveragedSourcePde()

template<unsigned DIM>
void AbstractPdeModifier< DIM >::SetUpSourceTermsForAveragedSourcePde ( TetrahedralMesh< DIM, DIM > *  pMesh,
std::map< CellPtr, unsigned > *  pCellPdeElementMap = nullptr 
)

In the case where the PDE has an averaged source, set the source terms using the information in the given mesh.

Parameters
pMeshPointer to a tetrahedral mesh
pCellPdeElementMapmap between cells and elements

Definition at line 114 of file AbstractPdeModifier.cpp.

◆ UpdateAtEndOfOutputTimeStep()

template<unsigned DIM>
void AbstractPdeModifier< DIM >::UpdateAtEndOfOutputTimeStep ( AbstractCellPopulation< DIM, DIM > &  rCellPopulation)
virtual

Overridden UpdateAtEndOfOutputTimeStep() method, after UpdateAtEndOfTimeStep() has been called.

Output the solution to the PDE at each cell to VTK and, if mOutputSolutionAtPdeNodes is set to true, output the solution to the PDE at each node of mpFeMesh to mpVizPdeSolutionResultsFile.

Parameters
rCellPopulationreference to the cell population

Definition at line 162 of file AbstractPdeModifier.cpp.

References VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddPointData(), PetscTools::AmMaster(), SimulationTime::GetTime(), SimulationTime::GetTimeStepsElapsed(), SimulationTime::Instance(), and VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().

◆ UpdateAtEndOfSolve()

template<unsigned DIM>
void AbstractPdeModifier< DIM >::UpdateAtEndOfSolve ( AbstractCellPopulation< DIM, DIM > &  rCellPopulation)
virtual

Overridden UpdateAtEndOfSolve() method.

If mOutputSolutionAtPdeNodes is set to true, close mpVizPdeSolutionResultsFile.

Parameters
rCellPopulationreference to the cell population

Definition at line 214 of file AbstractPdeModifier.cpp.

References PetscTools::AmMaster().

◆ UpdateAtEndOfTimeStep()

template<unsigned DIM>
virtual void AbstractPdeModifier< DIM >::UpdateAtEndOfTimeStep ( AbstractCellPopulation< DIM, DIM > &  rCellPopulation)
pure virtual

Overridden UpdateAtEndOfTimeStep() method.

As this method is pure virtual, it must be overridden in subclasses.

Parameters
rCellPopulationreference to the cell population

Implemented in EllipticBoxDomainPdeModifier< DIM >, EllipticGrowingDomainPdeModifier< DIM >, ParabolicBoxDomainPdeModifier< DIM >, and ParabolicGrowingDomainPdeModifier< DIM >.

Friends And Related Symbol Documentation

◆ boost::serialization::access

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

Needed for serialization.

Definition at line 59 of file AbstractPdeModifier.hpp.

Member Data Documentation

◆ mDeleteFeMesh

template<unsigned DIM>
bool AbstractPdeModifier< DIM >::mDeleteFeMesh
protected

Whether to delete the finite element mesh when we are destroyed.

Definition at line 131 of file AbstractPdeModifier.hpp.

Referenced by AbstractBoxDomainPdeModifier< DIM >::AbstractBoxDomainPdeModifier().

◆ mDependentVariableName

template<unsigned DIM>
std::string AbstractPdeModifier< DIM >::mDependentVariableName
protected

For use in PDEs where we know what the quantity for which we are solving is called, e.g. oxygen concentration.

Definition at line 105 of file AbstractPdeModifier.hpp.

Referenced by AbstractPdeModifier< DIM >::serialize().

◆ mIsNeumannBoundaryCondition

template<unsigned DIM>
bool AbstractPdeModifier< DIM >::mIsNeumannBoundaryCondition
protected

Whether the boundary condition is Neumann (false corresponds to a Dirichlet boundary condition).

Todo:
Generalize to allow mixed boundary conditions

Definition at line 99 of file AbstractPdeModifier.hpp.

Referenced by AbstractPdeModifier< DIM >::serialize().

◆ mOutputDirectory

template<unsigned DIM>
std::string AbstractPdeModifier< DIM >::mOutputDirectory
protected

Store the output directory name.

Definition at line 114 of file AbstractPdeModifier.hpp.

Referenced by AbstractPdeModifier< DIM >::serialize().

◆ mOutputGradient

template<unsigned DIM>
bool AbstractPdeModifier< DIM >::mOutputGradient
protected

Whether or not to calculate and output the gradient of the solution.

Definition at line 117 of file AbstractPdeModifier.hpp.

Referenced by AbstractPdeModifier< DIM >::serialize().

◆ mOutputSolutionAtPdeNodes

template<unsigned DIM>
bool AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes
protected

Whether to output the PDE solution at each node of the FE mesh at output time steps. Defaults to false.

Definition at line 123 of file AbstractPdeModifier.hpp.

Referenced by AbstractPdeModifier< DIM >::serialize().

◆ mpBoundaryCondition

template<unsigned DIM>
boost::shared_ptr<AbstractBoundaryCondition<DIM> > AbstractPdeModifier< DIM >::mpBoundaryCondition
protected

Shared pointer to a boundary condition object.

Definition at line 92 of file AbstractPdeModifier.hpp.

Referenced by AbstractPdeModifier< DIM >::serialize().

◆ mpFeMesh

template<unsigned DIM>
TetrahedralMesh<DIM,DIM>* AbstractPdeModifier< DIM >::mpFeMesh
protected

Pointer to the finite element mesh on which to solve the PDE.

Definition at line 111 of file AbstractPdeModifier.hpp.

◆ mpPde

template<unsigned DIM>
boost::shared_ptr<AbstractLinearPde<DIM,DIM> > AbstractPdeModifier< DIM >::mpPde
protected

Shared pointer to a linear PDE object.

Definition at line 87 of file AbstractPdeModifier.hpp.

Referenced by AbstractPdeModifier< DIM >::serialize().

◆ mpVizPdeSolutionResultsFile

template<unsigned DIM>
out_stream AbstractPdeModifier< DIM >::mpVizPdeSolutionResultsFile
protected

File that the values of the PDE solution are written out to.

Definition at line 126 of file AbstractPdeModifier.hpp.

◆ mSolution

template<unsigned DIM>
Vec AbstractPdeModifier< DIM >::mSolution
protected

The solution to the PDE problem at the current time step.

Definition at line 108 of file AbstractPdeModifier.hpp.

Referenced by AbstractPdeModifier< DIM >::AbstractPdeModifier().


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