24 #ifndef _GEMA_PLUGIN_CELL_MESH_DATA_H_ 25 #define _GEMA_PLUGIN_CELL_MESH_DATA_H_ 48 #include <QScopedPointer> 49 #include <QVariantMap> 57 #define GmpCellMeshDataMaxHTypes 3 68 _meshId = newMeshId(mesh,
this);
69 _hierarchicalIndex = -1;
80 static int hierarchicalOrderIndex(
int P,
int Q);
85 static inline int hierarchicalPOrder(
int index) { assert(index >= -1 && index < _hTableNumUsedSlots);
return index == -1 ? 0 : _hTable[index].first; }
90 static inline int hierarchicalQOrder(
int index) { assert(index >= -1 && index < _hTableNumUsedSlots);
return index == -1 ? 0 : _hTable[index].second; }
122 template <
template <
class>
class Vector>
134 int*
cellPropertiesPtr(
int cellId) { assert(_propertySets.size() > 0);
return _cellPropertyIndices.iptr(cellId * _propertySets.size()); }
140 virtual int addCellGroup(
QString groupName);
141 virtual bool addCellsToGroup(
int groupId,
const QVector<int>& cellIds);
144 virtual Vector<int>* cellNodesVector() {
return NULL; }
145 virtual void updateCellNodeOffset(
GmCell* c,
int offset) = 0;
149 virtual void releaseMemory(
bool clearBoundaryData =
true);
151 void increaseNumCells(
int nCells) { _numCells += nCells; _numActiveCells += nCells; }
153 size_t cellGroupsMemory()
const;
154 size_t cellBoundariesMemory()
const;
156 void setGhostEnabled(
bool state) { _ghostEnabled = state; }
159 bool resizeGaussValueSets(
GmElementMesh* emesh,
int* addedCellsByType);
161 bool buildTopologyStructure(
GmCellMesh* mesh);
170 virtual bool fillDumpControlMapData (
GmMesh* mesh, QVariantMap* map,
const GmLogCategory& logger);
171 virtual bool dumpControlMapDataLoaded(
GmMesh* mesh, QVariantMap* map,
const GmLogCategory& logger);
173 bool fillAuxCellBuffers(
int* cellSavedData,
int* baseCellType,
GmMesh* mesh,
const GmLogCategory& logger);
176 virtual void releaseDumpMemory();
244 static_assert(GM_NUM_CELL_TYPES <= 127,
"Number of cell types exceeds 7 bits");
bool _buildEdgeMap
The topology structure, if already built.
Definition: gmpCellMeshData.h:231
int _numActiveCells
The total number of active cells in the mesh.
Definition: gmpCellMeshData.h:179
GmStateDump * _state
Definition: gmpCellMeshData.h:268
int _meshId
Stores the mesh index in _meshTable for the current mesh.
Definition: gmpCellMeshData.h:101
int _maxNumGhostNodes
The maximum number of ghost nodes among mesh cells.
Definition: gmpCellMeshData.h:198
virtual ~GmpCellMeshDataBase()
Virtual destructor.
Definition: gmpCellMeshData.h:73
int _maxTotalNumNodes
The maximum number of nodes (common + ghost) among mesh cells.
Definition: gmpCellMeshData.h:201
GmCell *(* GmpMeshLoaderCellAllocator)(GmCellMesh *mesh, int meshId, GmCellType type, int hindex, int id, int offset)
Typedef for a function that can allocate a single cell of the given type and initialize it with the g...
Definition: gmpMeshLoaderAllocator.h:36
Vector< int > _cellPropertyIndices
A vector with size equal to _numCells * _propertySets.size() continuously storing the cell's property...
Definition: gmpCellMeshData.h:228
static int _hTableNumUsedSlots
The number of used entries in _hTable.
Definition: gmpCellMeshData.h:110
static int hierarchicalQOrder(int index)
Returns the Q order for hierarchical elements associated with the given index (returned by hierarchic...
Definition: gmpCellMeshData.h:90
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:189
A non template base class for GmpCellMeshData storing the needed static attributes and controlling th...
Definition: gmpCellMeshData.h:63
int _cellDumpGhostDataSize
The size of the vector _cellDumpGhostData.
Definition: gmpCellMeshData.h:258
int _cellDumpTypeActiveDataSize
The size of the vector _cellDumpTypeActiveData. Needed since _numCells is not zero when the vector is...
Definition: gmpCellMeshData.h:248
QList< int > _numCellsInGroup
A list with the number of cells in each cell group. Its size should be equal to _cellGroupIds....
Definition: gmpCellMeshData.h:209
static GmpCellMeshDataBase * meshData(int meshId)
Returns the mesh data pointer associated with the given mesh id.
Definition: gmpCellMeshData.h:98
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:224
bool hierarchicalElements() const
Returns true if the mesh uses hierarchical elements, false otherwise.
Definition: gmpCellMeshData.h:76
static GmCellMesh * mesh(int meshId)
Returns the mesh pointer associated with the given mesh id.
Definition: gmpCellMeshData.h:95
int _maxNumNodes
The maximum number of nodes among mesh cell types in use by the mesh.
Definition: gmpCellMeshData.h:192
QStringList _cellGroupIds
A list with available cell group names.
Definition: gmpCellMeshData.h:204
unsigned char * _cellDumpTypeActiveData
A vector storing temporary cell types + active data when needed for dumping code. If different from N...
Definition: gmpCellMeshData.h:244
GmpCellMeshDataBase(GmCellMesh *mesh)
Constructor.
Definition: gmpCellMeshData.h:66
#define GmpCellMeshDataMaxHTypes
The maximum number of distinct hierarchical type orders that can be used simmultaneously....
Definition: gmpCellMeshData.h:57
static int hierarchicalPOrder(int index)
Returns the P order for hierarchical elements associated with the given index (returned by hierarchic...
Definition: gmpCellMeshData.h:85
Interface for accessing the "exported" functions of a UibhmTopology class instance,...
Definition: uibhmTopology.h:83
Declaration of usefull configuration definitions for the plugin library.
virtual ~GmpCellMeshData()
Virtual destructor.
Definition: gmpCellMeshData.h:128
QMap< QString, GmCellBoundary * > _boundaryGroups
A map with the definition of each boundary group associated with the mesh. Map entries are instances ...
Definition: gmpCellMeshData.h:219
QVariantMap * _cellDumpLoadedMap
The map with loaded control data. Filled (different from NULL) only during the load process.
Definition: gmpCellMeshData.h:261
int _hierarchicalIndex
The hierarchical order index in _hTable if this mesh has hierarchical elements or -1 if elements are ...
Definition: gmpCellMeshData.h:106
Auxiliar structure used to share data between GmpXxxCellMeshBase and GmpMeshLoader.
Definition: gmpCellMeshData.h:123
int * cellPropertiesPtr(int cellId)
Returns a pointer to vector region where the property indices for the given cell are stored....
Definition: gmpCellMeshData.h:134
Vector< GmCell * > _cells
The cell vector (size equal to _numCells)
Definition: gmpCellMeshData.h:180
#define GMP_GEMAMESH_MAX_NUM_MESHES
The maximum number of allowed meshes.
Definition: gmpGemaMeshConfig.h:49
int * _cellDumpGhostData
A vector storing temporary information about ghost nodes when needed for dumping code....
Definition: gmpCellMeshData.h:255
bool _ghostEnabled
Can the cells store ghost nodes? (_maxNumGhostNodes can be zero if the mesh supports ghost nodes but ...
Definition: gmpCellMeshData.h:195
Declaration of the GmpMeshLoaderCellAllocator type.
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:214
int _numCells
The total number of cells.
Definition: gmpCellMeshData.h:178