24 #ifndef _GEMA_CELL_MESH_H_ 25 #define _GEMA_CELL_MESH_H_ 46 virtual int numCells()
const = 0;
49 virtual int numActiveCells()
const = 0;
56 virtual const GmCell* cell(
int cellIndex)
const = 0;
59 virtual GmCell* cell(
int cellIndex) = 0;
95 virtual const int* numCellTypes()
const = 0;
105 virtual const int* numActiveCellTypes()
const = 0;
111 virtual int maxNumCellNodes()
const = 0;
159 virtual void activeCellUpdated(
GmCellType type,
bool active) = 0;
161 virtual bool isValid(
QList<int>* nonValidIds = NULL,
double tol = 1e-3)
const;
163 virtual bool isQualityGT(
double minQuality)
const;
165 virtual void qualityHistogram(
QVector<int>& hist,
int nbins = 10)
const;
195 void clearCellStatistics();
197 void printQualityHistogram(
bool activeOnly =
true)
const;
214 virtual int numCellsInGroup(
int groupIndex)
const { Q_UNUSED(groupIndex); assert(0);
return 0; }
224 virtual const GmCell*
cellInGroup(
int groupIndex,
int cellIndex)
const { Q_UNUSED(groupIndex); Q_UNUSED(cellIndex); assert(0);
return NULL; }
227 virtual GmCell*
cellInGroup(
int groupIndex,
int cellIndex) { Q_UNUSED(groupIndex); Q_UNUSED(cellIndex); assert(0);
return NULL; }
253 virtual int propertySetIndex(
QString id)
const = 0;
299 virtual int addCells(
int* numCellTypes) { Q_UNUSED(numCellTypes);
return -1; }
344 virtual bool addCellAttributeSet(
GmValueInfo* info);
345 virtual void removeCellAttributeSet(
QString id);
346 virtual void clearCellAttributeSets();
347 virtual void clearCellAttributeSetsData();
352 virtual int numCellAttributeStates (
QString id)
const;
353 virtual QString cellAttributeStateTag (
QString id,
int snum)
const;
354 virtual double cellAttributeStateTime (
QString id,
int snum)
const;
355 virtual void setCellAttributeStateTag (
QString id,
int snum,
QString tag);
356 virtual void setCellAttributeStateTime(
QString id,
int snum,
double time);
362 virtual size_t cellMemory()
const = 0;
365 virtual size_t cellGroupsMemory()
const = 0;
368 virtual size_t cellBoundariesMemory()
const = 0;
377 void clearCellGroupSetsData(
bool keepMeshSet);
404 GmCellEdgeStatistics* edgeStatistics();
405 GmCellBboxStatistics* bboxStatistics();
407 void computeEdgeLength (GmCellEdgeStatistics* stat);
408 void computeCellBboxLength(GmCellBboxStatistics* stat);
429 _n = container->numCells();
458 #define GmForeachCellHelper(variable, container, contType, cellType, activeOnly) \ 459 for(GmForeachCellHelperClass<contType> it(container, activeOnly); it._control && it._index<it._n; it.inc(container, activeOnly), it._control ^= 1) \ 460 for(variable = (cellType*)container->cell(it._index); it._control; it._control = 0) 478 #define GmForeachActiveCell(variable, mesh) GmForeachCellHelper(variable, mesh, GmCellMesh, GmCell, true) 481 #define GmForeachCell(variable, mesh, activeOnly) GmForeachCellHelper(variable, mesh, GmCellMesh, GmCell, activeOnly) Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition: gmValueInfo.h:126
virtual void clearTopology()
If the mesh suppports the topology capability (hasCapability("topology") returns true),...
Definition: gmCellMesh.h:85
Interface storing property descriptions and values.
Definition: gmPropertySet.h:37
double _edgeMinLength
Minimun edge length in the whole mesh.
Definition: gmCellMesh.h:389
QMutex _meshStatsMutex
Mutex protecting the creation of the statistics objects.
Definition: gmCellMesh.h:417
int _index
The current index.
Definition: gmCellMesh.h:436
Interface for helping managing mesh cell groups and returning the elements in their union.
Definition: gmCellGroupSet.h:34
virtual void clearAddedCells()
Method called by the assembler to clear the internal list used to track added cells....
Definition: gmCellMesh.h:310
virtual QStringList cellGroupIds() const
Returns a list with the names of the available cell groups.
Definition: gmCellMesh.h:205
The GmStateDump class presents a higher level of abstraction over GmMemoryDump, storing accessor data...
Definition: gmStateDump.h:52
Helper class for the GmForeachActiveXxxx() family of macros.
Definition: gmCellMesh.h:422
void inc(const T *container, bool activeOnly)
Increments the iterator.
Definition: gmCellMesh.h:434
int _n
The number of cells in the container (either a mesh or a cell group set)
Definition: gmCellMesh.h:437
QList< GmCellGroupSet * > _cellGroups
A list with GmCellGroupSet objects used for traversing elements in a mesh group of cells.
Definition: gmCellMesh.h:413
virtual const GmCell * cellInGroup(int groupIndex, int cellIndex) const
Returns a cell present in the group referenced by groupIndex.
Definition: gmCellMesh.h:224
virtual int addCellGroup(QString groupName)
Adds a new (empty) cell group to the mesh.
Definition: gmCellMesh.h:320
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:43
Base interface for mesh cells.
Definition: gmCell.h:81
QMap< QString, int > _cellAttributesMap
Map translating ids from attributes into their position in _cellAttributesData.
Definition: gmCellMesh.h:410
virtual double cellBboxMinLength()
Definition: gmCellMesh.h:186
virtual double edgeMaxLength()
Definition: gmCellMesh.h:179
const QList< GmValueSet * > & cellValueSets() const
Returns a list with the mesh cell value sets. This is a very specialized function....
Definition: gmCellMesh.h:374
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:683
QAtomicPointer< GmCellEdgeStatistics > _meshEdgeStats
Atomic pointer to the mesh edge statistics object.
Definition: gmCellMesh.h:415
virtual double cellBboxMaxLength()
Definition: gmCellMesh.h:193
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
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:467
virtual int numCellsInGroup(int groupIndex) const
Returns the number of cells present in the group referenced by groupIndex.
Definition: gmCellMesh.h:214
virtual QList< int > addedCells() const
If the mesh supports mesh edition (hasCapability("addCells") returns true), this function should retu...
Definition: gmCellMesh.h:305
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:833
virtual int maxNumCellGhostNodes() const
Returns the maximum number of ghost nodes in a mesh cell.
Definition: gmCellMesh.h:125
Declaration of the GmMesh interface class.
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:342
The GmCellAccessor class is a proxy object to a value accesor implementing a more convenient interfac...
Definition: gmCellAccessor.h:66
Base interface class for CellMesh type plugins.
Definition: gmCellMesh.h:39
int _control
The controls flag used to allow breaking inside the inner loop.
Definition: gmCellMesh.h:438
virtual const GmCellMeshTopology * topology(bool create=true) const
If the mesh suppports the topology capability (hasCapability("topology") returns true),...
Definition: gmCellMesh.h:78
virtual bool dumpControlMapDataLoaded(QVariantMap *map, const GmLogCategory &logger)
Sanity checks + processing of the dump control data map after a load operation.
Definition: gmMesh.cpp:743
virtual void printParameters(const GmLogCategory &logger)
Asks the mesh to print all of its parameters using the provided logger.
Definition: gmMesh.cpp:780
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:151
Definition: gmCellMesh.h:396
virtual int maxTotalNumCellNodes() const
Returns the maximum total number of nodes (normal + ghost) in a cell mesh.
Definition: gmCellMesh.h:142
#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
Base interface class for mesh topological queries.
Definition: gmCellMeshTopology.h:32
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:727
double _bboxMinLength
Minimun length of a cell bounding box diagonal in the whole mesh.
Definition: gmCellMesh.h:398
virtual int addCells(int *numCellTypes)
Adds new cells to the mesh, WHITHOUT initializing their nodes or attributes.
Definition: gmCellMesh.h:299
double _edgeMaxLength
Maximum edge length in the whole mesh.
Definition: gmCellMesh.h:390
virtual double edgeMinLength()
Definition: gmCellMesh.h:172
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition: gmCellType.h:30
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
double _bboxMaxLength
Maximun length of a cell bounding box diagonal in the whole mesh.
Definition: gmCellMesh.h:399
SaveStateMode
Initialization mode for calls to saveState()
Definition: gmValueSet.h:59
GmForeachCellHelperClass(const T *container, bool activeOnly)
Constructor. Positions the iterator on the first active cell.
Definition: gmCellMesh.h:426
Declaration of the GmCell class.
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:330
Definition: gmCellMesh.h:387
QList< GmValueSet * > _cellAttributesData
List with set of values for cell attributes.
Definition: gmCellMesh.h:411
Base interface class for Mesh type plugins.
Definition: gmMesh.h:44
QAtomicPointer< GmCellBboxStatistics > _meshBboxStats
Atomic pointer to the mesh bbox statistics object.
Definition: gmCellMesh.h:416
A tag to request that the options should be filled with the default.
Definition: gmPrintUtils.h:68
virtual GmCell * cellInGroup(int groupIndex, int cellIndex)
Non const version of cellInGroup() const.
Definition: gmCellMesh.h:227