24 #ifndef _GEMA_CELL_GROUP_SET_H_ 25 #define _GEMA_CELL_GROUP_SET_H_ 40 virtual int numCells()
const = 0;
51 virtual GmCell* cell(
int setIndex)
const = 0;
54 virtual bool ordered()
const = 0;
57 virtual int numNodes()
const = 0;
60 virtual int node(
int setIndex)
const = 0;
63 virtual void clear() = 0;
68 virtual const QList<int>& cellGroups()
const = 0;
86 virtual int numCells()
const {
return _mesh->numCells(); }
89 virtual GmCell*
cell(
int setIndex)
const {
return _mesh->cell(setIndex); }
92 virtual bool ordered()
const {
return true; }
95 virtual int numNodes()
const {
return _mesh->numNodes(); }
98 virtual int node(
int setIndex)
const {
return setIndex; }
131 virtual int numNodes()
const {
return nodeData()->first; }
134 virtual int node(
int setIndex)
const 138 assert(setIndex >= 0 && setIndex < d->first);
139 return d->second[setIndex];
142 virtual void clear();
153 NodeData* buildNodeList()
const;
154 NodeData* nodeData()
const;
191 virtual bool ordered()
const {
return false; }
193 virtual void clear();
215 virtual GmCell*
cell(
int setIndex)
const { assert(setIndex >= 0 && setIndex < _ncells);
return _cells[setIndex]; }
220 virtual void clear();
228 #define GmForeachActiveGroupCell(variable, gs) GmForeachCellHelper(variable, gs, GmCellGroupSet, GmCell, true) 231 #define GmForeachGroupCell(variable, gs, activeOnly) GmForeachCellHelper(variable, gs, GmCellGroupSet, GmCell, activeOnly) 234 #define GmForeachActiveGroupElement(variable, gs) GmForeachCellHelper(variable, gs, GmCellGroupSet, GmElement, true) 237 #define GmForeachGroupElement(variable, gs, activeOnly) GmForeachCellHelper(variable, gs, GmCellGroupSet, GmElement, activeOnly) virtual void clear()
Clear the group set in response to a mesh clear() opeartion. It will not clear the list of cellGroups...
Definition: gmCellGroupSet.h:101
virtual GmCellMesh * mesh() const
Returns the mesh owning the cell groups.
Definition: gmCellGroupSet.h:148
Interface for helping managing mesh cell groups and returning the elements in their union.
Definition: gmCellGroupSet.h:34
GmCell ** _cells
A vector with pointers to all unique cells in the group with size _ncells.
Definition: gmCellGroupSet.h:224
virtual int numNodes() const
Returns the number of nodes shared by the group elements.
Definition: gmCellGroupSet.h:131
virtual GmCell * cell(int setIndex) const
Given an index in the range [0..numCells()-1], returns the respective cell.
Definition: gmCellGroupSet.h:89
virtual GmCellMesh * mesh() const
Returns the mesh owning the cell groups.
Definition: gmCellGroupSet.h:107
GmCellMeshGroupSet(GmCellMesh *mesh)
Constructor.
Definition: gmCellGroupSet.h:83
QList< int > _groupList
The list of mesh cell groups included in this set.
Definition: gmCellGroupSet.h:157
Base interface for mesh cells.
Definition: gmCell.h:81
virtual int numNodes() const
Returns the number of nodes shared by the group elements.
Definition: gmCellGroupSet.h:95
virtual bool ordered() const
Returns true if the the set returned by calls to cell(0) through cell(numCells()-1) is ordered by cel...
Definition: gmCellGroupSet.h:92
int _ncells
The number of unique cells in the group.
Definition: gmCellGroupSet.h:223
virtual int node(int setIndex) const
Given an index in the range [0..numNodes()-1], returns the respective mesh node index.
Definition: gmCellGroupSet.h:134
virtual GmCell * cell(int setIndex) const =0
Given an index in the range [0..numCells()-1], returns the respective cell.
virtual const QList< int > & cellGroups() const
Returns a list with the cell groups belonging to this group set. Values are the group index in the me...
Definition: gmCellGroupSet.h:145
virtual void clear()
Clear the group set in response to a mesh clear() opeartion. It will not clear the list of cellGroups...
Definition: gmCellGroupSet.cpp:118
virtual bool ordered() const
Returns true if the the set returned by calls to cell(0) through cell(numCells()-1) is ordered by cel...
Definition: gmCellGroupSet.h:218
QPair< int, int * > NodeData
Type for storing node data information: Number of nodes + vector pointer.
Definition: gmCellGroupSet.h:125
virtual const QList< int > & cellGroups() const
Returns a list with the cell groups belonging to this group set. Values are the group index in the me...
Definition: gmCellGroupSet.h:104
GmCellMesh * _mesh
The associated mesh.
Definition: gmCellGroupSet.h:156
virtual void clear()=0
Clear the group set in response to a mesh clear() opeartion. It will not clear the list of cellGroups...
Base interface class for CellMesh type plugins.
Definition: gmCellMesh.h:39
QMutex _nodeDataMutex
Mutex protecting the creation of _nodeData.
Definition: gmCellGroupSet.h:167
Cell group set consisting of a set of disjoint mesh cell groups.
Definition: gmCellGroupSet.h:180
Declaration of the GmCellMesh interface class.
virtual int node(int setIndex) const
Given an index in the range [0..numNodes()-1], returns the respective mesh node index.
Definition: gmCellGroupSet.h:98
virtual GmCell * cell(int setIndex) const
Given an index in the range [0..numCells()-1], returns the respective cell.
Definition: gmCellGroupSet.h:215
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
QAtomicPointer< NodeData > _nodeData
Atomic pointer to the node data. Contains the number of nodes shared by the group cells and a vector ...
Definition: gmCellGroupSet.h:164
virtual int numCells() const =0
Returns the number of unique elements in the cell group set.
QMap< int, int > _groupMap
A map associating the first cell index in a group with the group number.
Definition: gmCellGroupSet.h:196
virtual GmCellMesh * mesh() const =0
Returns the mesh owning the cell groups.
Cell group set consisting of all the mesh cells.
Definition: gmCellGroupSet.h:79
A helper class implementing common code for handling group sets, specially handling group nodes....
Definition: gmCellGroupSet.h:121
Declaration of the GmCell class.
virtual int numCells() const
Returns the number of unique elements in the cell group set.
Definition: gmCellGroupSet.h:212
virtual bool ordered() const
Returns true if the the set returned by calls to cell(0) through cell(numCells()-1) is ordered by cel...
Definition: gmCellGroupSet.h:191
virtual int numCells() const
Returns the number of unique elements in the cell group set.
Definition: gmCellGroupSet.h:86
Cell group set consisting of a set of mesh cell groups.
Definition: gmCellGroupSet.h:203