36 #include "AbstractNumericalMethod.hpp" 37 #include "StepSizeException.hpp" 38 #include "Warnings.hpp" 39 #include "AbstractCentreBasedCellPopulation.hpp" 40 #include "NodeBasedCellPopulationWithBuskeUpdate.hpp" 41 #include "MeshBasedCellPopulationWithGhostNodes.hpp" 42 #include "CellBasedEventHandler.hpp" 44 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
46 : mpCellPopulation(nullptr),
47 mpForceCollection(nullptr),
48 mUseAdaptiveTimestep(false),
49 mUseUpdateNodeLocation(false),
50 mGhostNodeForcesEnabled(true)
55 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
60 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
69 WARNING(
"Non-Euler steppers are not yet implemented for NodeBasedCellPopulationWithBuskeUpdate");
82 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
88 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
94 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
100 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
106 node_iter !=
mpCellPopulation->rGetMesh().GetNodeIteratorEnd(); ++node_iter)
108 node_iter->ClearAppliedForce();
129 std::vector<c_vector<double, SPACE_DIM> > forces_as_vector;
133 node_iter !=
mpCellPopulation->rGetMesh().GetNodeIteratorEnd(); ++node_iter)
135 double damping =
mpCellPopulation->GetDampingConstant(node_iter->GetIndex());
136 forces_as_vector.push_back(node_iter->rGetAppliedForce()/damping);
141 return forces_as_vector;
144 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
147 std::vector<c_vector<double, SPACE_DIM> > current_locations;
154 current_locations.push_back(node_iter->rGetLocation());
157 return current_locations;
160 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
167 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
183 WARN_ONCE_ONLY(e.
what());
192 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
198 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
204 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
209 *rParamsFile <<
"\t\t<" << numerical_method_type <<
">\n";
211 *rParamsFile <<
"\t\t</" << numerical_method_type <<
">\n";
214 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
217 *rParamsFile <<
"\t\t\t<UseAdaptiveTimestep>" <<
mUseAdaptiveTimestep <<
"</UseAdaptiveTimestep> \n";
218 *rParamsFile <<
"\t\t\t<UseUpdateNodeLocation>" <<
mUseUpdateNodeLocation <<
"</UseUpdateNodeLocation> \n";
void SafeNodePositionUpdate(unsigned nodeIndex, c_vector< double, SPACE_DIM > newPosition)
virtual const char * what() const
virtual ~AbstractNumericalMethod()
static void BeginEvent(unsigned event)
bool mUseUpdateNodeLocation
void SetForceCollection(std::vector< boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > > *pForces)
std::vector< boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > > * mpForceCollection
AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM > * mpCellPopulation
virtual void OutputNumericalMethodParameters(out_stream &rParamsFile)
void OutputNumericalMethodInfo(out_stream &rParamsFile)
bool mUseAdaptiveTimestep
bool HasAdaptiveTimestep()
void SetUseUpdateNodeLocation(bool useUpdateNodeLocation)
void SetUseAdaptiveTimestep(bool useAdaptiveTimestep)
void SetCellPopulation(AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM > *pPopulation)
std::vector< c_vector< double, SPACE_DIM > > SaveCurrentLocations()
void DetectStepSizeExceptions(unsigned nodeIndex, c_vector< double, SPACE_DIM > &displacement, double dt)
std::string GetIdentifier() const
static void EndEvent(unsigned event)
std::vector< c_vector< double, SPACE_DIM > > ComputeForcesIncludingDamping()
bool mGhostNodeForcesEnabled
AbstractNumericalMethod()
bool GetUseUpdateNodeLocation()