Chaste  Release::2017.1
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

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.

Member Function Documentation

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

Definition at line 140 of file AbstractPdeModifier.cpp.

References AbstractPdeModifier< DIM >::mpFeMesh.

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.

References AbstractPdeModifier< DIM >::mOutputGradient.

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

Definition at line 134 of file AbstractPdeModifier.cpp.

References AbstractPdeModifier< DIM >::mSolution.

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

Definition at line 107 of file AbstractPdeModifier.cpp.

References AbstractPdeModifier< DIM >::mpPde.

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

template<unsigned DIM>
void AbstractPdeModifier< DIM >::OutputSimulationModifierParameters ( out_stream &  rParamsFile)
virtual
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.

References AbstractPdeModifier< DIM >::mDependentVariableName.

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.

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.

References AbstractPdeModifier< DIM >::mDependentVariableName.

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.

References AbstractPdeModifier< DIM >::mOutputGradient.

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.

References AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes.

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 >, 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().

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.

References AbstractPdeModifier< DIM >::HasAveragedSourcePde(), and AbstractPdeModifier< DIM >::mpPde.

Referenced by ParabolicBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep(), and EllipticBoxDomainPdeModifier< DIM >::UpdateAtEndOfTimeStep().

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(), AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes, and AbstractPdeModifier< DIM >::mpVizPdeSolutionResultsFile.

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 >, ParabolicBoxDomainPdeModifier< DIM >, EllipticGrowingDomainPdeModifier< DIM >, and ParabolicGrowingDomainPdeModifier< DIM >.

Friends And Related Function Documentation

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

Needed for serialization.

Definition at line 59 of file AbstractPdeModifier.hpp.

Member Data Documentation

template<unsigned DIM>
bool AbstractPdeModifier< DIM >::mDeleteFeMesh
protected
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 >::IsNeumannBoundaryCondition(), and AbstractPdeModifier< DIM >::serialize().

template<unsigned DIM>
std::string AbstractPdeModifier< DIM >::mOutputDirectory
protected
template<unsigned DIM>
bool AbstractPdeModifier< DIM >::mOutputSolutionAtPdeNodes
protected
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.

Referenced by AbstractPdeModifier< DIM >::SetupSolve(), and AbstractPdeModifier< DIM >::UpdateAtEndOfSolve().


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