cee::vtfx::ResultBlock Class Reference

A block defining a result (scalars, vectors, or displacements) in a VTFx database. More...

Public Types

enum  ResultType {
  UNKNOWN_TYPE = -1, SCALAR = 0, VECTOR = 1, DISPLACEMENT = 2,
  TENSOR = 3
}
 Global result type constants used by Ceetron Export. These constants are used for various methods of ResultBlock. More...
 
enum  ResultMapping {
  UNKNOWN_MAPPING = -1, NODE_MAPPING = 0, ELEMENT_MAPPING = 1, ELEMENT_NODE_MAPPING = 3,
  ELEMENT_FACE_MAPPING = 4
}
 Global result mapping type constants used by Ceetron Export. These constants are used for various methods of ResultBlock. More...
 
enum  StrainType { STRAINTYPE_NONE = -1, STRAINTYPE_ENGINEERING = 0, STRAINTYPE_STANDARD = 1 }
 
- Public Types inherited from cee::vtfx::Block
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

 ResultBlock (int blockId, ResultType resultType, ResultMapping resultMapping)
 Constructs an empty result block. More...
 
Str name () const
 Returns the result name. More...
 
void setName (const Str &resultName)
 Sets the name of this result. More...
 
int resultId () const
 Returns the result id of the result defined in this block. More...
 
void setResultId (int resultId)
 Sets the result id. More...
 
std::vector< int > resultValuesBlocks (size_t stateIndex) const
 Returns an array containing ids of result values blocks defined for the given state index. More...
 
bool setResultValuesBlocks (const std::vector< int > &resultValuesBlockIds, int stateId=1)
 Defines which result values blocks are referenced by this result block, optionally for the specified state. More...
 
bool addResultValuesBlock (int resultValuesBlockId, int stateId=1)
 Adds a result values block reference for this result block, optionally for the specified state. More...
 
bool relativeDisplacementResults () const
 Returns true if the displacement results are relative, false if they are absolute. More...
 
void setRelativeDisplacementResults (bool relative)
 Sets if the displacement results are relative to the non-displaced nodes or absolute new node coordinates. More...
 
void setDefaultDisplacementScaleFactor (float scale)
 Sets the default displacement scale factor. More...
 
float defaultDisplacementScaleFactor () const
 Gets the default displacement scale factor. More...
 
StrainType strainType () const
 Returns the strain type of this result. More...
 
void setStrainType (StrainType type)
 Sets the strain type of this result. Allows to specify if strain tensor in engineering or not. More...
 
void addAttribute (const Str &attributeName, const Str &attributeValue)
 Adds an attribute to the result block definition. More...
 
Str attribute (const Str &attributeName) const
 Returns the value of the given attribute. More...
 
std::vector< StrattributeNames () const
 Returns the list of attribute names of this block. More...
 
ResultType resultType () const
 Returns the result type for this result block. More...
 
ResultMapping resultMapping () const
 Returns the result mapping for this result block. More...
 
size_t stateCount () const
 Returns the number of states defined for this result. More...
 
size_t stateIndex (int stateId) const
 Returns the zero-based state index for the given state id. More...
 
int stateId (size_t stateIndex) const
 Returns the state id for the given state index. More...
 
bool checkValidity () const
 Returns false if the weak validity check fails. More...
 
- Public Member Functions inherited from cee::vtfx::Block
 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...
 
- Public Member Functions inherited from cee::RefCountedObject
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...
 
Inheritance diagram for cee::vtfx::ResultBlock:
cee::vtfx::Block cee::RefCountedObject

Detailed Description

A block defining a result (scalars, vectors, or displacements) in a VTFx database.

The result block defines the result meta data and references result values blocks which contain the actual result values.

A VTFx database can contain many result blocks. The meta data consists of the result type - either scalars, vectors, or displacements - and the result mapping describing the association of result values with dataset items - either per node, per element, per element node, or per element face.

The result meta data also contains a "result id" which shall not be confused with the block id. The result id must be unique within all results of the same result type in a database, i.e. scalar ID1/ID2/..., vector ID1/ID2/..., displacement ID1/ID2/... However, the block id for all result blocks within a database has to be unique. The result id is being used to reference results while defining result properties, such as fringe color properties (see Case).

For a static dataset, it is sufficient to define result values blocks for one state (using stateId = 1). For adaptive results, one has to define the results for every state. If result values do not change for a particular state, one can reuse those result values blocks that had already been assigned to previous states.

For further information on states and adaptive results, please see the API documentation and StateInfoBlock.

Displacement results are either "relative", i.e. added as vectors onto node coordinates, or "absolute", i.e. replacing the node coordinates (see setRelativeDisplacementResults() method).

See the base class (Block) for more info on VTFx blocks in general.

Member Enumeration Documentation

Global result mapping type constants used by Ceetron Export. These constants are used for various methods of ResultBlock.

Enumerator
NODE_MAPPING 

Result values map on nodes.

ELEMENT_MAPPING 

Result values map on elements.

ELEMENT_NODE_MAPPING 

Result values map on element nodes.

ELEMENT_FACE_MAPPING 

Result values map on element faces.

Global result type constants used by Ceetron Export. These constants are used for various methods of ResultBlock.

Enumerator
SCALAR 

Scalar result (1D)

VECTOR 

Vector result (3D)

DISPLACEMENT 

Displacement result (3D)

TENSOR 

Symmetric tensor result (6D)

Constructor & Destructor Documentation

cee::vtfx::ResultBlock::ResultBlock ( int  blockId,
ResultType  resultType,
ResultMapping  resultMapping 
)

Constructs an empty result block.

blockId must be >= 0 and unique for all result blocks within a database.

Member Function Documentation

void cee::vtfx::ResultBlock::addAttribute ( const Str attributeName,
const Str attributeValue 
)

Adds an attribute to the result block definition.

bool cee::vtfx::ResultBlock::addResultValuesBlock ( int  resultValuesBlockId,
int  stateId = 1 
)

Adds a result values block reference for this result block, optionally for the specified state.

The state id defines for which state the result values block applies (default = 1 for single state).

Result values blocks do not need to be defined at all states. The rule is that result values blocks need to be defined for every state, but blocks can be re-used in multiple states if required.

Str cee::vtfx::ResultBlock::attribute ( const Str attributeName) const

Returns the value of the given attribute.

std::vector< Str > cee::vtfx::ResultBlock::attributeNames ( ) const

Returns the list of attribute names of this block.

bool cee::vtfx::ResultBlock::checkValidity ( ) const
virtual

Returns false if the weak validity check fails.

Reimplemented from cee::vtfx::Block.

float cee::vtfx::ResultBlock::defaultDisplacementScaleFactor ( ) const

Gets the default displacement scale factor.

Str cee::vtfx::ResultBlock::name ( ) const

Returns the result name.

bool cee::vtfx::ResultBlock::relativeDisplacementResults ( ) const

Returns true if the displacement results are relative, false if they are absolute.

int cee::vtfx::ResultBlock::resultId ( ) const

Returns the result id of the result defined in this block.

ResultBlock::ResultMapping cee::vtfx::ResultBlock::resultMapping ( ) const

Returns the result mapping for this result block.

ResultBlock::ResultType cee::vtfx::ResultBlock::resultType ( ) const

Returns the result type for this result block.

std::vector< int > cee::vtfx::ResultBlock::resultValuesBlocks ( size_t  stateIndex) const

Returns an array containing ids of result values blocks defined for the given state index.

stateIndex is the zero-based index of the state definition (not to be mixed up with state id!).

void cee::vtfx::ResultBlock::setDefaultDisplacementScaleFactor ( float  scale)

Sets the default displacement scale factor.

Only applies to absolute displacement results. See setRelativeDisplacementResults().

void cee::vtfx::ResultBlock::setName ( const Str resultName)

Sets the name of this result.

Recommended to be unique amongst results of the same type. The result name must be a single line string.

void cee::vtfx::ResultBlock::setRelativeDisplacementResults ( bool  relative)

Sets if the displacement results are relative to the non-displaced nodes or absolute new node coordinates.

relative set to true means displacement results are relative to non-displaced nodes, false (default) means displacement results are absolute new node coordinates

void cee::vtfx::ResultBlock::setResultId ( int  resultId)

Sets the result id.

Must be unique among results of the same type.

If no result name has yet been set, a default name will be assigned to the result depending on the result type : "Scalar/Vector/Displacement result #result id#". This default name can be overridden using setName(), of course.

The result id is referenced when specifying properties for the result.

bool cee::vtfx::ResultBlock::setResultValuesBlocks ( const std::vector< int > &  resultValuesBlockIds,
int  stateId = 1 
)

Defines which result values blocks are referenced by this result block, optionally for the specified state.

resultValuesBlockIds is an array with result values block ids. stateId is the state id for which the result values blocks apply (default = 1 for single state).

Result values blocks does not need to be defined at all states. The rule is that result values blocks need to be defined for every state, but blocks can be re-used in multiple states if required.

void cee::vtfx::ResultBlock::setStrainType ( ResultBlock::StrainType  type)

Sets the strain type of this result. Allows to specify if strain tensor in engineering or not.

size_t cee::vtfx::ResultBlock::stateCount ( ) const

Returns the number of states defined for this result.

int cee::vtfx::ResultBlock::stateId ( size_t  stateIndex) const

Returns the state id for the given state index.

stateIndex is the zero-based index of the state definition within this block (not to be mixed with state id!)

size_t cee::vtfx::ResultBlock::stateIndex ( int  stateId) const

Returns the zero-based state index for the given state id.

ResultBlock::StrainType cee::vtfx::ResultBlock::strainType ( ) const

Returns the strain type of this result.