Chaste  Release::2018.1
MutableVertexMesh< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <MutableVertexMesh.hpp>

+ Inheritance diagram for MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >:

Public Member Functions

 MutableVertexMesh (std::vector< Node< SPACE_DIM > * > nodes, std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > vertexElements, double cellRearrangementThreshold=0.01, double t2Threshold=0.001, double cellRearrangementRatio=1.5, double protorosetteFormationProbability=0.0, double protorosetteResolutionProbabilityPerTimestep=0.0, double rosetteResolutionProbabilityPerTimestep=0.0)
 
 MutableVertexMesh ()
 
virtual ~MutableVertexMesh ()
 
void SetCellRearrangementThreshold (double cellRearrangementThreshold)
 
void SetT2Threshold (double t2Threshold)
 
void SetCellRearrangementRatio (double cellRearrangementRatio)
 
void SetProtorosetteFormationProbability (double protorosetteFormationProbability)
 
void SetProtorosetteResolutionProbabilityPerTimestep (double protorosetteResolutionProbabilityPerTimestep)
 
void SetRosetteResolutionProbabilityPerTimestep (double rosetteResolutionProbabilityPerTimestep)
 
virtual void SetNode (unsigned nodeIndex, ChastePoint< SPACE_DIM > point)
 
void SetCheckForInternalIntersections (bool checkForInternalIntersections)
 
double GetCellRearrangementThreshold () const
 
double GetT2Threshold () const
 
double GetCellRearrangementRatio () const
 
double GetProtorosetteFormationProbability () const
 
double GetProtorosetteResolutionProbabilityPerTimestep () const
 
double GetRosetteResolutionProbabilityPerTimestep () const
 
void SetDistanceForT3SwapChecking (double distanceForT3SwapChecking)
 
double GetDistanceForT3SwapChecking () const
 
unsigned GetNumNodes () const
 
unsigned GetNumElements () const
 
bool GetCheckForInternalIntersections () const
 
std::vector< c_vector< double,
SPACE_DIM > > 
GetLocationsOfT1Swaps ()
 
c_vector< double, SPACE_DIM > GetLastT2SwapLocation ()
 
std::vector< c_vector< double,
SPACE_DIM > > 
GetLocationsOfT3Swaps ()
 
void ClearLocationsOfT1Swaps ()
 
void ClearLocationsOfT3Swaps ()
 
unsigned AddNode (Node< SPACE_DIM > *pNewNode)
 
void DeleteElementPriorToReMesh (unsigned index)
 
void DeleteNodePriorToReMesh (unsigned index)
 
unsigned DivideElementAlongShortAxis (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, bool placeOriginalElementBelow=false)
 
unsigned DivideElementAlongGivenAxis (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, c_vector< double, SPACE_DIM > axisOfDivision, bool placeOriginalElementBelow=false)
 
unsigned AddElement (VertexElement< ELEMENT_DIM, SPACE_DIM > *pNewElement)
 
bool CheckForT2Swaps (VertexElementMap &rElementMap)
 
void Clear ()
 
void DivideEdge (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
void RemoveDeletedNodesAndElements (VertexElementMap &rElementMap)
 
void RemoveDeletedNodes ()
 
virtual void ReMesh (VertexElementMap &rElementMap)
 
void ReMesh ()
 
- Public Member Functions inherited from VertexMesh< ELEMENT_DIM, SPACE_DIM >
VertexElementIterator GetElementIteratorBegin (bool skipDeletedElements=true)
 
VertexElementIterator GetElementIteratorEnd ()
 
 VertexMesh (std::vector< Node< SPACE_DIM > * > nodes, std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > vertexElements)
 
 VertexMesh (std::vector< Node< SPACE_DIM > * > nodes, std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > faces, std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > vertexElements)
 
 VertexMesh (TetrahedralMesh< 2, 2 > &rMesh, bool isPeriodic=false)
 Alternative 2D 'Voronoi' constructor. More...
 
 VertexMesh (TetrahedralMesh< 3, 3 > &rMesh)
 
 VertexMesh ()
 
virtual ~VertexMesh ()
 
unsigned GetNumAllElements () const
 
virtual unsigned GetNumFaces () const
 
VertexElement< ELEMENT_DIM,
SPACE_DIM > * 
GetElement (unsigned index) const
 
VertexElement< ELEMENT_DIM-1,
SPACE_DIM > * 
GetFace (unsigned index) const
 
virtual c_vector< double,
SPACE_DIM > 
GetCentroidOfElement (unsigned index)
 
void ConstructFromMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
 
unsigned GetDelaunayNodeIndexCorrespondingToVoronoiElementIndex (unsigned elementIndex)
 
unsigned GetVoronoiElementIndexCorrespondingToDelaunayNodeIndex (unsigned nodeIndex)
 
unsigned GetRosetteRankOfElement (unsigned index)
 
virtual c_vector< double,
SPACE_DIM > 
GetVectorFromAtoB (const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
 
virtual double GetVolumeOfElement (unsigned index)
 
virtual double GetSurfaceAreaOfElement (unsigned index)
 
c_vector< double, SPACE_DIM > GetAreaGradientOfElementAtNode (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
 
c_vector< double, SPACE_DIM > GetPreviousEdgeGradientOfElementAtNode (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
 
c_vector< double, SPACE_DIM > GetNextEdgeGradientOfElementAtNode (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
 
c_vector< double, SPACE_DIM > GetPerimeterGradientOfElementAtNode (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
 
virtual c_vector< double, 3 > CalculateMomentsOfElement (unsigned index)
 
double GetEdgeLength (unsigned elementIndex1, unsigned elementIndex2)
 
double GetElongationShapeFactorOfElement (unsigned elementIndex)
 
double CalculateUnitNormalToFaceWithArea (VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace, c_vector< double, SPACE_DIM > &rNormal)
 
virtual double CalculateAreaOfFace (VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace)
 
c_vector< double, SPACE_DIM > GetShortAxisOfElement (unsigned index)
 
std::set< unsignedGetNeighbouringNodeIndices (unsigned nodeIndex)
 
std::set< unsignedGetNeighbouringNodeNotAlsoInElement (unsigned nodeIndex, unsigned elemIndex)
 
std::set< unsignedGetNeighbouringElementIndices (unsigned elementIndex)
 
virtual VertexMesh
< ELEMENT_DIM, SPACE_DIM > * 
GetMeshForVtk ()
 
- Public Member Functions inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
NodeIterator GetNodeIteratorBegin (bool skipDeletedNodes=true)
 
NodeIterator GetNodeIteratorEnd ()
 
 AbstractMesh ()
 
virtual ~AbstractMesh ()
 
unsigned GetNumBoundaryNodes () const
 
virtual unsigned GetNumAllNodes () const
 
unsigned GetNumNodeAttributes () const
 
Node< SPACE_DIM > * GetNode (unsigned index) const
 
virtual Node< SPACE_DIM > * GetNodeOrHaloNode (unsigned index) const
 
Node< SPACE_DIM > * GetNodeFromPrePermutationIndex (unsigned index) const
 
virtual void ReadNodesPerProcessorFile (const std::string &rNodesPerProcessorFile)
 
virtual DistributedVectorFactoryGetDistributedVectorFactory ()
 
virtual void SetDistributedVectorFactory (DistributedVectorFactory *pFactory)
 
virtual void PermuteNodes ()
 
BoundaryNodeIterator GetBoundaryNodeIteratorBegin () const
 
BoundaryNodeIterator GetBoundaryNodeIteratorEnd () const
 
std::string GetMeshFileBaseName () const
 
bool IsMeshOnDisk () const
 
const std::vector< unsigned > & rGetNodePermutation () const
 
double GetDistanceBetweenNodes (unsigned indexA, unsigned indexB)
 
virtual double GetWidth (const unsigned &rDimension) const
 
virtual ChasteCuboid< SPACE_DIM > CalculateBoundingBox () const
 
virtual unsigned GetNearestNodeIndex (const ChastePoint< SPACE_DIM > &rTestPoint)
 
virtual void Scale (const double xFactor=1.0, const double yFactor=1.0, const double zFactor=1.0)
 
virtual void Translate (const c_vector< double, SPACE_DIM > &rDisplacement)
 
void Translate (const double xMovement=0.0, const double yMovement=0.0, const double zMovement=0.0)
 
virtual void Rotate (c_matrix< double, SPACE_DIM, SPACE_DIM > rotationMatrix)
 
void Rotate (c_vector< double, 3 > axis, double angle)
 
void RotateX (const double theta)
 
void RotateY (const double theta)
 
void RotateZ (const double theta)
 
void Rotate (double theta)
 
virtual void RefreshMesh ()
 
bool IsMeshChanging () const
 
unsigned CalculateMaximumContainingElementsPerProcess () const
 
void SetMeshHasChangedSinceLoading ()
 

Protected Member Functions

unsigned DivideElement (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned nodeAIndex, unsigned nodeBIndex, bool placeOriginalElementBelow=false)
 
virtual bool CheckForSwapsFromShortEdges ()
 
bool CheckForIntersections ()
 
virtual void IdentifySwapType (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
void PerformNodeMerge (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
void PerformT1Swap (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB, std::set< unsigned > &rElementsContainingNodes)
 
void PerformIntersectionSwap (Node< SPACE_DIM > *pNode, unsigned elementIndex)
 
void PerformT2Swap (VertexElement< ELEMENT_DIM, SPACE_DIM > &rElement)
 
void PerformT3Swap (Node< SPACE_DIM > *pNode, unsigned elementIndex)
 
void PerformVoidRemoval (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB, Node< SPACE_DIM > *pNodeC)
 
virtual void HandleHighOrderJunctions (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
void PerformRosetteRankIncrease (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
void PerformProtorosetteResolution (Node< SPACE_DIM > *pProtorosetteNode)
 
void PerformRosetteRankDecrease (Node< SPACE_DIM > *pRosetteNode)
 
void CheckForRosettes ()
 
c_vector< double, 2 > WidenEdgeOrCorrectIntersectionLocationIfNecessary (unsigned indexA, unsigned indexB, c_vector< double, 2 > intersection)
 
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 
- Protected Member Functions inherited from VertexMesh< ELEMENT_DIM, SPACE_DIM >
unsigned SolveNodeMapping (unsigned index) const
 
unsigned SolveElementMapping (unsigned index) const
 
unsigned SolveBoundaryElementMapping (unsigned index) const
 
void GenerateVerticesFromElementCircumcentres (TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
 
bool ElementIncludesPoint (const c_vector< double, SPACE_DIM > &rTestPoint, unsigned elementIndex)
 
unsigned GetLocalIndexForElementEdgeClosestToPoint (const c_vector< double, SPACE_DIM > &rTestPoint, unsigned elementIndex)
 
template<class Archive >
void save (Archive &archive, const unsigned int version) const
 
template<class Archive >
void load (Archive &archive, const unsigned int version)
 
- Protected Member Functions inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
virtual void SetElementOwnerships ()
 
ChasteCuboid< SPACE_DIM > CalculateBoundingBox (const std::vector< Node< SPACE_DIM > * > &rNodes) const
 

Protected Attributes

double mCellRearrangementThreshold
 
double mCellRearrangementRatio
 
double mT2Threshold
 
double mProtorosetteFormationProbability
 
double mProtorosetteResolutionProbabilityPerTimestep
 
double mRosetteResolutionProbabilityPerTimestep
 
bool mCheckForInternalIntersections
 
std::vector< unsignedmDeletedNodeIndices
 
std::vector< unsignedmDeletedElementIndices
 
double mDistanceForT3SwapChecking
 
std::vector< c_vector< double,
SPACE_DIM > > 
mLocationsOfT1Swaps
 
c_vector< double, SPACE_DIM > mLastT2SwapLocation
 
std::vector< c_vector< double,
SPACE_DIM > > 
mLocationsOfT3Swaps
 
- Protected Attributes inherited from VertexMesh< ELEMENT_DIM, SPACE_DIM >
std::vector< VertexElement
< ELEMENT_DIM, SPACE_DIM > * > 
mElements
 
std::vector< VertexElement
< ELEMENT_DIM-1, SPACE_DIM > * > 
mFaces
 
std::map< unsigned, unsignedmVoronoiElementIndexMap
 
TetrahedralMesh< ELEMENT_DIM,
SPACE_DIM > * 
mpDelaunayMesh
 
- Protected Attributes inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
std::vector< Node< SPACE_DIM > * > mNodes
 
std::vector< Node< SPACE_DIM > * > mBoundaryNodes
 
DistributedVectorFactorympDistributedVectorFactory
 
std::vector< unsignedmNodePermutation
 
std::string mMeshFileBaseName
 
bool mMeshChangesDuringSimulation
 

Friends

class TestMutableVertexMesh
 
class TestMutableVertexMeshReMesh
 
class TestMutableVertexMeshRosetteMethods
 
class boost::serialization::access
 

Additional Inherited Members

- Public Types inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
typedef std::vector< Node
< SPACE_DIM >
* >::const_iterator 
BoundaryNodeIterator
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >

A mutable vertex-based mesh class, which inherits from VertexMesh and allows for local remeshing. This is implemented through simple operations including node merging, neighbour exchange ("T1 swap"), node/edge merging in the case of intersections ("T3 swap") and removal of small triangular elements ("T2 swap").

MutableVertexMesh is used as a member of the VertexBasedCellPopulation class to represent the junctional network of cells that forms the basis of simulations of off-lattice vertex-based models.

Definition at line 65 of file MutableVertexMesh.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::MutableVertexMesh ( std::vector< Node< SPACE_DIM > * >  nodes,
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >  vertexElements,
double  cellRearrangementThreshold = 0.01,
double  t2Threshold = 0.001,
double  cellRearrangementRatio = 1.5,
double  protorosetteFormationProbability = 0.0,
double  protorosetteResolutionProbabilityPerTimestep = 0.0,
double  rosetteResolutionProbabilityPerTimestep = 0.0 
)

Default constructor.

Parameters
nodesvector of pointers to nodes
vertexElementsvector of pointers to VertexElements
cellRearrangementThresholdthe minimum threshold distance for element rearrangement (defaults to 0.01)
t2Thresholdthe maximum threshold distance for Type 2 swaps (defaults to 0.001)
cellRearrangementRatioratio between the minimum threshold distance for element rearrangement node separation after remeshing (defaults to 1.5)
protorosetteFormationProbabilitythe probability of a protorosette formation event happening instead of a T1 swap
protorosetteResolutionProbabilityPerTimestepthe probability that, in a given timestep, a protorosette will resolve (similar to the completion of a T1 swap)
rosetteResolutionProbabilityPerTimestepthe probability that, in a given timestep, a rosette will resolve (reduce the number of cells sharing a common vertex by 1)

Definition at line 43 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::AddElement(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::Clear(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements, VertexMesh< ELEMENT_DIM, SPACE_DIM >::mFaces, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mMeshChangesDuringSimulation, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::MutableVertexMesh ( )
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::~MutableVertexMesh ( )
virtual

Destructor.

Definition at line 140 of file MutableVertexMesh.cpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddElement ( VertexElement< ELEMENT_DIM, SPACE_DIM > *  pNewElement)

Add an element to the mesh.

Parameters
pNewElementthe new element
Returns
the index of the new element in the mesh

Definition at line 347 of file MutableVertexMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), and MutableElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddNode ( Node< SPACE_DIM > *  pNewNode)

Add a node to the mesh.

Note: After calling this one or more times, you must then call ReMesh.

Parameters
pNewNodepointer to the new node
Returns
the global index of the new node in the mesh.

Definition at line 328 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::GetIndex(), and Node< SPACE_DIM >::SetIndex().

Referenced by Cylindrical2dVertexMesh::AddNode(), and Toroidal2dVertexMesh::AddNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForIntersections ( )
protected

Helper method for ReMesh().

Check if any elements have become intersected and correct this by implementing the appropriate local remeshing operation (a T3 swap or node merge).

Returns
whether to recheck the mesh again
Todo:
Change to only loop over neighbouring elements (see #2401)

Definition at line 1016 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForRosettes ( )
protected

Helper method for ReMesh().

Check whether the mesh contains rosettes or protorosettes, and implement resolution events if necessary.

First, we loop over each node and populate vectors of protorosette and rosette nodes which need to undergo resolution.

We do not perform the resolution events in this initial loop because the resolution events involve changing nodes in the mesh.

Finally, we loop over the contents of each node vector and perform the necessary resolution events.

Because each resolution event changes nodes, we include several assertions to catch possible unconsidered behaviour.

Definition at line 3065 of file MutableVertexMesh.cpp.

References RandomNumberGenerator::Instance(), Node< SPACE_DIM >::IsDeleted(), and Node< SPACE_DIM >::rGetContainingElementIndices().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForSwapsFromShortEdges ( )
protectedvirtual

Helper method for ReMesh().

Check if any neighbouring nodes in an element are closer than the mCellRearrangementThreshold and are not contained in any triangular elements. If any such pair of nodes are found, then call IdentifySwapType(), which in turn implements the appropriate local remeshing operation (a T1 swap, void removal, or node merge).

Returns
whether we need to check for, and implement, any further local remeshing operations (true if any swaps are performed).
Todo:
Could we search more efficiently by just iterating over edges? (see #2401)
Todo:
Use iterators to tidy this up (see #2401)

Definition at line 930 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::GetIndex(), and Node< SPACE_DIM >::rGetContainingElementIndices().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForT2Swaps ( VertexElementMap rElementMap)

Helper method for ReMesh().

Check for any triangular element whose area is smaller than mT2Threshold and call PerformT2Swap() on any such element.

Parameters
rElementMapa VertexElementMap which associates the indices of VertexElements in the old mesh with indices of VertexElements in the new mesh. This should be created with the correct size, GetNumElements()
Returns
whether we need to check for, and implement, any further local remeshing operations
Todo:
: cover this line in a test

Definition at line 991 of file MutableVertexMesh.cpp.

References VertexElementMap::SetDeleted().

Referenced by T2SwapCellKiller< DIM >::CheckAndLabelCellsForApoptosisOrDeath().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::Clear ( )
virtual
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ClearLocationsOfT1Swaps ( )

Helper method to clear the stored T1 swaps

Definition at line 316 of file MutableVertexMesh.cpp.

Referenced by VertexT1SwapLocationsWriter< ELEMENT_DIM, SPACE_DIM >::Visit().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ClearLocationsOfT3Swaps ( )

Helper method to clear the stored T3 swaps

Definition at line 322 of file MutableVertexMesh.cpp.

Referenced by VertexT3SwapLocationsWriter< ELEMENT_DIM, SPACE_DIM >::Visit().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DeleteElementPriorToReMesh ( unsigned  index)

Mark an element as deleted. Note that it DOES NOT deal with the associated nodes and therefore should only be called immediately prior to a ReMesh() being called.

Parameters
indexthe global index of a specified vertex element

Definition at line 695 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::GetIndex(), Node< SPACE_DIM >::rGetContainingElementIndices(), and Node< SPACE_DIM >::SetAsBoundaryNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNodePriorToReMesh ( unsigned  index)

Mark a given node as deleted. Note that this method DOES NOT deal with the associated elements and therefore should only be called immediately prior to a ReMesh() being called.

Parameters
indexThe index of the node to delete

Definition at line 719 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideEdge ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElement ( VertexElement< ELEMENT_DIM, SPACE_DIM > *  pElement,
unsigned  nodeAIndex,
unsigned  nodeBIndex,
bool  placeOriginalElementBelow = false 
)
protected

Divide an element along the axis passing through two of its nodes.

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Parameters
pElementthe element to divide
nodeAIndexthe local index of one node within this element
nodeBIndexthe local index of another node within this element
placeOriginalElementBelowwhether to place the original element below (in the y direction) the new element (defaults to false)
Returns
the index of the new element

Remove the correct nodes from each element. If placeOriginalElementBelow is true, place the original element below (in the y direction) the new element; otherwise, place it above.

Todo:
this could be more efficient (see #2401)

Definition at line 569 of file MutableVertexMesh.cpp.

References MutableElement< ELEMENT_DIM, SPACE_DIM >::DeleteNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElementAlongGivenAxis ( VertexElement< ELEMENT_DIM, SPACE_DIM > *  pElement,
c_vector< double, SPACE_DIM >  axisOfDivision,
bool  placeOriginalElementBelow = false 
)

Divide an element along a specified axis.

If the new nodes (intersections of axis with element) are within mCellRearrangementThreshold of existing nodes then they are moved 2*mCellRearrangementThreshold away.

Parameters
pElementthe element to divide
axisOfDivisionaxis to divide the element by
placeOriginalElementBelowwhether to place the original element below (in the y direction) the new element (defaults to false)
Returns
the index of the new element
Todo:
or should we move a and b apart, it may interfere with neighbouring edges? (see #1399 and #2401)

Definition at line 370 of file MutableVertexMesh.cpp.

References EXCEPTION, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), MutableElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), Node< SPACE_DIM >::IsBoundaryNode(), Node< SPACE_DIM >::rGetContainingElementIndices(), and Node< SPACE_DIM >::rGetLocation().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElementAlongShortAxis ( VertexElement< ELEMENT_DIM, SPACE_DIM > *  pElement,
bool  placeOriginalElementBelow = false 
)

Divide an element along its short axis.

Parameters
pElementthe element to divide
placeOriginalElementBelowwhether to place the original element below (in the y direction) the new element (defaults to false)
Returns
the index of the new element

Definition at line 556 of file MutableVertexMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetCellRearrangementRatio ( ) const
Returns
mCellRearrangementRatio

Definition at line 158 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetCellRearrangementThreshold ( ) const
Returns
mCellRearrangementThreshold

Definition at line 146 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetCheckForInternalIntersections ( ) const
Returns
mCheckForInternalIntersections, either to check for edges intersections or not.

Definition at line 196 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetDistanceForT3SwapChecking ( ) const

Get Distance for T3 swap checking.

Returns
mDistanceForT3SwapChecking

Definition at line 188 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLastT2SwapLocation ( )
Returns
the location of the last T2 swap

Definition at line 304 of file MutableVertexMesh.cpp.

Referenced by T2SwapCellKiller< DIM >::CheckAndLabelCellsForApoptosisOrDeath().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< c_vector< double, SPACE_DIM > > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLocationsOfT1Swaps ( )
Returns
the locations of the T1 swaps

Definition at line 298 of file MutableVertexMesh.cpp.

Referenced by VertexT1SwapLocationsWriter< ELEMENT_DIM, SPACE_DIM >::Visit().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< c_vector< double, SPACE_DIM > > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLocationsOfT3Swaps ( )
Returns
the locations of the T3 swaps

Definition at line 310 of file MutableVertexMesh.cpp.

Referenced by VertexT3SwapLocationsWriter< ELEMENT_DIM, SPACE_DIM >::Visit().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements ( ) const
virtual
Returns
the number of VertexElements in the mesh.

Reimplemented from VertexMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 292 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes ( ) const
virtual
Returns
the number of Nodes in the mesh.

Reimplemented from VertexMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 286 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetProtorosetteFormationProbability ( ) const

Get method for mProtoRosetteFormationProbability.

Returns
mProtoRosetteFormationProbability

Definition at line 164 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetProtorosetteResolutionProbabilityPerTimestep ( ) const

Get method for mProtoRosetteResolutionProbabilityPerTimestep.

Returns
mProtoRosetteResolutionProbabilityPerTimestep

Definition at line 170 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetRosetteResolutionProbabilityPerTimestep ( ) const

Get method for mRosetteResolutionProbabilityPerTimestep.

Returns
mRosetteResolutionProbabilityPerTimestep

Definition at line 176 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetT2Threshold ( ) const
Returns
mT2Threshold

Definition at line 152 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::HandleHighOrderJunctions ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)
protectedvirtual

Helper method for ReMesh(), called by IdentifySwapType().

Handles the case where a swap involves a junction with more than three adjacent elements. This is implemented in a separate method to allow child classes to override this behaviour and implement junction remodelling with high-order nodes (see #2664).

Parameters
pNodeAone of the nodes to perform the swap with
pNodeBthe other node to perform the swap

Definition at line 2598 of file MutableVertexMesh.cpp.

References EXCEPTION, and Node< SPACE_DIM >::rGetContainingElementIndices().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::IdentifySwapType ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)
protectedvirtual

Helper method for ReMesh(), called by CheckForSwapsFromShortEdges() when neighbouring nodes in an element have been found to be closer than the mCellRearrangementThreshold and do not share any triangular elements.

Identify the type of local remeshing operation required (T1 swap, void removal, or node merge).

Parameters
pNodeAone of the nodes to perform the swap with
pNodeBthe other node to perform the swap

Here, the triangular element would be along the short edge. Since we are already checking in CheckForSwapsFromShortEdges() whether the element is triangular, this exception is redundant for simulations. We leave it in for clarity. ///

Todo:
: consider removing the checking for this exception (see #2401)

If this is true then one of the elements adjacent to the triangular void is triangular. This element will then not share the short edge that is considered for a swap. Nevertheless, it would loose an edge during the swap. We are currently not able to deal with this situation. Related to #2533 and #2401.

Definition at line 1108 of file MutableVertexMesh.cpp.

References EXCEPTION, Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), MutableElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), RandomNumberGenerator::Instance(), Node< SPACE_DIM >::IsBoundaryNode(), NEVER_REACHED, and Node< SPACE_DIM >::rGetContainingElementIndices().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformIntersectionSwap ( Node< SPACE_DIM > *  pNode,
unsigned  elementIndex 
)
protected

Helper method for ReMesh(), called by CheckForIntersections().

Perform an element swap to resolve the situation where a given node has been found to overlap a given element not containing it.

Parameters
pNodepointer to the node
elementIndexglobal index of the element in the mesh

Definition at line 1617 of file MutableVertexMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), MutableElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), Node< SPACE_DIM >::rGetContainingElementIndices(), and Node< SPACE_DIM >::rGetLocation().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformNodeMerge ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)
protected

Helper method for ReMesh(), called by IdentifySwapType().

Merge two given nodes in the mesh and update node/element ownership, by replacing the node contained in the least number of elements with the other node. The merged node is moved to the centre between the two old node positions.

Parameters
pNodeAone of the nodes to perform the merge with
pNodeBthe other node to perform the merge with

Definition at line 1438 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::GetIndex(), Node< SPACE_DIM >::rGetContainingElementIndices(), Node< SPACE_DIM >::rGetLocation(), and Node< SPACE_DIM >::rGetModifiableLocation().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformProtorosetteResolution ( Node< SPACE_DIM > *  pProtorosetteNode)
protected

Helper method for ReMesh(), called by CheckForRosettes().

Split protorosette in random direction. Create new node and redistribute nodes along line joining centres of randomly selected cell and cell opposite it.

Parameters
pProtorosetteNodenode at centre of protorosette

Ordering elements as follows:

\ A / \ / \ / B X D / \ / \ / C \

Element A is the randomly chosen element. Element C, which is directly opposite A, will end up separated from A, while the two elements B and D which start adjacent to A will end up sharing a common edge:

\ A / \ / \ / | B | D | / \ / \ / C \

Next, we compute where to place the two nodes which will replace the single protorosette node.

We place each node along the line joining the protorosette node to the centroid of element which will contain it, and the distance along this line is half of the swap distance.

To do this, we will move the existing protorosette node in to element A, and create a new node in element C. We then need to tidy up the nodes by adding the new node to elements B, C and D, and removing the protorosette node from element C.

NOTE: as the protorosette node was not necessarily on the line joining the centroids of elements A and C, unlike in a T1 swap, the new node locations will not necessarily be the full swap distance apart.

Here, we add the new node to elements B, C and D.

The method AddNode() takes the local index of a node i, where the new node is to be inserted between nodes i and i+1, so we need to find the local idx of the node directly before (clockwise from) where we wish to insert it.

For elements C and D, we just need the local index of the protorosette node, but for element B we need the one before, modulo number of elements.

Definition at line 2704 of file MutableVertexMesh.cpp.

References MutableElement< ELEMENT_DIM, SPACE_DIM >::AddNode(), MutableElement< ELEMENT_DIM, SPACE_DIM >::DeleteNode(), Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), MutableElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), RandomNumberGenerator::Instance(), RandomNumberGenerator::randMod(), Node< SPACE_DIM >::rGetContainingElementIndices(), Node< SPACE_DIM >::rGetLocation(), and Node< SPACE_DIM >::rGetModifiableLocation().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformRosetteRankDecrease ( Node< SPACE_DIM > *  pRosetteNode)
protected

Helper method for ReMesh(), called by CheckForRosettes().

Split rosette by removing one cell at random. Create new node positioned along line joining rosette node and centre of randomly selected cell. Rosette node will remain unmoved.

Parameters
pRosetteNodenode at centre of rosette

We have now picked a vertex element at random from the rosette. This element will now be disconnected from the rosette in a manner analogous to performing a T1 swap.

The node at the centre of the rosette will not move, and a new node will be created a suitable distance away, along a line joining the rosette node and the centroid of the element we have randomly selected to move.

Ordering of elements is as follows:

\ S / \ / N \ / P —–X—– / \ / \ / \

where element S is the selected element, N is the next (counterclockwise) element from S, and P is the previous (clockwise) element from S.

Elements N and P will end up sharing an edge:

\ S / \ / \ / N | P | —–*—– / \ / \ / \

Next, we compute where to place the new node which will separate the rosette node from element S.

We place this node along the line joining the rosette node to the centroid of element S, at a distance of the swap distance ( (rearrangement ratio) x (rearrangement threshold) )

To do this, we create a new node in element S. We then need to tidy up the nodes by adding the new node to elements S, N and P, and by removing the rosette node from element S.

Here, we add the new node to elements S, N and P, and remove the rosette node from element S.

The method AddNode() takes the local index of a node i, where the new node is to be inserted between nodes i and i+1, so we need to find the local idx of the node directly before (clockwise from) where we wish to insert it.

For elements S and P, we just need the local index of the rosette node, but for element N we need the one before, modulo number of elements.

Definition at line 2890 of file MutableVertexMesh.cpp.

References MutableElement< ELEMENT_DIM, SPACE_DIM >::AddNode(), MutableElement< ELEMENT_DIM, SPACE_DIM >::DeleteNode(), Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), MutableElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), RandomNumberGenerator::Instance(), RandomNumberGenerator::randMod(), Node< SPACE_DIM >::rGetContainingElementIndices(), and Node< SPACE_DIM >::rGetLocation().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformRosetteRankIncrease ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)
protected

Helper method for ReMesh(), called by HandleHighOrderJunctions().

Merge a node of a non-rosette cell with the central node of a rosette, by replacing the node in the non-rosette cell with that of the rosette centre, keeping the rosette centre in the same position.

Parameters
pNodeAone of the nodes to perform the merge with
pNodeBthe other node to perform the merge with

The picture below shows the situation we are in. The central node (marked with an 'X') is contained in (at least) four elements already (A, B, C and D), and this is the rosette node which we have designated as hi_rank_node.

The node shared by elements C, D and E has come within the cell rearrangement threshold of the rosette node in order for this method to have been called. We have designated this node lo_rank_node.

We now 'merge' hi_rank_node and lo_rank_node, but keep hi_rank_node where it is (which is why we don't call PerformNodeMerge(), as that would move both nodes to their average location).

To accomplish this merge, we need do nothing to elements A and B. We remove lo_rank_node from elements C and D, and we replace lo_rank_node by hi_rank_node in element E.

\ A / \ / \ / B X C / \ ______ / \ / D \ E

Definition at line 2617 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::GetIndex(), and Node< SPACE_DIM >::rGetContainingElementIndices().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT1Swap ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB,
std::set< unsigned > &  rElementsContainingNodes 
)
protected

Helper method for ReMesh(), called by IdentifySwapType().

Perform a T1 swap on two given nodes contained in a given set of elements. This involves replacing the two nodes with two new nodes placed on either side of the previous shared edge, such that the edge formed by the two new nodes is the perpendicular bisector of the previous shared edge, and 'just larger' (by a factor mCellRearrangementRatio) than mThresholdDistance.

Parameters
pNodeAone of the nodes to perform the swap with
pNodeBthe other node to perform the swap
rElementsContainingNodesset of common elements
Todo:
remove magic number? (see #1884 and #2401)

Definition at line 1476 of file MutableVertexMesh.cpp.

References EXCEPTION, Node< SPACE_DIM >::GetIndex(), Node< SPACE_DIM >::GetNumContainingElements(), Node< SPACE_DIM >::IsBoundaryNode(), Node< SPACE_DIM >::rGetContainingElementIndices(), Node< SPACE_DIM >::rGetLocation(), Node< SPACE_DIM >::rGetModifiableLocation(), and Node< SPACE_DIM >::SetAsBoundaryNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT2Swap ( VertexElement< ELEMENT_DIM, SPACE_DIM > &  rElement)
protected
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT3Swap ( Node< SPACE_DIM > *  pNode,
unsigned  elementIndex 
)
protected

Helper method for ReMesh(), called by CheckForIntersections().

Perform a T3 swap on a given node that has been found to overlap a given element by moving the node back onto the edge of that element, associating it with the element and adding new nodes to maintain three elements per node.

Parameters
pNodepointer to the node
elementIndexglobal index of the element in the mesh
Todo:
the intersection location is sometimes overwritten when WidenEdgeOrCorrectIntersectionLocationIfNecessary

Definition at line 1852 of file MutableVertexMesh.cpp.

References MutableElement< ELEMENT_DIM, SPACE_DIM >::AddNode(), MutableElement< ELEMENT_DIM, SPACE_DIM >::DeleteNode(), EXCEPTION, Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), MutableElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), Node< SPACE_DIM >::GetNumContainingElements(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), Node< SPACE_DIM >::IsBoundaryNode(), Node< SPACE_DIM >::MarkAsDeleted(), NEVER_REACHED, Node< SPACE_DIM >::rGetContainingElementIndices(), Node< SPACE_DIM >::rGetLocation(), Node< SPACE_DIM >::rGetModifiableLocation(), and Node< SPACE_DIM >::SetAsBoundaryNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformVoidRemoval ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB,
Node< SPACE_DIM > *  pNodeC 
)
protected

Helper method for ReMesh(), called by IdentifySwapType().

Remove a triangular void bounded by three given nodes, in which one of the edges is less than mCellRearrangementThreshold, through calls to PerformNodeMerge().

Parameters
pNodeAone of the nodes on the short edge
pNodeBthe other node on the short edge
pNodeCthe other node in the triangular void

Definition at line 2560 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::IsDeleted(), Node< SPACE_DIM >::rGetLocation(), Node< SPACE_DIM >::rGetModifiableLocation(), and Node< SPACE_DIM >::SetAsBoundaryNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh ( VertexElementMap rElementMap)
virtual

Update the state of the mesh by implementing any local remeshing operations (node merging, or T1, T2 or T3 swaps) that are required, and store any changes in element indices using the given VertexElementMap.

This method calls several other methods, in particular CheckForT2Swaps(), CheckForSwapsFromShortEdges() and CheckForIntersections().

Parameters
rElementMapa VertexElementMap which associates the indices of VertexElements in the old mesh with indices of VertexElements in the new mesh. This should be created with the correct size, GetNumElements()
Todo:
Implement ReMesh() in 3D (see #1422)

Definition at line 872 of file MutableVertexMesh.cpp.

References EXCEPTION, and VertexElementMap::Resize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh ( )

Alternative version of ReMesh which takes no parameters and does not require a VertexElementMap. Note: inherited classes should overload ReMesh(VertexElementMap&).

Todo:
This method seems to be redundant; remove it? (#2401)

Definition at line 923 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodes ( )

Helper method for ReMesh(). Removes the deleted nodes from the mesh and relabels the node indices.

Definition at line 841 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodesAndElements ( VertexElementMap rElementMap)

Helper method for ReMesh(). Removes the deleted nodes and elements from the mesh and updates the rElementMap accordingly.

Parameters
rElementMapa VertexElementMap which associates the indices of VertexElements in the old mesh with indices of VertexElements in the new mesh. This should be created with the correct size, GetNumElements()

Definition at line 802 of file MutableVertexMesh.cpp.

References VertexElementMap::Resize(), VertexElementMap::SetDeleted(), and VertexElementMap::SetNewIndex().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprotected

Serialize the mesh.

Note that if you are calling this method (from subclasses) you should archive your member variables FIRST. So that this method can call a ReMesh (to convert from TrianglesMeshReader input format into your native format).

Parameters
archivethe archive
versionthe current version of this class
Todo:
: maybe we should archive the mLocationsOfT1Swaps and mDeletedNodeIndices etc. as well?

Definition at line 337 of file MutableVertexMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetCellRearrangementRatio ( double  cellRearrangementRatio)

Set method for mCellRearrangementRatio.

Parameters
cellRearrangementRatio

Definition at line 214 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetCellRearrangementThreshold ( double  cellRearrangementThreshold)

Set method for mCellRearrangementThreshold.

Parameters
cellRearrangementThreshold

Definition at line 202 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetCheckForInternalIntersections ( bool  checkForInternalIntersections)

Set method for mCheckForInternalIntersections.

Parameters
checkForInternalIntersections

Definition at line 271 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetDistanceForT3SwapChecking ( double  distanceForT3SwapChecking)

Set distance for T3 swap checking. At each time step we check for each boundary node whether it intersects with any boundary elements (cells) whose centroids lie within this distance to the node. Note that T3 swaps may not be resolved correctly if this distance is chosen too small, while large values for mDistanceForT3SwapChecking may slow down the simulation.

Parameters
distanceForT3SwapChecking

Definition at line 182 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetNode ( unsigned  nodeIndex,
ChastePoint< SPACE_DIM >  point 
)
virtual

Move the node with a particular index to a new point in space.

Parameters
nodeIndexthe index of the node to be moved
pointthe new target location of the node

Definition at line 364 of file MutableVertexMesh.cpp.

Referenced by Cylindrical2dVertexMesh::SetNode(), and Toroidal2dVertexMesh::SetNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetProtorosetteFormationProbability ( double  protorosetteFormationProbability)

Set method for mProtoRosetteFormationProbability.

Parameters
protorosetteFormationProbabilitythe new value of mProtoRosetteFormationProbability

Definition at line 220 of file MutableVertexMesh.cpp.

References EXCEPTION.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetProtorosetteResolutionProbabilityPerTimestep ( double  protorosetteResolutionProbabilityPerTimestep)

Set method for mProtoRosetteResolutionProbabilityPerTimestep.

Parameters
protorosetteResolutionProbabilityPerTimestepthe new value of mProtoRosetteResolutionProbabilityPerTimestep

Definition at line 237 of file MutableVertexMesh.cpp.

References EXCEPTION.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetRosetteResolutionProbabilityPerTimestep ( double  rosetteResolutionProbabilityPerTimestep)

Set method for mRosetteResolutionProbabilityPerTimestep.

Parameters
rosetteResolutionProbabilityPerTimestepthe new value of mRosetteResolutionProbabilityPerTimestep

Definition at line 254 of file MutableVertexMesh.cpp.

References EXCEPTION.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetT2Threshold ( double  t2Threshold)

Set method for mT2Threshold.

Parameters
t2Threshold

Definition at line 208 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, 2 > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::WidenEdgeOrCorrectIntersectionLocationIfNecessary ( unsigned  indexA,
unsigned  indexB,
c_vector< double, 2 >  intersection 
)
protected

Helper method for ReMesh(), called by PerformT3Swap(). During T3 swaps nodes are merged onto edges. This method checks if the edge is too short and moves its vertices apart if necessary in order to prevent T1 swaps from happening right away. The method also checks that the location where the merged node is going to end up at is not too close to one of the neighbouring vertices and moves it if necessary to prevent T1 swaps.

Parameters
indexAindex of one of the nodes on the short edge
indexBindex of the other node on the short edge
intersectionthe intersection location, i.e. the location where we are planning to put the merged node
Returns
intersection, the corrected location of where we are planning to put the merged node

If the edge is shorter than 4.0*mCellRearrangementRatio*mCellRearrangementThreshold move vertexA and vertexB 4.0*mCellRearrangementRatio*mCellRearrangementThreshold apart.

Todo:
investigate if moving A and B causes other issues with nearby nodes (see #2401)

Note: this distance is so that there is always enough room for new nodes (if necessary)

Todo:
currently this assumes a worst case scenario of 3 nodes between A and B could be less movement for other cases (see #1399 and #2401)

If the intersection is within mCellRearrangementRatio^2*mCellRearrangementThreshold of vertexA or vertexB move it mCellRearrangementRatio^2*mCellRearrangementThreshold away.

Note: this distance so that there is always enough room for new nodes (if necessary).

Todo:
currently this assumes a worst case scenario of 3 nodes between A and B; could be less movement for other cases (see #2401)

Definition at line 3144 of file MutableVertexMesh.cpp.

Friends And Related Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 324 of file MutableVertexMesh.hpp.

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementRatio
protected

The ratio between the minimum distance apart that two nodes in the mesh can be without causing element rearrangement and their separation after remeshing.

Definition at line 80 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementThreshold
protected

The minimum distance apart that two nodes in the mesh can be without causing element rearrangement.

Definition at line 74 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCheckForInternalIntersections
protected

Whether to check for edges intersections (true) or not (false).

Definition at line 95 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices
protected

Indices of elements that have been deleted. These indices can be reused when adding new elements.

Definition at line 101 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices
protected

Indices of nodes that have been deleted. These indices can be reused when adding new elements/nodes.

Definition at line 98 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDistanceForT3SwapChecking
protected

Distance for T3 swap checking. At each time step we check for each boundary node whether it intersects with any boundary elements (cells) whose centroids lie within this distance to the node. Note that T3 swaps may not be resolved correctly if this distance is chosen too small, while large values for mDistanceForT3SwapChecking may slow down the simulation.

Definition at line 109 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector<double, SPACE_DIM> MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLastT2SwapLocation
protected

The location of the last T2 swap (the centre of the removed triangle), stored so it can be accessed by the T2SwapCellKiller.

Definition at line 120 of file MutableVertexMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< c_vector<double, SPACE_DIM> > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLocationsOfT1Swaps
protected

Locations of T1 swaps (the mid point of the moving nodes), stored so they can be accessed and output by the cell population. The locations are stored until they are cleared by ClearLocationsOfT1Swaps().

Definition at line 115 of file MutableVertexMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< c_vector<double, SPACE_DIM> > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLocationsOfT3Swaps
protected

Locations of T3 swaps (the location of the intersection with the edge), stored so they can be accessed and output by the cell population. The locations are stored until they are cleared by ClearLocationsOfT3Swaps().

Definition at line 126 of file MutableVertexMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mProtorosetteFormationProbability
protected

The probability that, instead of a T1 swap, the relevant nodes merge to form a protorosette

Definition at line 86 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mProtorosetteResolutionProbabilityPerTimestep
protected

The probability that, in a given timestep, a protorosette node resolves into two rank-3 nodes

Definition at line 89 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mRosetteResolutionProbabilityPerTimestep
protected

The probability that, in a given timestep, a rosette node resolves into two lower-rank nodes

Definition at line 92 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mT2Threshold
protected

The area threshold at which T2 swaps occur in an apoptotic, triangular cell/element.

Definition at line 83 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< DIM, DIM >::serialize().


The documentation for this class was generated from the following files: