24#ifndef _UIBHM_GEOMETRY_H_
25#define _UIBHM_GEOMETRY_H_
45template <
bool Hybr
id,
template <
class>
class Vector>
60 enum { IsHybrid = Hybrid };
64 bool updateCellTypes(
int numAddedCells);
67 int numNodes()
const {
return _nodeData->_numNodes; }
70 int numCells()
const {
return _cellData->_numCells; }
73 GmCell*
cell(
int cellId) { assert(cellId >= 0 && cellId < _cellData->_numCells);
return _cellData->cell(cellId); }
76 bool solid()
const {
return _solid; }
82 bool hybrid()
const {
return Hybrid; }
129 int findNodeIndex(
int cellId,
int v)
const;
130 int colapsedInterfaceNode(
int cellId,
int v,
int localIndex)
const;
131 int colapsedInterfaceEdge(
int cellId,
int face,
int faceEdge,
int refFace)
const;
132 int findFaceEdge (
int cellId,
int face,
int v1,
int v2)
const;
133 int findFaceEdge (
int cellId,
int face,
int* v1,
int* v2)
const;
134 int findFaceEdgeFromLocalNodes(
int cellId,
int face,
int lv1,
int lv2)
const;
135 int findFaceEdgeFromMidEdgeNode(
int cellId,
int face,
int v)
const;
158 t->
edgeNodes(edge, nodeList, cn(cellId));
174 return cn(cellId)[t->
midNode()];
215 if(v1 > v2) qSwap(v1, v2);
216 return (((
size_t)v1) << 32) | ((size_t)v2);
225 *v1 = (int)(edge >> 32);
226 *v2 = (int)(edge & 0xFFFFFFFF);
232 assert(cellId >= 0 && cellId < numCells());
234 return _typeTemplateList[_cellData->cell(cellId)->type()];
238 return _typeTemplate;
249 const int*
cn(
int cellId)
const {
return _cellData->cellNodesPtr(co(cellId)); }
Class for storing cell data, without ghost nodes support.
Definition gmpCell.h:132
Auxiliar structure used to share data between GmpCellMesh and GmpMeshLoader. All fields are public si...
Definition gmpCellMeshData.h:121
Auxiliar interface used to share node data between the mesh implementation and GmpMeshLoader....
Definition gmpNodeMeshData.h:53
A class used to provide all the geometric information needed by the topology and query Uibhm classes....
Definition uibhmGeometry.h:47
GmCell * cell(int cellId)
Returns the cell object from its id.
Definition uibhmGeometry.h:73
static size_t encodeEdge(int v1, int v2)
Encodes the edge definde by v1, v2 into a 64 bits integer number.
Definition uibhmGeometry.h:213
bool _interface
Flag set to true if the mesh includes interface elements.
Definition uibhmGeometry.h:259
const GmPCR * _pcr
The mesh PCR object to allow for needed model <--> internal cell and node id conversions.
Definition uibhmGeometry.h:256
bool _solid
Flag set to true if the mesh includes solid cells.
Definition uibhmGeometry.h:257
bool hasInterface() const
Returns true if the mesh includes any interface element.
Definition uibhmGeometry.h:85
int midCellNode(int cellId) const
If the element has a mid surface or a mid volume quadratic node, returns the node index....
Definition uibhmGeometry.h:170
int numCells() const
Return the number of mesh cells (including any 'strange' elements)
Definition uibhmGeometry.h:70
const int * cn(int cellId) const
Returns the cell node list.
Definition uibhmGeometry.h:249
void vertexAdjacentVertices(int cellId, int localNode, QVarLengthArray< int, 4 > &nodeList) const
Given a local vertex number (a geometry node, NOT a quadratic node), returns the set of global vertic...
Definition uibhmGeometry.h:193
void faceEdgeNodes(int cellId, int face, int edge, QVarLengthArray< int, 4 > &nodeList) const
Returns the list of nodes for the given element's face edge, where the face is defined by its local i...
Definition uibhmGeometry.h:122
bool _strange
Flag set to true if the mesh includes "strange" cells.
Definition uibhmGeometry.h:258
const GmPCR * pcr() const
Returns the PCR object used for model <--> internal cell and node id conversions.
Definition uibhmGeometry.h:252
int numSides(int cellId) const
Returns the number of sides(edges or faces) for the given element. Returns 0 for strange elements.
Definition uibhmGeometry.h:162
void edgeVertices(int cellId, int edge, int *first, int *last) const
Returns the pair of vertices for the given element's edge, where the edge is defined by its local ind...
Definition uibhmGeometry.h:142
int numNodes() const
Return the number of mesh nodes.
Definition uibhmGeometry.h:67
int co(int cellId) const
Returns the offset of the first node stored by the given cell.
Definition uibhmGeometry.h:246
NodeData * _nodeData
The mesh node data object.
Definition uibhmGeometry.h:254
const UibhmGemaTemplate * tt(int cellId) const
Returns the template type for the given cell. Will return NULL for "strange" cells.
Definition uibhmGeometry.h:230
bool solid() const
Returns true if the mesh includes any solid cell (a cell with more than one face)
Definition uibhmGeometry.h:76
bool strange() const
Returns true if the mesh includes "strange" cells. A surface mesh has strange cells if it includes ba...
Definition uibhmGeometry.h:92
static void decodeEdge(size_t edge, int *v1, int *v2)
Decodes the result of an encodeEdge() operation returning both nodes. Since encoded values are always...
Definition uibhmGeometry.h:223
const UibhmGemaTemplate *const * typeTemplates() const
Returns a vector with GM_NUM_CELL_TYPES entries storing the templates for the used cell types....
Definition uibhmGeometry.h:98
bool quadraticMidEdgeNodeAdjacentVertices(int cellId, int localNode, int *v1, int *v2) const
Given a mid-edge quadratic node defined by its local cell index, returns the pair of (global) vertice...
Definition uibhmGeometry.h:183
void faceEdgeVertices(int cellId, int face, int edge, int *first, int *last) const
Returns the pair of vertices for the given element's face edge, where the face is defined by its loca...
Definition uibhmGeometry.h:109
bool hybrid() const
Returns true if this mesh contains (or supports) hybrid cell types. It will always return true if the...
Definition uibhmGeometry.h:82
Vector< U > VectorType
The vector type used by the mesh.
Definition uibhmGeometry.h:51
CellData * _cellData
The mesh cell data object.
Definition uibhmGeometry.h:255
void edgeNodes(int cellId, int edge, QVarLengthArray< int, 4 > &nodeList) const
Returns the list of nodes for the given element's edge, where the edge is defined by its local index ...
Definition uibhmGeometry.h:154
void vertexAdjacentNodes(int cellId, int localNode, QVarLengthArray< int, 4 > &nodeList) const
Given a local vertex number (a geometry node, NOT a quadratic node), returns the set of global nodes ...
Definition uibhmGeometry.h:205
const UibhmGemaTemplate * _typeTemplate
The type template if the mesh has a single cell type that is not a strange type (not hybrid,...
Definition uibhmGeometry.h:262
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
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
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
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
int midNode() const
For quadratic elements with a mid face (surface element) or mid volume (solid element) node,...
Definition uibhmTemplate.h:112
int numSides() const
Returns numEdges() for surface elements and numFaces() for solid elements.
Definition uibhmTemplate.h:69
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
Declaration of the GmpCellMeshData structure.
Declaration of the GmpNodeMeshData class.
Declaration of the UibhmGemaTemplate class.