24#ifndef _GEMA_PLUGIN_CELL_MESH_DATA_H_
25#define _GEMA_PLUGIN_CELL_MESH_DATA_H_
46template <
class,
class,
class, GmCellType,
int>
class GmpCell;
47template <
class,
class,
class, GmCellType,
int>
class GmpGhostCell;
58 _meshId = newMeshId(mesh,
this);
59 _hierarchicalIndex = -1;
72 _hierarchicalIndex = hierarchicalOrderIndex(p, q);
73 return (_hierarchicalIndex >= 0);
76 static int hierarchicalOrderIndex(
int P,
int Q);
81 static inline int hierarchicalPOrder(
int index) { assert(index >= -1 && index < _hTableNumUsedSlots);
return index == -1 ? 0 : _hTable[index].first; }
86 static inline int hierarchicalQOrder(
int index) { assert(index >= -1 && index < _hTableNumUsedSlots);
return index == -1 ? 0 : _hTable[index].second; }
119template <
template <
class>
class Vector>
143 void releaseMemory(
bool clearBoundaryData =
true);
151 int*
cellPropertiesPtr(
int cellId) { assert(_propertySets.size() > 0);
return _cellPropertyIndices.iptr(cellId * _propertySets.size()); }
154 int*
cellNodesPtr(
int offset) {
return _cellNodeIndices.iptr(offset); }
160 assert(addedCellsByType);
161 return addCellsImpl(mesh, addedCellsByType, 0, 0, allocCells, updateValueSets, pcr, logger);
167 return addCellsImpl(mesh, NULL, numCells, numCellNodes,
false,
false, pcr, logger);
171 void adjustCellIncidences(
GmPCR* pcr,
bool ghostSupport);
173 bool checkAndCollectStatistics(
GmCellMesh* mesh,
int* addedCellsByType,
int* nAddedCells,
174 int* nAddedNodes,
int* maxNumCellNodes,
bool* hasSolidElements,
177 void destroyCellsInRange(
int first);
179 void updateCellNodeOffset(
GmCell* c,
int offset);
181 int addCellGroup(
QString groupName);
182 bool addCellsToGroup(
int groupId,
const QVector<int>& cellIds);
190 void clearTopology();
191 bool topologyMeshChanged();
193 size_t cellMemory()
const;
194 size_t cellGroupsMemory()
const;
195 size_t cellBoundariesMemory()
const;
198 int addCellsImpl(
GmCellMesh* mesh,
int* addedCellsByType,
int numCells,
int numCellNodes,
201 bool resizeGaussValueSets (
GmElementMesh* emesh,
int* addedCellsByType,
int offset = 0);
202 void restoreGaussValueSets(
GmElementMesh* emesh,
int oldNumCells);
A helper class to implement state dump operations for a GmpCellMeshData<Vector> object.
Definition gmpCellDataDump.h:43
Class for storing cell data, without ghost nodes support.
Definition gmpCell.h:132
A non template base class for GmpCellMeshData storing the needed static attributes to controll the gl...
Definition gmpCellMeshData.h:53
GmpCellMeshDataBase(GmCellMesh *mesh)
Constructor.
Definition gmpCellMeshData.h:56
bool hierarchicalElements() const
Returns true if the mesh uses hierarchical elements, false otherwise.
Definition gmpCellMeshData.h:66
static GmpCellMeshDataBase * meshData(int meshId)
Returns the mesh data pointer associated with the given mesh id.
Definition gmpCellMeshData.h:94
static int _hTableNumUsedSlots
The number of used entries in _hTable.
Definition gmpCellMeshData.h:105
static int hierarchicalPOrder(int index)
Returns the P order for hierarchical elements associated with the given index (returned by hierarchic...
Definition gmpCellMeshData.h:81
static int hierarchicalQOrder(int index)
Returns the Q order for hierarchical elements associated with the given index (returned by hierarchic...
Definition gmpCellMeshData.h:86
~GmpCellMeshDataBase()
Destructor. Clears our entry in the global _meshTable and _meshDataTable.
Definition gmpCellMeshData.h:63
bool setHierarchicalIndex(int p, int q)
Sets the hierarchical index for this mesh from the given P & Q element orders. Returns false if not p...
Definition gmpCellMeshData.h:69
static GmCellMesh * mesh(int meshId)
Returns the mesh pointer associated with the given mesh id.
Definition gmpCellMeshData.h:91
int _hierarchicalIndex
The hierarchical order index in _hTable if this mesh has hierarchical elements or -1 if elements are ...
Definition gmpCellMeshData.h:102
Auxiliar structure used to share data between GmpCellMesh and GmpMeshLoader. All fields are public si...
Definition gmpCellMeshData.h:121
UibhmTopologyBase::CheckOptions _topoCheckOptions
Etxra check options when building the topology.
Definition gmpCellMeshData.h:288
int _numConstructed
The number of cells in _cells that where effectively in-place constructed (by a call to _cellAllocato...
Definition gmpCellMeshData.h:227
int * cellPropertiesPtr(int cellId)
Returns a pointer to the vector region where the property indices for the given cell are stored....
Definition gmpCellMeshData.h:151
int _numCells
The total number of cells.
Definition gmpCellMeshData.h:205
int * cellNodesPtr(int offset)
Returns a pointer to the vector region where the node indices for the given cell are stored.
Definition gmpCellMeshData.h:154
Vector< int > _cellPropertyIndices
A vector with size equal to _numCells * _propertySets.size() continuously storing the cell's property...
Definition gmpCellMeshData.h:243
int _cellSize
The allocator function used to instance cell object in-place on the _cells vector.
Definition gmpCellMeshData.h:213
GmCell * cell(int cellId) const
Returns a pointer to the given cell object.
Definition gmpCellMeshData.h:146
bool _topoBuildError
Set to true if we tried, unsuccessfully, to build _topology. Reset when the mesh is changed.
Definition gmpCellMeshData.h:286
QMap< QString, GmCellBoundary * > _boundaryGroups
A map with the definition of each boundary group associated with the mesh. Map entries are instances ...
Definition gmpCellMeshData.h:282
int _maxNumGhostNodes
The maximum number of ghost nodes among mesh cells.
Definition gmpCellMeshData.h:261
QList< GmPropertySet * > _propertySets
The list of property sets "indexed" by every cell. The order of property sets in this list is the sam...
Definition gmpCellMeshData.h:240
QStringList _cellGroupIds
A list with available cell group names.
Definition gmpCellMeshData.h:267
Vector< int > _cellNodeIndices
The list of cell nodes storing, in order, the set of all cell nodes. Its size is equal to the sum of ...
Definition gmpCellMeshData.h:235
QList< int * > _cellGroupCells
A list with a vector of cell Ids for each cell group. Its size should be equal to _cellGroupIds....
Definition gmpCellMeshData.h:277
GmpCellDataDump< Vector > * _dumper
The object responsible for state dump operations.
Definition gmpCellMeshData.h:290
QList< int > _numCellsInGroup
A list with the number of cells in each cell group. Its size should be equal to _cellGroupIds....
Definition gmpCellMeshData.h:272
int addCells(GmCellMesh *mesh, int *addedCellsByType, bool allocCells, bool updateValueSets, GmPCR *pcr, const GmLogCategory &logger)
See comments on addCellsImpl()
Definition gmpCellMeshData.h:157
GmCellMeshTopology * _topoQuery
The query object, if already built.
Definition gmpCellMeshData.h:285
Vector< char > _cells
The cell vector. Size equal to _numCells * _cellSize. Since the type and size of a cell is only known...
Definition gmpCellMeshData.h:219
bool _hasSolidElements
Set to true if there is at least one solid element in _cellsByType.
Definition gmpCellMeshData.h:255
bool _topoBuildEdgeMap
Should we build the edge map when building the topology?
Definition gmpCellMeshData.h:287
bool cellIsTopologyIndexed(int cellId) const
Returns true if the mesh has a topology structure and the cell has already been added to that structu...
Definition gmpCellMeshData.h:186
bool _singleCellType
If set to true, the mesh has only one cell type and other types can NOT be added to it.
Definition gmpCellMeshData.h:252
int _maxTotalNumNodes
The maximum number of nodes (common + ghost) among mesh cells.
Definition gmpCellMeshData.h:264
int addCells(GmCellMesh *mesh, int numCells, int numCellNodes, GmPCR *pcr, const GmLogCategory &logger)
See comments on addCellsImpl()
Definition gmpCellMeshData.h:165
int _numActiveCells
The total number of active cells in the mesh.
Definition gmpCellMeshData.h:206
UibhmTopologyBase * _topology
The topology structure, if already built.
Definition gmpCellMeshData.h:284
int _maxNumNodes
The maximum number of nodes among mesh cell types in use by the mesh.
Definition gmpCellMeshData.h:258
Adds ghost node support to GmpCell.
Definition gmpCell.h:266
Auxiliar interface used to share node data between the mesh implementation and GmpMeshLoader....
Definition gmpNodeMeshData.h:53
Interface for accessing the "exported" functions of a UibhmTopology class instance,...
Definition uibhmTopology.h:94
CheckOptions
Check options for mesh initialization.
Definition uibhmTopology.h:99
#define GM_MAX_ORTHOGONAL_POL_ORDER
Declaration of the GmpCellAllocator type.
GmCell *(* GmpCellAllocator)(void *addr, int meshId, GmCellType type, int hindex, int id, int offset)
Typedef for a function that can construct a single cell of the given type, placing it at the provided...
Definition gmpCellAllocator.h:36
Declaration of useful configuration definitions for the plugin library.
#define GMP_GEMAMESH_MAX_HTYPES
The maximum number of distinct hierarchical type orders that can be used simmultaneously....
Definition gmpGemaMeshConfig.h:63
#define GMP_GEMAMESH_MAX_NUM_MESHES
The maximum number of allowed meshes.
Definition gmpGemaMeshConfig.h:52
Declaration of the UibhmTopology familiy of classes.