Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
Cylindrical2dNodesOnlyMesh Class Reference

#include <Cylindrical2dNodesOnlyMesh.hpp>

+ Inheritance diagram for Cylindrical2dNodesOnlyMesh:
+ Collaboration diagram for Cylindrical2dNodesOnlyMesh:

Public Member Functions

 Cylindrical2dNodesOnlyMesh (double width)
 
virtual void SetUpBoxCollection (double cutOffLength, c_vector< double, 2 *2 > domainSize, int numLocalRows=PETSC_DECIDE, c_vector< bool, 2 > isDimPeriodic=unit_vector< bool >(2, 0))
 
c_vector< double, 2 > GetVectorFromAtoB (const c_vector< double, 2 > &rLocation1, const c_vector< double, 2 > &rLocation2)
 
double GetWidth (const unsigned &rDimension) const
 
void SetNode (unsigned nodeIndex, ChastePoint< 2 > point, bool concreteMove=false)
 
unsigned AddNode (Node< 2 > *pNewNode)
 
void RefreshMesh ()
 
- Public Member Functions inherited from NodesOnlyMesh< 2 >
 NodesOnlyMesh ()
 
virtual ~NodesOnlyMesh ()
 
void ConstructNodesWithoutMesh (const std::vector< Node< SPACE_DIM > * > &rNodes, double maxInteractionDistance)
 
void ConstructNodesWithoutMesh (const std::vector< boost::shared_ptr< Node< SPACE_DIM > > > &rNodes, double maxInteractionDistance)
 
void ConstructNodesWithoutMesh (const AbstractMesh< SPACE_DIM, SPACE_DIM > &rGeneratingMesh, double maxInteractionDistance)
 
std::vector< bool > & rGetInitiallyOwnedNodes ()
 
void Clear ()
 
unsigned SolveNodeMapping (unsigned index) const
 
Node< SPACE_DIM > * GetNodeOrHaloNode (unsigned index) const
 
bool IsOwned (c_vector< double, SPACE_DIM > &location)
 
unsigned GetNumNodes () const
 
virtual unsigned GetMaximumNodeIndex ()
 
void SetMaximumInteractionDistance (double maxDistance)
 
double GetMaximumInteractionDistance ()
 
double GetWidth (const unsigned &rDimension) const
 
void SetCalculateNodeNeighbours (bool calculateNodeNeighbours)
 
void CalculateInteriorNodePairs (std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs)
 
void CalculateBoundaryNodePairs (std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs)
 
void ReMesh (NodeMap &rMap)
 
void SetInitialBoxCollection (const c_vector< double, 2 *SPACE_DIM > domainSize, double maxInteractionDistance)
 
void UpdateBoxCollection ()
 
void ResizeBoxCollection ()
 
bool GetIsPeriodicAcrossProcsFromBoxCollection () const
 
void AddNodesToBoxes ()
 
void AddHaloNodesToBoxes ()
 
void CalculateNodesOutsideLocalDomain ()
 
std::vector< unsigned > & rGetNodesToSendLeft ()
 
std::vector< unsigned > & rGetNodesToSendRight ()
 
std::vector< unsigned > & rGetHaloNodesToSendRight ()
 
std::vector< unsigned > & rGetHaloNodesToSendLeft ()
 
void AddHaloNode (boost::shared_ptr< Node< SPACE_DIM > > pNewNode)
 
void ClearHaloNodes ()
 
void SetNode (unsigned nodeIndex, ChastePoint< SPACE_DIM > point, bool concreteMove=false)
 
unsigned AddNode (Node< SPACE_DIM > *pNewNode)
 
void AddMovedNode (boost::shared_ptr< Node< SPACE_DIM > > pMovedNode)
 
void DeleteNode (unsigned index)
 
void DeleteMovedNode (unsigned index)
 
void SetMinimumNodeDomainBoundarySeparation (double separation)
 
void LoadBalanceMesh ()
 
void ConstructFromMeshReader (AbstractMeshReader< SPACE_DIM, SPACE_DIM > &rMeshReader)
 
std::vector< unsignedGetAllNodeIndices () const
 
- Public Member Functions inherited from MutableMesh< SPACE_DIM, SPACE_DIM >
bool CheckIsVoronoi (double maxPenetration=0.0)
 
 MutableMesh ()
 
 MutableMesh (std::vector< Node< SPACE_DIM > * > nodes)
 
virtual ~MutableMesh ()
 
unsigned GetNumElements () const
 
unsigned GetNumBoundaryElements () const
 
void RescaleMeshFromBoundaryNode (ChastePoint< 1 > updatedPoint, unsigned boundaryNodeIndex)
 
void RescaleMeshFromBoundaryNode (ChastePoint< 1 > updatedPoint, unsigned boundaryNodeIndex)
 
unsigned AddElement (Element< ELEMENT_DIM, SPACE_DIM > *pNewElement)
 
void MoveMergeNode (unsigned index, unsigned targetIndex, bool concreteMove=true)
 
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
 
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
 
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

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

Private Attributes

double mWidth
 

Friends

class TestCylindrical2dNodesOnlyMesh
 
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 NodesOnlyMesh< 2 >
virtual void SetUpBoxCollection (double cutOffLength, c_vector< double, 2 *SPACE_DIM > domainSize, int numLocalRows=PETSC_DECIDE, c_vector< bool, SPACE_DIM > isDimPeriodic=zero_vector< bool >(SPACE_DIM))
 
void ClearBoxCollection ()
 
DistributedBoxCollection< SPACE_DIM > * GetBoxCollection ()
 
- 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< SPACE_DIM, SPACE_DIM >
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 NodesOnlyMesh<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 NodesOnlyMesh<2>.

Definition at line 52 of file Cylindrical2dNodesOnlyMesh.hpp.

Constructor & Destructor Documentation

◆ Cylindrical2dNodesOnlyMesh()

Cylindrical2dNodesOnlyMesh::Cylindrical2dNodesOnlyMesh ( double  width)

Constructor.

Parameters
widththe width of the mesh (circumference)

Definition at line 39 of file Cylindrical2dNodesOnlyMesh.cpp.

Member Function Documentation

◆ AddNode()

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

Overridden AddNode() method.

Parameters
pNewNodepointer to the new node
Returns
index of new node

Definition at line 119 of file Cylindrical2dNodesOnlyMesh.cpp.

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

◆ GetVectorFromAtoB()

c_vector< double, 2 > Cylindrical2dNodesOnlyMesh::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 132 of file Cylindrical2dNodesOnlyMesh.cpp.

References mWidth.

◆ GetWidth()

double Cylindrical2dNodesOnlyMesh::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 73 of file Cylindrical2dNodesOnlyMesh.cpp.

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

◆ RefreshMesh()

void Cylindrical2dNodesOnlyMesh::RefreshMesh ( )
virtual

Overridden RefreshMesh() method.

If the location is outside the domain width, move it to within the boundary

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 153 of file Cylindrical2dNodesOnlyMesh.cpp.

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

◆ serialize()

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

Archives the member variables of the object which have to be preserved during its lifetime.

Note that we must archive any member variables FIRST so that this method can call a ReMesh (to convert from TrianglesMeshReader input format into our native format).

Parameters
archivethe archive
versionthe current version of this class

Definition at line 76 of file Cylindrical2dNodesOnlyMesh.hpp.

References mWidth.

◆ SetNode()

void Cylindrical2dNodesOnlyMesh::SetNode ( unsigned  nodeIndex,
ChastePoint< 2 >  point,
bool  concreteMove = false 
)

Overridden SetNode() method.

If the location should be set outside a cylindrical boundary move it back onto the cylinder.

Parameters
nodeIndexis 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 in the parent Class Note this should always be false here

Definition at line 89 of file Cylindrical2dNodesOnlyMesh.cpp.

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

Referenced by AddNode().

◆ SetUpBoxCollection()

void Cylindrical2dNodesOnlyMesh::SetUpBoxCollection ( double  cutOffLength,
c_vector< double, 2 *2 >  domainSize,
int  numLocalRows = PETSC_DECIDE,
c_vector< bool, 2 >  isDimPeriodic = unit_vector<bool>(2,0) 
)
virtual

Set up the box collection

Parameters
cutOffLengththe cut off length for node neighbours
domainSizethe size of the domain containing the nodes.
numLocalRowsthe number of rows of the collection that this process should own.
isDimPeriodicwhether the box collection should be periodic. Defaults to true in x not y.

Definition at line 46 of file Cylindrical2dNodesOnlyMesh.cpp.

References NodesOnlyMesh< 2 >::AddNodesToBoxes(), EXCEPTION, mWidth, and NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 63 of file Cylindrical2dNodesOnlyMesh.hpp.

◆ TestCylindrical2dNodesOnlyMesh

friend class TestCylindrical2dNodesOnlyMesh
friend

Definition at line 60 of file Cylindrical2dNodesOnlyMesh.hpp.

Member Data Documentation

◆ mWidth

double Cylindrical2dNodesOnlyMesh::mWidth
private

The periodic width of the domain

Definition at line 58 of file Cylindrical2dNodesOnlyMesh.hpp.

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


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