A block containing the actual result values for a specific result. More...
Public Types | |
enum | ResultValueDimension { SCALAR1D = 1, VECTOR3D = 3, TENSOR6D = 6 } |
Global dimension constants used by Ceetron Export. These constants are used for various methods of ResultValuesBlock to indicate the dimension of result values. More... | |
![]() | |
enum | BlockType { NODES, ELEMENTS, GEOMETRY, GEOMETRYINFO, RESULT, RESULTVALUES, TRANSFORMATIONRESULT, TRANSFORMATIONRESULTVALUES, STATEINFO, SET, ILLEGAL } |
Global block type constants used by Ceetron Export. Normally users do not need these, except for some methods of TransformationResultValuesBlock. More... | |
Public Member Functions | |
ResultValuesBlock (int blockId, ResultValueDimension dimension, bool mapToItemIds) | |
Constructs an empty results value block of the given dimension type. More... | |
int | mapToBlockId () const |
Returns the id of the node or element block these result values map to. More... | |
bool | setMapToBlockId (int blockId, BlockType blockType) |
Sets the id of the node or element to map results to. More... | |
std::vector< int > | mapToItemIds () const |
Returns an array containing item ids defining the association of result values with elements or nodes. More... | |
bool | hasMapToItemIds () const |
Returns true if the result values map to item ids, false if the result values map by corresponding index. More... | |
ResultValueDimension | dimension () const |
Returns the dimension of this result values block (scalar of vector) More... | |
std::vector< float > | resultValues () const |
Returns an array of result values defined in this block. More... | |
bool | setResultValues (const std::vector< float > &resultValues, const std::vector< int > &mapToItemIds=std::vector< int >()) |
Sets the result values data, optionally with id mapping. More... | |
bool | allocateResultValues (int numResultValues) |
Sets the number of result values to allocate. More... | |
bool | addResultValue1d (float scalarResultValue, int mapToItemId=-1) |
Adds the given scalar result value to the block. More... | |
bool | addResultValue3d (float vectorResultValueX, float vectorResultValueY, float vectorResultValueZ, int mapToItemId=-1) |
Adds the given vector or displacement (3D) result value to the block. More... | |
bool | checkValidity () const |
Returns false if the weak validity check fails. More... | |
![]() | |
Block (int blockId) | |
Constructs an empty block with given block id. More... | |
int | blockId () const |
Returns the block id. More... | |
BlockType | blockType () const |
Returns the block type. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
A block containing the actual result values for a specific result.
Global dimension constants used by Ceetron Export. These constants are used for various methods of ResultValuesBlock to indicate the dimension of result values.
Enumerator | |
---|---|
SCALAR1D |
Scalar result values (1D) |
VECTOR3D |
Vector result values (3D) |
TENSOR6D |
Symmetric tensor (6 values) |
cee::vtfx::ResultValuesBlock::ResultValuesBlock | ( | int | blockId, |
ResultValueDimension | dimension, | ||
bool | mapToItemIds | ||
) |
Constructs an empty results value block of the given dimension type.
blockId is the id of the result values block. Must be >= 0 and unique for all result values blocks within a database. Dimension type is either scalar (1D) or vector (3D). Set mapToItemIds to true if element or node ids are specified for each result item. If false, element or node indexes are specified for each result item.
Setting mapToItemIds to true is only valid if the "result block" that references this "result values block" uses a node or element mapping.
bool cee::vtfx::ResultValuesBlock::addResultValue1d | ( | float | scalarResultValue, |
int | mapToItemId = -1 |
||
) |
Adds the given scalar result value to the block.
Only use this for adding 1D (scalar results). Use addResultValue3d() for 3D results (vector and displacement).
mapToItemId is the id of the node/element to map the results to (default is -1, i.e. no id mapping).
Returns false if an error occurred.
bool cee::vtfx::ResultValuesBlock::addResultValue3d | ( | float | vectorResultValueX, |
float | vectorResultValueY, | ||
float | vectorResultValueZ, | ||
int | mapToItemId = -1 |
||
) |
Adds the given vector or displacement (3D) result value to the block.
Only use this for adding 3D results (vector and displacement). Use addResultValue1d() for 1D (scalar results).
mapToItemId is the id of the node/element to map the results to (default is -1, i.e. no id mapping).
Note that displacement result values can map only to nodes.
Returns false if an error occurred.
bool cee::vtfx::ResultValuesBlock::allocateResultValues | ( | int | numResultValues | ) |
Sets the number of result values to allocate.
This allocates space for result values added afterwards using addResultValue1d() or addResultValue3d().
The number set here is the number of result values, either 1D or 3D. Do NOT multiply by 3 when allocating for a 3D result. This is handled internally.
Returns false if an error occurred.
|
virtual |
Returns false if the weak validity check fails.
Reimplemented from cee::vtfx::Block.
ResultValuesBlock::ResultValueDimension cee::vtfx::ResultValuesBlock::dimension | ( | ) | const |
Returns the dimension of this result values block (scalar of vector)
bool cee::vtfx::ResultValuesBlock::hasMapToItemIds | ( | ) | const |
Returns true if the result values map to item ids, false if the result values map by corresponding index.
int cee::vtfx::ResultValuesBlock::mapToBlockId | ( | ) | const |
Returns the id of the node or element block these result values map to.
std::vector< int > cee::vtfx::ResultValuesBlock::mapToItemIds | ( | ) | const |
Returns an array containing item ids defining the association of result values with elements or nodes.
Use this method to get an array of node or element ids. The first result in the array returned by resultValues() maps to the node or element with the id found at the beginning of the returned array.
std::vector< float > cee::vtfx::ResultValuesBlock::resultValues | ( | ) | const |
Returns an array of result values defined in this block.
If the result is a vector or displacement result (3D), the returned array contains interleaved vector values (x,y,z,x,y,z,...).
bool cee::vtfx::ResultValuesBlock::setMapToBlockId | ( | int | blockId, |
BlockType | blockType | ||
) |
Sets the id of the node or element to map results to.
blockId specifies the id of the node or element block these results apply to and blockType specifies type of block, either NODES or ELEMENTS.
Returns false if an error occurred.
bool cee::vtfx::ResultValuesBlock::setResultValues | ( | const std::vector< float > & | resultValues, |
const std::vector< int > & | mapToItemIds = std::vector<int>() |
||
) |
Sets the result values data, optionally with id mapping.
Use this to set result values data for both 1D results (scalar) and 3D results (vectors and displacements). The result values array must consist of single floats for 1D results or interleaved float triplets (x,y,z,x,y,z,...) for 3D results. For 1D, the size of resultValues must be the same as number of result values and for 3D results resultValues' size must be "number of result values" * 3.
The dimension here must ALWAYS match the dimension set when creating the block!
mapToItemIds is an array of node or element ids to map the result values to. Default is an empty array, and then the result values are mapped to items elements/nodes/elements nodes/...) by index. If the item mapping is used for 1D results, the mapToItemIds.size() must be equal to resultValues.size(). And if the item mapping us used for 3D results, the mapToItemIds.size() must be equal to resultValues.size() / 3.
A call to this method overwrites any prior specifications of result values.
Returns false if an error occurred.