#include <QuadraticMesh.hpp>
Inherits TetrahedralMesh< DIM, 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 |
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 Attributes | |
unsigned | mNumVertices |
Friends | |
class | TestQuadraticMesh |
class | boost::serialization::access |
A concrete quadratic mesh class that inherits from TetrahedralMesh.
Definition at line 51 of file QuadraticMesh.hpp.
QuadraticMesh< DIM >::QuadraticMesh | ( | ) | [inline] |
Constructor
Definition at line 152 of file QuadraticMesh.hpp.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear.
QuadraticMesh< DIM >::QuadraticMesh | ( | double | spaceStep, | |
double | width, | |||
double | height = 0 , |
|||
double | depth = 0 | |||
) | [inline] |
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.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructRegularSlabMesh().
void QuadraticMesh< DIM >::ConstructCuboid | ( | unsigned | numElemX, | |
unsigned | numElemY, | |||
unsigned | numElemZ | |||
) | [inline, protected, virtual] |
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 247 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::CountVertices(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), QuadraticMesh< DIM >::LookupInternalNode(), QuadraticMesh< DIM >::MakeNewInternalNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and TetrahedralMesh< DIM, DIM >::RefreshMesh().
void QuadraticMesh< DIM >::ConstructFromLinearMeshReader | ( | AbstractMeshReader< DIM, DIM > & | rMeshReader | ) | [inline] |
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 419 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::ConstructFromMeshReader(), QuadraticMesh< DIM >::CountVertices(), TetrahedralMesh< DIM, DIM >::ExportToMesher(), TetrahedralMesh< DIM, DIM >::FreeTriangulateIo(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), TetrahedralMesh< DIM, DIM >::ImportFromMesher(), and TetrahedralMesh< DIM, DIM >::InitialiseTriangulateIo().
Referenced by QuadraticMesh< DIM >::ConstructFromMeshReader().
void QuadraticMesh< DIM >::ConstructFromMeshReader | ( | AbstractMeshReader< DIM, DIM > & | rMeshReader | ) | [inline] |
Load a quadratic mesh from a file.
rMeshReader | the mesh reader |
Definition at line 469 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::ConstructFromLinearMeshReader(), QuadraticMesh< DIM >::CountVertices(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumBoundaryElements(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfElements().
Referenced by QuadraticMesh< DIM >::ConstructFromLinearMeshReader().
void QuadraticMesh< DIM >::ConstructLinearMesh | ( | unsigned | numElemX | ) | [inline, protected, virtual] |
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(), QuadraticMesh< DIM >::MakeNewInternalNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElements, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, QuadraticMesh< DIM >::mNumVertices, and TetrahedralMesh< DIM, DIM >::RefreshMesh().
void QuadraticMesh< DIM >::ConstructRectangularMesh | ( | unsigned | numElemX, | |
unsigned | numElemY, | |||
bool | stagger = true | |||
) | [inline, protected, virtual] |
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 107 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::CountVertices(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), QuadraticMesh< DIM >::LookupInternalNode(), QuadraticMesh< DIM >::MakeNewInternalNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and TetrahedralMesh< DIM, DIM >::RefreshMesh().
void QuadraticMesh< DIM >::CountVertices | ( | ) | [inline, protected] |
Count nodes which are vertices (not marked as internal)
Definition at line 51 of file QuadraticMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and QuadraticMesh< DIM >::mNumVertices.
Referenced by QuadraticMesh< DIM >::ConstructCuboid(), QuadraticMesh< DIM >::ConstructFromLinearMeshReader(), QuadraticMesh< DIM >::ConstructFromMeshReader(), and QuadraticMesh< DIM >::ConstructRectangularMesh().
unsigned QuadraticMesh< DIM >::GetNumVertices | ( | ) | const [inline, virtual] |
Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 412 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::mNumVertices.
unsigned QuadraticMesh< DIM >::LookupInternalNode | ( | unsigned | globalIndex1, | |
unsigned | globalIndex2, | |||
std::map< std::pair< unsigned, unsigned >, unsigned > & | rEdgeMap | |||
) | [inline, 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 229 of file QuadraticMesh.cpp.
Referenced by QuadraticMesh< DIM >::ConstructCuboid(), and QuadraticMesh< DIM >::ConstructRectangularMesh().
Node< DIM > * QuadraticMesh< DIM >::MakeNewInternalNode | ( | unsigned & | rIndex, | |
c_vector< double, DIM > & | rLocation, | |||
c_vector< double, DIM > & | rTop | |||
) | [inline, 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 200 of file QuadraticMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by QuadraticMesh< DIM >::ConstructCuboid(), QuadraticMesh< DIM >::ConstructLinearMesh(), and QuadraticMesh< DIM >::ConstructRectangularMesh().
void QuadraticMesh< DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, protected] |
Serialize the mesh.
archive | the archive | |
version | the current version of this class |
Reimplemented from TetrahedralMesh< DIM, DIM >.
Definition at line 73 of file QuadraticMesh.hpp.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from TetrahedralMesh< DIM, DIM >.
Definition at line 65 of file QuadraticMesh.hpp.
unsigned QuadraticMesh< DIM >::mNumVertices [protected] |
Number of vertices, ie non-internal (non-quadratic), nodes.
Definition at line 57 of file QuadraticMesh.hpp.
Referenced by QuadraticMesh< DIM >::ConstructLinearMesh(), QuadraticMesh< DIM >::CountVertices(), and QuadraticMesh< DIM >::GetNumVertices().