Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
Cylindrical2dMesh Class Reference

#include <Cylindrical2dMesh.hpp>

+ Inheritance diagram for Cylindrical2dMesh:
+ Collaboration diagram for Cylindrical2dMesh:

Public Member Functions

 Cylindrical2dMesh (double width)
 
 Cylindrical2dMesh (double width, std::vector< Node< 2 > * > nodes)
 
 ~Cylindrical2dMesh ()
 
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
 
void SetHaloScalingFactor (double haloScalingFactor)
 
double GetHaloScalingFactor () const
 
void SetHaloOffset (double haloOffset)
 
double GetHaloOffset () const
 
unsigned AddNode (Node< 2 > *pNewNode)
 
bool GetInstanceOfMismatchedBoundaryNodes ()
 
- 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 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 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 UpdateTopAndBottom ()
 
void CreateHaloNodes ()
 
void CreateMirrorNodes ()
 
void ReconstructCylindricalMesh ()
 
void DeleteHaloNodes ()
 
void CorrectNonPeriodicMesh ()
 
void GenerateVectorsOfElementsStraddlingPeriodicBoundaries ()
 
unsigned GetCorrespondingNodeIndex (unsigned nodeIndex)
 
void UseTheseElementsToDecideMeshing (std::set< unsigned > &rMainSideElements)
 
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

double mWidth
 
double mTop
 
double mBottom
 
double mHaloScalingFactor
 
double mHaloOffset
 
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< unsignedmTopHaloNodes
 
std::vector< unsignedmBottomHaloNodes
 
bool mMismatchedBoundaryElements
 

Friends

class TestCylindrical2dMesh
 
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 cylindrical 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 Cylindrical2dMesh.hpp.

Constructor & Destructor Documentation

◆ Cylindrical2dMesh() [1/2]

Cylindrical2dMesh::Cylindrical2dMesh ( double  width)

Constructor.

Parameters
widththe width of the mesh (circumference)

Definition at line 47 of file Cylindrical2dMesh.cpp.

◆ Cylindrical2dMesh() [2/2]

Cylindrical2dMesh::Cylindrical2dMesh ( double  width,
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 length scale
nodesa collection of nodes to construct the mesh with

Definition at line 60 of file Cylindrical2dMesh.cpp.

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

◆ ~Cylindrical2dMesh()

Cylindrical2dMesh::~Cylindrical2dMesh ( )

Destructor.

Definition at line 56 of file Cylindrical2dMesh.cpp.

Member Function Documentation

◆ AddNode()

unsigned Cylindrical2dMesh::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 532 of file Cylindrical2dMesh.cpp.

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

◆ CorrectNonPeriodicMesh()

void Cylindrical2dMesh::CorrectNonPeriodicMesh ( )
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 543 of file Cylindrical2dMesh.cpp.

References GenerateVectorsOfElementsStraddlingPeriodicBoundaries(), GetCorrespondingNodeIndex(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), mLeftPeriodicBoundaryElementIndices, mRightPeriodicBoundaryElementIndices, NEVER_REACHED, and UseTheseElementsToDecideMeshing().

Referenced by ReMesh().

◆ CreateHaloNodes()

void Cylindrical2dMesh::CreateHaloNodes ( )
private

This method creates a compressed row of nodes, just above and below the main mesh at a constant height (a 'halo'). These will mesh to a known configuration (each one on the boundary), this avoids boundary elements of lengths over half the mesh width, which prevent the process of cylindrical meshing.

The nodes which are created are later removed by DeleteHaloNodes().

Definition at line 159 of file Cylindrical2dMesh.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), mBottom, mBottomHaloNodes, mHaloOffset, mHaloScalingFactor, mTop, mTopHaloNodes, mWidth, and UpdateTopAndBottom().

Referenced by ReMesh().

◆ CreateMirrorNodes()

void Cylindrical2dMesh::CreateMirrorNodes ( )
private

◆ DeleteHaloNodes()

void Cylindrical2dMesh::DeleteHaloNodes ( )
private

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

This method removes the nodes which were added by CreateHaloNodes() before the remeshing algorithm was called.

Definition at line 467 of file Cylindrical2dMesh.cpp.

References MutableMesh< 2, 2 >::DeleteBoundaryNodeAt(), mBottomHaloNodes, and mTopHaloNodes.

Referenced by ReMesh().

◆ GenerateVectorsOfElementsStraddlingPeriodicBoundaries()

void Cylindrical2dMesh::GenerateVectorsOfElementsStraddlingPeriodicBoundaries ( )
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 cylindrical mesh.

Empties and repopulates the member variables mLeftPeriodicBoundaryElementIndices and mRightPeriodicBoundaryElementIndices

Definition at line 735 of file Cylindrical2dMesh.cpp.

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

Referenced by CorrectNonPeriodicMesh().

◆ GetCorrespondingNodeIndex()

unsigned Cylindrical2dMesh::GetCorrespondingNodeIndex ( 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 795 of file Cylindrical2dMesh.cpp.

References mLeftImages, mLeftOriginals, mRightImages, and mRightOriginals.

Referenced by CorrectNonPeriodicMesh(), and UseTheseElementsToDecideMeshing().

◆ GetHaloOffset()

double Cylindrical2dMesh::GetHaloOffset ( ) const
Returns
mHaloOffset

Definition at line 849 of file Cylindrical2dMesh.cpp.

References mHaloOffset.

◆ GetHaloScalingFactor()

double Cylindrical2dMesh::GetHaloScalingFactor ( ) const
Returns
mHaloScalingFactor

Definition at line 838 of file Cylindrical2dMesh.cpp.

References mHaloScalingFactor.

◆ GetInstanceOfMismatchedBoundaryNodes()

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

◆ GetVectorFromAtoB()

c_vector< double, 2 > Cylindrical2dMesh::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 cylindrical 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 477 of file Cylindrical2dMesh.cpp.

References mWidth.

◆ GetWidth()

double Cylindrical2dMesh::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 517 of file Cylindrical2dMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetWidth(), and mWidth.

◆ ReconstructCylindricalMesh()

void Cylindrical2dMesh::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 cylindrical 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 333 of file Cylindrical2dMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElement(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllBoundaryElements(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::IsDeleted(), BoundaryElement< ELEMENT_DIM, SPACE_DIM >::MarkAsDeleted(), MutableMesh< 2, 2 >::mDeletedBoundaryElementIndices, MutableMesh< 2, 2 >::mDeletedElementIndices, MutableMesh< 2, 2 >::mDeletedNodeIndices, mImageToLeftOriginalNodeMap, mImageToRightOriginalNodeMap, mLeftImages, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, mRightImages, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::ReplaceNode().

Referenced by ReMesh().

◆ ReMesh()

void Cylindrical2dMesh::ReMesh ( NodeMap rMap)
virtual

Overridden ReMesh() method.

Conduct a cylindrical remesh by calling CreateMirrorNodes() to create mirror image nodes, then calling ReMesh() on the parent class, then mapping the new node indices and calling ReconstructCylindricalMesh() 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 188 of file Cylindrical2dMesh.cpp.

References CorrectNonPeriodicMesh(), CreateHaloNodes(), CreateMirrorNodes(), DeleteHaloNodes(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), NodeMap::GetNewIndex(), 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(), mBottomHaloNodes, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElementJacobianDeterminants, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElements, TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElementWeightedDirections, mImageToLeftOriginalNodeMap, mImageToRightOriginalNodeMap, mLeftImages, mLeftOriginals, mLeftPeriodicBoundaryElementIndices, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, mRightImages, mRightOriginals, mRightPeriodicBoundaryElementIndices, mTopHaloNodes, ReconstructCylindricalMesh(), BoundaryElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes(), MutableMesh< 2, 2 >::ReIndex(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh(), NodeMap::ResetToIdentity(), NodeMap::Resize(), NodeMap::SetDeleted(), and NodeMap::SetNewIndex().

◆ serialize()

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

Archives the member variables of the Cylindrical2dMesh 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 215 of file Cylindrical2dMesh.hpp.

References mBottom, mHaloOffset, mHaloScalingFactor, mTop, and mWidth.

◆ SetHaloOffset()

void Cylindrical2dMesh::SetHaloOffset ( double  haloOffset)

Set mHaloOffset

Parameters
haloOffsetthe new value of mHaloOffset

Definition at line 854 of file Cylindrical2dMesh.cpp.

References mHaloOffset.

◆ SetHaloScalingFactor()

void Cylindrical2dMesh::SetHaloScalingFactor ( double  haloScalingFactor)

Set mHaloScalingFactor

Parameters
haloScalingFactorthe new value of mHaloScalingFactor

Definition at line 843 of file Cylindrical2dMesh.cpp.

References mHaloScalingFactor.

◆ SetNode()

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

Overridden SetNode() method.

If the location should be set outside a cylindrical 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 499 of file Cylindrical2dMesh.cpp.

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

Referenced by AddNode().

◆ UpdateTopAndBottom()

void Cylindrical2dMesh::UpdateTopAndBottom ( )
private

Calls AbstractMesh<2,2>::CalculateBoundingBox() to calculate mTop and mBottom for the cylindrical mesh.

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

Definition at line 85 of file Cylindrical2dMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::CalculateBoundingBox(), mBottom, mTop, ChasteCuboid< SPACE_DIM >::rGetLowerCorner(), and ChasteCuboid< SPACE_DIM >::rGetUpperCorner().

Referenced by CreateHaloNodes().

◆ UseTheseElementsToDecideMeshing()

void Cylindrical2dMesh::UseTheseElementsToDecideMeshing ( std::set< unsigned > &  rMainSideElements)
private

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 202 of file Cylindrical2dMesh.hpp.

◆ TestCylindrical2dMesh

friend class TestCylindrical2dMesh
friend

Definition at line 57 of file Cylindrical2dMesh.hpp.

Member Data Documentation

◆ mBottom

double Cylindrical2dMesh::mBottom
private

The bottom of the cylinder (y coordinate).

Definition at line 67 of file Cylindrical2dMesh.hpp.

Referenced by CreateHaloNodes(), serialize(), and UpdateTopAndBottom().

◆ mBottomHaloNodes

std::vector<unsigned > Cylindrical2dMesh::mBottomHaloNodes
private

The indices of nodes on the bottom boundary.

Definition at line 103 of file Cylindrical2dMesh.hpp.

Referenced by CreateHaloNodes(), DeleteHaloNodes(), and ReMesh().

◆ mHaloOffset

double Cylindrical2dMesh::mHaloOffset
private

Scaling factor for offset of halo nodes

Definition at line 73 of file Cylindrical2dMesh.hpp.

Referenced by CreateHaloNodes(), GetHaloOffset(), serialize(), and SetHaloOffset().

◆ mHaloScalingFactor

double Cylindrical2dMesh::mHaloScalingFactor
private

Scaling factor used to calculate numebr of halo nodes

Definition at line 70 of file Cylindrical2dMesh.hpp.

Referenced by CreateHaloNodes(), GetHaloScalingFactor(), serialize(), and SetHaloScalingFactor().

◆ mImageToLeftOriginalNodeMap

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

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

Definition at line 82 of file Cylindrical2dMesh.hpp.

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

◆ mImageToRightOriginalNodeMap

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

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

Definition at line 91 of file Cylindrical2dMesh.hpp.

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

◆ mLeftImages

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

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

Definition at line 79 of file Cylindrical2dMesh.hpp.

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

◆ mLeftOriginals

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

The left nodes which have been mirrored during the remesh.

Definition at line 76 of file Cylindrical2dMesh.hpp.

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

◆ mLeftPeriodicBoundaryElementIndices

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

The indices of elements which straddle the left periodic boundary.

Definition at line 94 of file Cylindrical2dMesh.hpp.

Referenced by CorrectNonPeriodicMesh(), CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingPeriodicBoundaries(), and ReMesh().

◆ mMismatchedBoundaryElements

bool Cylindrical2dMesh::mMismatchedBoundaryElements
private

Whether the number of left hand boundary nodes does not equal the number of right hand boundary nodes

Definition at line 106 of file Cylindrical2dMesh.hpp.

◆ mRightImages

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

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

Definition at line 88 of file Cylindrical2dMesh.hpp.

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

◆ mRightOriginals

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

The right nodes which have been mirrored during the remesh.

Definition at line 85 of file Cylindrical2dMesh.hpp.

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

◆ mRightPeriodicBoundaryElementIndices

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

The indices of elements which straddle the right periodic boundary.

Definition at line 97 of file Cylindrical2dMesh.hpp.

Referenced by CorrectNonPeriodicMesh(), CreateMirrorNodes(), GenerateVectorsOfElementsStraddlingPeriodicBoundaries(), and ReMesh().

◆ mTop

double Cylindrical2dMesh::mTop
private

The top of the cylinder (y coordinate).

Definition at line 64 of file Cylindrical2dMesh.hpp.

Referenced by CreateHaloNodes(), serialize(), and UpdateTopAndBottom().

◆ mTopHaloNodes

std::vector<unsigned > Cylindrical2dMesh::mTopHaloNodes
private

The indices of nodes on the top boundary.

Definition at line 100 of file Cylindrical2dMesh.hpp.

Referenced by CreateHaloNodes(), DeleteHaloNodes(), and ReMesh().

◆ mWidth

double Cylindrical2dMesh::mWidth
private

The circumference of the cylinder.

Definition at line 61 of file Cylindrical2dMesh.hpp.

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


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