24 #ifndef _UIBHM_GEOMETRY_H_ 25 #define _UIBHM_GEOMETRY_H_ 43 template <
bool Hybr
id,
template <
class>
class Vector>
68 enum { IsHybrid = Hybrid };
73 dynamic_cast<
GmElementMesh*>(mesh) ? ((ElemMeshBase*)mesh)->theCellData() : ((CellMeshBase*)mesh)->theCellData())
78 bool updateCellTypes(
int numAddedCells);
81 int numNodes()
const {
return _nodeData->_numNodes; }
84 int numCells()
const {
return _cellData->_numCells; }
87 GmCell*
cell(
int cellId) { assert(cellId >= 0 && cellId < _cellData->_numCells);
return _cellData->_cells[cellId]; }
90 bool solid()
const {
return _solid; }
96 bool hybrid()
const {
return Hybrid; }
140 int findNodeIndex(
int cellId,
int v)
const;
141 int findFaceEdge (
int cellId,
int face,
int v1,
int v2)
const;
142 int findFaceEdge (
int cellId,
int face,
int* v1,
int* v2)
const;
165 t->
edgeNodes(edge, nodeList, cn(cellId));
180 return cn(cellId)[t->
midNode()];
221 if(v1 > v2) qSwap(v1, v2);
222 return (((
size_t)v1) << 32) | ((size_t)v2);
231 *v1 = (int)(edge >> 32);
232 *v2 = (int)(edge & 0xFFFFFFFF);
238 assert(cellId >= 0 && cellId < numCells());
240 return _typeTemplateList[_cellData->_cells[cellId]->type()];
244 return _typeTemplate;
249 int co(
int cellId)
const {
return ((
RealCell*)_cellData->_cells[cellId])->offset(); }
252 const int*
cn(
int cellId)
const {
return _cellData->cellNodesPtr(co(cellId)); }
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:211
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:199
GmpGemaMeshData< Vector > * _nodeData
The mesh node data object.
Definition: uibhmGeometry.h:254
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:169
GmpGemaCellMeshData< Vector > * _cellData
The mesh cell data object.
Definition: uibhmGeometry.h:255
int numNodes() const
Return the number of mesh nodes.
Definition: uibhmGeometry.h:81
bool _strange
Flag set to true if the mesh includes "strange" cells.
Definition: uibhmGeometry.h:257
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:258
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:177
static size_t encodeEdge(int v1, int v2)
Encodes the edge definde by v1, v2 into a 64 bits integer number.
Definition: uibhmGeometry.h:219
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:176
Vector< U > VectorType
The vector type used by the mesh.
Definition: uibhmGeometry.h:49
bool hybrid() const
Returns true if this mesh contains (or supports) hybrid cell types. It will always return true if the...
Definition: uibhmGeometry.h:96
int numSides() const
Returns numEdges() for surface elements and numFaces() for solid elements.
Definition: uibhmTemplate.h:69
Declaration of the GmpGemaCellMeshData structure.
const UibhmGemaTemplate * tt(int cellId) const
Returns the template type for the given cell. Will return NULL for "strange" cells.
Definition: uibhmGeometry.h:236
GmCell * cell(int cellId)
Returns the cell object from its id.
Definition: uibhmGeometry.h:87
Declaration of the GmpGemaCellMesh class.
Basic implementation for a "Gema cell", adding the information about the offset of its nodes in the g...
Definition: gmpGemaCell.h:37
A class used to store the type information needed by the Uibhm structure. The data is created based o...
Definition: uibhmTemplate.h:45
Declaration of the GmpGemaMeshData structure.
int co(int cellId) const
Returns the offset of the first node stored by the given cell.
Definition: uibhmGeometry.h:249
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:149
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:165
int numCells() const
Return the number of mesh cells (including any 'strange' elements)
Definition: uibhmGeometry.h:84
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:109
Declaration of the UibhmGemaTemplate class.
const int * cn(int cellId) const
Returns the cell node list.
Definition: uibhmGeometry.h:252
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:161
Auxiliar structure used to share data between GmpGemaCellMesh and GmpMeshLoader.
Definition: gmpGemaCellMeshData.h:36
bool strange() const
Returns true if the mesh includes "strange" cells. A surface mesh has strange cells if it includes ba...
Definition: uibhmGeometry.h:103
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:153
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:229
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:133
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:171
A class used to provide all the geometric information needed by the topology and query Uibhm classes....
Definition: uibhmGeometry.h:44
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:189
bool solid() const
Returns true if the mesh includes any solid cell (a cell with more than one face)
Definition: uibhmGeometry.h:90
int midNode() const
For quadratic elements with a mid face (surface element) or mid volume (solid element) node,...
Definition: uibhmTemplate.h:109
Auxiliar structure used to share data between GmpGemaMesh and GmpMeshLoader.
Definition: gmpGemaMeshData.h:31
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:140
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:183
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:193
bool _solid
Flag set to true if the mesh includes solid cells.
Definition: uibhmGeometry.h:256
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:120