#include <CellBasedPdeHandler.hpp>
Inherits Identifiable.
A helper class, containing code for handling the numerical solution of one or more PDEs (using the finite element method) associated with a cell-based simulation object.
By letting AbstractCellBasedSimulation have a pointer to an object of this type as a member variable, we separate out all PDE-related functionality into this class, and thus obviate the need for specialized cell-based simulation subclasses.
Definition at line 51 of file CellBasedPdeHandler.hpp.
CellBasedPdeHandler< DIM >::CellBasedPdeHandler | ( | AbstractCellPopulation< DIM > * | pCellPopulation, | |
bool | deleteMemberPointersInDestructor = false | |||
) | [inline] |
Constructor.
pCellPopulation | pointer to a cell population | |
deleteMemberPointersInDestructor | whether to delete member pointers in the destructor (defaults to false) |
Definition at line 39 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mpCellPopulation.
CellBasedPdeHandler< DIM >::~CellBasedPdeHandler | ( | ) | [inline, virtual] |
Destructor.
Definition at line 57 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mDeleteMemberPointersInDestructor, CellBasedPdeHandler< DIM >::mpCoarsePdeMesh, and CellBasedPdeHandler< DIM >::mPdeAndBcCollection.
void CellBasedPdeHandler< DIM >::AddPdeAndBc | ( | PdeAndBoundaryConditions< DIM > * | pPdeAndBc | ) | [inline] |
Pass a PDE and associated boundary conditions to the simulation.
pPdeAndBc | a pointer to a PdeAndBoundaryConditions object |
Definition at line 91 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mPdeAndBcCollection.
void CellBasedPdeHandler< DIM >::CloseResultsFiles | ( | ) | [inline] |
Close results files. Called by AbstractCellBasedSimulation::AfterSolve().
Definition at line 180 of file CellBasedPdeHandler.cpp.
References PetscTools::AmMaster(), SimulationTime::Instance(), CellBasedPdeHandler< DIM >::mpAverageRadialPdeSolutionResultsFile, CellBasedPdeHandler< DIM >::mpVizPdeSolutionResultsFile, CellBasedPdeHandler< DIM >::mWriteAverageRadialPdeSolution, and CellBasedPdeHandler< DIM >::WriteAverageRadialPdeSolution().
unsigned CellBasedPdeHandler< DIM >::FindCoarseElementContainingCell | ( | CellPtr | pCell | ) | [inline] |
Find the index of the coarse mesh element containing a given cell.
pCell | the cell |
Definition at line 477 of file CellBasedPdeHandler.cpp.
References TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetContainingElementIndex(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), CellBasedPdeHandler< DIM >::mCellPdeElementMap, CellBasedPdeHandler< DIM >::mpCellPopulation, and CellBasedPdeHandler< DIM >::mpCoarsePdeMesh.
const AbstractCellPopulation< DIM > * CellBasedPdeHandler< DIM >::GetCellPopulation | ( | ) | const [inline] |
Get a pointer to the cell population.
Definition at line 79 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mpCellPopulation.
TetrahedralMesh< DIM, DIM > * CellBasedPdeHandler< DIM >::GetCoarsePdeMesh | ( | ) | [inline] |
Definition at line 85 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mpCoarsePdeMesh.
bool CellBasedPdeHandler< DIM >::GetImposeBcsOnCoarseBoundary | ( | ) | [inline] |
Definition at line 667 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mSetBcsOnCoarseBoundary.
unsigned CellBasedPdeHandler< DIM >::GetNumRadialIntervals | ( | ) | [inline] |
Definition at line 673 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mNumRadialIntervals.
Vec CellBasedPdeHandler< DIM >::GetPdeSolution | ( | unsigned | pdeIndex | ) | [inline, virtual] |
Get the solution to the PDE at this time step.
pdeIndex | The index of the PDE in the vector mPdeAndBcCollection |
Definition at line 97 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mPdeAndBcCollection.
bool CellBasedPdeHandler< DIM >::GetWriteAverageRadialPdeSolution | ( | ) | [inline] |
Definition at line 655 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mWriteAverageRadialPdeSolution.
bool CellBasedPdeHandler< DIM >::GetWriteDailyAverageRadialPdeSolution | ( | ) | [inline] |
Definition at line 661 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mWriteDailyAverageRadialPdeSolution.
void CellBasedPdeHandler< DIM >::InitialiseCellPdeElementMap | ( | ) | [inline, protected] |
Initialise mCellPdeElementMap.
This method is only called within SetupSolve(), but is written as a separate method for testing purposes.
Definition at line 104 of file CellBasedPdeHandler.cpp.
References EXCEPTION, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetContainingElementIndex(), CellBasedPdeHandler< DIM >::mCellPdeElementMap, CellBasedPdeHandler< DIM >::mpCellPopulation, and CellBasedPdeHandler< DIM >::mpCoarsePdeMesh.
Referenced by CellBasedPdeHandler< DIM >::OpenResultsFiles().
void CellBasedPdeHandler< DIM >::OpenResultsFiles | ( | std::string | outputDirectory | ) | [inline] |
Open results files and write initial conditions to file. Called by AbstractCellBasedSimulation::SetupSolve().
outputDirectory | the output directory, relative to where Chaste output is stored |
Definition at line 139 of file CellBasedPdeHandler.cpp.
References PetscTools::AmMaster(), EXCEPTION, SimulationTime::GetTime(), CellBasedPdeHandler< DIM >::InitialiseCellPdeElementMap(), SimulationTime::Instance(), CellBasedPdeHandler< DIM >::mpAverageRadialPdeSolutionResultsFile, CellBasedPdeHandler< DIM >::mpCellPopulation, CellBasedPdeHandler< DIM >::mpCoarsePdeMesh, CellBasedPdeHandler< DIM >::mpVizPdeSolutionResultsFile, CellBasedPdeHandler< DIM >::mWriteAverageRadialPdeSolution, OutputFileHandler::OpenOutputFile(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), and CellBasedPdeHandler< DIM >::WritePdeSolution().
void CellBasedPdeHandler< DIM >::OutputParameters | ( | out_stream & | rParamsFile | ) | [inline, virtual] |
Output parameters to file.
rParamsFile | the file stream to which the parameters are output |
Definition at line 679 of file CellBasedPdeHandler.cpp.
References Identifiable::GetIdentifier(), CellBasedPdeHandler< DIM >::mNumRadialIntervals, CellBasedPdeHandler< DIM >::mSetBcsOnCoarseBoundary, CellBasedPdeHandler< DIM >::mWriteAverageRadialPdeSolution, and CellBasedPdeHandler< DIM >::mWriteDailyAverageRadialPdeSolution.
void CellBasedPdeHandler< DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archive the member variables.
archive | the archive | |
version | the current version of this class |
Definition at line 68 of file CellBasedPdeHandler.hpp.
References CellBasedPdeHandler< DIM >::mNumRadialIntervals, CellBasedPdeHandler< DIM >::mPdeAndBcCollection, CellBasedPdeHandler< DIM >::mSetBcsOnCoarseBoundary, CellBasedPdeHandler< DIM >::mWriteAverageRadialPdeSolution, and CellBasedPdeHandler< DIM >::mWriteDailyAverageRadialPdeSolution.
void CellBasedPdeHandler< DIM >::SetImposeBcsOnCoarseBoundary | ( | bool | setBcsOnCoarseBoundary | ) | [inline] |
Impose the PDE boundary conditions on the edge of the cell population when using the coarse mesh. The default option is to impose the condition on the boundary of the coarse mesh.
setBcsOnCoarseBoundary | whether to impose the BCs on the edge of the cell population |
Definition at line 590 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mSetBcsOnCoarseBoundary.
void CellBasedPdeHandler< DIM >::SetWriteAverageRadialPdeSolution | ( | unsigned | numRadialIntervals = 10 , |
|
bool | writeDailyResults = false | |||
) | [inline] |
Write the final (and optionally also the daily) average radial PDE solution to file.
numRadialIntervals | The number of radial intervals in which the average PDE solution is calculated (defaults to 10) | |
writeDailyResults | Whether to record the average radial PDE solution at the end of each day of the simulation (defaults to false) |
Definition at line 582 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mNumRadialIntervals, CellBasedPdeHandler< DIM >::mWriteAverageRadialPdeSolution, and CellBasedPdeHandler< DIM >::mWriteDailyAverageRadialPdeSolution.
void CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile | ( | unsigned | samplingTimestepMultiple | ) | [inline, virtual] |
Solve the PDE and write the solution to file.
samplingTimestepMultiple | the ratio of the number of actual timesteps to the number of timesteps at which results are written to file. |
Definition at line 241 of file CellBasedPdeHandler.cpp.
References BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AddDirichletBoundaryCondition(), BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AddNeumannBoundaryCondition(), Element< ELEMENT_DIM, SPACE_DIM >::CalculateInterpolationWeights(), PdeAndBoundaryConditions< DIM >::DestroySolution(), EXCEPTION, PdeAndBoundaryConditions< DIM >::GetBoundaryCondition(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryNodeIteratorBegin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryNodeIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), PdeAndBoundaryConditions< DIM >::GetPde(), PdeAndBoundaryConditions< DIM >::GetSolution(), SimulationTime::GetTime(), SimulationTime::GetTimeStep(), SimulationTime::GetTimeStepsElapsed(), SimulationTime::Instance(), PdeAndBoundaryConditions< DIM >::IsNeumannBoundaryCondition(), CellBasedPdeHandler< DIM >::mCellPdeElementMap, CellBasedPdeHandler< DIM >::mpCellPopulation, CellBasedPdeHandler< DIM >::mpCoarsePdeMesh, CellBasedPdeHandler< DIM >::mPdeAndBcCollection, CellBasedPdeHandler< DIM >::mSetBcsOnCoarseBoundary, CellBasedPdeHandler< DIM >::mWriteDailyAverageRadialPdeSolution, PdeAndBoundaryConditions< DIM >::SetSolution(), PdeAndBoundaryConditions< DIM >::SetUpSourceTermsForAveragedSourcePde(), CellBasedPdeHandler< DIM >::UpdateCellPdeElementMap(), CellBasedPdeHandler< DIM >::WriteAverageRadialPdeSolution(), and CellBasedPdeHandler< DIM >::WritePdeSolution().
void CellBasedPdeHandler< DIM >::UpdateCellPdeElementMap | ( | ) | [inline] |
Update the mCellPdeElementMap
This method should be called before sending the element map to a PDE class to ensure map is up to date.
Definition at line 125 of file CellBasedPdeHandler.cpp.
References TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetContainingElementIndexWithInitialGuess(), CellBasedPdeHandler< DIM >::mCellPdeElementMap, CellBasedPdeHandler< DIM >::mpCellPopulation, and CellBasedPdeHandler< DIM >::mpCoarsePdeMesh.
Referenced by CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile().
void CellBasedPdeHandler< DIM >::UseCoarsePdeMesh | ( | double | stepSize, | |
double | meshWidth | |||
) | [inline, virtual] |
Solve the PDE problem on a coarse mesh.
stepSize | horizontal and vertical distance between mesh points | |
meshWidth | width and height of the mesh |
Definition at line 195 of file CellBasedPdeHandler.cpp.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructRegularSlabMesh(), EXCEPTION, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), CellBasedPdeHandler< DIM >::mpCellPopulation, CellBasedPdeHandler< DIM >::mpCoarsePdeMesh, CellBasedPdeHandler< DIM >::mPdeAndBcCollection, NEVER_REACHED, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::Translate().
void CellBasedPdeHandler< DIM >::WriteAverageRadialPdeSolution | ( | double | time | ) | [inline, protected] |
Write the average radial PDE solution to file at a specified time.
time | The time at which to record the average radial PDE solution |
Definition at line 596 of file CellBasedPdeHandler.cpp.
References CellBasedPdeHandler< DIM >::mNumRadialIntervals, and CellBasedPdeHandler< DIM >::mpCellPopulation.
Referenced by CellBasedPdeHandler< DIM >::CloseResultsFiles(), and CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile().
void CellBasedPdeHandler< DIM >::WritePdeSolution | ( | double | time | ) | [inline, protected, virtual] |
Write the PDE solution to file at a specified time.
time | The time at which to record the PDE solution |
Definition at line 509 of file CellBasedPdeHandler.cpp.
References PetscTools::AmMaster(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), PdeAndBoundaryConditions< DIM >::GetSolution(), CellBasedPdeHandler< DIM >::mpCellPopulation, CellBasedPdeHandler< DIM >::mpCoarsePdeMesh, and CellBasedPdeHandler< DIM >::mPdeAndBcCollection.
Referenced by CellBasedPdeHandler< DIM >::OpenResultsFiles(), and CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile().
friend class boost::serialization::access [friend] |
Needed for serialization.
Definition at line 60 of file CellBasedPdeHandler.hpp.
std::map<CellPtr, unsigned> CellBasedPdeHandler< DIM >::mCellPdeElementMap [protected] |
Map between cells and the elements of the coarse PDE mesh containing them.
Definition at line 107 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::FindCoarseElementContainingCell(), CellBasedPdeHandler< DIM >::InitialiseCellPdeElementMap(), CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile(), and CellBasedPdeHandler< DIM >::UpdateCellPdeElementMap().
bool CellBasedPdeHandler< DIM >::mDeleteMemberPointersInDestructor [protected] |
Whether to delete member pointers in the destructor. Used in archiving.
Definition at line 113 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::~CellBasedPdeHandler().
unsigned CellBasedPdeHandler< DIM >::mNumRadialIntervals [protected] |
Number of radial 'bins' used to calculate the average radial PDE solution.
Definition at line 101 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::GetNumRadialIntervals(), CellBasedPdeHandler< DIM >::OutputParameters(), CellBasedPdeHandler< DIM >::serialize(), CellBasedPdeHandler< DIM >::SetWriteAverageRadialPdeSolution(), and CellBasedPdeHandler< DIM >::WriteAverageRadialPdeSolution().
out_stream CellBasedPdeHandler< DIM >::mpAverageRadialPdeSolutionResultsFile [protected] |
File that the average radial PDE solution is written out to.
Definition at line 89 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::CloseResultsFiles(), and CellBasedPdeHandler< DIM >::OpenResultsFiles().
AbstractCellPopulation<DIM>* CellBasedPdeHandler< DIM >::mpCellPopulation [protected] |
Pointer to a cell population.
Definition at line 80 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::CellBasedPdeHandler(), CellBasedPdeHandler< DIM >::FindCoarseElementContainingCell(), CellBasedPdeHandler< DIM >::GetCellPopulation(), CellBasedPdeHandler< DIM >::InitialiseCellPdeElementMap(), CellBasedPdeHandler< DIM >::OpenResultsFiles(), CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile(), CellBasedPdeHandler< DIM >::UpdateCellPdeElementMap(), CellBasedPdeHandler< DIM >::UseCoarsePdeMesh(), CellBasedPdeHandler< DIM >::WriteAverageRadialPdeSolution(), and CellBasedPdeHandler< DIM >::WritePdeSolution().
TetrahedralMesh<DIM,DIM>* CellBasedPdeHandler< DIM >::mpCoarsePdeMesh [protected] |
Coarse mesh on which to solve the PDE.
Definition at line 104 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::FindCoarseElementContainingCell(), CellBasedPdeHandler< DIM >::GetCoarsePdeMesh(), CellBasedPdeHandler< DIM >::InitialiseCellPdeElementMap(), CellBasedPdeHandler< DIM >::OpenResultsFiles(), CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile(), CellBasedPdeHandler< DIM >::UpdateCellPdeElementMap(), CellBasedPdeHandler< DIM >::UseCoarsePdeMesh(), CellBasedPdeHandler< DIM >::WritePdeSolution(), and CellBasedPdeHandler< DIM >::~CellBasedPdeHandler().
std::vector<PdeAndBoundaryConditions<DIM>*> CellBasedPdeHandler< DIM >::mPdeAndBcCollection [protected] |
Vector of pointers to linear elliptic PDE objects with additional boundary condition information.
Definition at line 83 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::AddPdeAndBc(), CellBasedPdeHandler< DIM >::GetPdeSolution(), CellBasedPdeHandler< DIM >::serialize(), CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile(), CellBasedPdeHandler< DIM >::UseCoarsePdeMesh(), CellBasedPdeHandler< DIM >::WritePdeSolution(), and CellBasedPdeHandler< DIM >::~CellBasedPdeHandler().
out_stream CellBasedPdeHandler< DIM >::mpVizPdeSolutionResultsFile [protected] |
File that the values of the PDE solution are written out to.
Definition at line 86 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::CloseResultsFiles(), and CellBasedPdeHandler< DIM >::OpenResultsFiles().
bool CellBasedPdeHandler< DIM >::mSetBcsOnCoarseBoundary [protected] |
Whether to set the boundary condition on the edge of the coarse mesh rather than the cell population.
Definition at line 98 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::GetImposeBcsOnCoarseBoundary(), CellBasedPdeHandler< DIM >::OutputParameters(), CellBasedPdeHandler< DIM >::serialize(), CellBasedPdeHandler< DIM >::SetImposeBcsOnCoarseBoundary(), and CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile().
bool CellBasedPdeHandler< DIM >::mWriteAverageRadialPdeSolution [protected] |
Whether to write to file the average radial PDE solution.
Definition at line 92 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::CloseResultsFiles(), CellBasedPdeHandler< DIM >::GetWriteAverageRadialPdeSolution(), CellBasedPdeHandler< DIM >::OpenResultsFiles(), CellBasedPdeHandler< DIM >::OutputParameters(), CellBasedPdeHandler< DIM >::serialize(), and CellBasedPdeHandler< DIM >::SetWriteAverageRadialPdeSolution().
bool CellBasedPdeHandler< DIM >::mWriteDailyAverageRadialPdeSolution [protected] |
Whether to write the average radial PDE solution daily.
Definition at line 95 of file CellBasedPdeHandler.hpp.
Referenced by CellBasedPdeHandler< DIM >::GetWriteDailyAverageRadialPdeSolution(), CellBasedPdeHandler< DIM >::OutputParameters(), CellBasedPdeHandler< DIM >::serialize(), CellBasedPdeHandler< DIM >::SetWriteAverageRadialPdeSolution(), and CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile().