QuadraticMeshHelper< DIM > Class Template Reference

#include <QuadraticMeshHelper.hpp>

List of all members.

Static Public Member Functions

static void AddInternalNodesToElements (AbstractTetrahedralMesh< DIM, DIM > *pMesh, AbstractMeshReader< DIM, DIM > *pMeshReader)
static void AddInternalNodesToBoundaryElements (AbstractTetrahedralMesh< DIM, DIM > *pMesh, AbstractMeshReader< DIM, DIM > *pMeshReader)
static void AddNodesToBoundaryElements (AbstractTetrahedralMesh< DIM, DIM > *pMesh, AbstractMeshReader< DIM, DIM > *pMeshReader)
static void CheckBoundaryElements (AbstractTetrahedralMesh< DIM, DIM > *pMesh)
static void AddNodeToBoundaryElement (AbstractTetrahedralMesh< DIM, DIM > *pMesh, BoundaryElement< DIM-1, DIM > *pBoundaryElement, Element< DIM, DIM > *pElement, unsigned internalNode)
static void AddNodeToBoundaryElement (AbstractTetrahedralMesh< DIM, DIM > *pMesh, BoundaryElement< DIM-1, DIM > *pBoundaryElement, Node< DIM > *pNode)
static void AddExtraBoundaryNodes (AbstractTetrahedralMesh< DIM, DIM > *pMesh, BoundaryElement< DIM-1, DIM > *pBoundaryElement, Element< DIM, DIM > *pElement, unsigned nodeIndexOppositeToFace)
static void HelperMethod1 (unsigned boundaryElemNode0, unsigned boundaryElemNode1, Element< DIM, DIM > *pElement, unsigned node0, unsigned node1, unsigned node2, unsigned &rOffset, bool &rReverse)
static void HelperMethod2 (AbstractTetrahedralMesh< DIM, DIM > *pMesh, BoundaryElement< DIM-1, DIM > *pBoundaryElement, Element< DIM, DIM > *pElement, unsigned internalNode0, unsigned internalNode1, unsigned internalNode2, unsigned offset, bool reverse)

Detailed Description

template<unsigned DIM>
class QuadraticMeshHelper< DIM >

A helper class for QuadraticMesh and DistributedQuadratic mesh, containing utility methods that are common to both classes (and only require public access).

Definition at line 47 of file QuadraticMeshHelper.hpp.


Member Function Documentation

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddExtraBoundaryNodes ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
BoundaryElement< DIM-1, DIM > *  pBoundaryElement,
Element< DIM, DIM > *  pElement,
unsigned  nodeIndexOppositeToFace 
) [inline, static]

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

Parameters:
pMesh the (quadratic) mesh to modify
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 291 of file QuadraticMeshHelper.cpp.

References QuadraticMeshHelper< DIM >::AddNodeToBoundaryElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), QuadraticMeshHelper< DIM >::HelperMethod1(), and QuadraticMeshHelper< DIM >::HelperMethod2().

Referenced by QuadraticMeshHelper< DIM >::AddNodesToBoundaryElements().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddInternalNodesToBoundaryElements ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
AbstractMeshReader< DIM, DIM > *  pMeshReader 
) [inline, static]

Top level method for adding internal nodes to the mesh's boundary elements.

Note that the internal nodes must already exist in the mesh; this method just associates them with the relevant boundary elements. If the mesh on disk has internal node indices in the boundary elements file, then we just look them up. Otherwise we figure out which normal element has each boundary element as a face, and extract the internal nodes from that.

Parameters:
pMesh the mesh to modify
pMeshReader pointer to the reader for accessing the on-disk mesh data

Definition at line 104 of file QuadraticMeshHelper.cpp.

References QuadraticMeshHelper< DIM >::AddNodesToBoundaryElements(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumLocalBoundaryElements(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfBoundaryElements().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddInternalNodesToElements ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
AbstractMeshReader< DIM, DIM > *  pMeshReader 
) [inline, static]
template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddNodesToBoundaryElements ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
AbstractMeshReader< DIM, DIM > *  pMeshReader 
) [inline, static]

Used by AddInternalNodesToBoundaryElements in the case where the on-disk mesh doesn't have the associations already, and by the linear -> quadratic mesh conversion routines.

If there is an on-mesh disk that has containing element information in its edge/face file, then this can be supplied to speed up finding the full element containing each boundary element.

Parameters:
pMesh the mesh to modify
pMeshReader pointer to the reader for accessing the on-disk mesh data, if any; NULL otherwise

Todo:
#1930 Until there is an interator_facade over boundary elements,
Todo:
#1930 Once there is an interator_facade then we can do: elem_index = pMeshReader->GetFaceData(face_index).ContainingElement;

Definition at line 128 of file QuadraticMeshHelper.cpp.

References QuadraticMeshHelper< 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(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetReadContainingElementOfBoundaryElement(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().

Referenced by QuadraticMeshHelper< DIM >::AddInternalNodesToBoundaryElements().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddNodeToBoundaryElement ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
BoundaryElement< DIM-1, DIM > *  pBoundaryElement,
Node< DIM > *  pNode 
) [inline, static]

This method adds the given node to the given boundary element, and also sets the node as a boundary node and adds it to the mesh's boundary nodes.

Parameters:
pMesh the (quadratic) mesh to modify
pBoundaryElement pointer to a boundary element in the mesh
pNode pointer to a node in the mesh

Definition at line 261 of file QuadraticMeshHelper.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::AddNode(), Node< SPACE_DIM >::IsBoundaryNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, and Node< SPACE_DIM >::SetAsBoundaryNode().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddNodeToBoundaryElement ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
BoundaryElement< DIM-1, DIM > *  pBoundaryElement,
Element< DIM, DIM > *  pElement,
unsigned  internalNode 
) [inline, static]

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 node and adds it to the mesh's boundary nodes.

Parameters:
pMesh the (quadratic) mesh to modify
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 278 of file QuadraticMeshHelper.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode().

Referenced by QuadraticMeshHelper< DIM >::AddExtraBoundaryNodes(), and QuadraticMeshHelper< DIM >::HelperMethod2().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::CheckBoundaryElements ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh  )  [inline, static]

Check whether all the boundary elements in the given mesh have the expected number of nodes.

Parameters:
pMesh the mesh to check

Definition at line 246 of file QuadraticMeshHelper.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), and AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::HelperMethod1 ( unsigned  boundaryElemNode0,
unsigned  boundaryElemNode1,
Element< DIM, DIM > *  pElement,
unsigned  node0,
unsigned  node1,
unsigned  node2,
unsigned rOffset,
bool rReverse 
) [inline, static]

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.

Todo:
document these parameters
Parameters:
boundaryElemNode0 
boundaryElemNode1 
pElement 
node0 
node1 
node2 
rOffset 
rReverse 

Definition at line 347 of file QuadraticMeshHelper.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex().

Referenced by QuadraticMeshHelper< DIM >::AddExtraBoundaryNodes().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::HelperMethod2 ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
BoundaryElement< DIM-1, DIM > *  pBoundaryElement,
Element< DIM, DIM > *  pElement,
unsigned  internalNode0,
unsigned  internalNode1,
unsigned  internalNode2,
unsigned  offset,
bool  reverse 
) [inline, static]

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.

Todo:
document these parameters
Parameters:
pMesh 
pBoundaryElement 
pElement 
internalNode0 
internalNode1 
internalNode2 
offset 
reverse 

Definition at line 399 of file QuadraticMeshHelper.cpp.

References QuadraticMeshHelper< DIM >::AddNodeToBoundaryElement().

Referenced by QuadraticMeshHelper< DIM >::AddExtraBoundaryNodes().


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

Generated by  doxygen 1.6.2