Chaste Release::3.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 >:

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 57 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 
)

Default constructor.

Parameters:
nodesvector of pointers to nodes
vertexElementsvector of pointers to VertexElements
cellRearrangementThresholdthe minimum threshold distance for element rearrangment (defaults to 0.01)
t2Thresholdthe maximum threshold distance for Type 2 swaps (defaults to 0.001)
cellRearrangementRatioratio between the minimum threshold distance for element rearrangment node separation after remeshing (defaults to 1.5)

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 120 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 245 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 226 of file MutableVertexMesh.cpp.

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

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

Helper method for ReMesh to check if elements have intersected and to correct them if required

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Returns:
whether to recheck the mesh again

Definition at line 896 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::CheckForT1Swaps ( VertexElementMap rElementMap) [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:
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 to recheck the mesh again

Todo:
use iterators to tidy this up

Definition at line 804 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) [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:
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 to recheck the mesh again

Definition at line 867 of file MutableVertexMesh.cpp.

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 T1Swaps

Definition at line 214 of file MutableVertexMesh.cpp.

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

Helper method to clear the stored T3Swaps

Definition at line 220 of file MutableVertexMesh.cpp.

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 585 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 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 609 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 
)

Add a node on the edge between two nodes.

Parameters:
pNodeAa pointer to one node
pNodeBa pointer to the other nodes

Definition at line 616 of file MutableVertexMesh.cpp.

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

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

Definition at line 457 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.

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
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)

Definition at line 268 of file MutableVertexMesh.cpp.

References EXCEPTION, Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, 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.

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
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 442 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 138 of file MutableVertexMesh.cpp.

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

Definition at line 126 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 144 of file MutableVertexMesh.cpp.

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 T1Swaps

Definition at line 202 of file MutableVertexMesh.cpp.

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 T3Swaps

Definition at line 208 of file MutableVertexMesh.cpp.

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 189 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 183 of file MutableVertexMesh.cpp.

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

Definition at line 132 of file MutableVertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::IdentifySwapType ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB,
VertexElementMap rElementMap 
) [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:
pNodeAone of the nodes to perform the swap with
pNodeBthe other node to perform the swap
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 962 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(), 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 to perform an element swap to fix overlaping elements

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
Parameters:
pNodepointer to the node
elementIndexglobal index of the element in the mesh

Definition at line 1517 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 to merge nodes when needed. Replaces the node contained in the least number of elements with the other node.

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

Definition at line 1288 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 >::PerformT1Swap ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB,
std::set< unsigned > &  rElementsContainingNodes 
) [protected]

Helper method for ReMesh to perform the T1 Swap

Todo:
This method currently assumes SPACE_DIM = 2 (see #866)
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? (#1884)

Definition at line 1339 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 >::PerformT3Swap ( Node< SPACE_DIM > *  pNode,
unsigned  elementIndex 
) [protected]
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() to remove a triangular void in which one of the edges is less than the cell rearrangement threshold.

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 2452 of file MutableVertexMesh.cpp.

References Node< SPACE_DIM >::GetIndex(), 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 ( )

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

Definition at line 797 of file MutableVertexMesh.cpp.

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

Re-mesh the mesh.

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

Definition at line 747 of file MutableVertexMesh.cpp.

References EXCEPTION.

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 721 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 682 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 
) [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:
archivethe archive
versionthe current version of this class

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in Cylindrical2dVertexMesh.

Definition at line 236 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 162 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 150 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 168 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 262 of file MutableVertexMesh.cpp.

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 156 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.

Reimplemented from VertexMesh< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in Cylindrical2dVertexMesh.

Definition at line 223 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 71 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 65 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 77 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 83 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 80 of file MutableVertexMesh.hpp.

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

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

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

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


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