Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
Toroidal2dMesh Class Reference

#include <Toroidal2dMesh.hpp>

+ Inheritance diagram for Toroidal2dMesh:
+ Collaboration diagram for Toroidal2dMesh:

Public Member Functions

 Toroidal2dMesh (double width, double depth)
 
 Toroidal2dMesh (double width, double depth, std::vector< Node< 2 > * > nodes)
 
 ~Toroidal2dMesh ()
 
void ReMesh (NodeMap &rMap)
 
c_vector< double, 2 > GetVectorFromAtoB (const c_vector< double, 2 > &rLocation1, const c_vector< double, 2 > &rLocation2)
 
void SetNode (unsigned index, ChastePoint< 2 > point, bool concreteMove)
 
double GetWidth (const unsigned &rDimension) const
 
unsigned AddNode (Node< 2 > *pNewNode)
 
bool GetInstanceOfMismatchedBoundaryNodes ()
 
void RefreshMesh ()
 
- Public Member Functions inherited from MutableMesh< 2, 2 >
bool CheckIsVoronoi (double maxPenetration=0.0)
 
 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)
 
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)
 
void ReMesh ()
 
std::vector< c_vector< unsigned, 5 > > SplitLongEdges (double cutoffLength)
 
c_vector< unsigned, 3 > SplitEdge (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
- 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 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 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 ()
 

Private Member Functions

void CreateMirrorNodes ()
 
void ReconstructCylindricalMesh ()
 
void ReconstructToroidalMesh ()
 
void CorrectCylindricalNonPeriodicMesh ()
 
void CorrectToroidalNonPeriodicMesh ()
 
void GenerateVectorsOfElementsStraddlingCylindricalPeriodicBoundaries ()
 
void GenerateVectorsOfElementsStraddlingToroidalPeriodicBoundaries ()
 
unsigned GetCorrespondingCylindricalNodeIndex (unsigned nodeIndex)
 
unsigned GetCorrespondingToroidalNodeIndex (unsigned nodeIndex)
 
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

double mWidth
 
double mHeight
 
std::vector< unsignedmLeftOriginals
 
std::vector< unsignedmLeftImages
 
std::map< unsigned, unsignedmImageToLeftOriginalNodeMap
 
std::vector< unsignedmRightOriginals
 
std::vector< unsignedmRightImages
 
std::map< unsigned, unsignedmImageToRightOriginalNodeMap
 
std::set< unsignedmLeftPeriodicBoundaryElementIndices
 
std::set< unsignedmRightPeriodicBoundaryElementIndices
 
std::vector< unsignedmBottomOriginals
 
std::vector< unsignedmBottomImages
 
std::map< unsigned, unsignedmImageToBottomOriginalNodeMap
 
std::vector< unsignedmTopOriginals
 
std::vector< unsignedmTopImages
 
std::map< unsigned, unsignedmImageToTopOriginalNodeMap
 
std::set< unsignedmBottomPeriodicBoundaryElementIndices
 
std::set< unsignedmTopPeriodicBoundaryElementIndices
 
bool mMismatchedBoundaryElements
 

Friends

class TestToroidal2dMesh
 
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
 
- Protected Attributes inherited from MutableMesh< 2, 2 >
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
 

Detailed Description

A subclass of MutableMesh<2,2> for a rectangular mesh with periodic left and right boundaries, representing a Toroidal geometry.

The class works by overriding calls such as ReMesh() and GetVectorFromAtoB() so that simulation classes can treat this class in exactly the same way as a MutableMesh<2,2>.

Definition at line 55 of file Toroidal2dMesh.hpp.

Constructor & Destructor Documentation

◆ Toroidal2dMesh() [1/2]

Toroidal2dMesh::Toroidal2dMesh ( double  width,
double  depth 
)

Con+structor.

Parameters
widththe periodic width of the mesh
depththe periodic depth of the mesh

Definition at line 47 of file Toroidal2dMesh.cpp.

◆ Toroidal2dMesh() [2/2]

Toroidal2dMesh::Toroidal2dMesh ( double  width,
double  depth,
std::vector< Node< 2 > * >  nodes 
)

A constructor which reads in a width and collection of nodes, then calls a ReMesh() command to create the elements of the mesh.

Parameters
widththe periodic width of the mesh
depththe periodic depth of the mesh
nodesa collection of nodes to construct the mesh with

Definition at line 60 of file Toroidal2dMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, MutableMesh< 2, 2 >::ReMesh(), Node< SPACE_DIM >::rGetLocation(), and UNUSED_OPT.

◆ ~Toroidal2dMesh()

Toroidal2dMesh::~Toroidal2dMesh ( )

Destructor.

Definition at line 56 of file Toroidal2dMesh.cpp.

Member Function Documentation

◆ AddNode()

unsigned Toroidal2dMesh::AddNode ( Node< 2 > *  pNewNode)

Overridden AddNode() method.

Parameters
pNewNodethe node to be added to the mesh
Returns
the global index of the new node

Definition at line 798 of file Toroidal2dMesh.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), Node< SPACE_DIM >::GetPoint(), and SetNode().

◆ CorrectCylindricalNonPeriodicMesh()

void Toroidal2dMesh::CorrectCylindricalNonPeriodicMesh ( )
private

This method should only ever be called by the public ReMesh() method.

Uses mLeftPeriodicBoundaryElementIndices and mRightPeriodicBoundaryElementIndices and compares the nodes in each to ensure that both boundaries have been meshed identically. If they have not it calls UseTheseElementsToDecideMeshing() to sort out the troublesome elements which have been meshed differently on each side and uses the meshing of the elements on the right hand boundary to decide on how to mesh the left hand side.

Definition at line 809 of file Toroidal2dMesh.cpp.

References GenerateVectorsOfElementsStraddlingCylindricalPeriodicBoundaries(), GetCorrespondingCylindricalNodeIndex(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), mLeftPeriodicBoundaryElementIndices, mRightPeriodicBoundaryElementIndices, and NEVER_REACHED.

Referenced by ReMesh().

◆ CorrectToroidalNonPeriodicMesh()

void Toroidal2dMesh::CorrectToroidalNonPeriodicMesh ( )
private

This method should only ever be called by the public ReMesh() method.

Uses mLeftPeriodicBoundaryElementIndices and mRightPeriodicBoundaryElementIndices and compares the nodes in each to ensure that both boundaries have been meshed identically. If they have not it calls UseTheseElementsToDecideMeshing() to sort out the troublesome elements which have been meshed differently on each side and uses the meshing of the elements on the right hand boundary to decide on how to mesh the left hand side.

Definition at line 915 of file Toroidal2dMesh.cpp.

References GenerateVectorsOfElementsStraddlingToroidalPeriodicBoundaries(), GetCorrespondingToroidalNodeIndex(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), mBottomPeriodicBoundaryElementIndices, mTopPeriodicBoundaryElementIndices, and NEVER_REACHED.

Referenced by ReMesh().

◆ CreateMirrorNodes()

◆ GenerateVectorsOfElementsStraddlingCylindricalPeriodicBoundaries()

void Toroidal2dMesh::GenerateVectorsOfElementsStraddlingCylindricalPeriodicBoundaries ( )
private

This method should only ever be called by the public ReMesh method.

The elements which straddle the periodic boundaries need to be identified in order to compare the list on the right with the list on the left and reconstruct a Toroidal mesh.

Empties and repopulates the member variables mLeftPeriodicBoundaryElementIndices and mRightPeriodicBoundaryElementIndices

Definition at line 1022 of file Toroidal2dMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), mImageToLeftOriginalNodeMap, mImageToRightOriginalNodeMap, mLeftPeriodicBoundaryElementIndices, and mRightPeriodicBoundaryElementIndices.

Referenced by CorrectCylindricalNonPeriodicMesh().

◆ GenerateVectorsOfElementsStraddlingToroidalPeriodicBoundaries()

void Toroidal2dMesh::GenerateVectorsOfElementsStraddlingToroidalPeriodicBoundaries ( )
private

This method should only ever be called by the public ReMesh method.

The elements which straddle the periodic boundaries need to be identified in order to compare the list on the right with the list on the left and reconstruct a Toroidal mesh.

Empties and repopulates the member variables mLeftPeriodicBoundaryElementIndices and mRightPeriodicBoundaryElementIndices

Definition at line 1103 of file Toroidal2dMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), mBottomPeriodicBoundaryElementIndices, mImageToBottomOriginalNodeMap, mImageToTopOriginalNodeMap, and mTopPeriodicBoundaryElementIndices.

Referenced by CorrectToroidalNonPeriodicMesh().

◆ GetCorrespondingCylindricalNodeIndex()

unsigned Toroidal2dMesh::GetCorrespondingCylindricalNodeIndex ( unsigned  nodeIndex)
private

This method should only ever be called by the public ReMesh() method.

Parameters
nodeIndexThe index of an original/mirrored node
Returns
the index of the corresponding mirror image of that node (can be either an original or mirror node)

Definition at line 1154 of file Toroidal2dMesh.cpp.

References mRightImages, mRightOriginals, and NEVER_REACHED.

Referenced by CorrectCylindricalNonPeriodicMesh().

◆ GetCorrespondingToroidalNodeIndex()

unsigned Toroidal2dMesh::GetCorrespondingToroidalNodeIndex ( unsigned  nodeIndex)
private

This method should only ever be called by the public ReMesh() method.

Parameters
nodeIndexThe index of an original/mirrored node
Returns
the index of the corresponding mirror image of that node (can be either an original or mirror node)

Definition at line 1203 of file Toroidal2dMesh.cpp.

References mTopImages, mTopOriginals, and NEVER_REACHED.

Referenced by CorrectToroidalNonPeriodicMesh().

◆ GetInstanceOfMismatchedBoundaryNodes()

bool Toroidal2dMesh::GetInstanceOfMismatchedBoundaryNodes ( )
Returns
whether you have mismatched numbers of left and right boundary nodes

◆ GetVectorFromAtoB()

c_vector< double, 2 > Toroidal2dMesh::GetVectorFromAtoB ( const c_vector< double, 2 > &  rLocation1,
const c_vector< double, 2 > &  rLocation2 
)

Overridden GetVectorFromAtoB() method.

Evaluates the (surface) distance between two points in a 2D Toroidal geometry.

Parameters
rLocation1the x and y co-ordinates of point 1
rLocation2the x and y co-ordinates of point 2
Returns
the vector from location1 to location2

Definition at line 720 of file Toroidal2dMesh.cpp.

References mHeight, and mWidth.

◆ GetWidth()

double Toroidal2dMesh::GetWidth ( const unsigned rDimension) const
virtual

Overridden GetWidth() method.

Calculate the 'width' of any dimension of the mesh, taking periodicity into account.

Parameters
rDimensiona dimension (0 or 1)
Returns
The maximum distance between any nodes in this dimension.

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 783 of file Toroidal2dMesh.cpp.

References mHeight, and mWidth.

◆ ReconstructCylindricalMesh()

void Toroidal2dMesh::ReconstructCylindricalMesh ( )
private

After any corrections have been made to the boundary elements (see UseTheseElementsToDecideMeshing()) this method deletes the mirror image nodes, elements and boundary elements created for a Toroidal remesh by cycling through the elements and changing elements with partly real and partly imaginary elements to be real with periodic real nodes instead of mirror image nodes. We end up with very strangely shaped elements which cross the whole mesh but specify the correct connections between nodes.

This method should only ever be called by the public ReMesh() method.

Definition at line 449 of file Toroidal2dMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), MutableMesh< 2, 2 >::mDeletedElementIndices, MutableMesh< 2, 2 >::mDeletedNodeIndices, mImageToLeftOriginalNodeMap, mImageToRightOriginalNodeMap, mLeftImages, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and mRightImages.

Referenced by ReMesh().

◆ ReconstructToroidalMesh()

void Toroidal2dMesh::ReconstructToroidalMesh ( )
private

After any corrections have been made to the boundary elements (see UseTheseElementsToDecideMeshing()) this method deletes the mirror image nodes, elements and boundary elements created for a Toroidal remesh by cycling through the elements and changing elements with partly real and partly imaginary elements to be real with periodic real nodes instead of mirror image nodes. We end up with very strangely shaped elements which cross the whole mesh but specify the correct connections between nodes.

This method should only ever be called by the public ReMesh() method.

Definition at line 586 of file Toroidal2dMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), mBottomImages, MutableMesh< 2, 2 >::mDeletedElementIndices, MutableMesh< 2, 2 >::mDeletedNodeIndices, mImageToBottomOriginalNodeMap, mImageToTopOriginalNodeMap, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and mTopImages.

Referenced by ReMesh().

◆ RefreshMesh()

void Toroidal2dMesh::RefreshMesh ( )
virtual

Overridden RefreshMesh method. This method moves node backinto domain and calls RefreshJacobianCachedData.

Reimplemented from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 1252 of file Toroidal2dMesh.cpp.

References mHeight, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and mWidth.

◆ ReMesh()

void Toroidal2dMesh::ReMesh ( NodeMap rMap)
virtual

Overridden ReMesh() method.

Conduct a Toroidal remesh by calling CreateMirrorNodes() to create mirror image nodes, then calling ReMesh() on the parent class, then mapping the new node indices and calling ReconstructToroidalMesh() to remove surplus nodes, leaving a fully periodic mesh.

Parameters
rMapa reference to a nodemap which should be created with the required number of nodes.

Reimplemented from MutableMesh< 2, 2 >.

Definition at line 199 of file Toroidal2dMesh.cpp.

References CorrectCylindricalNonPeriodicMesh(), CorrectToroidalNonPeriodicMesh(), CreateMirrorNodes(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), NodeMap::GetNewIndex(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllElements(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), NodeMap::GetSize(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::IsDeleted(), NodeMap::IsDeleted(), NodeMap::IsIdentityMap(), mBottomImages, mBottomOriginals, mBottomPeriodicBoundaryElementIndices, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElementJacobianDeterminants, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElements, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElementWeightedDirections, MutableMesh< 2, 2 >::mDeletedBoundaryElementIndices, MutableMesh< 2, 2 >::mDeletedElementIndices, mHeight, mImageToBottomOriginalNodeMap, mImageToLeftOriginalNodeMap, mImageToRightOriginalNodeMap, mImageToTopOriginalNodeMap, mLeftImages, mLeftOriginals, mLeftPeriodicBoundaryElementIndices, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, mRightImages, mRightOriginals, mRightPeriodicBoundaryElementIndices, mTopImages, mTopOriginals, mTopPeriodicBoundaryElementIndices, mWidth, ReconstructCylindricalMesh(), ReconstructToroidalMesh(), BoundaryElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes(), MutableMesh< 2, 2 >::ReIndex(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh(), NodeMap::ResetToIdentity(), NodeMap::Resize(), Node< SPACE_DIM >::rGetLocation(), NodeMap::SetDeleted(), and NodeMap::SetNewIndex().

◆ serialize()

template<class Archive >
void Toroidal2dMesh::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Archives the member variables of the Toroidal2dMesh class which have to be preserved during the lifetime of the mesh.

The remaining member variables are re-initialised before being used by each ReMesh() call so they do not need to be archived.

Parameters
archivethe archive
versionthe current version of this class the current version of this class

Definition at line 236 of file Toroidal2dMesh.hpp.

References mHeight, and mWidth.

◆ SetNode()

void Toroidal2dMesh::SetNode ( unsigned  index,
ChastePoint< 2 >  point,
bool  concreteMove 
)

Overridden SetNode() method.

If the location should be set outside a Toroidal boundary, it is moved back onto the cylinder.

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

Definition at line 752 of file Toroidal2dMesh.cpp.

References mHeight, mWidth, ChastePoint< DIM >::rGetLocation(), ChastePoint< DIM >::SetCoordinate(), and MutableMesh< ELEMENT_DIM, SPACE_DIM >::SetNode().

Referenced by AddNode().

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 223 of file Toroidal2dMesh.hpp.

◆ TestToroidal2dMesh

friend class TestToroidal2dMesh
friend

Definition at line 57 of file Toroidal2dMesh.hpp.

Member Data Documentation

◆ mBottomImages

std::vector<unsigned> Toroidal2dMesh::mBottomImages
private

The image nodes corresponding to these Bottom nodes (on Top of mesh).

Definition at line 94 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), ReconstructToroidalMesh(), and ReMesh().

◆ mBottomOriginals

std::vector<unsigned> Toroidal2dMesh::mBottomOriginals
private

The Bottom nodes which have been mirrored during the remesh.

Definition at line 91 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), and ReMesh().

◆ mBottomPeriodicBoundaryElementIndices

std::set<unsigned> Toroidal2dMesh::mBottomPeriodicBoundaryElementIndices
private

The indices of elements which straddle the Bottom periodic boundary.

Definition at line 109 of file Toroidal2dMesh.hpp.

Referenced by CorrectToroidalNonPeriodicMesh(), CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingToroidalPeriodicBoundaries(), and ReMesh().

◆ mHeight

double Toroidal2dMesh::mHeight
private

The periodic height of the domain.

Definition at line 64 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GetVectorFromAtoB(), GetWidth(), RefreshMesh(), ReMesh(), serialize(), and SetNode().

◆ mImageToBottomOriginalNodeMap

std::map<unsigned, unsigned> Toroidal2dMesh::mImageToBottomOriginalNodeMap
private

A map from image node index (on Top of mesh) to original node index (on Bottom of mesh).

Definition at line 97 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingToroidalPeriodicBoundaries(), ReconstructToroidalMesh(), and ReMesh().

◆ mImageToLeftOriginalNodeMap

std::map<unsigned, unsigned> Toroidal2dMesh::mImageToLeftOriginalNodeMap
private

A map from image node index (on right of mesh) to original node index (on left of mesh).

Definition at line 73 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingCylindricalPeriodicBoundaries(), ReconstructCylindricalMesh(), and ReMesh().

◆ mImageToRightOriginalNodeMap

std::map<unsigned, unsigned> Toroidal2dMesh::mImageToRightOriginalNodeMap
private

A map from image node index (on left of mesh) to original node index (on right of mesh).

Definition at line 82 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingCylindricalPeriodicBoundaries(), ReconstructCylindricalMesh(), and ReMesh().

◆ mImageToTopOriginalNodeMap

std::map<unsigned, unsigned> Toroidal2dMesh::mImageToTopOriginalNodeMap
private

A map from image node index (on Bottom of mesh) to original node index (on Top of mesh).

Definition at line 106 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingToroidalPeriodicBoundaries(), ReconstructToroidalMesh(), and ReMesh().

◆ mLeftImages

std::vector<unsigned> Toroidal2dMesh::mLeftImages
private

The image nodes corresponding to these left nodes (on right of mesh).

Definition at line 70 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), ReconstructCylindricalMesh(), and ReMesh().

◆ mLeftOriginals

std::vector<unsigned> Toroidal2dMesh::mLeftOriginals
private

The left nodes which have been mirrored during the remesh.

Definition at line 67 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), and ReMesh().

◆ mLeftPeriodicBoundaryElementIndices

std::set<unsigned> Toroidal2dMesh::mLeftPeriodicBoundaryElementIndices
private

The indices of elements which straddle the left periodic boundary.

Definition at line 85 of file Toroidal2dMesh.hpp.

Referenced by CorrectCylindricalNonPeriodicMesh(), CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingCylindricalPeriodicBoundaries(), and ReMesh().

◆ mMismatchedBoundaryElements

bool Toroidal2dMesh::mMismatchedBoundaryElements
private

Whether the number of left hand boundary nodes does not equal the number of right hand boundary nodes (and top=bottom)

Definition at line 116 of file Toroidal2dMesh.hpp.

◆ mRightImages

std::vector<unsigned> Toroidal2dMesh::mRightImages
private

The image nodes corresponding to these right nodes (on left of mesh).

Definition at line 79 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GetCorrespondingCylindricalNodeIndex(), ReconstructCylindricalMesh(), and ReMesh().

◆ mRightOriginals

std::vector<unsigned> Toroidal2dMesh::mRightOriginals
private

The right nodes which have been mirrored during the remesh.

Definition at line 76 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GetCorrespondingCylindricalNodeIndex(), and ReMesh().

◆ mRightPeriodicBoundaryElementIndices

std::set<unsigned> Toroidal2dMesh::mRightPeriodicBoundaryElementIndices
private

The indices of elements which straddle the right periodic boundary.

Definition at line 88 of file Toroidal2dMesh.hpp.

Referenced by CorrectCylindricalNonPeriodicMesh(), CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingCylindricalPeriodicBoundaries(), and ReMesh().

◆ mTopImages

std::vector<unsigned> Toroidal2dMesh::mTopImages
private

The image nodes corresponding to these Top nodes (on Bottom of mesh).

Definition at line 103 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GetCorrespondingToroidalNodeIndex(), ReconstructToroidalMesh(), and ReMesh().

◆ mTopOriginals

std::vector<unsigned> Toroidal2dMesh::mTopOriginals
private

The Top nodes which have been mirrored during the remesh.

Definition at line 100 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GetCorrespondingToroidalNodeIndex(), and ReMesh().

◆ mTopPeriodicBoundaryElementIndices

std::set<unsigned> Toroidal2dMesh::mTopPeriodicBoundaryElementIndices
private

The indices of elements which straddle the Top periodic boundary.

Definition at line 112 of file Toroidal2dMesh.hpp.

Referenced by CorrectToroidalNonPeriodicMesh(), CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingToroidalPeriodicBoundaries(), and ReMesh().

◆ mWidth

double Toroidal2dMesh::mWidth
private

The periodic width of the domina.

Definition at line 61 of file Toroidal2dMesh.hpp.

Referenced by CreateMirrorNodes(), GetVectorFromAtoB(), GetWidth(), RefreshMesh(), ReMesh(), serialize(), and SetNode().


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