cee::ug::DataResultGroup Class Reference

Result group binding a geometry and results (scalar, vector, displacement and/or transformation) More...

Public Member Functions

const DataGeometrygeometry () const
 Returns the geometry associated with this results group. More...
 
size_t scalarCount () const
 Returns number of scalar results for this group. More...
 
const DataResultScalarscalar (size_t resultIndex) const
 Returns the scalar result at the given index. More...
 
DataResultScalarscalar (size_t resultIndex)
 Returns the scalar result at the given index. More...
 
size_t scalarIndex (int resultId) const
 Returns the index of the result with the given id. More...
 
void addScalar (DataResultScalar *scalarResult)
 Adds a scalar result object to the group. More...
 
void removeAllScalars ()
 Removes all scalar results from the group. More...
 
size_t vectorCount () const
 Returns number of vector results for this group. More...
 
const DataResultVectorvector (size_t resultIndex) const
 Returns the vector result at the given index. More...
 
DataResultVectorvector (size_t resultIndex)
 Returns the vector result at the given index. More...
 
size_t vectorIndex (int resultId) const
 Returns the index of the result with the given id. More...
 
void addVector (DataResultVector *vectorResult)
 Adds a vector result object to the group. More...
 
void removeAllVectors ()
 Removes all vector results from the group. More...
 
size_t displacementCount () const
 Returns number of displacement results for this group. More...
 
const DataResultDisplacementdisplacement (size_t resultIndex) const
 Returns the displacement result at the given index. More...
 
DataResultDisplacementdisplacement (size_t resultIndex)
 Returns the displacement result at the given index. More...
 
size_t displacementIndex (int resultId) const
 Returns the index of the result with the given id. More...
 
void addDisplacement (DataResultDisplacement *displacementResult)
 Adds a displacement result object to the group. More...
 
void removeAllDisplacements ()
 Removes all displacement results from the group. More...
 
size_t symmetricTensorCount () const
 Returns number of symmetricTensor results for this group. More...
 
const DataResultSymmetricTensorsymmetricTensor (size_t resultIndex) const
 Returns the symmetricTensor result at the given index. More...
 
DataResultSymmetricTensorsymmetricTensor (size_t resultIndex)
 Returns the symmetricTensor result at the given index. More...
 
size_t symmetricTensorIndex (int resultId) const
 Returns the index of the result with the given id. More...
 
void addSymmetricTensor (DataResultSymmetricTensor *symmetricTensorResult)
 Adds a symmetricTensor result object to the group. More...
 
void removeAllSymmetricTensors ()
 Removes all symmetricTensor results from the group. More...
 
const DataResultTransformationtransformation () const
 Returns the transformation result. More...
 
DataResultTransformationtransformation ()
 Returns the transformation result. More...
 
void setTransformation (DataResultTransformation *transformationResult)
 Sets the transformation result. More...
 
void removeTransformation ()
 Removes the transformation result form the group. More...
 
const DataResultVisibilityvisibility () const
 Returns the visibility result. More...
 
DataResultVisibilityvisibility ()
 Returns visibility result. More...
 
void setVisibility (DataResultVisibility *visibilityResult)
 Sets the visibility result. More...
 
void removeVisibility ()
 Removes the visibility result form the group. 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::ug::DataResultGroup:
cee::RefCountedObject

Detailed Description

Result group binding a geometry and results (scalar, vector, displacement and/or transformation)

A state owns a set of geometries and a DataResultGroup is the binding between a geometry and it's results. Each geometry in the state have one (and only one) corresponding result group.

DataResultGroup has no public constructor and will always exist for each geometry in a state. Get the requested result group by calling DataState::results(const DataGeometry* geometry).

Get the data result group for a given geometry:

// Get geometry with global index 0
cee::ug::DataGeometry* geometry = state->DataGeometry(0);
// Get corresponding result group
cee::ug::DataResultGroup* resultGroup = state->results(geometry);

The DataResultGroup object contains all available results for a given geometry. Result types are:

Add a scalar result using addScalar(). Remove all using removeAllScalars(). Use scalarCount() to return number of scalar results for this result group. Access individual scalar results using scalar() with the requested index. To convert from a scalar id to a scalar index, use scalarIndex(). Vector results, Displacement results and Symmetric Tensor results use the same structure and naming convention as shown above for scalar. Transformation and visibility results differ slightly from the other since a result group only can have one of each of these results. Set the transformation result using setTransformation() and get the existing one using transformation(). Same syntax applies to visibility results.

Note
The class is reference counted and can be shared between multiple states. Remember that since this object to is reference counted it should never be created on the stack.
Example

Example of how to add a node based scalar result to a geometry consisting of only one triangle.

Create a scalar result object with a unique id and node based result mapping.

int scalarResultId = 1;

The result array must have one value for each node coordinate in the triangle. Remember that the array must be resized before inserting the results.

scalarPart->resize(3);
scalarPart->setValue(0, 1.0);
scalarPart->setValue(1, 2.0);
scalarPart->setValue(2, 3.0);

Number of parts in the DataResultScalar must match number of parts in the geometry. Scalar values must also fit the corresponding part in the geometry. Here the part is a single triangle with three nodes and a node mapped result, hence a results array with three values will fit.

scalarResult->addPart(scalarPart.get());

For each geometry in a state there is a result group binding the geometry and results.

Add the result scalar to the state's result group for the corresponding geometry (DataGeometry) geo

state->results(geo.get())->addScalar(scalarResult.get());

See also
DataResultScalar
DataResultVector
DataResultDisplacement
DataResultTransformation
DataState
Tutorials
UnstructGrid: A simple model with results

Member Function Documentation

void cee::ug::DataResultGroup::addDisplacement ( DataResultDisplacement displacementResult)

Adds a displacement result object to the group.

Warning
The added object is reference counted and should never be created on the stack or deleted!
void cee::ug::DataResultGroup::addScalar ( DataResultScalar scalarResult)

Adds a scalar result object to the group.

Warning
The added object is reference counted and should never be created on the stack or deleted!
void cee::ug::DataResultGroup::addSymmetricTensor ( DataResultSymmetricTensor symmetricTensorResult)

Adds a symmetricTensor result object to the group.

Warning
The added object is reference counted and should never be created on the stack or deleted!
void cee::ug::DataResultGroup::addVector ( DataResultVector vectorResult)

Adds a vector result object to the group.

Warning
The added object is reference counted and should never be created on the stack or deleted!
const DataResultDisplacement * cee::ug::DataResultGroup::displacement ( size_t  resultIndex) const

Returns the displacement result at the given index.

Use displacementIndex() to map from a displacement id if needed.

DataResultDisplacement * cee::ug::DataResultGroup::displacement ( size_t  resultIndex)

Returns the displacement result at the given index.

Use displacementIndex() to map from a displacement id if needed.

size_t cee::ug::DataResultGroup::displacementCount ( ) const

Returns number of displacement results for this group.

size_t cee::ug::DataResultGroup::displacementIndex ( int  resultId) const

Returns the index of the result with the given id.

Returns cee::UNDEFINED_SIZE_T if no matching id was found.

const DataGeometry * cee::ug::DataResultGroup::geometry ( ) const

Returns the geometry associated with this results group.

void cee::ug::DataResultGroup::removeAllDisplacements ( )

Removes all displacement results from the group.

void cee::ug::DataResultGroup::removeAllScalars ( )

Removes all scalar results from the group.

void cee::ug::DataResultGroup::removeAllSymmetricTensors ( )

Removes all symmetricTensor results from the group.

void cee::ug::DataResultGroup::removeAllVectors ( )

Removes all vector results from the group.

void cee::ug::DataResultGroup::removeTransformation ( )

Removes the transformation result form the group.

Same effect as doing setTransformation(NULL).

void cee::ug::DataResultGroup::removeVisibility ( )

Removes the visibility result form the group.

Same effect as doing setVisibility(NULL).

const DataResultScalar * cee::ug::DataResultGroup::scalar ( size_t  resultIndex) const

Returns the scalar result at the given index.

Use scalarIndex() to map from a scalar id if needed.

DataResultScalar * cee::ug::DataResultGroup::scalar ( size_t  resultIndex)

Returns the scalar result at the given index.

Use scalarIndex() to map from a scalar id if needed.

size_t cee::ug::DataResultGroup::scalarCount ( ) const

Returns number of scalar results for this group.

size_t cee::ug::DataResultGroup::scalarIndex ( int  resultId) const

Returns the index of the result with the given id.

Returns cee::UNDEFINED_SIZE_T if no matching id was found.

void cee::ug::DataResultGroup::setTransformation ( DataResultTransformation transformationResult)

Sets the transformation result.

Warning
The added object is reference counted and should never be created on the stack or deleted!
void cee::ug::DataResultGroup::setVisibility ( DataResultVisibility visibilityResult)

Sets the visibility result.

const DataResultSymmetricTensor * cee::ug::DataResultGroup::symmetricTensor ( size_t  resultIndex) const

Returns the symmetricTensor result at the given index.

Use symmetricTensorIndex() to map from a symmetricTensor id if needed.

DataResultSymmetricTensor * cee::ug::DataResultGroup::symmetricTensor ( size_t  resultIndex)

Returns the symmetricTensor result at the given index.

Use symmetricTensorIndex() to map from a symmetricTensor id if needed.

size_t cee::ug::DataResultGroup::symmetricTensorCount ( ) const

Returns number of symmetricTensor results for this group.

size_t cee::ug::DataResultGroup::symmetricTensorIndex ( int  resultId) const

Returns the index of the result with the given id.

Returns cee::UNDEFINED_SIZE_T if no matching id was found.

const DataResultTransformation * cee::ug::DataResultGroup::transformation ( ) const

Returns the transformation result.

DataResultTransformation * cee::ug::DataResultGroup::transformation ( )

Returns the transformation result.

const DataResultVector * cee::ug::DataResultGroup::vector ( size_t  resultIndex) const

Returns the vector result at the given index.

Use vectorIndex() to map from a vector id if needed.

DataResultVector * cee::ug::DataResultGroup::vector ( size_t  resultIndex)

Returns the vector result at the given index.

Use vectorIndex() to map from a vector id if needed.

size_t cee::ug::DataResultGroup::vectorCount ( ) const

Returns number of vector results for this group.

size_t cee::ug::DataResultGroup::vectorIndex ( int  resultId) const

Returns the index of the result with the given id.

Returns cee::UNDEFINED_SIZE_T if no matching id was found.

const DataResultVisibility * cee::ug::DataResultGroup::visibility ( ) const

Returns the visibility result.

DataResultVisibility * cee::ug::DataResultGroup::visibility ( )

Returns visibility result.