Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
PeriodicNodesOnlyMesh< SPACE_DIM > Class Template Reference

#include <PeriodicNodesOnlyMesh.hpp>

+ Inheritance diagram for PeriodicNodesOnlyMesh< SPACE_DIM >:
+ Collaboration diagram for PeriodicNodesOnlyMesh< SPACE_DIM >:

Public Member Functions

 PeriodicNodesOnlyMesh (c_vector< double, SPACE_DIM > width)
 
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))
 
c_vector< double, SPACE_DIM > GetVectorFromAtoB (const c_vector< double, SPACE_DIM > &rLocation1, const c_vector< double, SPACE_DIM > &rLocation2)
 
double GetWidth (const unsigned &rDimension) const
 
c_vector< double, SPACE_DIM > GetPeriodicWidths () const
 
void SetNode (unsigned nodeIndex, ChastePoint< SPACE_DIM > point, bool concreteMove=false)
 
unsigned AddNode (Node< SPACE_DIM > *pNewNode)
 
void RefreshMesh ()
 
- Public Member Functions inherited from NodesOnlyMesh< SPACE_DIM >
 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 ()
 
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 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
 
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

c_vector< double, SPACE_DIM > mWidth
 
c_vector< bool, SPACE_DIM > mIsDimPeriodic
 

Friends

class TestPeriodicNodesOnlyMesh
 
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< 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

template<unsigned SPACE_DIM>
class PeriodicNodesOnlyMesh< SPACE_DIM >

A subclass of NodesOnlyMesh<SPACE_DIM> for a rectangular mesh with periodic boundaries.

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<SPACE_DIM>.

Definition at line 53 of file PeriodicNodesOnlyMesh.hpp.

Constructor & Destructor Documentation

◆ PeriodicNodesOnlyMesh()

template<unsigned SPACE_DIM>
PeriodicNodesOnlyMesh< SPACE_DIM >::PeriodicNodesOnlyMesh ( c_vector< double, SPACE_DIM >  width)

Constructor.

Parameters
widththe periodic widths of the mesh. (Note if width=0.0 then not periodic)

Definition at line 40 of file PeriodicNodesOnlyMesh.cpp.

References PeriodicNodesOnlyMesh< SPACE_DIM >::mIsDimPeriodic.

Member Function Documentation

◆ AddNode()

template<unsigned SPACE_DIM>
unsigned PeriodicNodesOnlyMesh< SPACE_DIM >::AddNode ( Node< SPACE_DIM > *  pNewNode)
virtual

Overridden AddNode() method.

Parameters
pNewNodepointer to the new node
Returns
index of new node

Reimplemented from NodesOnlyMesh< SPACE_DIM >.

Definition at line 167 of file PeriodicNodesOnlyMesh.cpp.

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

◆ GetPeriodicWidths()

template<unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > PeriodicNodesOnlyMesh< SPACE_DIM >::GetPeriodicWidths ( ) const

Method to get the width of the periodic dimensions

Returns
The value of the mWidth vector

Definition at line 94 of file PeriodicNodesOnlyMesh.cpp.

◆ GetVectorFromAtoB()

template<unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > PeriodicNodesOnlyMesh< SPACE_DIM >::GetVectorFromAtoB ( const c_vector< double, SPACE_DIM > &  rLocation1,
const c_vector< double, SPACE_DIM > &  rLocation2 
)
virtual

Overridden GetVectorFromAtoB() method.

Evaluates the (surface) distance between two points in ND periodic geometry.

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

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 181 of file PeriodicNodesOnlyMesh.cpp.

◆ GetWidth()

template<unsigned SPACE_DIM>
double PeriodicNodesOnlyMesh< SPACE_DIM >::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,1 or 2)
Returns
The maximum distance between any nodes in this dimension.

Reimplemented from NodesOnlyMesh< SPACE_DIM >.

Definition at line 100 of file PeriodicNodesOnlyMesh.cpp.

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

◆ RefreshMesh()

template<unsigned SPACE_DIM>
void PeriodicNodesOnlyMesh< SPACE_DIM >::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 208 of file PeriodicNodesOnlyMesh.cpp.

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

◆ serialize()

template<unsigned SPACE_DIM>
template<class Archive >
void PeriodicNodesOnlyMesh< SPACE_DIM >::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 82 of file PeriodicNodesOnlyMesh.hpp.

References PeriodicNodesOnlyMesh< SPACE_DIM >::mIsDimPeriodic, and PeriodicNodesOnlyMesh< SPACE_DIM >::mWidth.

◆ SetNode()

template<unsigned SPACE_DIM>
void PeriodicNodesOnlyMesh< SPACE_DIM >::SetNode ( unsigned  nodeIndex,
ChastePoint< SPACE_DIM >  point,
bool  concreteMove = false 
)
virtual

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

Reimplemented from NodesOnlyMesh< SPACE_DIM >.

Definition at line 118 of file PeriodicNodesOnlyMesh.cpp.

References ChastePoint< DIM >::rGetLocation(), and ChastePoint< DIM >::SetCoordinate().

◆ SetUpBoxCollection()

template<unsigned SPACE_DIM>
void PeriodicNodesOnlyMesh< SPACE_DIM >::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) 
)
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 in the x y and/or z direction.

Reimplemented from NodesOnlyMesh< SPACE_DIM >.

Definition at line 57 of file PeriodicNodesOnlyMesh.cpp.

References EXCEPTION, PetscTools::GetNumProcs(), and NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().

Friends And Related Symbol Documentation

◆ boost::serialization::access

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

Needed for serialization.

Definition at line 69 of file PeriodicNodesOnlyMesh.hpp.

◆ TestPeriodicNodesOnlyMesh

template<unsigned SPACE_DIM>
friend class TestPeriodicNodesOnlyMesh
friend

Definition at line 66 of file PeriodicNodesOnlyMesh.hpp.

Member Data Documentation

◆ mIsDimPeriodic

template<unsigned SPACE_DIM>
c_vector<bool,SPACE_DIM> PeriodicNodesOnlyMesh< SPACE_DIM >::mIsDimPeriodic
private

◆ mWidth

template<unsigned SPACE_DIM>
c_vector<double,SPACE_DIM> PeriodicNodesOnlyMesh< SPACE_DIM >::mWidth
private

The periodic widths of the domain

Definition at line 59 of file PeriodicNodesOnlyMesh.hpp.

Referenced by PeriodicNodesOnlyMesh< SPACE_DIM >::serialize().


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