Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
|
#include <AbstractNumericalMethod.hpp>
Public Member Functions | |
AbstractNumericalMethod () | |
virtual | ~AbstractNumericalMethod () |
void | SetCellPopulation (AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM > *pPopulation) |
void | SetForceCollection (std::vector< boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > > *pForces) |
void | SetBoundaryConditions (std::vector< boost::shared_ptr< AbstractCellPopulationBoundaryCondition< ELEMENT_DIM, SPACE_DIM > > > *pBoundaryConditions) |
void | SetUseAdaptiveTimestep (bool useAdaptiveTimestep) |
void | SetUseUpdateNodeLocation (bool useUpdateNodeLocation) |
bool | GetUseUpdateNodeLocation () |
bool | HasAdaptiveTimestep () |
virtual void | UpdateAllNodePositions (double dt)=0 |
void | OutputNumericalMethodInfo (out_stream &rParamsFile) |
virtual void | OutputNumericalMethodParameters (out_stream &rParamsFile) |
Public Member Functions inherited from Identifiable | |
virtual | ~Identifiable () |
std::string | GetIdentifier () const |
Protected Member Functions | |
std::map< Node< SPACE_DIM > *, c_vector< double, SPACE_DIM > > | SaveCurrentNodeLocations () |
void | ImposeBoundaryConditions (std::map< Node< SPACE_DIM > *, c_vector< double, SPACE_DIM > > &rOldNodeLocations) |
std::vector< c_vector< double, SPACE_DIM > > | ComputeForcesIncludingDamping () |
std::vector< c_vector< double, SPACE_DIM > > | SaveCurrentLocations () |
void | SafeNodePositionUpdate (unsigned nodeIndex, c_vector< double, SPACE_DIM > newPosition) |
void | DetectStepSizeExceptions (unsigned nodeIndex, c_vector< double, SPACE_DIM > &displacement, double dt) |
Protected Attributes | |
AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM > * | mpCellPopulation |
std::vector< boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > > * | mpForceCollection |
std::vector< boost::shared_ptr< AbstractCellPopulationBoundaryCondition< ELEMENT_DIM, SPACE_DIM > > > * | mpBoundaryConditions |
bool | mUseAdaptiveTimestep |
bool | mUseUpdateNodeLocation |
bool | mGhostNodeForcesEnabled |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Friends | |
class | TestNumericalMethods |
class | boost::serialization::access |
An abstract class representing a numerical method for off lattice cell based simulations.
Numerical methods have access to the cell population and the force collection. The method is then responsible for evaluating forces at whatever times and positions are required, then updating all node positions.
Definition at line 56 of file AbstractNumericalMethod.hpp.
AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::AbstractNumericalMethod | ( | ) |
Constructor. No input parameters are required, allowing the numerical method to be created first, then passed to the simulation. The cell population and force collection pointers are then set by the simulation in its constructor.
Definition at line 45 of file AbstractNumericalMethod.cpp.
|
virtual |
Destructor.
Definition at line 56 of file AbstractNumericalMethod.cpp.
|
protected |
Computes and returns the force on each node, including the damping factor
Here we deal with the special case forces on ghost nodes. Note that 'particles' are dealt with like normal cells.
Definition at line 134 of file AbstractNumericalMethod.cpp.
|
protected |
Detects whether a node has exceeded the acceptable displacement for one timestep. If a step size exception has occurred, it either causes the simulation to terminate or, in adaptive simulations, the exception is caught and the step size is reduced in response.
nodeIndex | Index of the node being examined |
displacement | Displacement of the node this step |
dt | Time step size |
Definition at line 201 of file AbstractNumericalMethod.cpp.
bool AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::GetUseUpdateNodeLocation | ( | ) |
Get mUseUpdateNodeLocation.
Definition at line 232 of file AbstractNumericalMethod.cpp.
bool AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::HasAdaptiveTimestep | ( | ) |
Definition at line 101 of file AbstractNumericalMethod.cpp.
|
protected |
Helper method to apply boundary conditions. Used in higher order methods like RK4.
rOldNodeLocations | the node locations prior to being updated. |
Definition at line 122 of file AbstractNumericalMethod.cpp.
void AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::OutputNumericalMethodInfo | ( | out_stream & | rParamsFile | ) |
Saves the name of the numerical method to the parameters file
rParamsFile | Reference to the parameter output filestream |
Definition at line 238 of file AbstractNumericalMethod.cpp.
|
virtual |
Saves any additional numerical method details to the parameters file.
rParamsFile | Reference to the parameter output filestream |
Reimplemented in ForwardEulerNumericalMethod< ELEMENT_DIM, SPACE_DIM >.
Definition at line 248 of file AbstractNumericalMethod.cpp.
Referenced by ForwardEulerNumericalMethod< ELEMENT_DIM, SPACE_DIM >::OutputNumericalMethodParameters().
|
protected |
Updates a single node's position, taking into account periodic boundary conditions
nodeIndex | Index of the node to update |
newPosition | C_vector holding the new node position |
Definition at line 194 of file AbstractNumericalMethod.cpp.
|
protected |
Saves the current location of each cell in the population in a vector.
Definition at line 178 of file AbstractNumericalMethod.cpp.
|
protected |
Helper method to store the node locations used when applying the boundary conditions in higher order methods.
Definition at line 107 of file AbstractNumericalMethod.cpp.
|
inlineprivate |
Save or restore the simulation.
archive | the archive |
version | the current version of this class |
Definition at line 72 of file AbstractNumericalMethod.hpp.
References AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::mGhostNodeForcesEnabled, AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::mUseAdaptiveTimestep, and AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::mUseUpdateNodeLocation.
void AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::SetBoundaryConditions | ( | std::vector< boost::shared_ptr< AbstractCellPopulationBoundaryCondition< ELEMENT_DIM, SPACE_DIM > > > * | pBoundaryConditions | ) |
Sets the pointer to the boundary conditions applied by this method
pBoundaryConditions | Pointer to the simulation's boundary condition collection |
Definition at line 89 of file AbstractNumericalMethod.cpp.
void AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::SetCellPopulation | ( | AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM > * | pPopulation | ) |
Sets the pointer to the cell population updated by this method
pPopulation | Pointer to an AbstractOffLattice cell population |
Definition at line 61 of file AbstractNumericalMethod.cpp.
void AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::SetForceCollection | ( | std::vector< boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > > * | pForces | ) |
Sets the pointer to the force collection applied by this method
pForces | Pointer to the simulation's force collection |
Definition at line 83 of file AbstractNumericalMethod.cpp.
void AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::SetUseAdaptiveTimestep | ( | bool | useAdaptiveTimestep | ) |
Set mUseAdaptiveTimestep.
useAdaptiveTimestep | whether to use an adaptive time step |
Definition at line 95 of file AbstractNumericalMethod.cpp.
void AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::SetUseUpdateNodeLocation | ( | bool | useUpdateNodeLocation | ) |
Set mUseUpdateNodeLocation.
useUpdateNodeLocation | whether to use the population method UpdateNodeLocations() |
Definition at line 226 of file AbstractNumericalMethod.cpp.
|
pure virtual |
Updates node positions according to Newton's 2nd law with overdamping.
As this method is pure virtual, it must be overridden in subclasses.
dt | Time step size |
Implemented in ForwardEulerNumericalMethod< ELEMENT_DIM, SPACE_DIM >.
|
friend |
Needed for serialization.
Definition at line 63 of file AbstractNumericalMethod.hpp.
|
friend |
Definition at line 58 of file AbstractNumericalMethod.hpp.
|
protected |
A boolean indicating whether this cell population type contains ghost nodes. Initialized to true in the AbstractNumericalMethod constructor.
Definition at line 111 of file AbstractNumericalMethod.hpp.
Referenced by AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::serialize().
|
protected |
Pointer to the boundary conditions to apply
Definition at line 88 of file AbstractNumericalMethod.hpp.
|
protected |
Pointer to the cell population being updated by this method
Definition at line 82 of file AbstractNumericalMethod.hpp.
|
protected |
Pointer to the force collection to apply
Definition at line 85 of file AbstractNumericalMethod.hpp.
|
protected |
Whether the numerical method uses an adaptive time step. Initialized to false in the AbstractNumericalMethod constructor.
Definition at line 94 of file AbstractNumericalMethod.hpp.
Referenced by AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::serialize().
|
protected |
A boolean flag indicating whether non-forward Euler methods are supported for this type of cell population. Allows us to fall back to the old method of updating node positions for populations that require it (This is only for NodeBasedCellPopulationWithBuskeUpdates).
Initialized to false in the AbstractNumericalMethod constructor.
Definition at line 105 of file AbstractNumericalMethod.hpp.
Referenced by AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::serialize().