Chaste
Release::2017.1
|
#include <AbstractPdeModifier.hpp>
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 |
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.
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.
pPde | A shared pointer to a linear PDE object (defaults to NULL) |
pBoundaryCondition | A shared pointer to an abstract boundary condition (defaults to NULL, corresponding to a constant boundary condition with value zero) |
isNeumannBoundaryCondition | Whether the boundary condition is Neumann (defaults to true) |
solution | solution vector (defaults to NULL) |
Definition at line 43 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mSolution.
|
virtual |
Destructor.
Definition at line 64 of file AbstractPdeModifier.cpp.
References PetscTools::Destroy(), AbstractPdeModifier< DIM >::mDeleteFeMesh, AbstractPdeModifier< DIM >::mpFeMesh, and AbstractPdeModifier< DIM >::mSolution.
boost::shared_ptr< AbstractBoundaryCondition< DIM > > AbstractPdeModifier< DIM >::GetBoundaryCondition | ( | ) |
Definition at line 83 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mpBoundaryCondition.
Referenced by ParabolicGrowingDomainPdeModifier< DIM >::UpdateSolutionVector().
TetrahedralMesh< DIM, DIM > * AbstractPdeModifier< DIM >::GetFeMesh | ( | ) | const |
Definition at line 140 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mpFeMesh.
bool AbstractPdeModifier< DIM >::GetOutputGradient | ( | ) |
Set whether to calculate and save the gradient of the solution to CellData.
Definition at line 226 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mOutputGradient.
boost::shared_ptr< AbstractLinearPde< DIM, DIM > > AbstractPdeModifier< DIM >::GetPde | ( | ) |
Definition at line 77 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mpPde.
Referenced by EllipticGrowingDomainPdeModifier< DIM >::SetupSolve(), EllipticGrowingDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), ParabolicBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), and EllipticBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep().
Vec AbstractPdeModifier< DIM >::GetSolution | ( | ) |
Definition at line 128 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mSolution.
Referenced by EllipticGrowingDomainPdeModifier< DIM >::serialize(), ParabolicGrowingDomainPdeModifier< DIM >::serialize(), ParabolicBoxDomainPdeModifier< DIM >::serialize(), and EllipticBoxDomainPdeModifier< DIM >::serialize().
Vec AbstractPdeModifier< DIM >::GetSolution | ( | ) | const |
Definition at line 134 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mSolution.
bool AbstractPdeModifier< DIM >::HasAveragedSourcePde | ( | ) |
Definition at line 107 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mpPde.
Referenced by AbstractPdeModifier< DIM >::SetUpSourceTermsForAveragedSourcePde().
bool AbstractPdeModifier< DIM >::IsNeumannBoundaryCondition | ( | ) |
Definition at line 89 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mIsNeumannBoundaryCondition.
Referenced by EllipticGrowingDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), ParabolicGrowingDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), ParabolicBoxDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), EllipticBoxDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), and ParabolicGrowingDomainPdeModifier< DIM >::UpdateSolutionVector().
|
virtual |
Overridden OutputSimulationModifierParameters() method.
Output any simulation modifier parameters to file.
rParamsFile | the file stream to which the parameters are output |
Implements AbstractCellBasedSimulationModifier< DIM, DIM >.
Reimplemented in ParabolicBoxDomainPdeModifier< DIM >, EllipticBoxDomainPdeModifier< DIM >, ParabolicGrowingDomainPdeModifier< DIM >, and EllipticGrowingDomainPdeModifier< DIM >.
Definition at line 244 of file AbstractPdeModifier.cpp.
References AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM >::OutputSimulationModifierParameters().
Referenced by AbstractGrowingDomainPdeModifier< DIM >::OutputSimulationModifierParameters(), and AbstractBoxDomainPdeModifier< DIM >::OutputSimulationModifierParameters().
std::string & AbstractPdeModifier< DIM >::rGetDependentVariableName | ( | ) |
Get the name of the dependent variable.
Definition at line 101 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mDependentVariableName.
|
inlineprivate |
Boost Serialization method for archiving/checkpointing. Archives the object and its member variables.
archive | The boost archive. |
version | The 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.
void AbstractPdeModifier< DIM >::SetDependentVariableName | ( | const std::string & | rName | ) |
Set the name of the dependent variable.
rName | the name. |
Definition at line 95 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mDependentVariableName.
void AbstractPdeModifier< DIM >::SetOutputGradient | ( | bool | outputGradient | ) |
Set whether to calculate and save the gradient of the solution to CellData.
outputGradient | whether to output the gradient |
Definition at line 232 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mOutputGradient.
void AbstractPdeModifier< DIM >::SetOutputSolutionAtPdeNodes | ( | bool | outputSolutionAtPdeNodes | ) |
Set mOutputSolutionAtPdeNodes.
outputSolutionAtPdeNodes | whether to output the PDE solution at each node of the FE mesh at output time steps |
Definition at line 238 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes.
|
virtual |
Overridden SetupSolve() method.
Set mOutputDirectory and, if mOutputSolutionAtPdeNodes is set to true, open mpVizPdeSolutionResultsFile. This method is overridden in subclasses.
rCellPopulation | reference to the cell population |
outputDirectory | the output directory, relative to where Chaste output is stored |
Reimplemented in AbstractBoxDomainPdeModifier< DIM >, EllipticBoxDomainPdeModifier< DIM >, ParabolicBoxDomainPdeModifier< DIM >, EllipticGrowingDomainPdeModifier< DIM >, and ParabolicGrowingDomainPdeModifier< DIM >.
Definition at line 146 of file AbstractPdeModifier.cpp.
References PetscTools::AmMaster(), AbstractPdeModifier< DIM >::mOutputDirectory, AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes, AbstractPdeModifier< DIM >::mpVizPdeSolutionResultsFile, and OutputFileHandler::OpenOutputFile().
Referenced by EllipticGrowingDomainPdeModifier< DIM >::SetupSolve(), ParabolicGrowingDomainPdeModifier< DIM >::SetupSolve(), and AbstractBoxDomainPdeModifier< DIM >::SetupSolve().
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.
pMesh | Pointer to a tetrahedral mesh |
pCellPdeElementMap | map between cells and elements |
Definition at line 114 of file AbstractPdeModifier.cpp.
References AbstractPdeModifier< DIM >::HasAveragedSourcePde(), and AbstractPdeModifier< DIM >::mpPde.
Referenced by ParabolicBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), and EllipticBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep().
|
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.
rCellPopulation | reference to the cell population |
Definition at line 162 of file AbstractPdeModifier.cpp.
References VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddPointData(), PetscTools::AmMaster(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), SimulationTime::GetTime(), SimulationTime::GetTimeStepsElapsed(), SimulationTime::Instance(), AbstractPdeModifier< DIM >::mDependentVariableName, AbstractPdeModifier< DIM >::mOutputDirectory, AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes, AbstractPdeModifier< DIM >::mpFeMesh, AbstractPdeModifier< DIM >::mSolution, and VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
Referenced by EllipticGrowingDomainPdeModifier< DIM >::SetupSolve(), ParabolicGrowingDomainPdeModifier< DIM >::SetupSolve(), ParabolicBoxDomainPdeModifier< DIM >::SetupSolve(), and EllipticBoxDomainPdeModifier< DIM >::SetupSolve().
|
virtual |
Overridden UpdateAtEndOfSolve() method.
If mOutputSolutionAtPdeNodes is set to true, close mpVizPdeSolutionResultsFile.
rCellPopulation | reference to the cell population |
Definition at line 214 of file AbstractPdeModifier.cpp.
References PetscTools::AmMaster(), AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes, and AbstractPdeModifier< DIM >::mpVizPdeSolutionResultsFile.
|
pure virtual |
Overridden UpdateAtEndOfTimeStep() method.
As this method is pure virtual, it must be overridden in subclasses.
rCellPopulation | reference to the cell population |
Implemented in EllipticBoxDomainPdeModifier< DIM >, ParabolicBoxDomainPdeModifier< DIM >, EllipticGrowingDomainPdeModifier< DIM >, and ParabolicGrowingDomainPdeModifier< DIM >.
|
friend |
Needed for serialization.
Definition at line 59 of file AbstractPdeModifier.hpp.
|
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(), AbstractGrowingDomainPdeModifier< DIM >::GenerateFeMesh(), and AbstractPdeModifier< DIM >::~AbstractPdeModifier().
|
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 >::rGetDependentVariableName(), AbstractPdeModifier< DIM >::serialize(), AbstractPdeModifier< DIM >::SetDependentVariableName(), ParabolicBoxDomainPdeModifier< DIM >::SetupInitialSolutionVector(), AbstractPdeModifier< DIM >::UpdateAtEndOfOutputTimeStep(), AbstractGrowingDomainPdeModifier< DIM >::UpdateCellData(), AbstractBoxDomainPdeModifier< DIM >::UpdateCellData(), and ParabolicGrowingDomainPdeModifier< DIM >::UpdateSolutionVector().
|
protected |
Whether the boundary condition is Neumann (false corresponds to a Dirichlet boundary condition).
Definition at line 99 of file AbstractPdeModifier.hpp.
Referenced by AbstractPdeModifier< DIM >::IsNeumannBoundaryCondition(), and AbstractPdeModifier< DIM >::serialize().
|
protected |
Store the output directory name.
Definition at line 114 of file AbstractPdeModifier.hpp.
Referenced by AbstractPdeModifier< DIM >::serialize(), AbstractPdeModifier< DIM >::SetupSolve(), and AbstractPdeModifier< DIM >::UpdateAtEndOfOutputTimeStep().
|
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 >::GetOutputGradient(), AbstractPdeModifier< DIM >::serialize(), AbstractPdeModifier< DIM >::SetOutputGradient(), AbstractGrowingDomainPdeModifier< DIM >::UpdateCellData(), and AbstractBoxDomainPdeModifier< DIM >::UpdateCellData().
|
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(), AbstractPdeModifier< DIM >::SetOutputSolutionAtPdeNodes(), AbstractPdeModifier< DIM >::SetupSolve(), AbstractPdeModifier< DIM >::UpdateAtEndOfOutputTimeStep(), and AbstractPdeModifier< DIM >::UpdateAtEndOfSolve().
|
protected |
Shared pointer to a boundary condition object.
Definition at line 92 of file AbstractPdeModifier.hpp.
Referenced by EllipticGrowingDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), ParabolicGrowingDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), ParabolicBoxDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), EllipticBoxDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), AbstractPdeModifier< DIM >::GetBoundaryCondition(), and AbstractPdeModifier< DIM >::serialize().
|
protected |
Pointer to the finite element mesh on which to solve the PDE.
Definition at line 111 of file AbstractPdeModifier.hpp.
Referenced by EllipticGrowingDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), ParabolicGrowingDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), ParabolicBoxDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), EllipticBoxDomainPdeModifier< DIM >::ConstructBoundaryConditionsContainer(), AbstractGrowingDomainPdeModifier< DIM >::GenerateFeMesh(), AbstractBoxDomainPdeModifier< DIM >::GenerateFeMesh(), AbstractPdeModifier< DIM >::GetFeMesh(), AbstractBoxDomainPdeModifier< DIM >::InitialiseCellPdeElementMap(), ParabolicBoxDomainPdeModifier< DIM >::SetupInitialSolutionVector(), AbstractPdeModifier< DIM >::UpdateAtEndOfOutputTimeStep(), EllipticGrowingDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), ParabolicGrowingDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), ParabolicBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), EllipticBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), AbstractGrowingDomainPdeModifier< DIM >::UpdateCellData(), AbstractBoxDomainPdeModifier< DIM >::UpdateCellData(), AbstractBoxDomainPdeModifier< DIM >::UpdateCellPdeElementMap(), ParabolicGrowingDomainPdeModifier< DIM >::UpdateSolutionVector(), and AbstractPdeModifier< DIM >::~AbstractPdeModifier().
|
protected |
Shared pointer to a linear PDE object.
Definition at line 87 of file AbstractPdeModifier.hpp.
Referenced by AbstractPdeModifier< DIM >::GetPde(), AbstractPdeModifier< DIM >::HasAveragedSourcePde(), AbstractPdeModifier< DIM >::serialize(), ParabolicGrowingDomainPdeModifier< DIM >::SetupSolve(), AbstractPdeModifier< DIM >::SetUpSourceTermsForAveragedSourcePde(), and ParabolicGrowingDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep().
|
protected |
File that the values of the PDE solution are written out to.
Definition at line 126 of file AbstractPdeModifier.hpp.
Referenced by AbstractPdeModifier< DIM >::SetupSolve(), and AbstractPdeModifier< DIM >::UpdateAtEndOfSolve().
|
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(), AbstractPdeModifier< DIM >::GetSolution(), ParabolicBoxDomainPdeModifier< DIM >::SetupInitialSolutionVector(), AbstractPdeModifier< DIM >::UpdateAtEndOfOutputTimeStep(), EllipticGrowingDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), ParabolicGrowingDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), ParabolicBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), EllipticBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), AbstractGrowingDomainPdeModifier< DIM >::UpdateCellData(), AbstractBoxDomainPdeModifier< DIM >::UpdateCellData(), ParabolicGrowingDomainPdeModifier< DIM >::UpdateSolutionVector(), and AbstractPdeModifier< DIM >::~AbstractPdeModifier().