Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
QuadraticMesh< DIM > Class Template Reference

#include <QuadraticMesh.hpp>

+ Inheritance diagram for QuadraticMesh< DIM >:
+ Collaboration diagram for QuadraticMesh< DIM >:

Public Member Functions

 QuadraticMesh ()
 
 QuadraticMesh (double spaceStep, double width, double height=0, double depth=0)
 
void ConstructFromMeshReader (AbstractMeshReader< DIM, DIM > &rMeshReader)
 
void ConstructFromLinearMeshReader (AbstractMeshReader< DIM, DIM > &rMeshReader)
 
unsigned GetNumVertices () const
 
- Public Member Functions inherited from TetrahedralMesh< DIM, 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)
 
virtual void Clear ()
 
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 GetNumElements () const
 
virtual unsigned GetNumLocalElements () const
 
virtual unsigned GetNumBoundaryElements () const
 
virtual unsigned GetNumLocalBoundaryElements () const
 
unsigned GetNumAllElements () const
 
unsigned GetNumAllBoundaryElements () const
 
virtual unsigned GetNumCableElements () 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 ()
 
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 ()
 
virtual unsigned GetNumNodes () const
 
unsigned GetNumBoundaryNodes () const
 
virtual unsigned GetNumAllNodes () const
 
unsigned GetNumNodeAttributes () const
 
Node< SPACE_DIM > * GetNode (unsigned index) const
 
virtual Node< SPACE_DIM > * GetNodeOrHaloNode (unsigned index) const
 
Node< SPACE_DIM > * GetNodeFromPrePermutationIndex (unsigned index) const
 
virtual DistributedVectorFactoryGetDistributedVectorFactory ()
 
virtual void SetDistributedVectorFactory (DistributedVectorFactory *pFactory)
 
BoundaryNodeIterator GetBoundaryNodeIteratorBegin () const
 
BoundaryNodeIterator GetBoundaryNodeIteratorEnd () const
 
std::string GetMeshFileBaseName () const
 
bool IsMeshOnDisk () const
 
const std::vector< unsigned > & rGetNodePermutation () const
 
virtual c_vector< double, SPACE_DIM > GetVectorFromAtoB (const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
 
double GetDistanceBetweenNodes (unsigned indexA, unsigned indexB)
 
virtual double GetWidth (const unsigned &rDimension) const
 
virtual ChasteCuboid< SPACE_DIM > CalculateBoundingBox () const
 
virtual unsigned GetNearestNodeIndex (const ChastePoint< SPACE_DIM > &rTestPoint)
 
virtual void Scale (const double xFactor=1.0, const double yFactor=1.0, const double zFactor=1.0)
 
virtual void Translate (const c_vector< double, SPACE_DIM > &rDisplacement)
 
void Translate (const double xMovement=0.0, const double yMovement=0.0, const double zMovement=0.0)
 
virtual void Rotate (c_matrix< double, SPACE_DIM, SPACE_DIM > rotationMatrix)
 
void Rotate (c_vector< double, 3 > axis, double angle)
 
void RotateX (const double theta)
 
void RotateY (const double theta)
 
void RotateZ (const double theta)
 
void Rotate (double theta)
 
bool IsMeshChanging () const
 
unsigned CalculateMaximumContainingElementsPerProcess () const
 
void SetMeshHasChangedSinceLoading ()
 

Protected Member Functions

void CountVertices ()
 
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 
void ConstructLinearMesh (unsigned numElemX)
 
void ConstructRectangularMesh (unsigned numElemX, unsigned numElemY, bool stagger=true)
 
void ConstructCuboid (unsigned numElemX, unsigned numElemY, unsigned numElemZ)
 
Node< DIM > * MakeNewInternalNode (unsigned &rIndex, c_vector< double, DIM > &rLocation, c_vector< double, DIM > &rTop)
 
unsigned LookupInternalNode (unsigned globalIndex1, unsigned globalIndex2, std::map< std::pair< unsigned, unsigned >, unsigned > &rEdgeMap)
 
- Protected Member Functions inherited from TetrahedralMesh< DIM, DIM >
unsigned SolveNodeMapping (unsigned index) const
 
unsigned SolveElementMapping (unsigned index) const
 
unsigned SolveBoundaryElementMapping (unsigned index) const
 
void ExportToMesher (NodeMap &map, MESHER_IO &mesherInput, int *elementList=nullptr)
 
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

unsigned mNumVertices
 
- Protected Attributes inherited from TetrahedralMesh< DIM, 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
 

Friends

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

Detailed Description

template<unsigned DIM>
class QuadraticMesh< DIM >

A concrete quadratic mesh class that inherits from TetrahedralMesh.

Definition at line 51 of file QuadraticMesh.hpp.

Constructor & Destructor Documentation

◆ QuadraticMesh() [1/2]

template<unsigned DIM>
QuadraticMesh< DIM >::QuadraticMesh ( )
inline

Constructor

Definition at line 152 of file QuadraticMesh.hpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear.

◆ QuadraticMesh() [2/2]

template<unsigned DIM>
QuadraticMesh< DIM >::QuadraticMesh ( double  spaceStep,
double  width,
double  height = 0,
double  depth = 0 
)

Create a quadratic mesh on a slab (on a line in 1D, rectangle in 2d, cuboid in 3D), with the given widths and given space step. In 1D height and depth need to be passed in as 0 (the default value); in 2D depth must be zero

Parameters
spaceStepThe spatial stepsize
widththe width of the cuboid
heightthe height of the cuboid
depththe depth of the cuboid

Definition at line 65 of file QuadraticMesh.cpp.

Member Function Documentation

◆ ConstructCuboid()

template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructCuboid ( unsigned  numElemX,
unsigned  numElemY,
unsigned  numElemZ 
)
protectedvirtual

Create a quadratic mesh on a cuobid from (0,0,0) to (numElemX,numElemY,numElemZ) with that number of elements in each direction. The method overloads the equivalent method in AbstractTetrahedralMesh. This is private, users should call ConstructRegularSlabMesh();

Parameters
numElemXNumber of elements in x-direction (also, the width of the final mesh)
numElemYNumber of elements in y-direction (also, the height of the final mesh)
numElemZNumber of elements in y-direction (also, the depth of the final mesh)

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 247 of file QuadraticMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructCuboid(), and EXCEPTION.

◆ ConstructFromLinearMeshReader()

template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructFromLinearMeshReader ( AbstractMeshReader< DIM, DIM > &  rMeshReader)

Load a quadratic mesh from a linear mesh file.

Constructs as linear mesh, then exports to triangle/tetgen

Parameters
rMeshReaderthe mesh reader

Definition at line 417 of file QuadraticMesh.cpp.

References QuadraticMeshHelper< DIM >::AddNodesToBoundaryElements(), and TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader().

◆ ConstructFromMeshReader()

◆ ConstructLinearMesh()

template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructLinearMesh ( unsigned  numElemX)
protectedvirtual

Create a quadratic mesh on the interval [0,numElemX] with numElemX elements in each direction. This is private, users should call ConstructRegularSlabMesh();

Very badly named. This creates a QUADRATIC mesh, the linear just refers to the fact the mesh is a line in 1D. The name is inherited from the parent class.

Parameters
numElemXNumber of elements in x-direction (also, the width of the final mesh)

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 76 of file QuadraticMesh.cpp.

References Node< SPACE_DIM >::AddElement(), and AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructLinearMesh().

◆ ConstructRectangularMesh()

template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructRectangularMesh ( unsigned  numElemX,
unsigned  numElemY,
bool  stagger = true 
)
protectedvirtual

Create a quadratic mesh on a rectangle from (0,0) to (numElemX,numElemY) with that number of elements in each direction.

The method overloads the equivalent method in AbstractTetrahedralMesh. This is private, users should call ConstructRegularSlabMesh();

Parameters
numElemXNumber of elements in x-direction (also, the width of the final mesh)
numElemYNumber of elements in y-direction (also, the height of the final mesh)
staggeris the same as the over-ridden method with same name in AbstractTetrahedralMesh. stagger = false gives all back-slash diagonals stagger = true check-boards the diagonals as forward and back slashes

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 103 of file QuadraticMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructRectangularMesh(), and EXCEPTION.

◆ CountVertices()

template<unsigned DIM>
void QuadraticMesh< DIM >::CountVertices ( )
protected

Count nodes which are vertices (not marked as internal)

Definition at line 51 of file QuadraticMesh.cpp.

◆ GetNumVertices()

template<unsigned DIM>
unsigned QuadraticMesh< DIM >::GetNumVertices ( ) const
virtual
Returns
the number of vertices, ie non-internal (non-quadratic), nodes.

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 411 of file QuadraticMesh.cpp.

◆ LookupInternalNode()

template<unsigned DIM>
unsigned QuadraticMesh< DIM >::LookupInternalNode ( unsigned  globalIndex1,
unsigned  globalIndex2,
std::map< std::pair< unsigned, unsigned >, unsigned > &  rEdgeMap 
)
protected

A helper method used in the private structured mesh constructors (ConstructRectangularMesh etc).

Gets the internal node index between two vertex node indices assuming ordered pairs have been used as keys in the map

Parameters
globalIndex1is the index of one of the vertex nodes
globalIndex2is the index of the other vertex node (ordering is unimportant)
rEdgeMapthe map from ordered pairs of vertex indices to internal node index
Returns
global node index of the internal node between globalIndex1 and globalIndex2

Definition at line 229 of file QuadraticMesh.cpp.

◆ MakeNewInternalNode()

template<unsigned DIM>
Node< DIM > * QuadraticMesh< DIM >::MakeNewInternalNode ( unsigned rIndex,
c_vector< double, DIM > &  rLocation,
c_vector< double, DIM > &  rTop 
)
protected

A helper method used in the private structured mesh constructors (ConstructRectangularMesh etc).

Method uses top (and the zero vector) to calculate if the node should be designated as a boundary node. Method uses top to determine if the node is outside the cuboid – this allows for simpler loops in the caller Method creates node, pushes node onto mNodes and marks it as an internal node.

Returns
pointer to new node
Parameters
rIndexis the index in the mesh which this node should take. Note: this method increments rIndex
rLocationthe position of the node in space (coordinates should be integers or multiples of 1/2)
rTopthe position of top-most node in the line/slab/cuboid

Definition at line 200 of file QuadraticMesh.cpp.

References Node< SPACE_DIM >::MarkAsInternal().

◆ serialize()

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

Serialize the mesh.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 73 of file QuadraticMesh.hpp.

Friends And Related Symbol Documentation

◆ boost::serialization::access

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

Needed for serialization.

Definition at line 65 of file QuadraticMesh.hpp.

◆ TestQuadraticMesh

template<unsigned DIM>
friend class TestQuadraticMesh
friend

Definition at line 53 of file QuadraticMesh.hpp.

Member Data Documentation

◆ mNumVertices

template<unsigned DIM>
unsigned QuadraticMesh< DIM >::mNumVertices
protected

Number of vertices, ie non-internal (non-quadratic), nodes.

Definition at line 57 of file QuadraticMesh.hpp.


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