24#ifndef _GEMA_CELL_MESH_H_
25#define _GEMA_CELL_MESH_H_
175 virtual bool isValid(
QMap<int, int>& nonValidIds,
bool valNonPlanar =
false,
bool print =
true,
double tol = 1e-3)
const;
177 virtual bool isQualityGT(
double minQuality)
const;
179 virtual void qualityHistogram(
QVector<int>& hist,
int nbins = 10)
const;
209 void clearCellStatistics();
211 void printQualityHistogram(
bool activeOnly =
true)
const;
228 virtual int numCellsInGroup(
int groupIndex)
const { Q_UNUSED(groupIndex); assert(0);
return 0; }
238 virtual const GmCell*
cellInGroup(
int groupIndex,
int cellIndex)
const { Q_UNUSED(groupIndex); Q_UNUSED(cellIndex); assert(0);
return NULL; }
241 virtual GmCell*
cellInGroup(
int groupIndex,
int cellIndex) { Q_UNUSED(groupIndex); Q_UNUSED(cellIndex); assert(0);
return NULL; }
272 virtual QStringList cellValueIds(
int filter = -1)
const;
316 virtual int addCells(
int* numCellTypes) { Q_UNUSED(numCellTypes);
return -1; }
362 virtual void removeCellValueSet(
QString id);
363 virtual bool initCellValueSets();
364 virtual void beginAddingCellValueSets();
365 virtual bool endAddingCellValueSets();
366 virtual void clearCellValueSets();
367 virtual void clearCellValueSetsData();
372 virtual int numCellValueStates (
QString id)
const;
374 virtual double cellValueStateTime (
QString id,
int snum)
const;
375 virtual void setCellValueStateTag (
QString id,
int snum,
QString tag);
376 virtual void setCellValueStateTime(
QString id,
int snum,
double time);
404 void clearCellGroupSetsData(
bool keepMeshSet);
431 GmCellEdgeStatistics* edgeStatistics();
432 GmCellBboxStatistics* bboxStatistics();
434 void computeEdgeLength (GmCellEdgeStatistics* stat);
435 void computeCellBboxLength(GmCellBboxStatistics* stat);
462 _n = container->numCells();
520#define GmForeachCellHelper(variable, container, contType, cellType, activeOnly) \
521for(GmForeachCellHelperClass<contType, cellType> it(container, activeOnly); it._control && it._index<it._n; it.inc(), it._control ^= 1) \
522 for(variable = it.cell(); it._control; it._control = 0)
525#define GmForeachOrderedCellHelper(variable, container, contType, cellType, activeOnly, pcr) \
526for(GmForeachOrderedCellHelperClass<contType, cellType> it(container, activeOnly, pcr); it._control && it._index<it._n; it.inc(), it._control ^= 1) \
527 for(variable = it.cell(); it._control; it._control = 0)
545#define GmForeachActiveCell(variable, mesh) GmForeachCellHelper(variable, mesh, GmCellMesh, GmCell, true)
548#define GmForeachCell(variable, mesh, activeOnly) GmForeachCellHelper(variable, mesh, GmCellMesh, GmCell, activeOnly)
553#define GmForeachOrderedCell(variable, mesh, activeOnly, modelOrder) \
554GmForeachOrderedCellHelper(variable, mesh, GmCellMesh, GmCell, activeOnly, modelOrder ? (mesh)->pcrObject() : NULL)
The GmCellAccessor class is a proxy object to a value accesor implementing a more convenient interfac...
Definition gmCellAccessor.h:67
This class stores a set of cell edges or cell faces that together form a piece of the boundary of a m...
Definition gmCellBoundary.h:44
Interface for helping managing mesh cell groups and returning the elements in their union.
Definition gmCellGroupSet.h:35
Base interface for mesh cells.
Definition gmCell.h:88
Base interface class for CellMesh type plugins.
Definition gmCellMesh.h:40
GmValueSetGroup * _cellValuesGroup
Value set Group with cell attributes and state vars.
Definition gmCellMesh.h:437
virtual QStringList cellGroupIds() const
Returns a list with the names of the available cell groups.
Definition gmCellMesh.h:219
QAtomicPointer< GmCellEdgeStatistics > _meshEdgeStats
Atomic pointer to the mesh edge statistics object.
Definition gmCellMesh.h:441
QVector< GmCellGroupSet * > _cellGroups
A list with GmCellGroupSet objects used for traversing elements in a mesh group of cells.
Definition gmCellMesh.h:439
virtual int numCells() const =0
Returns the number of cells in the mesh.
virtual void clearAddedCells()
Method called by the assembler to clear the internal list used to track added cells....
Definition gmCellMesh.h:327
virtual void ghostNodesUpdated(int nghost, int ntotal)
Informs the mesh that the number of ghost nodes / total num nodes in a cell was updated to the given ...
Definition gmCellMesh.h:165
virtual int propertySetIndex(QString id) const =0
virtual const QMap< QString, GmCellBoundary * > & cellBoundaryGroups() const =0
Returns a map of boundaries registered within the mesh. Each entry in the returned map contains a gro...
virtual bool addCellsToGroup(int groupId, const QVector< int > &cellIds)
Adds the set of cells in the given list to the cell group. Assumes that the intersection of the given...
Definition gmCellMesh.h:347
virtual double edgeMaxLength()
Definition gmCellMesh.h:193
virtual bool hasSolidElements() const =0
Returns true if the mesh includes solid elements. Notice that this is different from checking if node...
virtual GmCell * cell(int cellIndex)=0
Non const version of cell() const.
virtual const int * numActiveCellTypes() const =0
Returns a const vector of size equal to GM_NUM_CELL_TYPES where each entry is the number of active ce...
virtual int maxTotalNumCellNodes() const
Returns the maximum total number of nodes (normal + ghost) in a cell mesh.
Definition gmCellMesh.h:156
const QVector< GmCellGroupSet * > & cellGroupSets() const
Returns the list of stored cell group set objects.
Definition gmCellMesh.h:402
virtual const GmCell * cellInGroup(int groupIndex, int cellIndex) const
Returns a cell present in the group referenced by groupIndex.
Definition gmCellMesh.h:238
virtual QList< int > addedCells() const
If the mesh supports mesh edition (hasCapability("addCells") returns true), this function should retu...
Definition gmCellMesh.h:322
virtual GmCell * cellInGroup(int groupIndex, int cellIndex)
Non const version of cellInGroup() const.
Definition gmCellMesh.h:241
virtual void activeCellUpdated(GmCellType type, bool active)=0
Informs the mesh that a cell had its active state changed, being made active / inactive....
virtual size_t cellGroupsMemory() const =0
Returns the approximate memory used for storing cell groups.
virtual bool addCellsToGroup(int groupId, const QVector< QPair< int, int > > &cellIds)
Adds the set of cells in the given list to the cell group.. The set of added cells is given by a vect...
Definition gmCellMesh.h:359
virtual const QList< GmPropertySet * > & propertySets() const =0
Returns a reference to the list of property sets associated to this mesh.
virtual double cellBboxMaxLength()
Definition gmCellMesh.h:207
virtual int numCellsInGroup(int groupIndex) const
Returns the number of cells present in the group referenced by groupIndex.
Definition gmCellMesh.h:228
virtual size_t cellMemory() const =0
Returns the approximate memory used for storing mesh cells (does not include memory for attributes)
QAtomicPointer< GmCellBboxStatistics > _meshBboxStats
Atomic pointer to the mesh bbox statistics object.
Definition gmCellMesh.h:442
GmValueSetGroup * cellValueSetGroup() const
Returns the ValueSetGroup object used to store the set of mesh cell value sets. This is a very specia...
Definition gmCellMesh.h:394
virtual int addCells(int *numCellTypes)
Adds new cells to the mesh, WHITHOUT initializing their nodes or attributes.
Definition gmCellMesh.h:316
virtual const GmCellMeshTopology * topology(bool create=true) const
If the mesh supports the topology capability (hasCapability("topology") returns true),...
Definition gmCellMesh.h:85
virtual double edgeMinLength()
Definition gmCellMesh.h:186
virtual int addCellGroup(QString groupName)
Adds a new (empty) cell group to the mesh.
Definition gmCellMesh.h:337
virtual const GmCell * cell(int cellIndex) const =0
Returns a cell of the mesh.
virtual size_t cellBoundariesMemory() const =0
Returns the approximate memory used for storing cell boundaries.
virtual int maxNumCellNodes() const =0
Returns the maximum number of nodes in a mesh cell (equivalent to calculating the maximum of the numb...
virtual int numGlobalCells() const
When working with partitioned meshes, returns the number of cells in the global mesh,...
Definition gmCellMesh.h:52
virtual int numActiveCells() const =0
Returns the number of active cells in the mesh.
virtual double cellBboxMinLength()
Definition gmCellMesh.h:200
GmValueSet * cellValueSet(QString id) const
Returns the value set associated with the given cell attribute.
Definition gmCellMesh.h:397
virtual const int * numCellTypes() const =0
Returns a const vector of size equal to GM_NUM_CELL_TYPES where each entry is the number of cells of ...
virtual int maxNumCellGhostNodes() const
Returns the maximum number of ghost nodes in a mesh cell.
Definition gmCellMesh.h:139
virtual void clearTopology()
If the mesh supports the topology capability (hasCapability("topology") returns true),...
Definition gmCellMesh.h:92
QMutex _meshStatsMutex
Mutex protecting the creation of the statistics objects.
Definition gmCellMesh.h:443
Base interface class for mesh topological queries.
Definition gmCellMeshTopology.h:33
Base helper class for the GmForeachXxxx() family of macros.
Definition gmCellMesh.h:448
int _control
The controls flag used to allow breaking inside the inner loop.
Definition gmCellMesh.h:454
const T * _container
The container.
Definition gmCellMesh.h:450
int _index
The current index.
Definition gmCellMesh.h:452
int _n
The number of cells in the container (either a mesh or a cell group set)
Definition gmCellMesh.h:453
bool _activeOnly
Should we traverse only active cells?
Definition gmCellMesh.h:451
Helper class for the GmForeachActiveXxxx() family of macros.
Definition gmCellMesh.h:470
GmForeachCellHelperClass(const T *container, bool activeOnly)
Constructor. Positions the iterator on the first active cell.
Definition gmCellMesh.h:473
void inc()
Increments the iterator.
Definition gmCellMesh.h:477
C * cell() const
Returns the current cell.
Definition gmCellMesh.h:480
Helper class for the GmForeachOrderedActiveXxxx() family of macros.
Definition gmCellMesh.h:487
C * cell() const
Returns the current cell.
Definition gmCellMesh.h:497
void inc()
Increments the iterator.
Definition gmCellMesh.h:494
GmForeachOrderedCellHelperClass(const T *container, bool activeOnly, GmPCR *pcr)
Constructor. Positions the iterator on the first active cell.
Definition gmCellMesh.h:490
GmPCR * _pcr
The PCR object used for model order traversal.
Definition gmCellMesh.h:499
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Base interface class for Mesh type plugins.
Definition gmMesh.h:48
virtual GmPCR * pcrObject() const =0
Returns the PCR(Partition - Color - Renumber) object associated with this mesh. Should NEVER return N...
virtual bool dumpControlMapDataLoaded(QVariantMap *map, const GmLogCategory &logger)
Sanity checks + processing of the dump control data map after a load operation.
Definition gmMesh.cpp:728
virtual void printParameters(const GmLogCategory &logger)
Asks the mesh to print all of its parameters using the provided logger.
Definition gmMesh.cpp:766
virtual void printValues(const GmLogCategory &logger, int options=GM_PRINT_DEFAULT)
Asks the mesh to print all of its node and cell data using the provided logger and requested options.
Definition gmMesh.cpp:823
virtual bool addStateAccessorData(GmStateDump *state, int groupId)
Adds to 'state' accessors for all the data stored on state variables or node attributes associated wi...
Definition gmMesh.cpp:664
virtual bool saveState(GmValueSet::SaveStateMode mode, const GmLogCategory &logger)
Simmilar to saveNodeValueState(), saves the current state of all values that support state saving....
Definition gmMesh.cpp:494
virtual bool fillDumpControlMapData(QVariantMap *map, const GmLogCategory &logger)
Fills the dump control data map with mesh data prior to a save operation On errors,...
Definition gmMesh.cpp:711
Base interface class for Partition-Color-Renumber object plugins.
Definition gmPCR.h:54
virtual int numGlobalCells() const =0
When working with partitioned meshes, returns the number of cells in the global mesh,...
virtual int originalCellTraversalOrder(int i) const =0
When traversing the whole set of mesh cells, one common requirement is for the traversal to produce t...
Interface storing property descriptions and values.
Definition gmPropertySet.h:38
Auxiliar class used to store the complete set of simulation data.
Definition gmSimulationData.h:55
The GmStateDump class presents a higher level of abstraction over GmMemoryDump, storing accessor data...
Definition gmStateDump.h:54
Auxiliar class used to store the definition of a state variable.
Definition gmStateVar.h:41
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition gmValueInfo.h:132
This class manages a group of ValueSets that have all the same size and must grow (or shrink) togethe...
Definition gmValueSetGroup.h:38
Basic class used to store sets of values, bound to a common definition, on behalf of another object (...
Definition gmValueSet.h:54
SaveStateMode
Initialization mode for calls to saveState()
Definition gmValueSet.h:60
Declaration of the GmCell class.
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition gmCellType.h:31
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of the GmMesh interface class.
Implementation of the GmPCR class.
@ GM_PRINT_DEFAULT
A tag to request that the options should be filled with the default.
Definition gmPrintUtils.h:72
Definition gmCellMesh.h:424
double _bboxMinLength
Minimum length of a cell bounding box diagonal in the whole mesh.
Definition gmCellMesh.h:425
double _bboxMaxLength
Maximum length of a cell bounding box diagonal in the whole mesh.
Definition gmCellMesh.h:426
Definition gmCellMesh.h:415
double _edgeMinLength
Minimum edge length in the whole mesh.
Definition gmCellMesh.h:416
double _edgeMaxLength
Maximum edge length in the whole mesh.
Definition gmCellMesh.h:417