Chaste
Release::2017.1
|
#include <QuadraticMesh.hpp>
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< unsigned > | GetContainingElementIndices (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 DistributedVectorFactory * | GetDistributedVectorFactory () |
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 |
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 |
A concrete quadratic mesh class that inherits from TetrahedralMesh.
Definition at line 51 of file QuadraticMesh.hpp.
|
inline |
Constructor
Definition at line 152 of file QuadraticMesh.hpp.
References QuadraticMesh< DIM >::ConstructFromLinearMeshReader(), QuadraticMesh< DIM >::ConstructFromMeshReader(), EXPORT_TEMPLATE_CLASS_SAME_DIMS, QuadraticMesh< DIM >::GetNumVertices(), and AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear.
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
spaceStep | The spatial stepsize |
width | the width of the cuboid |
height | the height of the cuboid |
depth | the depth of the cuboid |
Definition at line 65 of file QuadraticMesh.cpp.
|
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();
numElemX | Number of elements in x-direction (also, the width of the final mesh) |
numElemY | Number of elements in y-direction (also, the height of the final mesh) |
numElemZ | Number of elements in y-direction (also, the depth of the final mesh) |
Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 243 of file QuadraticMesh.cpp.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructCuboid().
Referenced by QuadraticMesh< DIM >::serialize().
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
rMeshReader | the mesh reader |
Definition at line 410 of file QuadraticMesh.cpp.
References QuadraticMeshHelper< DIM >::AddNodesToBoundaryElements(), and TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader().
Referenced by QuadraticMesh< DIM >::QuadraticMesh().
void QuadraticMesh< DIM >::ConstructFromMeshReader | ( | AbstractMeshReader< DIM, DIM > & | rMeshReader | ) |
Load a quadratic mesh from a file.
rMeshReader | the mesh reader |
Definition at line 459 of file QuadraticMesh.cpp.
References QuadraticMeshHelper< DIM >::AddInternalNodesToBoundaryElements(), QuadraticMeshHelper< DIM >::AddInternalNodesToElements(), QuadraticMeshHelper< DIM >::CheckBoundaryElements(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), EXPORT_TEMPLATE_CLASS_SAME_DIMS, and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfElements().
Referenced by QuadraticMesh< DIM >::QuadraticMesh().
|
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.
numElemX | Number 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().
Referenced by QuadraticMesh< DIM >::serialize().
|
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();
numElemX | Number of elements in x-direction (also, the width of the final mesh) |
numElemY | Number of elements in y-direction (also, the height of the final mesh) |
stagger | is 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().
Referenced by QuadraticMesh< DIM >::serialize().
|
protected |
Count nodes which are vertices (not marked as internal)
Definition at line 51 of file QuadraticMesh.cpp.
|
virtual |
Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 404 of file QuadraticMesh.cpp.
Referenced by QuadraticMesh< DIM >::QuadraticMesh().
|
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
globalIndex1 | is the index of one of the vertex nodes |
globalIndex2 | is the index of the other vertex node (ordering is unimportant) |
rEdgeMap | the map from ordered pairs of vertex indices to internal node index |
Definition at line 225 of file QuadraticMesh.cpp.
Referenced by QuadraticMesh< DIM >::serialize().
|
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.
rIndex | is the index in the mesh which this node should take. Note: this method increments rIndex |
rLocation | the position of the node in space (coordinates should be integers or multiples of 1/2) |
rTop | the position of top-most node in the line/slab/cuboid |
Definition at line 196 of file QuadraticMesh.cpp.
References Node< SPACE_DIM >::MarkAsInternal().
Referenced by QuadraticMesh< DIM >::serialize().
|
inlineprotected |
Serialize the mesh.
archive | the archive |
version | the current version of this class |
Definition at line 73 of file QuadraticMesh.hpp.
References QuadraticMesh< DIM >::ConstructCuboid(), QuadraticMesh< DIM >::ConstructLinearMesh(), QuadraticMesh< DIM >::ConstructRectangularMesh(), QuadraticMesh< DIM >::LookupInternalNode(), and QuadraticMesh< DIM >::MakeNewInternalNode().
|
friend |
Needed for serialization.
Definition at line 65 of file QuadraticMesh.hpp.
|
protected |
Number of vertices, ie non-internal (non-quadratic), nodes.
Definition at line 57 of file QuadraticMesh.hpp.