24 #ifndef _GEMA_PLUGIN_GEMA_CELL_MESH_DATA_H_ 25 #define _GEMA_PLUGIN_GEMA_CELL_MESH_DATA_H_ 35 template <
template <
class>
class Vector>
46 virtual Vector<int>* cellNodesVector() {
return &_cellNodeIndices; }
48 virtual void updateCellNodeOffset(
GmCell* c,
int offset)
50 assert(offset >= 0 && offset < _cellNodeIndices.size());
56 GmpGemaCell<GmCell, GmLuaCell, GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>* gc = (
GmpGemaCell<GmCell, GmLuaCell, GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>*)c;
57 gc->setOffset(offset);
68 int*
cellNodesPtr(
int offset) {
return _cellNodeIndices.iptr(offset); }
83 assert(
sizeof(
GmpGemaCell <
GmCell,
GmLuaCell,
GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>) ==
sizeof(
GmpGemaCell <
GmElement,
GmLuaElement,
GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>));
84 assert(
sizeof(
GmpGemaCell <
GmCell,
GmLuaCell,
GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>) ==
sizeof(
GmpGemaCell <
GmCell,
GmLuaCell,
GmpGemaCellMeshData<Vector>,
GM_HEX8, 8, 8>));
85 assert(
sizeof(
GmpGemaGhostCell<
GmCell,
GmLuaCell,
GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>) ==
sizeof(
GmpGemaGhostCell<
GmElement,
GmLuaElement,
GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>));
86 assert(
sizeof(
GmpGemaGhostCell<
GmCell,
GmLuaCell,
GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>) ==
sizeof(
GmpGemaGhostCell<
GmCell,
GmLuaCell,
GmpGemaCellMeshData<Vector>,
GM_HEX8, 8, 8>));
87 assert(
sizeof(
GmpGemaGhostCell<
GmElement,
GmLuaElement,
GmpGemaCellMeshData<Vector>,
GM_QUAD4, 4, 4>) ==
sizeof(
GmpGemaGhostCell<
GmpHElementBase<0>,
GmLuaHElement,
GmpGemaCellMeshData<Vector>,
GM_HQUADP, 4, 4>));
90 size_t size = _cells.usedMemory();
97 size += _cellPropertyIndices.usedMemory();
100 size += _cellNodeIndices.usedMemory();
102 if(_maxNumGhostNodes > 0)
109 GmpGemaGhostCell<GmCell, GmLuaCell, GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>* c = (
GmpGemaGhostCell<GmCell, GmLuaCell, GmpGemaCellMeshData<Vector>,
GM_BAR2, 2, 2>*)_cells[i];
116 if(_cellDumpTypeActiveData)
117 size += _numCells *
sizeof(char);
119 if(_cellDumpGhostData)
120 size += _cellDumpGhostDataSize *
sizeof(int);
134 false, state->
logger(),
false,
"CellMeshDataCellNodes");
155 _cellNodeIndices.clear();
virtual bool addStateGeometryData(GmSimulationData *simData, GmMesh *mesh, GmpMeshLoaderCellAllocator alloc, GmStateDump *state, int groupId)
Adds to the state dump the items used for storing cell information, together with number os cells by ...
Definition: gmpCellMeshData.cpp:671
void releaseOwnMemory()
Releases memory owned directly by this class, without releasing memory owned by the base class.
Definition: gmpGemaCellMeshData.h:153
An auxiliar class that can be used as the base class for GmpCellBase for Hierarchical elements....
Definition: gmpCellBase.h:323
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: gmpGemaCellMeshData.h:148
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
virtual bool addStateGeometryData(GmSimulationData *simData, GmMesh *mesh, GmpMeshLoaderCellAllocator alloc, GmStateDump *state, int groupId)
Add to the state dump item the vectors storing cell node information.
Definition: gmpGemaCellMeshData.h:126
GmpGemaCellMeshData(GmCellMesh *mesh)
Constructor.
Definition: gmpGemaCellMeshData.h:39
int * cellNodesPtr(int offset)
Returns a pointer to vector region where the node indices for the given cell are stored.
Definition: gmpGemaCellMeshData.h:68
int addStateItem(GmValueAccessor *ac, const GmMesh *mesh, bool fixedHint, bool ownership=false, int groupId=-1, QString prefix="")
GmPODVector< int, uint32_t, GmPODVectorFastGrow< uint32_t > > _ghostList
List storing cell ghost nodes. Uses a GmPODVector with size control based on a 32 bits value giving a...
Definition: gmpCellBase.h:314
Basic implementation for a "Gema cell", adding the information about the offset of its nodes in the g...
Definition: gmpGemaCell.h:37
Basic implementation for a GmpGemaGhostCell cell, based on the GmpGhostCellBase class.
Definition: gmpGemaCell.h:98
Declaration of the GmpCellMeshData structure.
Auxiliar structure used to share data between GmpGemaCellMesh and GmpMeshLoader.
Definition: gmpGemaCellMeshData.h:36
virtual size_t cellMemory() const
Returns the approximate memory used for storing mesh cells.
Definition: gmpGemaCellMeshData.h:71
const GmLogCategory & logger() const
int nextIdInGroup(int groupId)
virtual void releaseMemory(bool clearBoundaryData=true)
Releases all the memory DIRECTLY owned by the object.
Definition: gmpCellMeshData.cpp:460
Auxiliar structure used to share data between GmpXxxCellMeshBase and GmpMeshLoader.
Definition: gmpCellMeshData.h:123
Declaration of the GmpGemaCell class.
virtual void releaseMemory(bool clearBoundaryData=true)
Releases all the memory DIRECTLY owned by the object.
Definition: gmpGemaCellMeshData.h:61
ControlSize capacity() const
virtual ~GmpGemaCellMeshData()
Virtual destructor.
Definition: gmpGemaCellMeshData.h:44
int _numCells
The total number of cells.
Definition: gmpCellMeshData.h:178