Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

ScalarMOP2 Class Reference

Last update: 16.07.2025

Represents a ScalarMOP2. More...

Public Member Functions

Matrix activeVariables (::data_handler::DataHandlerBase datahandler, uint64_t output)
 Return the the variable active for the selected output. More...
 
Matrix constantInputs (::data_handler::DataHandlerBase datahandler)
 Return the the variables inactive for all outputs (the constant inputs) More...
 
Matrix copInputs () override
 
Matrix copInputs (::data_handler::DataHandlerBase datahandler)
 Compute the individual CoPs of second order for each input of given order for all outputs from the ScalarMOP in the datahandler. More...
 
Matrix copInputs (::data_handler::DataHandlerBase datahandler, uint64_t output)
 Compute the individual CoPs of second order for each input of given order for a single output from the ScalarMOP in the datahandler. More...
 
Matrix copInputsFirstOrder (::data_handler::DataHandlerBase datahandler)
 Compute the individual CoPs of first order for each input of given order for all outputs from the ScalarMOP in the datahandler. More...
 
Matrix copInputsFirstOrder (::data_handler::DataHandlerBase datahandler, uint64_t output)
 Compute the individual CoPs of given order for each input of given order for a single output from the ScalarMOP in the datahandler. More...
 
Matrix copTotal () override
 
Matrix copTotal (::data_handler::DataHandlerBase datahandler)
 Return the total CoP from the ScalarMOP in the given datahandler. More...
 
number copTotal (::data_handler::DataHandlerBase datahandler, uint64_t output)
 Return the total CoP of the given output the ScalarMOP in the datahandler. More...
 
Matrix crossValidation (::data_handler::DataHandlerBase datahandler)
 Returns the cross validation values. More...
 
Matrix crossValidation (::data_handler::DataHandlerBase datahandler, uint64_t output)
 
Matrix cvOutputs () override
 
Matrix cvOutputs (number output)
 
Matrix evaluate (::data_handler::DataHandlerBase datahandler, Matrix values)
 Evaluate the ScalarMOP in the datahandler on the given values with bounds check. More...
 
Matrix evaluate (::data_handler::DataHandlerBase datahandler, Matrix values, uint64_t output)
 Evaluate the ScalarMOP in the datahandler on the given values. Only evaluate the given output. With bounds check. More...
 
Matrix evaluate (Matrix x, bool extrapolate=false) override
 
Matrix evaluate (Matrix x, uint64_t output, bool extrapolate=false) override
 
Matrix evaluateExtrapolate (::data_handler::DataHandlerBase datahandler, Matrix values)
 Evaluate the ScalarMOP in the datahandler on the given values no bounds check. More...
 
Matrix evaluateExtrapolate (::data_handler::DataHandlerBase datahandler, Matrix values, uint64_t output)
 Evaluate the ScalarMOP in the datahandler on the given values. Only evaluate the given output. No bounds check. More...
 
Matrix evaluateExtrapolate (Matrix x)
 
std::vector< string > filterActiveSampleIds (::data_handler::DataHandlerBase datahandler, std::vector< string > sample_ids, uint64_t model)
 Return the the samples id active for the selected output from the given list of sample_ids. More...
 
std::vector< string > filterConstantInputNames (::data_handler::DataHandlerBase datahandler, std::vector< string > input_names)
 Filter the list of input names such that only the constant ones are returned The Input names need to be in the order as given on the training of the MOP. More...
 
Matrix getFilter () override
 
Matrix getMean () override
 
Matrix getSensitivities () override
 
Matrix inputs ()
 
bool isValid (::data_handler::DataHandlerBase datahandler)
 checks the settings More...
 
bool isValid () override
 destructor More...
 
Matrix lowerBounds () override
 Returns a column vector of lower bound values of input parameters in DoE.
 
string modelDescription (::data_handler::DataHandlerBase datahandler, std::size_t output)
 Return the description of the model computing the output for the SclarMOP in the datahandler. More...
 
string modelName (::data_handler::DataHandlerBase datahandler, uint64_t output)
 Return the name of the model computing the output for the SclarMOP in the datahandler. More...
 
int numInputs () override
 
int numOutputs () override
 
number numSamples () override
 
Matrix outputs ()
 
Matrix predictionError (::data_handler::DataHandlerBase datahandler)
 Estimate the prediction error for ScalarMOP in the datahandler on the given values. More...
 
number predictionError (::data_handler::DataHandlerBase datahandler, uint64_t output)
 Estimate the prediction error for ScalarMOP in the datahandler on the given values for the given output. More...
 
Matrix qualityMeasureTotal (::data_handler::DataHandlerBase datahandler, ::quality_measure::QualityMeasureBase quality_measure)
 Return the total quality measure w.r.t. the expected responses from the ScalarMOP in the given datahandler. More...
 
number qualityMeasureTotal (::data_handler::DataHandlerBase datahandler, ::quality_measure::QualityMeasureBase quality_measure, uint64_t output)
 Return the total quality measure w.r.t. the expected responses for the given output from the ScalarMOP in the given datahandler. More...
 
Matrix sampleStatus (::data_handler::DataHandlerBase datahandler)
 Return the the samples active/inactive for all models. More...
 
Matrix sampleStatus (::data_handler::DataHandlerBase datahandler, uint64_t model)
 Return the the samples id active for the selected output from the given list of sample_ids. More...
 
 save (string path, bool replace_files=false)
 Saves the ScalarMOP2 to a file. More...
 
 ScalarMOP2 ()
 default constructor. Creates an empty (unusable) ScalarMOP2 object.
 
 ScalarMOP2 (ScalarMOP2 other)
 copy constructor More...
 
Matrix upperBounds () override
 Returns a column vector of upper bound values of input parameters in DoE.
 
 writeOMDB (string path, bool replace_files=false)
 Writes an optiSLang monitoring database file. More...
 

Static Public Member Functions

static ScalarMOP2 load (string path)
 Loads the ScalarMOP2 from a file. More...
 

Serialization

class boost::serialization::access
 
bool operator== (ScalarMOP2 other)
 
ScalarMOP2 operator= (ScalarMOP2 other)
 overrides the default assignment operator More...
 

Detailed Description

Represents a ScalarMOP2.

The meta model is a mathematical function which approximates one or multiple output quantities from values of one or multiple input quantities.

Constructor & Destructor Documentation

◆ ScalarMOP2()

ScalarMOP2 ( ScalarMOP2  other)

copy constructor

Parameters
otherthe ScalarMOP2 object to be copied from

Member Function Documentation

◆ activeVariables()

Matrix activeVariables ( ::data_handler::DataHandlerBase  datahandler,
uint64_t  output 
)
inherited

Return the the variable active for the selected output.

Parameters
datahandlerThe database to take the ScalarMOP from
outputThe selected output
Returns
A vector of bools specifying for each input if it is active

◆ constantInputs()

Matrix constantInputs ( ::data_handler::DataHandlerBase  datahandler)
inherited

Return the the variables inactive for all outputs (the constant inputs)

Parameters
datahandlerThe database to take the ScalarMOP from
Returns
A vector of bools specifying for each input if it is constant

◆ copInputs() [1/3]

Matrix copInputs ( )
override
Returns
the individual CoP values of each input for each output The CoP matrix is organized as follows:
  • each column corresponds to one design variable
  • each row corresponds to one output variable

◆ copInputs() [2/3]

Matrix copInputs ( ::data_handler::DataHandlerBase  datahandler)
inherited

Compute the individual CoPs of second order for each input of given order for all outputs from the ScalarMOP in the datahandler.

Parameters
datahandlerThe datahandler
Returns
the individual CoP values of each input for each output The CoP matrix is organized as follows:
  • each column corresponds to one design variable
  • each row corresponds to one output variable

◆ copInputs() [3/3]

Matrix copInputs ( ::data_handler::DataHandlerBase  datahandler,
uint64_t  output 
)
inherited

Compute the individual CoPs of second order for each input of given order for a single output from the ScalarMOP in the datahandler.

Parameters
datahandlerThe datahandler
outputThe output to compute for
Returns
the individual CoP values of each input for a single output output The CoP matrix is organized as follows:
  • each column corresponds to one design variable
  • each row corresponds to one output variable

◆ copInputsFirstOrder() [1/2]

Matrix copInputsFirstOrder ( ::data_handler::DataHandlerBase  datahandler)
inherited

Compute the individual CoPs of first order for each input of given order for all outputs from the ScalarMOP in the datahandler.

Parameters
datahandlerThe datahandler
Returns
the individual CoP values of each input for each output The CoP matrix is organized as follows:
  • each column corresponds to one design variable
  • each row corresponds to one output variable

◆ copInputsFirstOrder() [2/2]

Matrix copInputsFirstOrder ( ::data_handler::DataHandlerBase  datahandler,
uint64_t  output 
)
inherited

Compute the individual CoPs of given order for each input of given order for a single output from the ScalarMOP in the datahandler.

Parameters
datahandlerThe datahandler
outputThe output to compute for
Returns
the individual CoP values of each input for a single output output The CoP matrix is organized as follows:
  • each column corresponds to one design variable
  • each row corresponds to one output variable

◆ copTotal() [1/3]

Matrix copTotal ( )
override
Returns
a column vector which contains the total CoP for each output variable

◆ copTotal() [2/3]

Matrix copTotal ( ::data_handler::DataHandlerBase  datahandler)
inherited

Return the total CoP from the ScalarMOP in the given datahandler.

Parameters
datahandlerThe datahandler
Returns
The total CoP of all outputs

◆ copTotal() [3/3]

number copTotal ( ::data_handler::DataHandlerBase  datahandler,
uint64_t  output 
)
inherited

Return the total CoP of the given output the ScalarMOP in the datahandler.

Parameters
datahandlerThe datahandler
outputThe output to compute the CoP for
Returns
The total CoP of given output

◆ crossValidation()

Matrix crossValidation ( ::data_handler::DataHandlerBase  datahandler)
inherited

Returns the cross validation values.

Parameters
datahandlerThe datahandler containing the ScalarMOP
Returns
cross validation data from the ScalarMOP

◆ cvOutputs()

Matrix cvOutputs ( )
override
Returns
a matrix which contains the cross-validated values for each output variable

◆ evaluate() [1/3]

Matrix evaluate ( ::data_handler::DataHandlerBase  datahandler,
Matrix  values 
)
inherited

Evaluate the ScalarMOP in the datahandler on the given values with bounds check.

Parameters
datahandlerThe datahandler containing the ScalarMOP
valuesThe values to evaluate the scalarMOP on
Returns
Values approximated by the ScalarMOP

◆ evaluate() [2/3]

Matrix evaluate ( ::data_handler::DataHandlerBase  datahandler,
Matrix  values,
uint64_t  output 
)
inherited

Evaluate the ScalarMOP in the datahandler on the given values. Only evaluate the given output. With bounds check.

Parameters
datahandlerThe datahandler containing the ScalarMOP
valuesThe values to evaluate the scalarMOP on
outputThe output to evaluate
Returns
Values approximated by the ScalarMOP

◆ evaluate() [3/3]

Matrix evaluate ( Matrix  x,
bool  extrapolate = false 
)
override
Parameters
xthe inputs to be evaluated. Each column is one set of inputs, e.g. each column represents a single design, e.g. numRows = numInputs; The input values must be be within the original sampling bounds!
extrapolateExtrapolate values outside the sample boundaries
Returns
matrix of output variable values as approximated by the meta model; each column represents a single design, e.g. numRows = numOutputs; numCols = x.numCols()

◆ evaluateExtrapolate() [1/2]

Matrix evaluateExtrapolate ( ::data_handler::DataHandlerBase  datahandler,
Matrix  values 
)
inherited

Evaluate the ScalarMOP in the datahandler on the given values no bounds check.

Parameters
datahandlerThe datahandler containing the ScalarMOP
valuesThe values to evaluate the scalarMOP on
Returns
Values approximated by the ScalarMOP

◆ evaluateExtrapolate() [2/2]

Matrix evaluateExtrapolate ( ::data_handler::DataHandlerBase  datahandler,
Matrix  values,
uint64_t  output 
)
inherited

Evaluate the ScalarMOP in the datahandler on the given values. Only evaluate the given output. No bounds check.

Parameters
datahandlerThe datahandler containing the ScalarMOP
valuesThe values to evaluate the scalarMOP on
outputThe output to evaluate
Returns
Values approximated by the ScalarMOP

◆ filterActiveSampleIds()

std::vector<string> filterActiveSampleIds ( ::data_handler::DataHandlerBase  datahandler,
std::vector< string >  sample_ids,
uint64_t  model 
)
inherited

Return the the samples id active for the selected output from the given list of sample_ids.

Parameters
datahandlerThe database to take the ScalarMOP from
sample_idsA list of sample ids corresponding to the used samples
modelThe selected model
Returns
A vector of strings representing the ids of the active samples

◆ filterConstantInputNames()

std::vector<string> filterConstantInputNames ( ::data_handler::DataHandlerBase  datahandler,
std::vector< string >  input_names 
)
inherited

Filter the list of input names such that only the constant ones are returned The Input names need to be in the order as given on the training of the MOP.

Parameters
datahandlerThe database to take the ScalarMOP from
input_namesThe names of the inputs in the order of the training
Returns
A list of input names representing the constant inputs

◆ getSensitivities()

Matrix getSensitivities ( )
override
Returns
the individual CoP values of each input for each output The sensitivities matrix is organized as follows:
  • The first column contains the total CoP for each output variable
  • The other columns contain the CoP matrix organized as follows:
    • each column corresponds to one design variable
    • each row corresponds to one output variable

◆ isValid() [1/2]

bool isValid ( ::data_handler::DataHandlerBase  datahandler)
inherited

checks the settings

Parameters
datahandlerThe datahandler we refer to
Returns
true iff the datahandler may be accessed

◆ isValid() [2/2]

bool isValid ( )
override

destructor

returns true if the ScalarMOP2 is valid

◆ load()

static ScalarMOP2 load ( string  path)
static

Loads the ScalarMOP2 from a file.

Parameters
pathThe path to read the file from

◆ modelDescription()

string modelDescription ( ::data_handler::DataHandlerBase  datahandler,
std::size_t  output 
)
inherited

Return the description of the model computing the output for the SclarMOP in the datahandler.

Parameters
datahandlerThe datahandler
outputThe output under consideration
Returns
A string containing the description of the model

◆ modelName()

string modelName ( ::data_handler::DataHandlerBase  datahandler,
uint64_t  output 
)
inherited

Return the name of the model computing the output for the SclarMOP in the datahandler.

Parameters
datahandlerThe datahandler
outputThe output under consideration
Returns
A string containing the name of the model

◆ numInputs()

int numInputs ( )
override
Returns
the number of input variables

◆ numOutputs()

int numOutputs ( )
override
Returns
the number of output variables

◆ numSamples()

number numSamples ( )
override
Returns
number of samples used to establish ScalarMOP2

◆ operator=()

ScalarMOP2 operator= ( ScalarMOP2  other)

overrides the default assignment operator

Parameters
otherthe source object
Returns
a reference to this object

◆ operator==()

bool operator== ( ScalarMOP2  other)
Parameters
otherthe other object to be compared with
Returns
true if both objects contain the same content

◆ predictionError() [1/2]

Matrix predictionError ( ::data_handler::DataHandlerBase  datahandler)
inherited

Estimate the prediction error for ScalarMOP in the datahandler on the given values.

Parameters
datahandlerThe datahandler containing the ScalarMOP
Returns
The prediction error

◆ predictionError() [2/2]

number predictionError ( ::data_handler::DataHandlerBase  datahandler,
uint64_t  output 
)
inherited

Estimate the prediction error for ScalarMOP in the datahandler on the given values for the given output.

Parameters
datahandlerThe datahandler containing the ScalarMOP
outputThe selected output
Returns
Values approximated by the ScalarMOP

◆ qualityMeasureTotal() [1/2]

Matrix qualityMeasureTotal ( ::data_handler::DataHandlerBase  datahandler,
::quality_measure::QualityMeasureBase  quality_measure 
)
inherited

Return the total quality measure w.r.t. the expected responses from the ScalarMOP in the given datahandler.

Parameters
datahandlerThe datahandler
quality_measureThe quality measure
Returns
The total quality measure of all outputs w.r.t. the expected responses

◆ qualityMeasureTotal() [2/2]

number qualityMeasureTotal ( ::data_handler::DataHandlerBase  datahandler,
::quality_measure::QualityMeasureBase  quality_measure,
uint64_t  output 
)
inherited

Return the total quality measure w.r.t. the expected responses for the given output from the ScalarMOP in the given datahandler.

Parameters
datahandlerThe datahandler
quality_measureThe quality measure
outputThe output to compute for
Returns
The total quality measure of all outputs w.r.t. the expected responses

◆ sampleStatus() [1/2]

Matrix sampleStatus ( ::data_handler::DataHandlerBase  datahandler)
inherited

Return the the samples active/inactive for all models.

Parameters
datahandlerThe database to take the ScalarMOP from
Returns
A matrix of bools specifying for each sample/model if it is active/inactive

◆ sampleStatus() [2/2]

Matrix sampleStatus ( ::data_handler::DataHandlerBase  datahandler,
uint64_t  model 
)
inherited

Return the the samples id active for the selected output from the given list of sample_ids.

Parameters
datahandlerThe database to take the ScalarMOP from
modelThe selected model
Returns
A vector of bools specifying for each samples if it is active/inactive for the model

◆ save()

save ( string  path,
bool  replace_files = false 
)

Saves the ScalarMOP2 to a file.

Parameters
pathThe path to write the file to
replace_filesif true, then an already existin gfile will be replaced

◆ writeOMDB()

writeOMDB ( string  path,
bool  replace_files = false 
)

Writes an optiSLang monitoring database file.

Parameters
pathThe path to write the file to
replace_filesif true, then an already existin gfile will be replaced

Connect with Ansys