MutableMesh< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <MutableMesh.hpp>

Inheritance diagram for MutableMesh< ELEMENT_DIM, SPACE_DIM >:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MutableMesh ()
 MutableMesh (std::vector< Node< SPACE_DIM > * > nodes)
virtual ~MutableMesh ()
void Clear ()
unsigned GetNumNodes () const
unsigned GetNumElements () const
unsigned GetNumBoundaryElements () const
void RescaleMeshFromBoundaryNode (ChastePoint< 1 > updatedPoint, unsigned boundaryNodeIndex)
virtual unsigned AddNode (Node< SPACE_DIM > *pNewNode)
virtual void SetNode (unsigned index, ChastePoint< SPACE_DIM > point, bool concreteMove=true)
void MoveMergeNode (unsigned index, unsigned targetIndex, bool concreteMove=true)
void DeleteNode (unsigned index)
void DeleteNodePriorToReMesh (unsigned index)
unsigned RefineElement (Element< ELEMENT_DIM, SPACE_DIM > *pElement, ChastePoint< SPACE_DIM > point)
void DeleteBoundaryNodeAt (unsigned index)
void ReIndex (NodeMap &map)
virtual void ReMesh (NodeMap &map)
void ReMesh ()
bool CheckVoronoi (double maxPenetration=0.0)
template<>
void RescaleMeshFromBoundaryNode (ChastePoint< 1 > updatedPoint, unsigned boundaryNodeIndex)

Protected Attributes

std::vector< unsigned > mDeletedElementIndices
std::vector< unsigned > mDeletedBoundaryElementIndices
std::vector< unsigned > mDeletedNodeIndices
bool mAddedNodes

Private Member Functions

template<class Archive>
void serialize (Archive &archive, const unsigned int version)
bool CheckVoronoi (Element< ELEMENT_DIM, SPACE_DIM > *pElement, double maxPenetration)

Friends

class boost::serialization::access


Detailed Description

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

A concrete mutable mesh class.

Definition at line 42 of file MutableMesh.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableMesh< ELEMENT_DIM, SPACE_DIM >::MutableMesh (  )  [inline]

Constructor.

Definition at line 45 of file MutableMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mMeshChangesDuringSimulation.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableMesh< ELEMENT_DIM, SPACE_DIM >::MutableMesh ( std::vector< Node< SPACE_DIM > * >  nodes  )  [inline]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableMesh< ELEMENT_DIM, SPACE_DIM >::~MutableMesh (  )  [inline, virtual]

Destructor.

Definition at line 67 of file MutableMesh.cpp.

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


Member Function Documentation

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

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 TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in Cylindrical2dMesh.

Definition at line 58 of file MutableMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckVoronoi ( Element< ELEMENT_DIM, SPACE_DIM > *  pElement,
double  maxPenetration 
) [inline, private]

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes (  )  const [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements (  )  const [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumBoundaryElements (  )  const [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::RescaleMeshFromBoundaryNode ( ChastePoint< 1 >  updatedPoint,
unsigned  boundaryNodeIndex 
)

Todo:
should unsigned GetNumBoundaryNodes() be overloaded too??
Rescale the mesh from a boundary node.

Parameters:
updatedPoint point determining the scale factor
boundaryNodeIndex index of the boundary node

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode ( Node< SPACE_DIM > *  pNewNode  )  [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::SetNode ( unsigned  index,
ChastePoint< SPACE_DIM >  point,
bool  concreteMove = true 
) [inline, virtual]

Move the node with a particular index to a new point in space and verifies that the signed areas of the supporting Elements are positive.

Parameters:
index is the index of the node to be moved
point is the new target location of the node
concreteMove is set to false if we want to skip the signed area tests (defaults to true)

Definition at line 143 of file MutableMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElement(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElementWeightedDirections, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by MeshBasedTissue< DIM >::SetNode(), Cylindrical2dMesh::SetNode(), and MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostPositions().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::MoveMergeNode ( unsigned  index,
unsigned  targetIndex,
bool  concreteMove = true 
) [inline]

Move one node to another (i.e. merges the nodes), refreshing/deleting elements as appropriate.

Parameters:
index is the index of the node to be moved
targetIndex is the index of the node to move to
concreteMove can be set to false if you just want to check whether this will work (defaults to true). Set it to true if you're doing the merger for real, in order to do all the bookkeeping.

Definition at line 243 of file MutableMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElement(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElementJacobianDeterminants, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElementWeightedDirections, MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedBoundaryElementIndices, MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices, MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElementJacobianDeterminants, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNode ( unsigned  index  )  [inline]

Delete a node from the mesh by finding an appropriate neighbour node to merge it with.

Parameters:
index is the index of the node to be deleted

Definition at line 200 of file MutableMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and MutableMesh< ELEMENT_DIM, SPACE_DIM >::MoveMergeNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< 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. (Thus saves work compared to DeleteNode() function and does not MoveMerge the node and elements).

Parameters:
index The index of the node to delete

Definition at line 236 of file MutableMesh.cpp.

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

Referenced by HoneycombMeshGenerator::GetCircularMesh(), and MeshBasedTissue< DIM >::RemoveDeadCells().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::RefineElement ( Element< ELEMENT_DIM, SPACE_DIM > *  pElement,
ChastePoint< SPACE_DIM >  point 
) [inline]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteBoundaryNodeAt ( unsigned  index  )  [inline]

Remove a boundary node, and update all the appropriate data structures.

The deleted node is not removed from the list, merely marked as deleted, and can be reused when a new node is added to the mesh.

Any elements or boundary elements containing this node will be removed. The boundary nodes information will be updated with new boundary node(s). NB: New boundary elements WILL NOT be added.

Parameters:
index The index of the node to remove.

Definition at line 453 of file MutableMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElement(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), Node< SPACE_DIM >::IsDeleted(), Element< ELEMENT_DIM, SPACE_DIM >::MarkAsDeleted(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedBoundaryElementIndices, MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices, MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and Node< SPACE_DIM >::SetAsBoundaryNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReIndex ( NodeMap map  )  [inline]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh ( NodeMap map  )  [inline, virtual]

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

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

Definition at line 920 of file MutableMesh.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

Referenced by MutableMesh< ELEMENT_DIM, SPACE_DIM >::MutableMesh(), Cylindrical2dMesh::ReMesh(), and MutableMesh< DIM, DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckVoronoi ( double  maxPenetration = 0.0  )  [inline]

Checks the entire mesh element by element and checks whether any neighbouring node is inside the circumsphere of this element.

Parameters:
maxPenetration is the maximum distance a node is allowed to be inside the circumsphere of an element that it is not a member of, as a proportion of the circumsphere radius.

Todo:
use ElementIterator here?

Definition at line 1012 of file MutableMesh.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckVoronoi(), and AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

template<>
void MutableMesh< 1, 1 >::RescaleMeshFromBoundaryNode ( ChastePoint< 1 >  updatedPoint,
unsigned  boundaryNodeIndex 
) [inline]

The RescaleMeshFromBoundaryNode method is only defined for 1D meshes.

Parameters:
updatedPoint point determining the scale factor
boundaryNodeIndex index of the boundary node

Definition at line 128 of file MutableMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::RefreshMesh().


Friends And Related Function Documentation

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

Needed for serialization.

Reimplemented from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in Cylindrical2dMesh.

Definition at line 45 of file MutableMesh.hpp.


Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices [protected]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedBoundaryElementIndices [protected]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices [protected]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::mAddedNodes [protected]


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

Generated on Tue Aug 4 16:11:32 2009 for Chaste by  doxygen 1.5.5