24#ifndef _UIBHM_TEMPLATE_H_
25#define _UIBHM_TEMPLATE_H_
69 int numSides()
const {
return _g->_nfaces == 1 ? numEdges() : numFaces(); }
84 assert(f >= 0 && f < numFaces());
87 return _g->_faceNodeInfo[f]._faceNodes.size() - (!mid && _midNode != -1);
91 int numFaceVertices(
int f)
const { assert(f >= 0 && f < numFaces());
return _vg->_faceNodeInfo[f]._faceNodes.size(); }
101 const int*
faceNodes(
int f)
const { assert(f >= 0 && f < numFaces());
return _g->_faceNodeInfo[f]._faceNodes.constData(); }
107 const int*
faceVertices(
int f)
const { assert(f >= 0 && f < numFaces());
return _vg->_faceNodeInfo[f]._faceNodes.constData(); }
118 const int*
adjacentFaces(
int f)
const { assert(f >= 0 && f < numFaces());
return _CF + f * _maxNfv; }
124 const int*
vertexHalfEdges(
int v)
const { assert(v >= 0 && v < numVertices());
return _CE + v * numVertices(); }
136 int edgeFace(
int edge)
const { assert(edge >= 0 && edge < numEdges());
return _g->_edgeFaceInfo[edge][0]; }
153 assert(_g->_edgeNodeInfo[_g->_faceEdgeInfo[f][e]]._edgeNodes.size() == 3);
154 return _g->_edgeNodeInfo[_g->_faceEdgeInfo[f][e]]._edgeNodes[1];
163 assert(v >= 0 && v < _g->_nnodes);
164 return _g->_interface && v >= (_g->_nnodes - _g->_nextraDofNodes);
167 int colapsedInterfaceNodeSibling(
int v)
const;
195 void edgeVertices(
int e,
int* first,
int* last)
const { edgeVerticesImpl<false>(e, first, last); }
198 void edgeVertices(
int e,
int* first,
int* last,
const int* cellNodes)
const { edgeVerticesImpl<true>(e, first, last, cellNodes); }
207 void faceEdgeVertices(
int f,
int e,
int* first,
int* last)
const { faceEdgeVerticesImpl<false>(f, e, first, last); }
210 void faceEdgeVertices(
int f,
int e,
int* first,
int* last,
const int* cellNodes)
const { faceEdgeVerticesImpl<true>(f, e, first, last, cellNodes); }
213 int numFaceEdgeNodes(
int f,
int e)
const {
const int* neo = nodeOffsets(f);
return neo[e+1] - neo[e] + 1; }
226 int numApertureSides()
const { assert(_g->_interface);
return _g->_interfaceInfo._apertureSides.size(); }
229 const int*
apertureSides()
const { assert(_g->_interface);
return _g->_interfaceInfo._apertureSides.constData(); }
235 int firstContactEdge(
int f)
const { assert(_g->_interface);
return _g->_interfaceInfo._contactEdges[f][0]; }
248 const int*
nodeOffsets(
int f)
const { assert(f >= 0 && f < numFaces());
return _edgeNodeOffset + f * (_maxNfv+1); }
250 template <
bool Translate>
bool quadraticMidEdgeNodeAdjacentVerticesImpl(
int node,
int* v1,
int* v2,
const int* cellNodes = NULL)
const;
252 template <
bool Translate>
void edgeVerticesImpl (
int e,
int* first,
int* last,
const int* cellNodes = NULL)
const;
253 template <
bool Translate>
void edgeNodesImpl (
int e,
QVarLengthArray<int, 4>& list,
const int* cellNodes = NULL)
const;
254 template <
bool Translate>
void faceEdgeVerticesImpl(
int f,
int e,
int* first,
int* last,
const int* cellNodes = NULL)
const;
255 template <
bool Translate>
void faceEdgeNodesImpl (
int f,
int e,
QVarLengthArray<int, 4>& list,
const int* cellNodes = NULL)
const;
A class used to store the type information needed by the Uibhm structure. The data is created based o...
Definition uibhmTemplate.h:46
void edgeVertices(int e, int *first, int *last) const
Returns the pair of edge vertices for the given edge definied by its local element number.
Definition uibhmTemplate.h:195
void faceEdgeNodes(int f, int e, QVarLengthArray< int, 4 > &list) const
Returns the set of edge nodes for the given face, local (face) edge pair. The list endpoints are the ...
Definition uibhmTemplate.h:220
void vertexAdjacentNodes(int v, QVarLengthArray< int, 4 > &list) const
Given a local vertex number, returns the set of local nodes adjacent to the given one....
Definition uibhmTemplate.h:189
bool isInterface() const
Returns true if this element is an interface element.
Definition uibhmTemplate.h:58
int numEdges() const
Returns the total number of edges for the type. For surfaces it is equal to the number of vertices....
Definition uibhmTemplate.h:66
int numApertureSides() const
Returns the number of aperture (or flow) sides. For interface elements only.
Definition uibhmTemplate.h:226
int numFaceEdgeNodes(int f, int e) const
Returns the number of nodes for the given face, local (face) edge pair.
Definition uibhmTemplate.h:213
void edgeNodes(int e, QVarLengthArray< int, 4 > &list) const
Returns the list of edge nodes for the given edge definied by its local element number.
Definition uibhmTemplate.h:201
int numNodes() const
Returns the total number of nodes in the element.
Definition uibhmTemplate.h:72
void edgeNodes(int e, QVarLengthArray< int, 4 > &list, const int *cellNodes) const
Overload for edgeNodes() returning global vertices translated with cellNodes.
Definition uibhmTemplate.h:204
bool quadraticMidEdgeNodeAdjacentVertices(int node, int *v1, int *v2) const
Given a mid-edge quadratic node defined by its local cell index v, returns the pair of vertices of th...
Definition uibhmTemplate.h:143
int edgeFace(int edge) const
Given a cell edge index, returns one of the cell faces that includes that edge.
Definition uibhmTemplate.h:136
GmCellType type() const
Returns the cell type.
Definition uibhmTemplate.h:55
void faceEdgeVertices(int f, int e, int *first, int *last, const int *cellNodes) const
Overload for faceEdgeVertices() returning global vertices translated with cellNodes.
Definition uibhmTemplate.h:210
static const UibhmGemaTemplate * typeTemplate(GmCellType t)
Returns the template object for the given element type. Might return NULL for unsupported elements (b...
Definition uibhmTemplate.h:238
void vertexAdjacentVertices(int v, QVarLengthArray< int, 4 > &list) const
Given a local vertex number, returns the set of local vertices adjacent to the given one....
Definition uibhmTemplate.h:177
const int * faceVertices(int f) const
Returns a vector with the set of vertices in face f (0 <= f < numFaces()). Returned vector size is eq...
Definition uibhmTemplate.h:107
int numVertices() const
Returns the number of vertices in the element (the set of geometry nodes, excluding non-linear nodes ...
Definition uibhmTemplate.h:77
void faceEdgeNodes(int f, int e, QVarLengthArray< int, 4 > &list, const int *cellNodes) const
Overload for faceEdgeNodes() returning global vertices translated with cellNodes.
Definition uibhmTemplate.h:223
void vertexAdjacentNodes(int v, QVarLengthArray< int, 4 > &list, const int *cellNodes) const
Overload for vertexAdjacentNodes() returning global vertices translated with cellNodes.
Definition uibhmTemplate.h:192
int firstContactEdge(int f) const
Given a face index, returns the local index of the first contact edge from that face (a value from 0 ...
Definition uibhmTemplate.h:235
const GmCellGeometryInfo * _g
The type info object.
Definition uibhmTemplate.h:257
int numFaces() const
Returns the number of faces for the type. Will return 1 for surface elements.
Definition uibhmTemplate.h:61
int * _CE
The half edge matrix, linearized by row. Known in the IBHM paper as CE. Size equal to numVertices() x...
Definition uibhmTemplate.h:285
const GmCellGeometryInfo * _vg
The type info object used to query faces for vertices. Will be equal to _g for linear types without e...
Definition uibhmTemplate.h:258
int numFaceNodes(int f, bool mid) const
Returns the number of nodes in face f (0 <= f < numFaces()). If mid is true, that includes an eventua...
Definition uibhmTemplate.h:82
const int * faceNodes(int f) const
Returns a vector with the set of nodes in face f (0 <= f < numFaces()). Returned vector size is equal...
Definition uibhmTemplate.h:101
bool isInterfaceExtraFlowNode(int v) const
Given an element local node index, returns true if that node is a mid edge flow(extra dof) node of an...
Definition uibhmTemplate.h:161
int midEdgeNode(int f, int e) const
Return the local to the cell index of the mid edge node for the given face, local(face) edge pair....
Definition uibhmTemplate.h:151
int _midNode
The local number of the mid face/volume node for a quadratic surface/solid element....
Definition uibhmTemplate.h:260
const int * nodeOffsets(int f) const
Returns the edge node offset vector for the given face.
Definition uibhmTemplate.h:248
bool quadraticMidEdgeNodeAdjacentVertices(int node, int *v1, int *v2, const int *cellNodes) const
Overload for quadraticMidEdgeNodeAdjacentVertices() returning global vertices translated with cellNod...
Definition uibhmTemplate.h:146
int midNode() const
For quadratic elements with a mid face (surface element) or mid volume (solid element) node,...
Definition uibhmTemplate.h:112
int * _CF
The face adjacency matrix, linearized by row. Known in the IBHM paper as CF. Size equal to numFaces()...
Definition uibhmTemplate.h:276
void edgeVertices(int e, int *first, int *last, const int *cellNodes) const
Overload for edgeVertices() returning global vertices translated with cellNodes.
Definition uibhmTemplate.h:198
int numFaceVertices(int f) const
The number of vertices in face f (0 <= f < numFaces())
Definition uibhmTemplate.h:91
int numSides() const
Returns numEdges() for surface elements and numFaces() for solid elements.
Definition uibhmTemplate.h:69
void vertexAdjacentVertices(int v, QVarLengthArray< int, 4 > &list, const int *cellNodes) const
Overload for vertexAdjacentVertices() returning global vertices translated with cellNodes.
Definition uibhmTemplate.h:180
int _maxNfv
The maximum number of vertices in a face for this element.
Definition uibhmTemplate.h:259
const int * adjacentFaces(int f) const
Given a face number, returns a vector with size numFaceVertices(f) storing the index of the adjacent ...
Definition uibhmTemplate.h:118
int * _edgeNodeOffset
An auxiliary matrix used to to store the node index in the face node description of the first node of...
Definition uibhmTemplate.h:268
const int * apertureSides() const
Returns a list of aperture (or flow) side indices with numApertureSides() entries....
Definition uibhmTemplate.h:229
int maxNumFaceVertices() const
Returns the maximum number of vertices for a face from this element type.
Definition uibhmTemplate.h:94
void faceEdgeVertices(int f, int e, int *first, int *last) const
Returns the pair of edge vertices for the given face, local (face) edge pair.
Definition uibhmTemplate.h:207
const int * vertexHalfEdges(int v) const
Given a vertex number, returns a vector with size numVertices() storing in column i the index of the ...
Definition uibhmTemplate.h:124
Declaration of useful configuration definitions for the plugin library.
static bool UibhmGemaTemplateInit()
Initializes the UibhmGemaTemplate::_typeTemplates list.
Definition uibhmTemplate.cpp:195