![]() |
Chaste Commit::9e4a273f0754a391514ab12ed9d4a38fc9933db2
|
#include <AbstractNumericalMethod.hpp>
Inheritance diagram for AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >:
Collaboration diagram for AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >: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) |
| virtual void | SetUseAdaptiveTimestep (bool useAdaptiveTimestep) |
| bool | HasAdaptiveTimestep () |
| virtual bool | DelegatesToPopulation () |
| 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 | 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 55 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 140 of file AbstractNumericalMethod.cpp.
|
virtual |
Defaults to false; overridden to return true by NoNumericalMethod, which is the only numerical method that may be paired with a cell population whose UpdateNodeLocations() is not NEVER_REACHED (currently NodeBasedCellPopulationWithBuskeUpdate and ImmersedBoundaryCellPopulation). This pairing is enforced in SetCellPopulation().
Reimplemented in NoNumericalMethod< ELEMENT_DIM, SPACE_DIM >.
Definition at line 232 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 207 of file AbstractNumericalMethod.cpp.
| bool AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::HasAdaptiveTimestep | ( | ) |
Definition at line 107 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 128 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 >, NoNumericalMethod< ELEMENT_DIM, SPACE_DIM >, and RK4NumericalMethod< ELEMENT_DIM, SPACE_DIM >.
Definition at line 248 of file AbstractNumericalMethod.cpp.
Referenced by ForwardEulerNumericalMethod< ELEMENT_DIM, SPACE_DIM >::OutputNumericalMethodParameters(), NoNumericalMethod< ELEMENT_DIM, SPACE_DIM >::OutputNumericalMethodParameters(), and RK4NumericalMethod< 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 200 of file AbstractNumericalMethod.cpp.
|
protected |
Saves the current location of each cell in the population in a vector.
Definition at line 184 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 113 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, and AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::mUseAdaptiveTimestep.
| 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 95 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 60 of file AbstractNumericalMethod.cpp.
References EXCEPTION.
| 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 89 of file AbstractNumericalMethod.cpp.
|
virtual |
Set mUseAdaptiveTimestep.
| useAdaptiveTimestep | whether to use an adaptive time step |
Reimplemented in NoNumericalMethod< ELEMENT_DIM, SPACE_DIM >.
Definition at line 101 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 >, NoNumericalMethod< ELEMENT_DIM, SPACE_DIM >, and RK4NumericalMethod< 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 99 of file AbstractNumericalMethod.hpp.
Referenced by AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::serialize().
|
protected |
Pointer to the boundary conditions to apply
Definition at line 87 of file AbstractNumericalMethod.hpp.
|
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 93 of file AbstractNumericalMethod.hpp.
Referenced by AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM >::serialize().