Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

RandomFieldModel< TYPE > Class Template Reference

Last update: 16.07.2025

Provides random field models. More...

Public Types

typedef boost::function< number(TVector3 x, TVector3 y)> TCorrelationFunction
 a function which is called to analyze the correlation
 
typedef std::vector< number > TDoubleVector
 a vector of floating point numbers
 
typedef Eigen::Vector3d TVector3
 a 3D vector type
 

Public Member Functions

 check (Structure database)
 checks the settings on plausibility More...
 
 compute (Structure database)
 does the action More...
 
 RandomFieldModel (Structure database, string the_quantity_ident, DataObjectPtr the_mean, DataObjectPtr the_stddev)
 default constructor More...
 
 setExponentialCorrelation (number length)
 Defines the correlation model in standard-normal space being a simple exponential one using the distance between two points. More...
 
 setSquaredExponentialCorrelation (number length)
 Defines the correlation model in standard-normal space being an exponential one using the squared distance between two points. More...
 

Public Attributes

DataObjectPtr bounds_lower
 lower bounds (may be an empty pointer)
 
DataObjectPtr bounds_upper
 upper bounds (may be an empty pointer)
 
bool compute_cumulative_variations
 true, if the cumulative variations are to be computed
 
bool compute_variations
 true, if the individual variations are to be computed
 
number desired_variation
 the desired variation (when reducing the model; 0<x<1). Default: 0.9
 
MultivariateDistributionTypes::enum_type distribution_type
 The ident of the probability distribution that is assumed to convert data from original space to Gaussian. If empty (default), then it is automatically chosen.
 
number max_number
 the maximum number of vectors to be computed. Default: 5
 
DataObjectPtr mean
 mean value of the field
 
bool overwrite_existing
 Is true if already existing output data objects will be replaced. In this case, also all depending objects of the already existing one will be deleted.
 
string quantity_ident
 the ident of the quantity for which the random field is to be generated
 
size_t seed
 the initial random seed used for random number generators used internally.
 
DataObjectPtr stddev
 standard deviation of the field
 
number sub_space_dimension
 the sub space dimension This is the number of points in sub space for which the full and dense correlation matrix is created. Must not be too large. Absolute maximum (on 64 bit CPUs): 16000. Recommended maximum: 2000.
 

Detailed Description

template<dataobject_types TYPE>
class RandomFieldModel< TYPE >

Provides random field models.

Template Parameters
TYPEthe field data type

This class provides random field correlation models. Herein, the required information to simulate random fields (scatter shapes, distribution information etc.) are based on a simple numerical model assumption. Such models may be used if there is not sufficient data available for the estimation of the true correlation structure.

The correlation models employed here refer to the correlation matrix that is created after transforming the field marginal CDF to standard normal space.

Constructor & Destructor Documentation

◆ RandomFieldModel()

RandomFieldModel ( Structure  database,
string  the_quantity_ident,
DataObjectPtr  the_mean,
DataObjectPtr  the_stddev 
)

default constructor

Parameters
databasethe database where all data is stored into
the_quantity_identsets quantity_ident
the_meansets mean
the_stddevsets stddev

Member Function Documentation

◆ check()

check ( Structure  database)

checks the settings on plausibility

It throws an exception if there is a problem with the settings. Important: It tries to find out all problems with these settings and then exits the routine.

Parameters
databasethe SoS structure

◆ compute()

compute ( Structure  database)

does the action

Parameters
databasethe database where all data is stored into

◆ setExponentialCorrelation()

setExponentialCorrelation ( number  length)

Defines the correlation model in standard-normal space being a simple exponential one using the distance between two points.

Parameters
lengththe correlation length (as absolute number)

◆ setSquaredExponentialCorrelation()

setSquaredExponentialCorrelation ( number  length)

Defines the correlation model in standard-normal space being an exponential one using the squared distance between two points.

Parameters
lengththe correlation length (as absolute number)

Connect with Ansys