23#ifndef _GEMA_GHOSTNODE_ACCESSOR_H_
24#define _GEMA_GHOSTNODE_ACCESSOR_H_
123 return (index >= 0 && index <
size()) ? index : -1;
130 index -= firstGhostIndex;
131 return (index >= 0 && index <
size()) ? index : -1;
169 int fieldWidth = 0,
char format =
'g',
int precision = -1,
172 return t(&index)->
valueStr(index, evalFunctions, printDefAsNil, fieldWidth, format, precision, coord);
196 assert(0); Q_UNUSED(context); Q_UNUSED(ownsContext);
A proxy class that receives as parameters two accessors for the same data, one for the common node da...
Definition gmGhostNodeAccessor.h:76
virtual Unit unit() const
Returns the unit in which data returned/received by the accessor is expressed.
Definition gmGhostNodeAccessor.h:141
virtual double scalarValueAt(int index, const GmVector *coord) const
Similar to valueAt() but returning a single double. Must be used for scalar data sets only.
Definition gmGhostNodeAccessor.h:150
virtual bool setValue(int index, const double *value)
Allows for altering the value associated with entry "index" in the value set. This version of the fun...
Definition gmGhostNodeAccessor.h:153
GmValueAccessor * ghostAc() const
Returns the stored accessor for the ghost part of the data.
Definition gmGhostNodeAccessor.h:116
GmValueAccessor * t(int *index)
Non const version of the homonimous function.
Definition gmGhostNodeAccessor.h:251
virtual bool setScalarValue(int index, double value)
Similar to setValue() but passing a single double. Must be used for scalar data sets only.
Definition gmGhostNodeAccessor.h:156
GmGhostNodeAccessor(GmValueAccessor *commonAc, GmValueAccessor *ghostAc)
Constructor receiving as parameters the wrapped accessors.
Definition gmGhostNodeAccessor.h:85
virtual GmValueSetEvalContext * evalContext() const
Returns the internal evaluation context. Needed by GmCellAccessorProxy, GmBcAccessorProxy & state dum...
Definition gmGhostNodeAccessor.h:204
GmValueAccessor * geomAc() const
Returns the stored accessor for the geometry part of the data.
Definition gmGhostNodeAccessor.h:113
virtual bool isDefValue(int index) const
Returns true if the value at the specified index is equal to the default value defined by info()->def...
Definition gmGhostNodeAccessor.h:138
int nodeSize() const
Returns the number of 'common' (geometric) nodes in this accessor.
Definition gmGhostNodeAccessor.h:107
virtual GmValueInfo * info() const
Returns the information object describing the values returned by this accessor.
Definition gmGhostNodeAccessor.h:135
GmValueAccessor * _cAc
The accessor for the data tied to the common, "geometric", nodes.
Definition gmGhostNodeAccessor.h:261
virtual bool setFunctionValue(int index, GmUserFunction *functionDef)
Overload of setValue() storing a user function definition.
Definition gmGhostNodeAccessor.h:162
virtual double convertToAccessorUnit(double val) const
An utility function that given a value, converts it to the accessor unit. If no conversion is needed,...
Definition gmGhostNodeAccessor.h:218
virtual QString valueStr(int index, bool evalFunctions, bool printDefAsNil, int fieldWidth=0, char format='g', int precision=-1, const GmVector *coord=NULL) const
Auxiliary function to return the value of an accessor converted to a string. Works for scalars,...
Definition gmGhostNodeAccessor.h:168
virtual void setEvalContext(GmValueSetEvalContext *context, bool ownsContext)
Sets the EvalContext object that will be used to translate function names / objects into function eva...
Definition gmGhostNodeAccessor.h:188
virtual bool setFunctionFromName(int index, QString userFunctionId, QString &err)
Sets a function value from the function name.
Definition gmGhostNodeAccessor.h:176
virtual bool isFunction(int index) const
Returns true if the data in index is a reference to a function (in C or Lua). Used by valueStr() to m...
Definition gmGhostNodeAccessor.h:182
virtual const double * convertToAccessorUnit(const double *p) const
An utility function that given a pointer to the stored data, converts the value to the accessor unit ...
Definition gmGhostNodeAccessor.h:221
const GmValueAccessor * t(int *index) const
Given an index, returns the accessor that should be called and also changes the value of the given in...
Definition gmGhostNodeAccessor.h:240
GmValueAccessor * _gAc
The accessor for the data tied to ghost nodes.
Definition gmGhostNodeAccessor.h:262
virtual bool hasUnitConversion() const
Returns true if this accessor performs unit conversions, false if not.
Definition gmGhostNodeAccessor.h:144
virtual int size() const
Returns the number of values in the set referred to by the accessor, meaning that valid indices will ...
Definition gmGhostNodeAccessor.h:104
virtual int adjustLinearIndex(int index, const GmMesh *m)
Translates a linear index (from 0 to mesh->totalNumNodes()-1) into a valid index for this accessor or...
Definition gmGhostNodeAccessor.h:119
virtual const double * valueAt(int index, const GmVector *coord) const
Returns the value associated with the "index" position of the data set, evaluated at the requested po...
Definition gmGhostNodeAccessor.h:147
virtual ~GmGhostNodeAccessor()
Virtual destructor.
Definition gmGhostNodeAccessor.h:97
virtual void convertFromAccessorUnit(double val, double *dst) const
Copies the values given by val into the area pointed to by dst, converting units if needed.
Definition gmGhostNodeAccessor.h:224
virtual bool setFunctionValue(int index, GmUserFunctionEvaluator *functionEval)
Overload of setValue() storing a user function evaluation context.
Definition gmGhostNodeAccessor.h:165
virtual QString functionId(int index) const
Returns a function id name for a function reference at the index or an empty string for non function ...
Definition gmGhostNodeAccessor.h:185
virtual bool setValueFromVariant(int index, const QVariant &v, bool acceptMissingDimension, QString &err)
Sets a value with data read from a QVariant.
Definition gmGhostNodeAccessor.h:179
virtual void convertFromAccessorUnit(const double *val, double *dst) const
Copies the values given by val into the area pointed to by dst, converting units if needed.
Definition gmGhostNodeAccessor.h:227
virtual bool setValueAsDef(int index)
Similar to setValue(), filling the index entry with the default value.
Definition gmGhostNodeAccessor.h:159
int ghostSize() const
Returns the number of 'ghost' nodes in this accessor.
Definition gmGhostNodeAccessor.h:110
virtual int adjustLinearIndex(int index, int firstGhostIndex)
Similar to adjustLinearIndex(int, const GmMesh*), this function overload gets as second parameter the...
Definition gmGhostNodeAccessor.h:127
Base interface class for Mesh type plugins.
Definition gmMesh.h:48
static bool isGhostNode(int nodeIndex)
Returns true if the given index is a ghost node index, false if not.
Definition gmMesh.h:136
static int clearGhostFlag(int nodeIndex)
Returns the given index with the ghost node bit cleared.
Definition gmMesh.h:142
int toLocalGhostIndex(int nodeIndex) const
Given a global ghost index (a value >= numNodes() and < totalNumNodes()), returns a zero based versio...
Definition gmMesh.h:153
Class responsible for evaluating a UserFunction over a node / cell.
Definition gmUserFunction.h:160
Class used to store the definition of a user function and its parameters.
Definition gmUserFunction.h:82
Interface class for accessing and setting values from an "indexable" collection of values.
Definition gmValueAccessor.h:60
virtual bool isDefValue(int index) const =0
Returns true if the value at the specified index is equal to the default value defined by info()->def...
virtual Unit unit() const =0
Returns the unit in which data returned/received by the accessor is expressed.
const double * value(int index) const
Similar to valueAt(), passing NULL as coordinates.
Definition gmValueAccessor.h:160
virtual GmValueSetEvalContext * evalContext() const =0
Returns the internal evaluation context. Needed by GmCellAccessorProxy, GmBcAccessorProxy & state dum...
virtual bool setFunctionValue(int index, GmUserFunction *functionDef)=0
Overload of setValue() storing a user function definition.
virtual double convertToAccessorUnit(double val) const =0
An utility function that given a value, converts it to the accessor unit. If no conversion is needed,...
virtual QString valueStr(int index, bool evalFunctions, bool printDefAsNil, int fieldWidth=0, char format='g', int precision=-1, const GmVector *coord=NULL) const =0
Auxiliary function to return the value of an accessor converted to a string. Works for scalars,...
virtual const double * valueAt(int index, const GmVector *coord) const =0
Returns the value associated with the "index" position of the data set, evaluated at the requested po...
virtual QString functionId(int index) const =0
Returns a function id name for a function reference at the index or an empty string for non function ...
virtual bool setValueFromVariant(int index, const QVariant &v, bool acceptMissingDimension, QString &err)=0
Sets a value with data read from a QVariant.
virtual bool hasUnitConversion() const =0
Returns true if this accessor performs unit conversions, false if not.
virtual bool setScalarValue(int index, double value)=0
Similar to setValue() but passing a single double. Must be used for scalar data sets only.
virtual int size() const =0
Returns the number of values in the set referred to by the accessor, meaning that valid indices will ...
virtual void convertFromAccessorUnit(double val, double *dst) const =0
Copies the values given by val into the area pointed to by dst, converting units if needed.
virtual bool setValue(int index, const double *value)=0
Allows for altering the value associated with entry "index" in the value set. This version of the fun...
virtual bool isFunction(int index) const =0
Returns true if the data in index is a reference to a function (in C or Lua). Used by valueStr() to m...
virtual GmValueInfo * info() const =0
Returns the information object describing the values returned by this accessor.
virtual bool setFunctionFromName(int index, QString userFunctionId, QString &err)=0
Sets a function value from the function name.
virtual double scalarValueAt(int index, const GmVector *coord) const =0
Similar to valueAt() but returning a single double. Must be used for scalar data sets only.
virtual bool setValueAsDef(int index)=0
Similar to setValue(), filling the index entry with the default value.
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition gmValueInfo.h:132
Auxiliar class used to store the needed information to translate an user function id / user function ...
Definition gmValueSetEvalContext.h:46
void setGhostData(bool mode)
Changes the flag that states if this context is tied to a ghost value set or not.
Definition gmValueSetEvalContext.h:84
Declaration of the GmMesh interface class.
Declaration of the GmValueAccessor interface and GmValueAccessorBase class.
Declaration of the GmValueSetEvalContext class.
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34