cee::imp::cae::StateLinearCombination Class Reference

This class handles the building and storing of a linear combination of states. More...

Public Member Functions

 StateLinearCombination (cee::ug::UnstructGridModel *sourceModel, const std::vector< int > &sourceStateIds, const std::vector< double > &combinedStateReferenceValues)
 Constructor. Specifies the source UnstructGridModel, the ids of the states in this model that will be used in the linear combination and finally, the reference values of the combined states that will be generated. More...
 
void setSourceStateWeights (int sourceStateId, const std::vector< double > &weights)
 Sets the weights of the given state in each of the combined states to be generated. More...
 
bool build ()
 Builds the combined states. Data is stored for performance in the output folder. More...
 
void setBuildFolderLocation (const cee::Str &location)
 Sets the location where the temporary build folder will be created. More...
 
bool deleteBuildFolder ()
 Deletes the temporary build folder, releasing memory. More...
 
void setUseParallelComputation (bool use)
 Activates/deactivates the use of parallel computation of combined states. More...
 
bool write (const cee::Str &vtfxFile)
 Builds the data source by linearly combining states of the source UnstructGridModel. 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::imp::cae::StateLinearCombination:
cee::RefCountedObject

Detailed Description

This class handles the building and storing of a linear combination of states.

Once built and written to a VTFx file, it provides states that are a weighted linear combination of a the DataSource of a given UnstructGridModel.

First, use the constructor to define source UnstructGridModel and the source state ids used in the linear combination, as well as the reference values of the combined states to create.

The linear combination is then defined by setting the weights of each of the source states in each combined state. This is done in setSourceStateWeights().

As soon as all the data is provided, a call to build() will generate the new states in a build folder. The location of this build folder can be specified using setBuildFolderLocation()

All source states that are combined must have the same geometries

Constructor & Destructor Documentation

cee::imp::cae::StateLinearCombination::StateLinearCombination ( cee::ug::UnstructGridModel sourceModel,
const std::vector< int > &  sourceStateIds,
const std::vector< double > &  combinedStateReferenceValues 
)

Constructor. Specifies the source UnstructGridModel, the ids of the states in this model that will be used in the linear combination and finally, the reference values of the combined states that will be generated.

Member Function Documentation

bool cee::imp::cae::StateLinearCombination::build ( )

Builds the combined states. Data is stored for performance in the output folder.

bool cee::imp::cae::StateLinearCombination::deleteBuildFolder ( )

Deletes the temporary build folder, releasing memory.

Only do this if the data is safely store in a VTFx file with a call to write()

void cee::imp::cae::StateLinearCombination::setBuildFolderLocation ( const cee::Str location)

Sets the location where the temporary build folder will be created.

void cee::imp::cae::StateLinearCombination::setSourceStateWeights ( int  sourceStateId,
const std::vector< double > &  weights 
)

Sets the weights of the given state in each of the combined states to be generated.

void cee::imp::cae::StateLinearCombination::setUseParallelComputation ( bool  use)

Activates/deactivates the use of parallel computation of combined states.

Activating usage when parallel is not supported will cause an assert.

bool cee::imp::cae::StateLinearCombination::write ( const cee::Str vtfxFile)

Builds the data source by linearly combining states of the source UnstructGridModel.

Data is stored in the given folder