Chaste  Release::3.4
QuadraticMeshHelper< DIM > Class Template Reference

#include <QuadraticMeshHelper.hpp>

+ Collaboration diagram for QuadraticMeshHelper< DIM >:

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 
)
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
pMeshthe (quadratic) mesh to modify
pBoundaryElementpointer to a boundary element in the mesh
pElementpointer to an element in the mesh
nodeIndexOppositeToFaceindex of a node in the mesh

Definition at line 291 of file QuadraticMeshHelper.cpp.

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

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

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddInternalNodesToBoundaryElements ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
AbstractMeshReader< DIM, DIM > *  pMeshReader 
)
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
pMeshthe mesh to modify
pMeshReaderpointer to the reader for accessing the on-disk mesh data

Definition at line 104 of file QuadraticMeshHelper.cpp.

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

Referenced by DistributedQuadraticMesh< DIM >::ConstructFromMeshReader(), and QuadraticMesh< DIM >::ConstructFromMeshReader().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddNodesToBoundaryElements ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
AbstractMeshReader< DIM, DIM > *  pMeshReader 
)
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
pMeshthe mesh to modify
pMeshReaderpointer 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(), Node< SPACE_DIM >::GetIndex(), 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 QuadraticMesh< DIM >::ConstructFromLinearMeshReader().

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddNodeToBoundaryElement ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
BoundaryElement< DIM-1, DIM > *  pBoundaryElement,
Element< DIM, DIM > *  pElement,
unsigned  internalNode 
)
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
pMeshthe (quadratic) mesh to modify
pBoundaryElementpointer to a boundary element in the mesh
pElementpointer to an element in the mesh
internalNodeindex of a node in the mesh

Definition at line 278 of file QuadraticMeshHelper.cpp.

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

template<unsigned DIM>
void QuadraticMeshHelper< DIM >::AddNodeToBoundaryElement ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh,
BoundaryElement< DIM-1, DIM > *  pBoundaryElement,
Node< DIM > *  pNode 
)
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
pMeshthe (quadratic) mesh to modify
pBoundaryElementpointer to a boundary element in the mesh
pNodepointer 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 >::CheckBoundaryElements ( AbstractTetrahedralMesh< DIM, DIM > *  pMesh)
static

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

Parameters
pMeshthe 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().

Referenced by DistributedQuadraticMesh< DIM >::ConstructFromMeshReader(), and QuadraticMesh< DIM >::ConstructFromMeshReader().

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

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


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