Chaste  Release::3.4
MutableMesh< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <MutableMesh.hpp>

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

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)
 
unsigned AddElement (Element< ELEMENT_DIM, SPACE_DIM > *pNewElement)
 
virtual void SetNode (unsigned index, ChastePoint< SPACE_DIM > point, bool concreteMove=true)
 
void MoveMergeNode (unsigned index, unsigned targetIndex, bool concreteMove=true)
 
virtual void DeleteNode (unsigned index)
 
virtual void DeleteElement (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 ()
 
std::vector< c_vector
< unsigned, 5 > > 
SplitLongEdges (double cutoffLength)
 
c_vector< unsigned, 3 > SplitEdge (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
bool CheckIsVoronoi (double maxPenetration=0.0)
 
template<>
void RescaleMeshFromBoundaryNode (ChastePoint< 1 > updatedPoint, unsigned boundaryNodeIndex)
 
- Public Member Functions inherited from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
 TetrahedralMesh ()
 
void ConstructFromMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
 
void ReadNodesPerProcessorFile (const std::string &rNodesPerProcessorFile)
 
bool CheckIsConforming ()
 
double GetVolume ()
 
double GetSurfaceArea ()
 
void RefreshMesh ()
 
void PermuteNodes ()
 
void PermuteNodes (const std::vector< unsigned > &perm)
 
unsigned GetContainingElementIndexWithInitialGuess (const ChastePoint< SPACE_DIM > &rTestPoint, unsigned startingElementGuess, bool strict=false)
 
unsigned GetNearestElementIndex (const ChastePoint< SPACE_DIM > &rTestPoint)
 
std::vector< unsignedGetContainingElementIndices (const ChastePoint< SPACE_DIM > &rTestPoint)
 
double GetAngleBetweenNodes (unsigned indexA, unsigned indexB)
 
virtual void RefreshJacobianCachedData ()
 
virtual void GetJacobianForElement (unsigned elementIndex, c_matrix< double, SPACE_DIM, SPACE_DIM > &rJacobian, double &rJacobianDeterminant) const
 
virtual void GetInverseJacobianForElement (unsigned elementIndex, c_matrix< double, SPACE_DIM, ELEMENT_DIM > &rJacobian, double &rJacobianDeterminant, c_matrix< double, ELEMENT_DIM, SPACE_DIM > &rInverseJacobian) const
 
virtual void GetWeightedDirectionForElement (unsigned elementIndex, c_vector< double, SPACE_DIM > &rWeightedDirection, double &rJacobianDeterminant) const
 
virtual void GetWeightedDirectionForBoundaryElement (unsigned elementIndex, c_vector< double, SPACE_DIM > &rWeightedDirection, double &rJacobianDeterminant) const
 
EdgeIterator EdgesBegin ()
 
EdgeIterator EdgesEnd ()
 
- Public Member Functions inherited from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
ElementIterator GetElementIteratorBegin (bool skipDeletedElements=true)
 
ElementIterator GetElementIteratorEnd ()
 
 AbstractTetrahedralMesh ()
 
virtual ~AbstractTetrahedralMesh ()
 
virtual unsigned GetNumLocalElements () const
 
virtual unsigned GetNumLocalBoundaryElements () const
 
unsigned GetNumAllElements () const
 
unsigned GetNumAllBoundaryElements () const
 
virtual unsigned GetNumCableElements () const
 
virtual unsigned GetNumVertices () const
 
virtual unsigned GetMaximumNodeIndex ()
 
Element< ELEMENT_DIM, SPACE_DIM > * GetElement (unsigned index) const
 
BoundaryElement< ELEMENT_DIM-1,
SPACE_DIM > * 
GetBoundaryElement (unsigned index) const
 
void ConstructFromMesh (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rOtherMesh)
 
BoundaryElementIterator GetBoundaryElementIteratorBegin () const
 
BoundaryElementIterator GetBoundaryElementIteratorEnd () const
 
void CheckOutwardNormals ()
 
virtual void ConstructLinearMesh (unsigned width)
 
virtual void ConstructRectangularMesh (unsigned width, unsigned height, bool stagger=true)
 
virtual void ConstructCuboid (unsigned width, unsigned height, unsigned depth)
 
void ConstructRegularSlabMesh (double spaceStep, double width, double height=0, double depth=0)
 
void ConstructRegularSlabMeshWithDimensionSplit (unsigned dimension, double spaceStep, double width, double height=0, double depth=0)
 
virtual bool CalculateDesignatedOwnershipOfBoundaryElement (unsigned faceIndex)
 
virtual bool CalculateDesignatedOwnershipOfElement (unsigned elementIndex)
 
unsigned CalculateMaximumNodeConnectivityPerProcess () const
 
virtual void GetHaloNodeIndices (std::vector< unsigned > &rHaloIndices) const
 
void CalculateNodeExchange (std::vector< std::vector< unsigned > > &rNodesToSendPerProcess, std::vector< std::vector< unsigned > > &rNodesToReceivePerProcess)
 
virtual c_vector< double, 2 > CalculateMinMaxEdgeLengths ()
 
unsigned GetContainingElementIndex (const ChastePoint< SPACE_DIM > &rTestPoint, bool strict=false, std::set< unsigned > testElements=std::set< unsigned >(), bool onlyTryWithTestElements=false)
 
unsigned GetNearestElementIndexFromTestElements (const ChastePoint< SPACE_DIM > &rTestPoint, std::set< unsigned > testElements)
 
- 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 DistributedVectorFactoryGetDistributedVectorFactory ()
 
virtual void SetDistributedVectorFactory (DistributedVectorFactory *pFactory)
 
BoundaryNodeIterator GetBoundaryNodeIteratorBegin () const
 
BoundaryNodeIterator GetBoundaryNodeIteratorEnd () const
 
std::string GetMeshFileBaseName () const
 
bool IsMeshOnDisk () const
 
const std::vector< unsigned > & rGetNodePermutation () const
 
virtual c_vector< double,
SPACE_DIM > 
GetVectorFromAtoB (const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
 
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)
 
bool IsMeshChanging () const
 
unsigned CalculateMaximumContainingElementsPerProcess () const
 
void SetMeshHasChangedSinceLoading ()
 

Protected Attributes

std::vector< unsignedmDeletedElementIndices
 
std::vector< unsignedmDeletedBoundaryElementIndices
 
std::vector< unsignedmDeletedNodeIndices
 
bool mAddedNodes
 
- Protected Attributes inherited from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
std::vector< c_vector< double,
SPACE_DIM > > 
mElementWeightedDirections
 
std::vector< c_matrix< double,
SPACE_DIM, ELEMENT_DIM > > 
mElementJacobians
 
std::vector< c_matrix< double,
ELEMENT_DIM, SPACE_DIM > > 
mElementInverseJacobians
 
std::vector< doublemElementJacobianDeterminants
 
std::vector< c_vector< double,
SPACE_DIM > > 
mBoundaryElementWeightedDirections
 
std::vector< doublemBoundaryElementJacobianDeterminants
 
- Protected Attributes inherited from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
bool mMeshIsLinear
 
std::vector< Element
< ELEMENT_DIM, SPACE_DIM > * > 
mElements
 
std::vector< BoundaryElement
< ELEMENT_DIM-1, SPACE_DIM > * > 
mBoundaryElements
 
- 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
 

Private Member Functions

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

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Types inherited from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
typedef std::vector
< BoundaryElement< ELEMENT_DIM-1,
SPACE_DIM >
* >::const_iterator 
BoundaryElementIterator
 
- Public Types inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
typedef std::vector< Node
< SPACE_DIM >
* >::const_iterator 
BoundaryNodeIterator
 
- Protected Member Functions inherited from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
unsigned SolveNodeMapping (unsigned index) const
 
unsigned SolveElementMapping (unsigned index) const
 
unsigned SolveBoundaryElementMapping (unsigned index) const
 
template<class MESHER_IO >
void ExportToMesher (NodeMap &map, MESHER_IO &mesherInput, int *elementList=NULL)
 
template<class MESHER_IO >
void ImportFromMesher (MESHER_IO &mesherOutput, unsigned numberOfElements, int *elementList, unsigned numberOfFaces, int *faceList, int *edgeMarkerList)
 
void InitialiseTriangulateIo (triangulateio &mesherIo)
 
void FreeTriangulateIo (triangulateio &mesherIo)
 
- Protected Member Functions inherited from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >
void SetElementOwnerships ()
 
- Protected Member Functions inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
ChasteCuboid< SPACE_DIM > CalculateBoundingBox (const std::vector< Node< SPACE_DIM > * > &rNodes) const
 

Detailed Description

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

A concrete mutable mesh class.

Definition at line 50 of file MutableMesh.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableMesh< ELEMENT_DIM, SPACE_DIM >::MutableMesh ( )

Constructor.

Definition at line 52 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)

Constructor which takes in a vector of nodes.

Parameters
nodesa vector of nodes

Definition at line 59 of file MutableMesh.cpp.

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

Destructor.

Definition at line 74 of file MutableMesh.cpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddElement ( Element< ELEMENT_DIM, SPACE_DIM > *  pNewElement)

Helper method to add an element to the mesh.

Parameters
pNewElementpointer to the new element object. The object will be updated with the index assigned to the element.
Returns
new element index

Definition at line 100 of file MutableMesh.cpp.

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

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

Add a node to the mesh.

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

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

Reimplemented in NodesOnlyMesh< SPACE_DIM >, NodesOnlyMesh< DIM >, and NodesOnlyMesh< 2 >.

Definition at line 80 of file MutableMesh.cpp.

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

Referenced by Cylindrical2dMesh::AddNode(), Cylindrical2dMesh::CreateHaloNodes(), and Cylindrical2dMesh::CreateMirrorNodes().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckIsVoronoi ( Element< ELEMENT_DIM, SPACE_DIM > *  pElement,
double  maxPenetration 
)
private
Returns
true if the mesh is Voronoi local to the given element. Check whether any neighbouring node is inside the circumsphere of this element.
Parameters
pElementpointer to an element
maxPenetrationis the maximum distance a node is allowed to be inside the circumsphere of the element, as a proportion of the circumsphere radius.

Definition at line 995 of file MutableMesh.cpp.

References Element< ELEMENT_DIM, SPACE_DIM >::CalculateCircumsphere(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and Node< SPACE_DIM >::rGetContainingElementIndices().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckIsVoronoi ( double  maxPenetration = 0.0)
Returns
true if Voronoi. Checks the entire mesh element by element and checks whether any neighbouring node is inside the circumsphere of this element.
Parameters
maxPenetrationis 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 1079 of file MutableMesh.cpp.

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

Clear all the data in the mesh.

Reimplemented from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in NodesOnlyMesh< DIM >, and NodesOnlyMesh< 2 >.

Definition at line 124 of file MutableMesh.cpp.

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

Referenced by NodesOnlyMesh< SPACE_DIM >::Clear().

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

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
indexThe index of the node to remove.

Definition at line 516 of file MutableMesh.cpp.

References EXCEPTION, 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(), and Node< SPACE_DIM >::SetAsBoundaryNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteElement ( unsigned  index)
virtual

Delete an element from the mesh. Any remaining nodes not connected to an element are also removed.

Parameters
indexThe index of the element to be deleted

Definition at line 267 of file MutableMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNode ( unsigned  index)
virtual

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

Parameters
indexis the index of the node to be deleted

Reimplemented in NodesOnlyMesh< SPACE_DIM >, NodesOnlyMesh< DIM >, and NodesOnlyMesh< 2 >.

Definition at line 231 of file MutableMesh.cpp.

References EXCEPTION, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex().

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

Parameters
indexThe index of the node to delete

Definition at line 299 of file MutableMesh.cpp.

Referenced by HoneycombMeshGenerator::GetCircularMesh(), and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::RemoveDeadCells().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumBoundaryElements ( ) const
virtual
Returns
the number of boundary elements that are actually in use.

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 135 of file MutableMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements ( ) const
virtual
Returns
the number of elements that are actually in use.

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 141 of file MutableMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes ( ) const
virtual
Returns
the number of nodes that are actually in use.

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in NodesOnlyMesh< DIM >, and NodesOnlyMesh< 2 >.

Definition at line 147 of file MutableMesh.cpp.

Referenced by HoneycombMeshGenerator::GetCellLocationIndices(), HoneycombMeshGenerator::GetCircularMesh(), and MutableMesh< SPACE_DIM, SPACE_DIM >::load().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::load ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Load the mesh, along with attributes if saved nodes have attributes. Loading of attributes is covered in TestNodesOnlyMesh.

Parameters
archivethe archive to save to.
versionthe version number.

Definition at line 93 of file MutableMesh.hpp.

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

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

Parameters
indexis the index of the node to be moved
targetIndexis the index of the node to move to
concreteMovecan 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 306 of file MutableMesh.cpp.

References EXCEPTION.

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

Refine an element at a given point.

Parameters
pElementpointer to the element
pointa point located in the element
Returns
index of the new node which has been created at the given location

Definition at line 460 of file MutableMesh.cpp.

References EXCEPTION, Element< ELEMENT_DIM, SPACE_DIM >::IncludesPoint(), ChastePoint< DIM >::rGetLocation(), and Element< ELEMENT_DIM, SPACE_DIM >::UpdateNode().

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

Re-index a mesh so that it has no deleted elements or nodes.

Parameters
mapis a NodeMap which associates the indices of nodes in the old mesh with indices of nodes in the new mesh. This should be created with the correct size (NumAllNodes)

Definition at line 565 of file MutableMesh.cpp.

References NodeMap::Resize(), NodeMap::SetDeleted(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::SetIndex(), and NodeMap::SetNewIndex().

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

Re-mesh a mesh using triangle (via library calls) or tetgen

Parameters
mapis a NodeMap which associates the indices of nodes in the old mesh with indices of nodes in the new mesh. This should be created with the correct size (NumAllNodes)

Reimplemented in NodesOnlyMesh< SPACE_DIM >, NodesOnlyMesh< DIM >, NodesOnlyMesh< 2 >, and Cylindrical2dMesh.

Definition at line 677 of file MutableMesh.cpp.

References EXCEPTION, Node< SPACE_DIM >::GetIndex(), NodeMap::Resize(), NodeMap::SetDeleted(), and NodeMap::SetNewIndex().

Referenced by CylindricalHoneycombMeshGenerator::CylindricalHoneycombMeshGenerator(), HoneycombMeshGenerator::GetCircularMesh(), and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::Update().

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

Alternative version of remesh which takes no parameters, i.e. does not require a NodeMap. It will create one and call the other ReMesh method. Note: inherited classes should overload ReMesh(NodeMap&)

Definition at line 810 of file MutableMesh.cpp.

Referenced by MutableMesh< SPACE_DIM, SPACE_DIM >::load(), and Cylindrical2dMesh::ReMesh().

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

The RescaleMeshFromBoundaryNode method is only defined for 1D meshes.

Parameters
updatedPointpoint determining the scale factor
boundaryNodeIndexindex of the boundary node

Definition at line 159 of file MutableMesh.cpp.

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
updatedPointpoint determining the scale factor
boundaryNodeIndexindex of the boundary node
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::save ( Archive &  archive,
const unsigned int  version 
) const
inlineprivate

Save the mesh, along with attributes if nodes have attributes. Saving of attributes is covered in TestNodesOnlyMesh.

Parameters
archivethe archive to save to.
versionthe version number.

Definition at line 62 of file MutableMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::SetNode ( unsigned  index,
ChastePoint< SPACE_DIM >  point,
bool  concreteMove = true 
)
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
indexis the index of the node to be moved
pointis the new target location of the node
concreteMoveis set to false if we want to skip the signed area tests (defaults to true)

Reimplemented in NodesOnlyMesh< SPACE_DIM >, NodesOnlyMesh< DIM >, and NodesOnlyMesh< 2 >.

Definition at line 174 of file MutableMesh.cpp.

References EXCEPTION.

Referenced by MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::SetNode(), Cylindrical2dMesh::SetNode(), and MeshBasedCellPopulationWithGhostNodes< DIM >::UpdateGhostPositions().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< unsigned, 3 > MutableMesh< ELEMENT_DIM, SPACE_DIM >::SplitEdge ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)

Splits an edge in two and create all the relevant new elements and nodes

Parameters
pNodeAfirst point defining the edge
pNodeBsecond point defining the edge
Returns
the index of the new node

Definition at line 914 of file MutableMesh.cpp.

References Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), NEVER_REACHED, AbstractElement< ELEMENT_DIM, SPACE_DIM >::ReplaceNode(), Node< SPACE_DIM >::rGetContainingElementIndices(), Node< SPACE_DIM >::rGetLocation(), and UNSIGNED_UNSET.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< c_vector< unsigned, 5 > > MutableMesh< ELEMENT_DIM, SPACE_DIM >::SplitLongEdges ( double  cutoffLength)

Find edges in the mesh longer than the given cutoff length and split them creating new elements as required.

Parameters
cutoffLengthcutoff length for edge splitting
Returns
returns a vector of triples with pointers to the new node followed by pointers to the nodes defining the bisected edge.
Todo:
use iterators to tidy this up

Definition at line 817 of file MutableMesh.cpp.

References Node< SPACE_DIM >::GetIndex().

Friends And Related Function Documentation

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

Needed for serialization.

Definition at line 53 of file MutableMesh.hpp.

Member Data Documentation

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

Whether any nodes have been added to the mesh.

Definition at line 151 of file MutableMesh.hpp.

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

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

Definition at line 142 of file MutableMesh.hpp.

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

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

Definition at line 136 of file MutableMesh.hpp.

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

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

Definition at line 148 of file MutableMesh.hpp.


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