Chaste
Release::2018.1
|
#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 | 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::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 |
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 55 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 101 of file AbstractNumericalMethod.cpp.
References GenericEventHandler< 11, CellBasedEventHandler >::BeginEvent(), and GenericEventHandler< 11, CellBasedEventHandler >::EndEvent().
|
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 168 of file AbstractNumericalMethod.cpp.
References StepSizeException::IsTerminal(), and StepSizeException::what().
bool AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::GetUseUpdateNodeLocation | ( | ) |
Get mUseUpdateNodeLocation.
Definition at line 199 of file AbstractNumericalMethod.cpp.
bool AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::HasAdaptiveTimestep | ( | ) |
Definition at line 95 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 205 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 215 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 161 of file AbstractNumericalMethod.cpp.
|
protected |
Saves the current location of each cell in the population in a vector.
Definition at line 145 of file AbstractNumericalMethod.cpp.
|
inlineprivate |
Save or restore the simulation.
archive | the archive |
version | the current version of this class |
Definition at line 71 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 >::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 89 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 193 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 62 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 107 of file AbstractNumericalMethod.hpp.
Referenced by AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::serialize().
|
protected |
Pointer to the cell population being updated by this method
Definition at line 81 of file AbstractNumericalMethod.hpp.
|
protected |
Pointer to the force collection to apply
Definition at line 84 of file AbstractNumericalMethod.hpp.
|
protected |
Whether the numerical method uses an adaptive time step. Initialized to false in the AbstractNumericalMethod constructor.
Definition at line 90 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 101 of file AbstractNumericalMethod.hpp.
Referenced by AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::serialize().