![]() |
GemaCoreLib
The GeMA Core library
|
A class storing the evaluation points for a set of rules. More...
#include <gmResultsEvalSet.h>
Public Member Functions | |
~GmResultsEvalSet () | |
Destructor. | |
bool | prepare (GmSpatialIndex *si, bool natural, GmAffectedNodes nodeTypes, QString ruleId, const GmLogCategory &logger) |
Initializes internal structures needed for answering further queries. On errors, uses the logger to emmit errors and returns false. More... | |
bool | hasIpBasedLines () const |
Returns true if the evaluation set has lines that should be evaluated over integration points. Unlike the other functions, this function CAN be called before prepare() is called. | |
bool | hasPosBasedLines () const |
Returns true if the evaluation set has lines that should be evaluated over user points or over the cell centroid. Unlike the other functions, this function CAN be called before prepare() is called. | |
int | numLines () const |
Returns the number of lines associated with this evaluation set. | |
bool | isNodeBased (int line) const |
Returns true if the given line is associated with a node line. | |
bool | isIpBased (int line) const |
Returns true if the given line is associated with a cell integration point. | |
bool | isPosBased (int line) const |
Returns true if the given line is associated with a user point or with a cell centroid. | |
bool | isUserPointBased (int line) const |
Returns true if the given line is associated with a user given point. | |
int | nodeIndex (int line) const |
Returns the node index asscoiated with the given line. isNodeBased() must be true. Ghost nodes are always returned with the ghost bit set. | |
int | cellIpIndex (int line, int *ip, int *ruleSet=NULL) const |
Returns the cell + ip index asscoiated with the given line. isIpBased() must be true. If ruleSet is not NULL, fill it with the expected ruleSet number. | |
int | cellPos (int line, bool naturalCoord, GmVector &coord) const |
Returns the cell + position coordinate asscoiated with the given line. The coordinate is returned in natural coordinates if naturalCoord is true. For this, the equivalent flag must have been provided to the prepare() call. The vector size must be compatible with the coordinate result. | |
QString | explain (int line) const |
Explains the evaluation point associated with a line (like "node 5" or "cell 4 @ ip 2") | |
void | explainToIndex (GmResultTrackedIndexData *indexData, int line) const |
Simmilar to explain() but instead of returning a string, adds the data to the given track index object. | |
bool | changed () const |
Returns the value of the changed flag. This flag is set to true on the constructor or when a mesh change triggers a change in the eval set contents. It is cleared by a call to resethanges() | |
void | resetChanges () |
Resets the cahnge flag, setting it to false. | |
void | print (const GmLogCategory &logger, GmLogLevel level) const |
Prints the basic evaluation set data to the given logger. | |
Static Public Member Functions | |
static GmResultsEvalSet * | loadFromTable (LuaTable &tab, GmMesh *mesh, QString tabPrefix, QString ruleId, bool nodeBased, int defEvalAt, int ruleSet, const GmLogCategory &logger) |
Parses either a monitor or a save rule definition from the given Lua table, returning an evaluation set object. More... | |
Private Member Functions | |
Q_DISABLE_COPY (GmResultsEvalSet) | |
GmResultsEvalSet (GmMesh *mesh, bool nodeBased, int defEvalAt, int defRuleSet) | |
Constructor. Marks the set as changed. | |
bool | parseNodes (LuaTable &tab, const GmMesh *mesh, QString &err) |
Parse node definitions filling the related object attributes. On error, returns false, filling err. | |
bool | parseCells (LuaTable &tab, const GmCellMesh *mesh, bool userRuleSet, QString &err) |
Parse cell definitions filling the related object attributes. On error, returns false, filling err. More... | |
bool | parsePoints (LuaTable &tab, const GmMesh *mesh, QString &err) |
Parse point definitions filling the related object attributes. On error, returns false, filling err. | |
bool | buildIpIndex (QString &err) |
Builds the information needed for working with multiple IPs per cell. | |
bool | buildPointIndex (GmSpatialIndex *si, bool natural, QString &err) |
For every user given point, finds its surrounding cell and translates the cartesian coordinate to a natural one if requested. | |
bool | cellData (int line, int *cellId, GmVector &coord) const |
Simillar to cellPos() but filling coord with cartesian coordinates only for point lines. The cellId is filled with the cell. Returns true if this is a cell centroid line, false for a user point line. | |
Private Attributes | |
GmMesh * | _mesh |
The mesh that this evaluation set is tied to. | |
GmValueAccessor * | _nodeAc |
The accessor used for handling centroid queries. | |
int | _nodeDim |
The node coordinate dimension. | |
bool | _allMeshNodes |
Should the data be evaluated at all mesh nodes? If true, _nodes will be NULL. | |
int * | _nodes |
The subset of mesh nodes in the node result set. Can be NULL. | |
int | _numNodes |
The number of entries in _nodes. | |
QVector< GmNodeSet * > | _nodeSets |
The named node sets included in _nodes. | |
QVector< GmCellBoundary * > | _nodeBorders |
The named cell borders included in _nodes. | |
bool | _allMeshCells |
Should the data be evaluated at all mesh cells? If true, _cells will be NULL. | |
int * | _cells |
The subset of mesh cells in the cell result set. Can be NULL. | |
int | _numCells |
The number of entries in _cells. | |
int | _evalAt |
The evaluation point for cell values. If -1, the centroid will be used. If -2, all integration points will be used. Otherwise, stores the ip index. | |
int | _ruleSet |
The rule set if _evalAt is associated to integration points. | |
QVector< GmCellBoundary * > | _cellBorders |
The named cell borders included in _cells. | |
QStringList | _cellGroups |
The named cell groups included in _cells. | |
GmVector * | _points |
The set of configured extra points where data should be evaluated. | |
int | _numPoints |
The number of points in _points. | |
bool | _changed |
Has the eval set data changed since the last call to resetChanges()? Set to true on the constructor. | |
GmAffectedNodes | _nodeTypes |
The types of nodes returned when _allMeshNodes is true. | |
int | _numNodeLines |
The number of lines associated with the node part. Set to -1 before prepare() | |
int | _numCellLines |
The number of lines associated with the cell part. Set to -1 before prepare() | |
GmFixedMeshSetGaussIndex * | _ipIndex |
int * | _pointCells |
<The index used to translate line indices into nell + ip number pairs More... | |
GmVector * | _pointNaturalCoordinates |
The set of points translated to natural coordinates. | |
A class storing the evaluation points for a set of rules.
|
static |
Parses either a monitor or a save rule definition from the given Lua table, returning an evaluation set object.
If nodeBased is true, we are reading an evaluation set tied to node data. Otherwise it is tied to cell (or gauss) data. defEvalAt should be either -1 for a default cell evaluation point equal to the cell centroid or -2 for the default being the evaluation at each cell integration point.
ruleSet should be -1 for accepting cell definitions tied to a user given rule set (or 0 by default). If different from -1, the given rule set will be used and the user can not provide the ruleSet clause (ignored).
If the given table is nil, the default evaluation set will be over the whole mesh nodes or cells (depending on nodeBased).
The tabPrefix and ruleId strings are used by error messages, which are created
using the following format: "Error while parsing %1.nodes table for %2: %3.", where %1 is the tabPrefix (ex: nodeEvalSet), and %2 the ruleId (ex: monitor rule 'xxx').
The logger object is used to emmit messages during rule parsing.
|
private |
Parse cell definitions filling the related object attributes. On error, returns false, filling err.
userRuleSet should be true if the user can change the default rule set with a ruleSet definition, or false to ignore ruleSet fields.
bool GmResultsEvalSet::prepare | ( | GmSpatialIndex * | si, |
bool | natural, | ||
GmAffectedNodes | nodeTypes, | ||
QString | ruleId, | ||
const GmLogCategory & | logger | ||
) |
Initializes internal structures needed for answering further queries. On errors, uses the logger to emmit errors and returns false.
si | The spatial index used for mapping points to cells. Can be NULL if the user didn't supplied extra points. |
natural | Should be set to true if any of the data srcs require interpolation and the interpolation method requires natural coordinates (shape) or, for cell attributes, if the mesh is an element mesh. This is used for user given points only. |
nodeTypes | Used if the result set defines that the whole mesh should be used to define if only geometry nodes, ghost nodes or both should be considered. |
ruleId | The rule id used on error messages |
logger | The logger |
|
private |
<The index used to translate line indices into nell + ip number pairs
The cell index associated with each extra point. Size equal to _numPoints