Chaste  Release::2017.1
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=nullptr)
 
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)
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MutableMesh< ELEMENT_DIM, SPACE_DIM >::~MutableMesh ( )
virtual

Destructor.

Definition at line 74 of file MutableMesh.cpp.

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

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(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElements, and Element< ELEMENT_DIM, SPACE_DIM >::ResetIndex().

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode ( Node< SPACE_DIM > *  pNewNode)
virtual
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckIsVoronoi ( Element< ELEMENT_DIM, SPACE_DIM > *  pElement,
double  maxPenetration 
)
private
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 1078 of file MutableMesh.cpp.

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

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 515 of file MutableMesh.cpp.

References EXCEPTION, 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 >::DeleteElement ( unsigned  index)
virtual
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, 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)

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 298 of file MutableMesh.cpp.

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

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumBoundaryElements ( ) const
virtual
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.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices, and AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes ( ) const
virtual
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 305 of file MutableMesh.cpp.

References EXCEPTION, 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>
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 459 of file MutableMesh.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), EXCEPTION, Element< ELEMENT_DIM, SPACE_DIM >::IncludesPoint(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElements, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, ChastePoint< DIM >::rGetLocation(), and Element< ELEMENT_DIM, SPACE_DIM >::UpdateNode().

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 676 of file MutableMesh.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::Clear(), EXCEPTION, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ExportToMesher(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::FreeTriangulateIo(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ImportFromMesher(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::InitialiseTriangulateIo(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::mAddedNodes, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElements, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElements, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mpDistributedVectorFactory, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::RefreshJacobianCachedData(), 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 809 of file MutableMesh.cpp.

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

Referenced by MutableMesh< SPACE_DIM, SPACE_DIM >::load(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::MutableMesh(), 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.

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

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, 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 MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::SetNode(), and Cylindrical2dMesh::SetNode().

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 
)
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 816 of file MutableMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistanceBetweenNodes(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), Node< SPACE_DIM >::GetIndex(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), and MutableMesh< ELEMENT_DIM, SPACE_DIM >::SplitEdge().

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
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedBoundaryElementIndices
protected

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