#include <DiscreteSystemForceCalculator.hpp>
Public Member Functions | |
DiscreteSystemForceCalculator (MeshBasedCellPopulation< 2 > &rCellPopulation, std::vector< AbstractTwoBodyInteractionForce< 2 > * > forceCollection) | |
std::vector< std::vector < double > > | CalculateExtremalNormalForces () |
void | WriteResultsToFile (std::string simulationOutputDirectory) |
Private Member Functions | |
std::set< unsigned > | GetNeighbouringNodeIndices (unsigned index) |
std::vector< double > | CalculateFtAndFn (unsigned index, double theta) |
std::vector< double > | GetSamplingAngles (unsigned index) |
double | GetLocalExtremum (unsigned index, double angle1, double angle2) |
std::vector< double > | GetExtremalAngles (unsigned index, std::vector< double > samplingAngles) |
Private Attributes | |
MeshBasedCellPopulation< 2 > & | mrCellPopulation |
std::vector < AbstractTwoBodyInteractionForce< 2 > * > | mForceCollection |
double | mEpsilon |
out_stream | mpVizStressResultsFile |
Friends | |
class | TestDiscreteSystemForceCalculator |
Definition at line 37 of file DiscreteSystemForceCalculator.hpp.
DiscreteSystemForceCalculator::DiscreteSystemForceCalculator | ( | MeshBasedCellPopulation< 2 > & | rCellPopulation, | |
std::vector< AbstractTwoBodyInteractionForce< 2 > * > | forceCollection | |||
) |
Constructor.
rCellPopulation | reference to the cell population | |
forceCollection | vector of force laws present |
Definition at line 30 of file DiscreteSystemForceCalculator.cpp.
std::set< unsigned > DiscreteSystemForceCalculator::GetNeighbouringNodeIndices | ( | unsigned | index | ) | [private] |
Given a node index, returns the set of neighbouring node indices.
index | the node index |
Definition at line 122 of file DiscreteSystemForceCalculator.cpp.
References Node< SPACE_DIM >::ContainingElementsBegin(), Node< SPACE_DIM >::ContainingElementsEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), mrCellPopulation, and MeshBasedCellPopulation< DIM >::rGetMesh().
Referenced by CalculateFtAndFn(), and GetSamplingAngles().
std::vector< double > DiscreteSystemForceCalculator::CalculateFtAndFn | ( | unsigned | index, | |
double | theta | |||
) | [private] |
Given a node index and angle of intersecting line in the range (-pi,pi], returns the tangential and normal forces.
index | the node index | |
theta | the angle of intersection |
Definition at line 148 of file DiscreteSystemForceCalculator.cpp.
References TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetAngleBetweenNodes(), GetNeighbouringNodeIndices(), mForceCollection, mrCellPopulation, and MeshBasedCellPopulation< DIM >::rGetMesh().
Referenced by CalculateExtremalNormalForces(), GetExtremalAngles(), and GetLocalExtremum().
std::vector< double > DiscreteSystemForceCalculator::GetSamplingAngles | ( | unsigned | index | ) | [private] |
Given a node index, returns a vector of sampling angles in the range (-pi,pi] that can be used by GetExtremalAngles() to find the locations of local extrema of the normal force.
index |
Definition at line 200 of file DiscreteSystemForceCalculator.cpp.
References TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetAngleBetweenNodes(), GetNeighbouringNodeIndices(), mEpsilon, mrCellPopulation, and MeshBasedCellPopulation< DIM >::rGetMesh().
Referenced by CalculateExtremalNormalForces().
double DiscreteSystemForceCalculator::GetLocalExtremum | ( | unsigned | index, | |
double | angle1, | |||
double | angle2 | |||
) | [private] |
Given a node index and two sampling angles, finds the location of the root of the tangential force in the interval between the two angles. There is no guarantee that this will lie in (-pi,pi].
index | the node index | |
angle1 | the first sampling angle | |
angle2 | the second sampling angle |
Definition at line 272 of file DiscreteSystemForceCalculator.cpp.
References CalculateFtAndFn().
Referenced by GetExtremalAngles().
std::vector< double > DiscreteSystemForceCalculator::GetExtremalAngles | ( | unsigned | index, | |
std::vector< double > | samplingAngles | |||
) | [private] |
Given a vector of sampling angles in the range (-pi,pi], returns a vector of extremal angles, i.e. angles at which local extrema of the normal force occur, again in the range (-pi,pi].
index | the node index | |
samplingAngles | the vector of sampling angles |
Definition at line 304 of file DiscreteSystemForceCalculator.cpp.
References CalculateFtAndFn(), GetLocalExtremum(), and mEpsilon.
Referenced by CalculateExtremalNormalForces().
std::vector< std::vector< double > > DiscreteSystemForceCalculator::CalculateExtremalNormalForces | ( | ) |
Definition at line 39 of file DiscreteSystemForceCalculator.cpp.
References CalculateFtAndFn(), GetExtremalAngles(), MeshBasedCellPopulation< DIM >::GetNumNodes(), GetSamplingAngles(), and mrCellPopulation.
Referenced by WriteResultsToFile().
void DiscreteSystemForceCalculator::WriteResultsToFile | ( | std::string | simulationOutputDirectory | ) |
Write results to file.
simulationOutputDirectory | the output directory, relative to where Chaste output is stored |
Definition at line 82 of file DiscreteSystemForceCalculator.cpp.
References CalculateExtremalNormalForces(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), SimulationTime::GetTime(), SimulationTime::Instance(), mpVizStressResultsFile, mrCellPopulation, OutputFileHandler::OpenOutputFile(), and MeshBasedCellPopulation< DIM >::rGetMesh().
Reference to cell population.
Definition at line 46 of file DiscreteSystemForceCalculator.hpp.
Referenced by CalculateExtremalNormalForces(), CalculateFtAndFn(), GetNeighbouringNodeIndices(), GetSamplingAngles(), and WriteResultsToFile().
std::vector<AbstractTwoBodyInteractionForce<2>*> DiscreteSystemForceCalculator::mForceCollection [private] |
The mechanics used to determine the new location of the cells.
Definition at line 49 of file DiscreteSystemForceCalculator.hpp.
Referenced by CalculateFtAndFn().
double DiscreteSystemForceCalculator::mEpsilon [private] |
Small parameter, used in GetSamplingAngles().
Definition at line 54 of file DiscreteSystemForceCalculator.hpp.
Referenced by GetExtremalAngles(), and GetSamplingAngles().
out_stream DiscreteSystemForceCalculator::mpVizStressResultsFile [private] |
The file that the results of CalculateExtremalNormalForces.
Definition at line 57 of file DiscreteSystemForceCalculator.hpp.
Referenced by WriteResultsToFile().