GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmCellGenericGroupSet Class Reference

Cell group set consisting of a set of mesh cell groups. More...

#include <gmCellGroupSet.h>

Inheritance diagram for GmCellGenericGroupSet:
Collaboration diagram for GmCellGenericGroupSet:

Public Member Functions

 GmCellGenericGroupSet (GmCellMesh *mesh, const QList< int > &groups)
 Constructor.
 
 GmCellGenericGroupSet (GmCellMesh *mesh, const QVector< int > &cellIds)
 Constructor used for other subsets which does not depends on groups.
 
virtual ~GmCellGenericGroupSet ()
 Destructor.
 
virtual int numCells () const
 Returns the number of unique elements in the cell group set.
 
virtual GmCellcell (int setIndex) const
 Given an index in the range [0..numCells()-1], returns the respective cell.
 
virtual bool ordered () const
 Returns true if the the set returned by calls to cell(0) through cell(numCells()-1) is ordered by cell id.
 
virtual void clear ()
 Clear the group set in response to a mesh clear() operation. It will not clear the list of cellGroups.
 
virtual size_t usedMemory () const
 Returns the approximate amount of memory used to store node data, if any.
 
virtual void applyTransform (std::function< int(int)> &t)
 This is a very specialized function. Use only if you know what you are doing. For sets storing internally the cell ids, it should apply the given transformation to every id, replacing the previous ones. Sets that just point to cell groups should do nothing.
 
- Public Member Functions inherited from GmBaseCellGroupSet
virtual ~GmBaseCellGroupSet ()
 Destructor.
 
virtual int numNodes () const
 Returns the number of geometric nodes shared by the group elements.
 
virtual int node (int setIndex) const
 Given an index in the range [0..numNodes()-1], returns the respective mesh node index.
 
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 mesh, ordered by index.
 
virtual GmCellMeshmesh () const
 Returns the mesh owning the cell groups.
 
- Public Member Functions inherited from GmCellGroupSet
virtual ~GmCellGroupSet ()
 Virtual destructor.
 
QStringList cellGroupNames () const
 Returns the result of cellGroups() converted to group names.
 

Private Attributes

int _ncells
 The number of unique cells in the group.
 
int * _cells
 A vector with the ids of all unique cells in the group with size _ncells.
 
friend GmCellGroupSet
 

Additional Inherited Members

- Static Public Member Functions inherited from GmCellGroupSet
static bool cellGroupIds (const GmCellMesh *mesh, const QStringList &groupNames, QList< int > &idList, QString &err)
 Given a set of cell group names, creates a set of group ids, filling idList.
 
- Protected Types inherited from GmBaseCellGroupSet
typedef QPair< int, int * > NodeData
 Type for storing node data information: Number of nodes + vector pointer.
 
- Protected Member Functions inherited from GmBaseCellGroupSet
 GmBaseCellGroupSet (GmCellMesh *mesh, const QList< int > &groups)
 Base group set constructor. Stores the mesh and an ordered version of the group list.
 
 GmBaseCellGroupSet (GmCellMesh *mesh)
 Base group set constructor. Stores the mesh and an ordered version of the group list.
 
NodeDatabuildNodeList () const
 Builds the list with nodes used by this element groups. Does not changes the internal state.
 
NodeDatanodeData () const
 Auxiliar function that uses the Double Checked Locking Pattern (DCLP) to grab
the pointer to the node data, creating it by calling buildNodeList() if the node data was not created yet..
 
- Protected Attributes inherited from GmBaseCellGroupSet
GmCellMesh_mesh
 The associated mesh.
 
QList< int > _groupList
 The list of mesh cell groups included in this set.
 
QAtomicPointer< NodeData_nodeData
 Atomic pointer to the node data. Contains the number of nodes shared by the group cells and a vector with node indices. Mutable so that it can be filled in a lazy way by nodeData(). Stored in an atomic pointer to enable the use of a DCLP.
 
QMutex _nodeDataMutex
 Mutex protecting the creation of _nodeData.
 

Detailed Description

Cell group set consisting of a set of mesh cell groups.

Cells will be traversed in cell id order

Member Function Documentation

◆ applyTransform()

void GmCellGenericGroupSet::applyTransform ( std::function< int(int)> & t)
virtual

This is a very specialized function. Use only if you know what you are doing. For sets storing internally the cell ids, it should apply the given transformation to every id, replacing the previous ones. Sets that just point to cell groups should do nothing.

Implements GmCellGroupSet.

◆ cell()

virtual GmCell * GmCellGenericGroupSet::cell ( int setIndex) const
inlinevirtual

Given an index in the range [0..numCells()-1], returns the respective cell.

Implements GmCellGroupSet.

◆ clear()

void GmCellGenericGroupSet::clear ( )
virtual

Clear the group set in response to a mesh clear() operation. It will not clear the list of cellGroups.

Reimplemented from GmBaseCellGroupSet.

◆ numCells()

virtual int GmCellGenericGroupSet::numCells ( ) const
inlinevirtual

Returns the number of unique elements in the cell group set.

Implements GmCellGroupSet.

◆ ordered()

virtual bool GmCellGenericGroupSet::ordered ( ) const
inlinevirtual

Returns true if the the set returned by calls to cell(0) through cell(numCells()-1) is ordered by cell id.

Implements GmCellGroupSet.

◆ usedMemory()

virtual size_t GmCellGenericGroupSet::usedMemory ( ) const
inlinevirtual

Returns the approximate amount of memory used to store node data, if any.

Reimplemented from GmBaseCellGroupSet.


The documentation for this class was generated from the following files: