#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) |
void | WriteBoundaryElementFile (std::string directory, std::string fileName) |
unsigned | GetNumVertices () |
Protected Member Functions | |
void | CountAndCheckVertices () |
void | AddNodesToBoundaryElements (TrianglesMeshReader< DIM, DIM > *pMeshReader) |
void | AddNodeToBoundaryElement (BoundaryElement< DIM-1, DIM > *pBoundaryElement, Element< DIM, DIM > *pElement, unsigned internalNode) |
void | AddExtraBoundaryNodes (BoundaryElement< DIM-1, DIM > *pBoundaryElement, Element< DIM, DIM > *pElement, unsigned nodeIndexOppositeToFace) |
void | HelperMethod1 (unsigned boundaryElemNode0, unsigned boundaryElemNode1, Element< DIM, DIM > *pElement, unsigned node0, unsigned node1, unsigned node2, unsigned &rOffset, bool &rReverse) |
void | HelperMethod2 (BoundaryElement< DIM-1, DIM > *pBoundaryElement, Element< DIM, DIM > *pElement, unsigned internalNode0, unsigned internalNode1, unsigned internalNode2, unsigned offset, bool reverse) |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
void | ConstructLinearMesh (unsigned numElemX) |
void | ConstructRectangularMesh (unsigned numElemX, unsigned numElemY, bool unused=true) |
void | ConstructCuboid (unsigned numElemX, unsigned numElemY, unsigned numElemZ) |
Protected Attributes | |
unsigned | mNumVertices |
Friends | |
class | boost::serialization::access |
Definition at line 44 of file QuadraticMesh.hpp.
QuadraticMesh< DIM >::QuadraticMesh | ( | ) | [inline] |
Constructor
Definition at line 200 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 spacestep. In 1D height and depth need to 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 71 of file QuadraticMesh.cpp.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructRegularSlabMesh().
void QuadraticMesh< DIM >::CountAndCheckVertices | ( | ) | [inline, protected] |
Count nodes which are vertices (not marked as internal) Check that internals appear after vertices in the list
Definition at line 42 of file QuadraticMesh.cpp.
References EXCEPTION, 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().
void QuadraticMesh< DIM >::AddNodesToBoundaryElements | ( | TrianglesMeshReader< DIM, DIM > * | pMeshReader | ) | [inline, protected] |
Top level method for making 2D edges have 3 nodes not 2 and making 3D faces have 6 nodes not 3 (ie linear to quadratic).
pMeshReader | Pointer to the reader. Only used if boundaryElemFileHasContainElementInfo==true (can be null if not). |
Definition at line 367 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::AddExtraBoundaryNodes(), ElementData::ContainingElement, Node< SPACE_DIM >::ContainingElementsBegin(), Node< SPACE_DIM >::ContainingElementsEnd(), EXCEPTION, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetReadContainingElementOfBoundaryElement(), and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
Referenced by QuadraticMesh< DIM >::ConstructCuboid(), QuadraticMesh< DIM >::ConstructFromLinearMeshReader(), QuadraticMesh< DIM >::ConstructFromMeshReader(), and QuadraticMesh< DIM >::ConstructRectangularMesh().
void QuadraticMesh< DIM >::AddNodeToBoundaryElement | ( | BoundaryElement< DIM-1, DIM > * | pBoundaryElement, | |
Element< DIM, DIM > * | pElement, | |||
unsigned | internalNode | |||
) | [inline, protected] |
This method adds the given node (defined by an element and a node index) to the given boundary element, and also sets the node as a boundary element and adds it to the std::vector of boundary elements.
pBoundaryElement | pointer to a boundary element in the mesh | |
pElement | pointer to an element in the mesh | |
internalNode | index of a node in the mesh |
Definition at line 478 of file QuadraticMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::AddNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), Node< SPACE_DIM >::IsBoundaryNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, and Node< SPACE_DIM >::SetAsBoundaryNode().
Referenced by QuadraticMesh< DIM >::AddExtraBoundaryNodes(), and QuadraticMesh< DIM >::HelperMethod2().
void QuadraticMesh< DIM >::AddExtraBoundaryNodes | ( | BoundaryElement< DIM-1, DIM > * | pBoundaryElement, | |
Element< DIM, DIM > * | pElement, | |||
unsigned | nodeIndexOppositeToFace | |||
) | [inline, protected] |
Given a face in an element (defined by giving an element and the opposite node number to the face) that corresponds to a given boundary element, this method adds in the face's internal nodes to the boundary element (in the correct order).
pBoundaryElement | pointer to a boundary element in the mesh | |
pElement | pointer to an element in the mesh | |
nodeIndexOppositeToFace | index of a node in the mesh |
Definition at line 499 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::AddNodeToBoundaryElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), QuadraticMesh< DIM >::HelperMethod1(), and QuadraticMesh< DIM >::HelperMethod2().
Referenced by QuadraticMesh< DIM >::AddNodesToBoundaryElements().
void QuadraticMesh< DIM >::HelperMethod1 | ( | unsigned | boundaryElemNode0, | |
unsigned | boundaryElemNode1, | |||
Element< DIM, DIM > * | pElement, | |||
unsigned | node0, | |||
unsigned | node1, | |||
unsigned | node2, | |||
unsigned & | rOffset, | |||
bool & | rReverse | |||
) | [inline, protected] |
Nasty helper method for AddNodeToBoundaryElement() in 3D.
This method takes in the three vertices of a face which match the given boundary element, and figure out if the order of the nodes in the face is reversed in the boundary element (returned in the bool 'rReverse'). Also, the offset between the first node in the face (as given to this method) and the first node in the boundary element is computed (returned in the variable 'rOffset'). Offset should then be applied before reverse to match the face nodes to the boundary element nodes.
boundaryElemNode0 | ||
boundaryElemNode1 | ||
pElement | ||
node0 | ||
node1 | ||
node2 | ||
rOffset | ||
rReverse |
Definition at line 601 of file QuadraticMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex().
Referenced by QuadraticMesh< DIM >::AddExtraBoundaryNodes().
void QuadraticMesh< DIM >::HelperMethod2 | ( | BoundaryElement< DIM-1, DIM > * | pBoundaryElement, | |
Element< DIM, DIM > * | pElement, | |||
unsigned | internalNode0, | |||
unsigned | internalNode1, | |||
unsigned | internalNode2, | |||
unsigned | offset, | |||
bool | reverse | |||
) | [inline, protected] |
Nasty helper method for AddNodeToBoundaryElement() in 3D.
This method takes the three internal nodes for some face in some element, applies the given offset and reverse (see HelperMethod1) to them, to get the ordered internal nodes which should given to the boundary element. It then calls AddNodeToBoundaryElement with each of the three internal nodes.
pBoundaryElement | ||
pElement | ||
internalNode0 | ||
internalNode1 | ||
internalNode2 | ||
offset | ||
reverse |
Definition at line 653 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::AddNodeToBoundaryElement().
Referenced by QuadraticMesh< DIM >::AddExtraBoundaryNodes().
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 151 of file QuadraticMesh.hpp.
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 77 of file QuadraticMesh.cpp.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryElements, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, 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 | unused = 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. This writes a temporary node file and uses triangle to mesh this nodefile. 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) | |
unused | (defaults to true; must always be true) is for compatibility of the interface of this method with same name in AbstractTetrahedralMesh. |
Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 123 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::AddNodesToBoundaryElements(), QuadraticMesh< DIM >::CountAndCheckVertices(), TetrahedralMesh< DIM, DIM >::FreeTriangulateIo(), TetrahedralMesh< DIM, DIM >::ImportFromMesher(), TetrahedralMesh< DIM, DIM >::InitialiseTriangulateIo(), and AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear.
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. This writes a temporary node file and uses tetgen to mesh this nodefile. 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 175 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::AddNodesToBoundaryElements(), QuadraticMesh< DIM >::CountAndCheckVertices(), TetrahedralMesh< DIM, DIM >::ImportFromMesher(), and AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear.
void QuadraticMesh< DIM >::ConstructFromMeshReader | ( | AbstractMeshReader< DIM, DIM > & | rMeshReader | ) | [inline] |
Load a quadratic mesh from a file.
rMeshReader | the mesh reader |
Definition at line 282 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::AddNodesToBoundaryElements(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), QuadraticMesh< DIM >::CountAndCheckVertices(), EXCEPTION, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumBoundaryElements(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfBoundaryElements(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfElements(), Node< SPACE_DIM >::IsBoundaryNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, ElementData::NodeIndices, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset(), and Node< SPACE_DIM >::SetAsBoundaryNode().
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 232 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::AddNodesToBoundaryElements(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), QuadraticMesh< DIM >::CountAndCheckVertices(), 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().
void QuadraticMesh< DIM >::WriteBoundaryElementFile | ( | std::string | directory, | |
std::string | fileName | |||
) | [inline] |
Write the boundary elements to file (in case the boundary elements were linear when read and the quadratic versions have been computed.
directory | Directory relative to CHASTE_TEST_OUTPUT. Not cleaned | |
fileName | Boundary element file name. |
Definition at line 549 of file QuadraticMesh.cpp.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), and OutputFileHandler::OpenOutputFile().
unsigned QuadraticMesh< DIM >::GetNumVertices | ( | ) | [inline] |
Get the number of vertices, ie non-internal (non-quadratic), nodes.
Definition at line 224 of file QuadraticMesh.cpp.
References QuadraticMesh< DIM >::mNumVertices.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from TetrahedralMesh< DIM, DIM >.
Definition at line 143 of file QuadraticMesh.hpp.
unsigned QuadraticMesh< DIM >::mNumVertices [protected] |
Number of vertices, ie non-internal (non-quadratic), nodes.
Definition at line 49 of file QuadraticMesh.hpp.
Referenced by QuadraticMesh< DIM >::ConstructLinearMesh(), QuadraticMesh< DIM >::CountAndCheckVertices(), and QuadraticMesh< DIM >::GetNumVertices().