Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

RandomFieldData Class Reference

Last update: 16.07.2025

contains random field data for analysis and simulation for a single random field. More...

Public Types

typedef boost::shared_ptr< MultivariateDistributionBase > TDistributionPtr
 a shared pointer for multivariate distributions
 

Public Member Functions

Matrix computeAmplitudeValues (Matrix field_value)
 computes amplitudes from a single field design More...
 
Matrix computeAmplitudeValues (Matrix field_value, Matrix missing_items)
 computes amplitudes from a single field design More...
 
Matrix computeFieldValues (Matrix amplitudes)
 computes a field design from a single sample of amplitudes More...
 
 copyToDatabase (Structure database, bool overwrite_existing)
 copies contained data to the database (being visible in data object table) More...
 
DataObjectVector cumulativeVariations ()
 
 eraseDatabaseCopies (Structure database)
 deletes all data objects contained in this data structure from the respective database. More...
 
Matrix globalCumulativeVariations ()
 
Matrix globalIndividualVariations ()
 
DataObjectVector individualVariations ()
 
RandomFieldData operator= (RandomFieldData other)
 overrides the default assignment operator (making it thread-safe) Only the shared pointers are copied (the objects are not duplicated). The distributions are duplicated! More...
 
bool operator== (RandomFieldData other)
 
string quantityIdent ()
 destructor More...
 
 RandomFieldData ()
 a default constructor used for serialization
 
 RandomFieldData (string quantity_ident, dataobject_types type, TDistributionPtr field_distribution, Eigen::VectorXd global_variations_individual, number total_variation, DataObjectVector shapes, Eigen::MatrixXd pseudo_inverse)
 constructor The constructor creates values for More...
 
DataObjectVector shapes ()
 
number totalVariation ()
 
dataobject_types type ()
 
DataObjectPtr variation ()
 

Detailed Description

contains random field data for analysis and simulation for a single random field.

Constructor & Destructor Documentation

◆ RandomFieldData()

RandomFieldData ( string  quantity_ident,
dataobject_types  type,
TDistributionPtr  field_distribution,
Eigen::VectorXd  global_variations_individual,
number  total_variation,
DataObjectVector  shapes,
Eigen::MatrixXd  pseudo_inverse 
)

constructor The constructor creates values for

  • m_quantity_ident
  • m_type
  • m_field_distribution
  • m_gaussan_distribution
  • m_shapes
  • m_global_variations_cumulative
  • m_global_variations_individual
    Parameters
    quantity_identsets m_quantity_ident
    typesets m_type, the dataobject type of this random field
    field_distributionsets m_field_distribution;
    global_variations_individualdefines the absolute values of the variations of each shape (respective the whole random field group)
    total_variationthe absolute value of the total global variation present in the system (respective the whole random field group)
    shapesthe linear scatter shapes
    pseudo_inverseis a temporary term in the pseudo inverse, i.e. (A'A)^(-1) with A being the matrix of the shapes. For random fields, this is the dialogonal matrix of the inverse eigenvalues. Else it is the true pseudo inverse...

Member Function Documentation

◆ computeAmplitudeValues() [1/2]

Matrix computeAmplitudeValues ( Matrix  field_value)

computes amplitudes from a single field design

Note
For cross-correlated fields, you must build the sum of all amplitude vectors of all fields belongig to the same field group.
Parameters
field_valuethe field design
Returns
a vector of amplitudes

◆ computeAmplitudeValues() [2/2]

Matrix computeAmplitudeValues ( Matrix  field_value,
Matrix  missing_items 
)

computes amplitudes from a single field design

Note
For cross-correlated fields, you must build the sum of all amplitude vectors of all fields belongig to the same field group.
Use this function to "reconstruct" missing items. The projection operator will be changed such that the random field can be used for "reconstruction".
Parameters
field_valuethe field design
missing_itemsdefines the missing items: 0 = is existing, !=0 = is missing.
Returns
a vector of amplitudes

◆ computeFieldValues()

Matrix computeFieldValues ( Matrix  amplitudes)

computes a field design from a single sample of amplitudes

Note
For cross-correlated fields, you must use the same amplitude values of all fields belongig to the same field group.
Parameters
amplitudesthe amplitude values for a single sample
Returns
the field value vector

◆ copyToDatabase()

copyToDatabase ( Structure  database,
bool  overwrite_existing 
)

copies contained data to the database (being visible in data object table)

Parameters
databasethe target database
overwrite_existingif true, then data objects with identical ident will be replaced, else an exception is thrown.

◆ cumulativeVariations()

DataObjectVector cumulativeVariations ( )
Returns
a const-reference to m_variations_cumulative

◆ eraseDatabaseCopies()

eraseDatabaseCopies ( Structure  database)

deletes all data objects contained in this data structure from the respective database.

Parameters
databasethe database to be deleted

◆ globalCumulativeVariations()

Matrix globalCumulativeVariations ( )
Returns
a const-reference to m_global_variations_cumulative

◆ globalIndividualVariations()

Matrix globalIndividualVariations ( )
Returns
a const-reference to m_global_variations_individual

◆ individualVariations()

DataObjectVector individualVariations ( )
Returns
a const-reference to m_variations_individual

◆ operator=()

RandomFieldData operator= ( RandomFieldData  other)

overrides the default assignment operator (making it thread-safe) Only the shared pointers are copied (the objects are not duplicated). The distributions are duplicated!

Parameters
otherthe source object
Returns
a reference to this object

◆ operator==()

bool operator== ( RandomFieldData  other)

Both objects must not contain NULL pointers!

Parameters
otherthe other object to be compared with
Returns
true if both objects contain the same content
Note
This operator should be used with care. It is slow since the data of the distributions are first converted to Meta format and are then compared!

◆ quantityIdent()

string quantityIdent ( )

destructor

Returns
a const-reference to m_quantity_ident

◆ shapes()

DataObjectVector shapes ( )
Returns
a const-reference to m_shapes

◆ totalVariation()

number totalVariation ( )
Returns
a const-reference to m_total_variation

◆ type()

dataobject_types type ( )
Returns
a const-reference to m_quantity_ident

◆ variation()

DataObjectPtr variation ( )
Returns
a const-reference to m_variation

Connect with Ansys