23#ifndef _GEMA_VALUE_INFO_H_
24#define _GEMA_VALUE_INFO_H_
103#define GM_VALUE_INFO_DEFAULT_FORMAT_WIDTH 12
104#define GM_VALUE_INFO_DEFAULT_FORMAT 'f'
105#define GM_VALUE_INFO_DEFAULT_FORMAT_PREC 2
106#define GM_VALUE_INFO_DEFAULT_FORMAT_STR "12.2f"
164 int sizeofStorageType()
const;
178 int size()
const {
return _nlin * _ncol; }
181 int nlin()
const {
return _nlin; }
184 int ncol()
const {
return _ncol; }
193 const double*
defValue()
const {
return _defValue; }
240 int pack()
const {
return _pack; }
283 void setDimType(
GmDimType type,
int nlin = 1,
int ncol = 1);
285 void setDefValue(
const double* val);
286 void setDefFunction(
QString functionId);
362 void setPack(
int packId) { assert(packId >= -1); _pack = packId; }
371 void setFormat(
int fieldWidth,
char format,
int precision)
373 _fieldWidth = fieldWidth;
375 _precision = precision;
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Interface class for accessing and setting values from an "indexable" collection of values.
Definition gmValueAccessor.h:60
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition gmValueInfo.h:132
int _precision
Number of decimal places used when printing values of this type.
Definition gmValueInfo.h:420
void setAllocMode(GmAllocMode mode)
Updates the mode used for allocating space for the data values.
Definition gmValueInfo.h:305
void setPack(int packId)
Updates the pack to which this value belongs. Used to combine values in an interleaved buffer....
Definition gmValueInfo.h:362
void setRuleSet(int ruleSet)
Defines the integration rule set that this value is bound to. Used only by values with kind == GM_GAU...
Definition gmValueInfo.h:349
GmBcTagInfo * _tagInfo
The tag information associated with this value. Can be NULL. Valid only if kind == GM_BC_NODE_PROPERT...
Definition gmValueInfo.h:417
int _nlin
The number of lines in a vector type or in a matrix type (1 for scalars)
Definition gmValueInfo.h:411
GmAffectedNodes affectedNodes() const
For node based values, returns whether values are stored for nodes, ghost nodes or both (default = no...
Definition gmValueInfo.h:220
bool isCellBased() const
Returns true if the set kind is a cell based set (cell or gauss attributes)
Definition gmValueInfo.h:159
GmStorageType storageType() const
The desired storage type for data values. Might not be how the data is really stored....
Definition gmValueInfo.h:162
void setTagInfo(GmBcTagInfo *info)
Defines the boundary condition tag info that this value is associated with. Takes ownership of the in...
Definition gmValueInfo.h:368
void setCanStoreFunctions(bool mode)
Updates weather the values associated to this definition can or cannot be functions.
Definition gmValueInfo.h:296
bool defIsFunction() const
Is the default value a function?
Definition gmValueInfo.h:199
Unit unit() const
Returns the unit in which the value is expressed.
Definition gmValueInfo.h:147
int history() const
Returns -1 if the value does not have history support, 0 for unlimited history levels and n > 0 for a...
Definition gmValueInfo.h:228
QMap< QString, double > _constantMap
A map associating constant names to values. Used for creating enumerated scalar values.
Definition gmValueInfo.h:422
GmAllocMode allocMode() const
Returns how the values associated with this definition should be allocated. Default = auto.
Definition gmValueInfo.h:208
void setUnit(Unit unit)
Updates the value definition unit. Use with care. Changes the way how values are interpreted,...
Definition gmValueInfo.h:272
bool canStoreFunctions() const
Returns true if values associated to this definition can be expressed as functions....
Definition gmValueInfo.h:205
int ncol() const
Returns the number of columns in a matrix type or 1 for scalars or arrays.
Definition gmValueInfo.h:184
void setAffectedNodes(GmAffectedNodes affNodes)
Updates the affected nodes information. For node based values only.
Definition gmValueInfo.h:323
void setHistory(int mode)
Defines if this value should store only one value (default) or several versions of the value,...
Definition gmValueInfo.h:339
QString _description
Value description.
Definition gmValueInfo.h:400
QString id() const
Returns the value id.
Definition gmValueInfo.h:141
QString dimTypeStr() const
Returns a string representation of the dimension type: scalar, vector(n), matrix(m,...
Definition gmValueInfo.h:175
GmValueSetKind _setKind
What kind of information is stored.
Definition gmValueInfo.h:402
int ruleSet() const
Returns the integration rule set that this value is bound to. Used only by values with kind == GM_GAU...
Definition gmValueInfo.h:233
int _ncol
The number of columns in a matrix type (1 for scalars or arrays)
Definition gmValueInfo.h:412
int precision() const
Returns the number of decimal places used when printing values of this type.
Definition gmValueInfo.h:255
void setFormat(int fieldWidth, char format, int precision)
Updates the format used to print values of this type.
Definition gmValueInfo.h:371
char _format
Format type ('f', 'g', 'e', 'G' or 'E') used when printing values of this type.
Definition gmValueInfo.h:419
bool isScalar() const
Checks the dimType to see if the value is a scalar value. This cannot be infered by size() == 1 since...
Definition gmValueInfo.h:190
void setAllocStrategy(GmAllocStrategy strategy)
Updates the allocation strategy used for allocating space for the data values.
Definition gmValueInfo.h:314
QString affectedNodesStr() const
Returns a string representation of the affected nodes type.
Definition gmValueInfo.h:223
QString _id
Value id.
Definition gmValueInfo.h:399
int _fieldWidth
Field width used when printing values of this type.
Definition gmValueInfo.h:418
const double * defValue() const
Returns the default value used for initializing/sparse values. If the default is a function,...
Definition gmValueInfo.h:193
int _ruleSet
The integration rule set that this value is bound to. Used only by values with kind == GM_GAUSS_ATTRI...
Definition gmValueInfo.h:415
QString _defFunction
A default function name if the default is a function.
Definition gmValueInfo.h:410
QString allocModeStr() const
Returns a string representation of the alloc mode.
Definition gmValueInfo.h:211
QString allocStrategyStr() const
Returns a string representation of the alloc strategy.
Definition gmValueInfo.h:217
Unit _unit
Unit in which the values are given.
Definition gmValueInfo.h:401
const GmBcTagInfo * tagInfo() const
Returns the boundary condition tag information that this value is associated with or NULL if the obje...
Definition gmValueInfo.h:246
bool isNodeBased() const
Returns true if the set kind is a node based set (node coordinates, attributes or state vars)
Definition gmValueInfo.h:156
int _pack
The number of the pack in which this value is stored when working with interleaved groups of values.
Definition gmValueInfo.h:416
int size() const
Returns the number of values (doubles) associated to this definition.
Definition gmValueInfo.h:178
GmDimType _dimType
The dimension type of the values.
Definition gmValueInfo.h:404
GmAllocStrategy allocStrategy() const
Returns the allocation strategy for the stored data. Default = auto.
Definition gmValueInfo.h:214
QString description() const
Returns the value description.
Definition gmValueInfo.h:144
QString defFunction() const
Returns the name of the function used as default.
Definition gmValueInfo.h:202
GmDimType dimType() const
Returns the dimension type associated to this definition (scalar, vector or matrix)
Definition gmValueInfo.h:170
int fieldWidth() const
Returns the field width used when printing values of this type.
Definition gmValueInfo.h:252
double defScalarValue() const
Returns the default value for scalar data types.
Definition gmValueInfo.h:196
int _history
Does this value requires/ accepts history? -1 = no, 0 = multiple, n > 0 = 'n' rolling states.
Definition gmValueInfo.h:414
GmValueSetKind kind() const
Returns the kind of information associated to this definition.
Definition gmValueInfo.h:150
GmAllocMode _allocMode
How should values of this type be allocated?
Definition gmValueInfo.h:405
int pack() const
Returns the pack number for this value. A value > 0 defines a pack id. A value of 0 means that the va...
Definition gmValueInfo.h:240
double * _defValue
Default value used for initializing/sparse values. Valid only if _defFunction is empty (0....
Definition gmValueInfo.h:409
void setKind(GmValueSetKind kind)
Updates the value set kind. Use with care.
Definition gmValueInfo.h:269
QString kindStr() const
Returns a string representation of the data kind.
Definition gmValueInfo.h:153
void setStorageType(GmStorageType storageType)
Updates the requested storage type of values bound to this definition.
Definition gmValueInfo.h:281
QString storageTypeStr() const
Returns a string representation of the desired storage type.
Definition gmValueInfo.h:167
void setConstantMap(const QMap< QString, double > &map)
Defines the map used to translate constant names into scalar values.
Definition gmValueInfo.h:382
GmAllocStrategy _allocStrategy
Allocation strategy for the stored data.
Definition gmValueInfo.h:406
char format() const
Returns the format type ('f', 'g', 'e', 'G' or 'E') used when printing values of this type.
Definition gmValueInfo.h:249
GmStorageType _storageType
The desired type used to store values. Might not be equal to the type really used by a value set.
Definition gmValueInfo.h:403
bool _canStoreFunction
Can values of this type be represented by functions?
Definition gmValueInfo.h:413
int nlin() const
Returns the number of lines in a vector type or in a matrix type or 1 for scalars.
Definition gmValueInfo.h:181
GmAffectedNodes _affectedNodes
Is this value stored for ghost nodes? Valid only if kind == GM_NODE_COORDINATES, GM_NODE_ATTRIBUTE or...
Definition gmValueInfo.h:407
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
Declaration of support functions and macros for information logging.
GmLogLevel
Available log levels list.
Definition gmLog.h:36
GmAllocStrategy
Allocation strategy for the stored data.
Definition gmValueInfo.h:88
@ GM_STRATEGY_SPARSE_HASH
Sparse data is stored in a hash table.
Definition gmValueInfo.h:90
@ GM_STRATEGY_AUTO
Framework defined strategy.
Definition gmValueInfo.h:89
@ GM_STRATEGY_SPARSE_LINKED
Sparse data is stored as a linked list.
Definition gmValueInfo.h:91
@ GM_STRATEGY_SPARSE_RLE
Sparse data is stored as run lenght encoded blocks.
Definition gmValueInfo.h:92
GmStorageType
The desired storage type for the data.
Definition gmValueInfo.h:55
@ GM_INT32_TYPE
Values are a signed 32 bits integer.
Definition gmValueInfo.h:58
@ GM_BYTE_TYPE
Values are a signed 8 bits integer.
Definition gmValueInfo.h:60
@ GM_DOUBLE_TYPE
Values are a double.
Definition gmValueInfo.h:56
@ GM_UINT32_TYPE
Values are a unsigned 32 bits integer.
Definition gmValueInfo.h:61
@ GM_FLOAT_TYPE
Values are a single precision float.
Definition gmValueInfo.h:57
@ GM_UBYTE_TYPE
Values are a unsigned 8 bits integer.
Definition gmValueInfo.h:63
@ GM_INT16_TYPE
Values are a signed 16 bits integer.
Definition gmValueInfo.h:59
@ GM_UINT16_TYPE
Values are a unsigned 16 bits integer.
Definition gmValueInfo.h:62
GmAllocMode
Type describing how the data space should be allocated.
Definition gmValueInfo.h:80
@ GM_ALLOC_AUTO
The data is NOT sparse but should be allocated only when the first non default value is written.
Definition gmValueInfo.h:83
@ GM_ALLOC_SPARSE
The data is sparse.
Definition gmValueInfo.h:82
@ GM_ALLOC_FULL
The data is NOT sparse and space should be fully preallocated.
Definition gmValueInfo.h:81
GmAffectedNodes
Affected node types for node based values (GM_NODE_COORDINATES, GM_NODE_ATTRIBUTE or GM_NODE_STATEVAR...
Definition gmValueInfo.h:97
@ GM_GHOST_NODE
Specifies that this value exists over ghost nodes only.
Definition gmValueInfo.h:99
@ GM_BOTH
Specifies that this value exists over mesh and ghost nodes.
Definition gmValueInfo.h:100
@ GM_GEOMETRY_NODE
Specifies that this value exists over common geometry mesh nodes only.
Definition gmValueInfo.h:98
GmDimType
Value dimension type.
Definition gmValueInfo.h:72
@ GM_SCALAR_VALUE
Means that the value is a scalar number.
Definition gmValueInfo.h:73
@ GM_MATRIX_VALUE
Means that the value is a 2D matrix of numbers.
Definition gmValueInfo.h:75
@ GM_VECTOR_VALUE
Means that the value is a 1D vector of numbers.
Definition gmValueInfo.h:74
GmValueSetKind
Type describing what kind of information is stored by a values set.
Definition gmValueInfo.h:37
@ GM_PSET_PROPERTY
This value set stores properties attached to a property set.
Definition gmValueInfo.h:44
@ GM_GAUSS_ATTRIBUTE
This value set stores attributes attached to Gauss points.
Definition gmValueInfo.h:43
@ GM_BC_NODE_PROPERTY
This value set stores properties attached to a node for a boundary condition.
Definition gmValueInfo.h:45
@ GM_BC_BOUNDARY_PROPERTY
This value set stores properties attached to a boundary (edge or face) for a boundary condition.
Definition gmValueInfo.h:46
@ GM_NODE_ATTRIBUTE
This value set stores attributes attached to nodes.
Definition gmValueInfo.h:39
@ GM_NODE_COORDINATES
This value set stores coordinates attached to nodes.
Definition gmValueInfo.h:38
@ GM_CELL_ATTRIBUTE
This value set stores attributes attached to cells.
Definition gmValueInfo.h:41
@ GM_DS_ATTRIBUTE
This value set stores attributes attached to discontinuity sets.
Definition gmValueInfo.h:47
@ GM_NODE_STATEVAR
This value set stores state variables attached to nodes.
Definition gmValueInfo.h:40
@ GM_USER
Other kinds of value set used by the Gui / extensions.
Definition gmValueInfo.h:48
@ GM_CELL_STATEVAR
This value set stores state variables attached to cells.
Definition gmValueInfo.h:42
A helper struct to store bc tag information.
Definition gmValueInfo.h:111
bool _ignoreDef
Should we ignore NODE values (component) equal to the default value?
Definition gmValueInfo.h:120
bool _ignoreZero
Should we ignore NODE zero values (component)?
Definition gmValueInfo.h:121
int * _tags
The set of tags. Vector size is ALWAYS equal to the associated value info object dimension....
Definition gmValueInfo.h:119