GemaMesh
The GeMA Mesh Plugin
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
UibhmGemaTemplate Class Reference

A class used to store the type information needed by the Uibhm structure. The data is created based on the information that already exists on the GmCellGeometry class. More...

#include <uibhmTemplate.h>

Collaboration diagram for UibhmGemaTemplate:
Collaboration graph
[legend]

Public Member Functions

 ~UibhmGemaTemplate ()
 Destructor.
 
GmCellType type () const
 Returns the cell type.
 
bool isInterface () const
 Returns true if this element is an interface element.
 
int numFaces () const
 Returns the number of faces for the type. Will return 1 for surface elements.
 
int numEdges () const
 Returns the total number of edges for the type. For surfaces it is equal to the number of vertices. For solids, E = F + V - 2.
 
int numSides () const
 Returns numEdges() for surface elements and numFaces() for solid elements.
 
int numNodes () const
 Returns the total number of nodes in the element.
 
int numVertices () const
 Returns the number of vertices in the element (the set of geometry nodes, excluding non-linear nodes and extra-dof nodes)
 
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 eventual quadratic mid surface node. If false it will not be accounted.
 
int numFaceVertices (int f) const
 The number of vertices in face f (0 <= f < numFaces())
 
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 to numFaceNodes(f). Equivalent to returning a line from an extended CV matrix in the IBHM paper, including all nodes and not only the vertices.
 
const int * faceVertices (int f) const
 Returns a vector with the set of vertices in face f (0 <= f < numFaces()). Returned vector size is equal to numFaceVertices(f). Equivalent to returning a line from the CV matrix in the IBHM paper.
 
int midNode () const
 For quadratic elements with a mid face (surface element) or mid volume (solid element) node, returns the index of that node. Otherwise, returns -1.
 
const int * adjacentFaces (int f) const
 Given a face number, returns a vector with size numFaceVertices(f) storing the index of the adjacent faces, ordered according to the half edges specified by faceVertices(f). Equivalent to returning the f row from matrix CF in the IBHM paper.
 
const int * vertexHalfEdges (int v) const
 Given a vertex number, returns a vector with size numVertices() storing in column i the index of the face that contains the half-edge going from v to i or -1 if there is no such half-edge. Equivalent to returning the v row from matrix CE in the IBHM paper.
 
void print (const GmLogCategory &logger, GmLogLevel level) const
 Prints the template to the given logger using the EXTRA_INFO category.
 
void vertexFaces (int v, QVarLengthArray< int, 4 > &list) const
 Given a local vertex number, returns the set of local faces that include that vertex. Corresponds to returning the non-empty entries of line v from matrix CE. Values are returned on list. The pre-alloc size of 4 entries should be enough for any common element type.
 
void nodeFaces (int node, QVarLengthArray< int, 4 > &list) const
 Given a local node number, returns the set of local faces that include that node, working for any node in a quadratic element. For element vertices, it is equivalent to vertexFaces(). Values are returned on list. The pre-alloc size of 4 entries should be enough for any common element type.
 
int edgeFace (int edge) const
 Given a cell edge index, returns one of the cell faces that includes that edge.
 
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 that edge by filling v1 and v2 and returns true. If the local node is a mid-surface node, returns false. Should not be called for vertex nodes or mid-volume nodes.
 
bool quadraticMidEdgeNodeAdjacentVertices (int node, int *v1, int *v2, const int *cellNodes) const
 Overload for quadraticMidEdgeNodeAdjacentVertices() returning global vertices translated with cellNodes.
 
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. Corresponds to returning the columns of the non-empty entries of line v from matrix CE (but is not implemented this way since wel already have that incidence information pre-computed in the cell geometry metadata object kept by GeMA). Values are returned on list. The pre-alloc size of 4 entries should be enough for any common element type.
 
void vertexAdjacentVertices (int v, QVarLengthArray< int, 4 > &list, const int *cellNodes) const
 Overload for vertexAdjacentVertices() returning global vertices translated with cellNodes.
 
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. If the element is linear, its result is equal to calling vertexAdjacentVertices(). For quadratic elements, returns the adjacent mid-edge nodes instead of the adjacent corner vertices (ignoring mid-edge nodes). Values are returned on list. The pre-alloc size of 4 entries should be enough for any common element type.
 
void vertexAdjacentNodes (int v, QVarLengthArray< int, 4 > &list, const int *cellNodes) const
 Overload for vertexAdjacentNodes() returning global vertices translated with cellNodes.
 
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.
 
void edgeVertices (int e, int *first, int *last, const int *cellNodes) const
 Overload for edgeVertices() returning global vertices translated with cellNodes.
 
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.
 
void edgeNodes (int e, QVarLengthArray< int, 4 > &list, const int *cellNodes) const
 Overload for edgeNodes() returning global vertices translated with cellNodes.
 
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.
 
void faceEdgeVertices (int f, int e, int *first, int *last, const int *cellNodes) const
 Overload for edgeVertices() returning global vertices translated with cellNodes.
 
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 edge vertices. Values are returned on list. The pre-alloc size of 4 entries should be enough for any common element type.
 
void faceEdgeNodes (int f, int e, QVarLengthArray< int, 4 > &list, const int *cellNodes) const
 Overload for edgeNodes() returning global vertices translated with cellNodes.
 

Static Public Member Functions

static const UibhmGemaTemplatetypeTemplate (GmCellType t)
 Returns the template object for the given element type. Might return NULL for unsupported elements (bars, for exemple)
 

Private Member Functions

 Q_DISABLE_COPY (UibhmGemaTemplate)
 
 UibhmGemaTemplate (GmCellType t)
 Private constructor. Should be called only by UibhmGemaTemplateInit()
 
const int * nodeOffsets (int f) const
 Returns the edge node offset vector for the given face.
 
template<bool Translate>
bool quadraticMidEdgeNodeAdjacentVerticesImpl (int node, int *v1, int *v2, const int *cellNodes=NULL) const
 Work horse for both versions of quadraticMidEdgeNodeAdjacentVertices()
 
template<bool Translate>
void vertexAdjacentImpl (int v, const GmCellGeometryInfo *g, QVarLengthArray< int, 4 > &list, const int *cellNodes=NULL) const
 Work horse for both versions of vertexAdjacentVertices() and vertexAdjacentNodes()
 
template<bool Translate>
void edgeVerticesImpl (int e, int *first, int *last, const int *cellNodes=NULL) const
 Work horse for both versions of edgeVertices()
 
template<bool Translate>
void edgeNodesImpl (int e, QVarLengthArray< int, 4 > &list, const int *cellNodes=NULL) const
 Work horse for both versions of edgeNodes()
 
template<bool Translate>
void faceEdgeVerticesImpl (int f, int e, int *first, int *last, const int *cellNodes=NULL) const
 Work horse for both versions of faceEdgeVertices()
 
template<bool Translate>
void faceEdgeNodesImpl (int f, int e, QVarLengthArray< int, 4 > &list, const int *cellNodes=NULL) const
 Work horse for both versions of faceEdgeNodes()
 

Private Attributes

const GmCellGeometryInfo_g
 The type info object.
 
const GmCellGeometryInfo_vg
 The type info object used to query faces for vertices. Will be equal to _g for linear types without extra dof nodes.
 
int _maxNfv
 The maximum number of vertices in a face for this element.
 
int _midNode
 The local number of the mid face/volume node for a quadratic surface/solid element. -1 if there is none.
 
int * _edgeFace
 An auxiliar vector with numEdges() entries storing, for each edge, one (any) face that includes that edge. TODO: Maybe this should be moved to the GmCellGeometry / GmCellGeometryMetadata classes?
 
int * _edgeNodeOffset
 An auxiliary matrix used to to store the node index in the face node description of the first node of each face half-edge. Needed to handle elements with varying number of nodes per edge (like a quadratic interface element without extra dof nodes) Size equal to numFaces() x (_maxNfv + 1). Linearizes by row. The extra entry in each line works as a sentinell and stores the number of nodes in the face.
 
int * _CF
 The face adjacency matrix, linearized by row. Known in the IBHM paper as CF. Size equal to numFaces() x _maxNfv. For each face, stores the index of the adjacent faces, ordered according to the half edges specified by faceVertices() for the face. If that face has a number of vertices < _maxNfv, the remaining entries are filled with -1;.
 
int * _CE
 The half edge matrix, linearized by row. Known in the IBHM paper as CE. Size equal to numVertices() x numVertices(). An entry (i, j) has a value if there is a half-edge starting at node i and ending at node j. In that case, the stored value is the index of the face that contains that edge. Otherwise the entry is -1. Symmetric elements correspond to adjacent faces. More...
 

Static Private Attributes

static const UibhmGemaTemplate_typeTemplates [GM_NUM_CELL_TYPES]
 The vector with per GeMA type templates. Might be NULL for unsupported types (bars, for example). Built at plugin startup. More...
 

Friends

bool UibhmGemaTemplateInit ()
 Initializes the UibhmGemaTemplate::_typeTemplates list.
 

Detailed Description

A class used to store the type information needed by the Uibhm structure. The data is created based on the information that already exists on the GmCellGeometry class.

Can only be instanced for surface or solid types (no bars)

Part of the information is already available at the geometry class and the queries are just forwarded to a GmCellGeometryInfo object, but the CF & CE matrices are created and stored internally.

For Interface elements with extra dof nodes, extra care has to be taken for finding the correct nodes for an edge since there are elements where each edge has a different number of nodes.

Member Data Documentation

◆ _CE

int* UibhmGemaTemplate::_CE
private

The half edge matrix, linearized by row. Known in the IBHM paper as CE. Size equal to numVertices() x numVertices(). An entry (i, j) has a value if there is a half-edge starting at node i and ending at node j. In that case, the stored value is the index of the face that contains that edge. Otherwise the entry is -1. Symmetric elements correspond to adjacent faces.

◆ _typeTemplates

const UibhmGemaTemplate * UibhmGemaTemplate::_typeTemplates
staticprivate

The vector with per GeMA type templates. Might be NULL for unsupported types (bars, for example). Built at plugin startup.

The declaration for the global list of template objects per GeMA cell type.


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