24#ifndef _GEMA_RESULTS_EVALSET_H_
25#define _GEMA_RESULTS_EVALSET_H_
64 GM_NUM_EVALSET_AGGR_RULES
72 bool hasIpBasedLines()
const;
73 bool hasPosBasedLines()
const;
78 assert(_numNodeLines >= 0 && _numCellLines >= 0);
79 return _numNodeLines + _numCellLines + _numPoints;
85 assert(_numNodeLines >= 0 && _numCellLines >= 0);
86 assert(line >= 0 && line < numLines());
87 return line < _numNodeLines;
93 assert(_numNodeLines >= 0 && _numCellLines >= 0);
94 assert(line >= 0 && line < numLines());
95 return (_evalAt != -1) && (line >= _numNodeLines) && line < (_numNodeLines + _numCellLines);
101 bool isPosBased(
int line)
const {
return !isNodeBased(line) && !isIpBased(line); }
106 assert(_numNodeLines >= 0 && _numCellLines >= 0);
107 assert(line >= 0 && line < numLines());
108 return line >= (_numNodeLines + _numCellLines);
112 bool isSimple()
const {
return !_nodes && (!_cells || _allCellsFromGroup) && !_points; }
117 int nodeIndex (
int line)
const;
118 int cellIpIndex(
int line,
int* ip,
int* ruleSet = NULL)
const;
119 int cellPos (
int line,
bool naturalCoord,
GmVector& coord)
const;
127 assert(rule >= 0 && rule < GM_NUM_EVALSET_AGGR_RULES);
128 static const char* ruleNames[GM_NUM_EVALSET_AGGR_RULES] = {
"none",
"min",
"max",
"avg",
"sum",
"minnorm",
"maxnorm"};
129 return ruleNames[rule];
135 QString explain(
int line)
const;
150 QString ruleId,
bool nodeBased,
int defEvalAt,
161 bool buildIpIndex (
QString& err);
164 bool cellData(
int line,
int* cellId,
GmVector& coord)
const;
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
Base interface class for CellMesh type plugins.
Definition gmCellMesh.h:40
A Gauss index interface always indexing ALL the elements in either the full mesh or in the given mesh...
Definition gmGaussIndex.h:312
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Base interface class for Mesh type plugins.
Definition gmMesh.h:48
This class stores a set of nodes belonging to a mesh. The nodes can belong to the mesh boundary but t...
Definition gmNodeSet.h:34
A class storing the evaluation points for a set of rules.
Definition gmResultsEvalSet.h:47
int _evalAt
The evaluation point for cell values. If -1, the centroid will be used. If -2, all integration points...
Definition gmResultsEvalSet.h:181
QVector< GmCellBoundary * > _cellBorders
The named cell borders included in _cells.
Definition gmResultsEvalSet.h:184
int * _cells
The subset of mesh cells in the cell result set. Can be NULL. Entries are kept ordered by Lua model i...
Definition gmResultsEvalSet.h:179
int _numNodes
The number of entries in _nodes.
Definition gmResultsEvalSet.h:173
bool _allMeshCells
Should the data be evaluated at all mesh cells? If true, _cells will be NULL.
Definition gmResultsEvalSet.h:178
int _numPoints
The number of points in _points.
Definition gmResultsEvalSet.h:190
const char * aggregationRuleStr() const
Returns a string version for the configured aggregation rule.
Definition gmResultsEvalSet.h:133
GmValueAccessor * _nodeAc
The accessor used for handling centroid queries.
Definition gmResultsEvalSet.h:167
GmVector * _points
The set of configured extra points where data should be evaluated.
Definition gmResultsEvalSet.h:189
bool _allCellsFromGroup
Set to true if all the cells in _cells came from the groups in _cellGroups.
Definition gmResultsEvalSet.h:186
bool isSimple() const
Returns true if the eval set is the full set of mesh nodes, full set of mesh cells or is given by cel...
Definition gmResultsEvalSet.h:112
GmEvalSetAggregationRule _evalAggr
The aggregation rule for _evalAt = -3.
Definition gmResultsEvalSet.h:182
const QStringList & simpleGroups() const
The set of cell groups if isSimple() is true (might be empty if the entire mesh is used)
Definition gmResultsEvalSet.h:115
int _numCells
The number of entries in _cells.
Definition gmResultsEvalSet.h:180
int * _nodes
The subset of mesh nodes in the node result set. Can be NULL. Entries are kept ordered by Lua model i...
Definition gmResultsEvalSet.h:172
int _nodeDim
The node coordinate dimension.
Definition gmResultsEvalSet.h:168
bool isNodeBased(int line) const
Returns true if the given line is associated with a node line.
Definition gmResultsEvalSet.h:83
void resetChanges()
Resets the cahnge flag, setting it to false.
Definition gmResultsEvalSet.h:145
int numLines() const
Returns the number of lines associated with this evaluation set.
Definition gmResultsEvalSet.h:76
bool changed() const
Returns the value of the changed flag. This flag is set to true on the constructor or when a mesh cha...
Definition gmResultsEvalSet.h:142
GmVector * _pointNaturalCoordinates
The set of points translated to natural coordinates.
Definition gmResultsEvalSet.h:199
bool isUserPointBased(int line) const
Returns true if the given line is associated with a user given point.
Definition gmResultsEvalSet.h:104
GmMesh * _mesh
The mesh that this evaluation set is tied to.
Definition gmResultsEvalSet.h:166
GmEvalSetAggregationRule aggregationRule() const
Returns the configured aggregation rule for ip based cell values.
Definition gmResultsEvalSet.h:122
QVector< GmNodeSet * > _nodeSets
The named node sets included in _nodes.
Definition gmResultsEvalSet.h:174
int _ruleSet
The rule set if _evalAt is associated to integration points.
Definition gmResultsEvalSet.h:183
int * _pointCells
The cell index associated with each extra point. Size equal to _numPoints.
Definition gmResultsEvalSet.h:198
bool _allMeshNodes
Should the data be evaluated at all mesh nodes? If true, _nodes will be NULL.
Definition gmResultsEvalSet.h:171
int _numNodeLines
The number of lines associated with the node part. Set to -1 before prepare()
Definition gmResultsEvalSet.h:195
bool isIpBased(int line) const
Returns true if the given line is associated with a cell integration point.
Definition gmResultsEvalSet.h:91
int _numCellLines
The number of lines associated with the cell part. Set to -1 before prepare()
Definition gmResultsEvalSet.h:196
QStringList _cellGroups
The named cell groups included in _cells.
Definition gmResultsEvalSet.h:185
bool isPosBased(int line) const
Returns true if the given line is associated with a user point or with a cell centroid.
Definition gmResultsEvalSet.h:101
GmFixedMeshSetGaussIndex * _ipIndex
The index used to translate line indices into cell + ip number pairs.
Definition gmResultsEvalSet.h:197
GmAffectedNodes _nodeTypes
The types of nodes returned when _allMeshNodes is true.
Definition gmResultsEvalSet.h:194
QVector< GmCellBoundary * > _nodeBorders
The named cell borders included in _nodes.
Definition gmResultsEvalSet.h:175
GmEvalSetAggregationRule
Definition gmResultsEvalSet.h:52
@ GM_EVALSET_MINNORM
Returns the value with minimum norm.
Definition gmResultsEvalSet.h:58
@ GM_EVALSET_AVG
Returns the average of the values (for each component when dealing with vectors/matrices)
Definition gmResultsEvalSet.h:56
@ GM_EVALSET_MIN
Returns the minimum value (for each component when dealing with vectors/matrices)
Definition gmResultsEvalSet.h:54
@ GM_EVALSET_NONE
No aggregation rule.
Definition gmResultsEvalSet.h:53
@ GM_EVALSET_MAX
Returns the maximum value (for each component when dealing with vectors/matrices)
Definition gmResultsEvalSet.h:55
@ GM_EVALSET_MAXNORM
Returns the value with maximum norm.
Definition gmResultsEvalSet.h:59
@ GM_EVALSET_SUM
Returns the sum of the values (for each component when dealing with vectors/matrices)
Definition gmResultsEvalSet.h:57
bool _changed
Has the eval set data changed since the last call to resetChanges()? Set to true on the constructor.
Definition gmResultsEvalSet.h:193
static const char * aggregationRuleStr(GmEvalSetAggregationRule rule)
Returns a string version for the given aggregation rule.
Definition gmResultsEvalSet.h:125
Base interface class for Spatial Index type plugins.
Definition gmSpatialIndex.h:66
Interface class for accessing and setting values from an "indexable" collection of values.
Definition gmValueAccessor.h:60
Declaration of useful configuration definitions for the Core library.
#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
GmLogLevel
Available log levels list.
Definition gmLog.h:36
Declaration of the GmValueInfo class.
GmAffectedNodes
Affected node types for node based values (GM_NODE_COORDINATES, GM_NODE_ATTRIBUTE or GM_NODE_STATEVAR...
Definition gmValueInfo.h:97
Declaration of the GmVector class.
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34
The index data for a result rule, storing "evaluation point" data for node, cell or gauss based indic...
Definition gmResultsTrackedData.h:65