MutableVertexMesh< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <MutableVertexMesh.hpp>

Inherits VertexMesh< ELEMENT_DIM, SPACE_DIM >.

Collaboration diagram for MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >:
Collaboration graph
[legend]

List of all members.

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)
 MutableVertexMesh ()
virtual ~MutableVertexMesh ()
void SetCellRearrangementThreshold (double cellRearrangementThreshold)
void SetT2Threshold (double t2Threshold)
void SetCellRearrangementRatio (double cellRearrangementRatio)
virtual void SetNode (unsigned nodeIndex, ChastePoint< SPACE_DIM > point)
void SetCheckForInternalIntersections (bool checkForInternalIntersections)
double GetCellRearrangementThreshold () const
double GetT2Threshold () const
double GetCellRearrangementRatio () const
unsigned GetNumNodes () const
unsigned GetNumElements () const
bool GetCheckForInternalIntersections () const
std::vector< c_vector< double,
SPACE_DIM > > 
GetLocationsOfT1Swaps ()
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)
void Clear ()
void DivideEdge (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
void RemoveDeletedNodesAndElements (VertexElementMap &rElementMap)
void RemoveDeletedNodes ()
void ReMesh (VertexElementMap &rElementMap)
void ReMesh ()

Protected Member Functions

unsigned DivideElement (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned nodeAIndex, unsigned nodeBIndex, bool placeOriginalElementBelow=false)
bool CheckForT1Swaps (VertexElementMap &rElementMap)
bool CheckForT2Swaps (VertexElementMap &rElementMap)
bool CheckForIntersections ()
void IdentifySwapType (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB, VertexElementMap &rElementMap)
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)
template<class Archive >
void serialize (Archive &archive, const unsigned int version)

Protected Attributes

double mCellRearrangementThreshold
double mCellRearrangementRatio
double mT2Threshold
bool mCheckForInternalIntersections
std::vector< unsignedmDeletedNodeIndices
std::vector< unsignedmDeletedElementIndices
std::vector< c_vector< double,
SPACE_DIM > > 
mLocationsOfT1Swaps
std::vector< c_vector< double,
SPACE_DIM > > 
mLocationsOfT3Swaps

Friends

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

Detailed Description

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

A vertex-based mesh class, for use in vertex-based cell-based simulations.

Definition at line 50 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 
) [inline]

Default constructor.

Parameters:
nodes vector of pointers to nodes
vertexElements vector of pointers to VertexElements
cellRearrangementThreshold the minimum threshold distance for element rearrangment (defaults to 0.01)
t2Threshold the maximum threshold distance for Type 2 swaps (defaults to 0.001)
cellRearrangementRatio ratio between the minimum threshold distance for element rearrangment node separation after remeshing (defaults to 1.5)

Definition at line 36 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 (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::~MutableVertexMesh (  )  [inline, virtual]

Destructor.

Definition at line 113 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::Clear().


Member Function Documentation

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

Add an element to the mesh.

Parameters:
pNewElement the new element
Returns:
the index of the new element in the mesh

Definition at line 238 of file MutableVertexMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements, and VertexElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddNode ( Node< SPACE_DIM > *  pNewNode  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForIntersections (  )  [inline, protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForT1Swaps ( VertexElementMap rElementMap  )  [inline, protected]

Helper method for ReMesh to check if any neighbouring nodes in an element are within the mCellRearrangementThreshold and perform any T1Swaps if required

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Parameters:
rElementMap a 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 to recheck the mesh again

Todo:
use iterators to tidy this up

Definition at line 797 of file MutableVertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistanceBetweenNodes(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), Node< SPACE_DIM >::GetIndex(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::IdentifySwapType(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementThreshold, and Node< SPACE_DIM >::rGetContainingElementIndices().

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForT2Swaps ( VertexElementMap rElementMap  )  [inline, protected]

Helper method for ReMesh to check if any elements are smaller than the mT2Threshold and perform any T2Swaps, removing elements, if required

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Parameters:
rElementMap a 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 to recheck the mesh again

Definition at line 860 of file MutableVertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetT2Threshold(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVolumeOfElement(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT2Swap(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodesAndElements().

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh().

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

Helper method to clear the stored T1Swaps

Definition at line 207 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLocationsOfT1Swaps.

Referenced by VertexBasedCellPopulation< DIM >::WriteResultsToFiles().

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

Helper method to clear the stored T3Swaps

Definition at line 213 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLocationsOfT3Swaps.

Referenced by VertexBasedCellPopulation< DIM >::WriteResultsToFiles().

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

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:
index the global index of a specified vertex element

Definition at line 578 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNodePriorToReMesh(), Node< SPACE_DIM >::GetIndex(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices, VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements, Node< SPACE_DIM >::rGetContainingElementIndices(), and Node< SPACE_DIM >::SetAsBoundaryNode().

Referenced by VertexBasedCellPopulation< DIM >::RemoveDeadCells().

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

Mark a 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:
index The index of the node to delete

Definition at line 602 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DeleteElementPriorToReMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideEdge ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
) [inline]
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 
) [inline, protected]

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

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Parameters:
pElement the element to divide
nodeAIndex the local index of one node within this element
nodeBIndex the local index of another node within this element
placeOriginalElementBelow whether 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

Definition at line 450 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddElement(), VertexElement< ELEMENT_DIM, SPACE_DIM >::DeleteNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices, and VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElementAlongGivenAxis().

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 
) [inline]

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.

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Parameters:
pElement the element to divide
axisOfDivision axis to divide the element by
placeOriginalElementBelow whether 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)

Definition at line 261 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElement(), EXCEPTION, VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetCentroidOfElement(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), Node< SPACE_DIM >::IsBoundaryNode(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementRatio, MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementThreshold, Node< SPACE_DIM >::rGetContainingElementIndices(), and Node< SPACE_DIM >::rGetLocation().

Referenced by VertexBasedCellPopulation< DIM >::AddCell(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElementAlongShortAxis().

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

Divide an element along its short axis.

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Parameters:
pElement the element to divide
placeOriginalElementBelow whether 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 435 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElementAlongGivenAxis(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetShortAxisOfElement().

Referenced by VertexBasedCellPopulation< DIM >::AddCell().

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

Definition at line 137 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCheckForInternalIntersections.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< c_vector< double, SPACE_DIM > > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLocationsOfT1Swaps (  )  [inline]
Returns:
the locations of the T1Swaps

Definition at line 195 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLocationsOfT1Swaps.

Referenced by VertexBasedCellPopulation< DIM >::WriteResultsToFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< c_vector< double, SPACE_DIM > > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLocationsOfT3Swaps (  )  [inline]
Returns:
the locations of the T3Swaps

Definition at line 201 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLocationsOfT3Swaps.

Referenced by VertexBasedCellPopulation< DIM >::WriteResultsToFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements (  )  const [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes (  )  const [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetT2Threshold (  )  const [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::IdentifySwapType ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB,
VertexElementMap rElementMap 
) [inline, protected]

Helper method for ReMesh to Identify the type of swap when nodes are too close, T2Swap or NodeMerge.

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Parameters:
pNodeA one of the nodes to perform the swap with
pNodeB the other node to perform the swap
rElementMap a 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 955 of file MutableVertexMesh.cpp.

References EXCEPTION, Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), Node< SPACE_DIM >::IsBoundaryNode(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, NEVER_REACHED, MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformNodeMerge(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT1Swap(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformVoidRemoval(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodes(), and Node< SPACE_DIM >::rGetContainingElementIndices().

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForT1Swaps().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformIntersectionSwap ( Node< SPACE_DIM > *  pNode,
unsigned  elementIndex 
) [inline, protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformNodeMerge ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
) [inline, protected]
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 
) [inline, protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT2Swap ( VertexElement< ELEMENT_DIM, SPACE_DIM > &  rElement  )  [inline, protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT3Swap ( Node< SPACE_DIM > *  pNode,
unsigned  elementIndex 
) [inline, protected]

Called by ReMesh(). Moves a node, which has been found to overlap an element, back onto the edge of that element and associates it with the element and adds new nodes to maitain three elemets a node.

Parameters:
pNode pointer to the node
elementIndex global index of the element in the mesh

Definition at line 1784 of file MutableVertexMesh.cpp.

References VertexElement< ELEMENT_DIM, SPACE_DIM >::AddNode(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), VertexElement< ELEMENT_DIM, SPACE_DIM >::DeleteNode(), EXCEPTION, VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), Node< SPACE_DIM >::GetIndex(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLocalIndexForElementEdgeClosestToPoint(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), Node< SPACE_DIM >::GetNumContainingElements(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), Node< SPACE_DIM >::IsBoundaryNode(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementRatio, MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementThreshold, MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices, MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLocationsOfT3Swaps, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, NEVER_REACHED, Node< SPACE_DIM >::rGetContainingElementIndices(), Node< SPACE_DIM >::rGetLocation(), Node< SPACE_DIM >::rGetModifiableLocation(), Node< SPACE_DIM >::SetAsBoundaryNode(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetNode().

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForIntersections().

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 
) [inline, protected]

Helper method for ReMesh() to remove a triangular void in which one of the edges is less than the cell rearrangement threshold.

Parameters:
pNodeA one of the nodes on the short edge
pNodeB the other node on the short edge
pNodeC the other node in the triangular void

Definition at line 2445 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::GetIndex(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformNodeMerge(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodes(), Node< SPACE_DIM >::rGetLocation(), Node< SPACE_DIM >::rGetModifiableLocation(), and Node< SPACE_DIM >::SetAsBoundaryNode().

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::IdentifySwapType().

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

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

Definition at line 790 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh ( VertexElementMap rElementMap  )  [inline]

Re-mesh the mesh.

Parameters:
rElementMap a 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:
put code for remeshing in 3D here - see #866 and the paper doi:10.1016/j.jtbi.2003.10.001

Definition at line 740 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForIntersections(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForT1Swaps(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForT2Swaps(), EXCEPTION, MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodes(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodesAndElements().

Referenced by VertexBasedCellPopulation< DIM >::Update().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodes (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodesAndElements ( VertexElementMap rElementMap  )  [inline]

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

Parameters:
rElementMap a 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 675 of file MutableVertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllElements(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices, VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements, MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::RemoveDeletedNodes(), VertexElementMap::Resize(), VertexElementMap::SetDeleted(), and VertexElementMap::SetNewIndex().

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForT2Swaps(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh().

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

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:
archive the archive
version the current version of this class

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in Cylindrical2dVertexMesh.

Definition at line 229 of file MutableVertexMesh.hpp.

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

Set method for mCellRearrangementRatio.

Parameters:
cellRearrangementRatio 

Definition at line 155 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementRatio.

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

Set method for mCellRearrangementThreshold.

Parameters:
cellRearrangementThreshold 

Definition at line 143 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementThreshold.

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

Set method for mCheckForInternalIntersections.

Parameters:
checkForInternalIntersections 

Definition at line 161 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCheckForInternalIntersections.

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

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

Parameters:
nodeIndex the index of the node to be moved
point the new target location of the node

Definition at line 255 of file MutableVertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT3Swap(), and VertexBasedCellPopulation< DIM >::SetNode().

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

Set method for mT2Threshold.

Parameters:
t2Threshold 

Definition at line 149 of file MutableVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mT2Threshold.


Friends And Related Function Documentation

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

Needed for serialization.

Reimplemented from VertexMesh< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in Cylindrical2dVertexMesh.

Definition at line 216 of file MutableVertexMesh.hpp.


Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementRatio [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCellRearrangementThreshold [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mCheckForInternalIntersections [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< c_vector<double, SPACE_DIM> > MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::mLocationsOfT1Swaps [protected]

Locations of T1Swaps (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 82 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ClearLocationsOfT1Swaps(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLocationsOfT1Swaps(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT1Swap().

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

Locations of T3Swaps (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 88 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::ClearLocationsOfT3Swaps(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLocationsOfT3Swaps(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT3Swap().

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 67 of file MutableVertexMesh.hpp.

Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::GetT2Threshold(), MutableVertexMesh< DIM, DIM >::serialize(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetT2Threshold().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:06:39 2011 for Chaste by  doxygen 1.6.3