Skip to main content

optiSLang MOPSolver API 2024 R1

/home/lgraenin/develop/optiSLang/protos/mopsolver/mopsolver_api2.h File Reference

Last update: 10.07.2023

Go to the source code of this file.

Functions

DYNARDO_MOPSOLVER_API int dmop2_hasSurrogate (const char *_omdbfile)
 
DYNARDO_MOPSOLVER_API int dmop2_getDimensions (const char *_omdbfile, unsigned int _flags, unsigned int *_dimensions, unsigned int _size_dimensions)
 
DYNARDO_MOPSOLVER_API int dmop2_solve (const char *_omdbfile, unsigned int _num_designs, const double *_inputs, unsigned int _size_inputs, unsigned int _flags, double *_responses, unsigned int _size_responses)
 
DYNARDO_MOPSOLVER_API int dmop2_get_per_response (const char *_omdbfile, unsigned int _num_designs, const double *_inputs, unsigned int _size_inputs, const char *_response_name, unsigned int _flags, double *_responses, unsigned int _size_responses)
 
DYNARDO_MOPSOLVER_API int dmop2_getNames (const char *_omdbfile, DMOP2_NAME_FLAG _flag, char **_names)
 
DYNARDO_MOPSOLVER_API int dmop2_getNamesWithDelimiter (const char *_omdbfile, DMOP2_NAME_FLAG _flag, char **_names, const char *_delimiter)
 
DYNARDO_MOPSOLVER_API int dmop2_getInputBounds (const char *_omdbfile, double *_limits)
 
DYNARDO_MOPSOLVER_API int dmop2_getInputBoundsPerParameter (const char *_omdbfile, const char *_param_name, double *_limits)
 
DYNARDO_MOPSOLVER_API int dmop2_getReferenceValuePerParameter (const char *_omdbfile, const char *_param_name, double *_ref_val)
 
DYNARDO_MOPSOLVER_API int dmop2_getCoPValuesPerResponse (const char *_omdbfile, const char *_response_name, double *_cop_vals)
 
DYNARDO_MOPSOLVER_API int dmop2_getFilteredStatesPerResponse (const char *_omdbfile, const char *_response_name, int *_filtered_states)
 

Detailed Description

Version
$Rev$

Function Documentation

◆ dmop2_get_per_response()

DYNARDO_MOPSOLVER_API int dmop2_get_per_response ( const char *  _omdbfile,
unsigned int  _num_designs,
const double *  _inputs,
unsigned int  _size_inputs,
const char *  _response_name,
unsigned int  _flags,
double *  _responses,
unsigned int  _size_responses 
)

approximates the active response values based on their best metamodel for any given design point

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_num_designsnumber of design points for which response values should be approximated
[in]_inputspointer to array of consecutive input values per design point. The length of the array is to be expected as ( _num_designs * dmop_getDimensions._num_inputs )
[in]_size_inputsnumber of elements of _inputs
[in]_response_namezero terminated character string containing the name of the response
[in]_flagsinteger value representing the set flags (see enum DMOP_PER_RESPONSE_FLAG)
[out]_responsespointer to array of consecutive response values approximated per design point. The length and order of the array depends on set flags: 1: RESP_GRADIENTS : Number of designs * number of inputs 2: RESP_DENSITIES : Number of designs 3: RESP_ERRORS : Number of designs * 4
[in]_size_responsesthe number of elements of the preallocated response array
Returns
zero if the approximation succeeded

◆ dmop2_getCoPValuesPerResponse()

DYNARDO_MOPSOLVER_API int dmop2_getCoPValuesPerResponse ( const char *  _omdbfile,
const char *  _response_name,
double *  _cop_vals 
)

retrieves the CoP values for given response.

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_response_namezero terminated character string containing the name of the response
[out]_cop_valspointer to array of CoP values, containing single CoP values for each parameter plus the total CoP. The length of the array is to be expected dmop_getDimensions._num_inputs+1.
Returns
zero if the name arrays were created and filled

◆ dmop2_getDimensions()

DYNARDO_MOPSOLVER_API int dmop2_getDimensions ( const char *  _omdbfile,
unsigned int  _flags,
unsigned int *  _dimensions,
unsigned int  _size_dimensions 
)

retrieves problem dimensions based on the flags

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_flagsuint value representing the specified flags (see enum DMOP_DIMENSION_FLAG)
[out]_dimensionspreallocated uint array for returning the dimensions. The length and order of the array depends on set flags: 1: DIM_INPUTS : 1 2: DIM_OUTPUTS : 1 3: DIM_CRITERIA : 1
[in]_size_dimensionsnumber of elements of the preallocated dimensions array
Returns
zero if the dimensions could be determined

◆ dmop2_getFilteredStatesPerResponse()

DYNARDO_MOPSOLVER_API int dmop2_getFilteredStatesPerResponse ( const char *  _omdbfile,
const char *  _response_name,
int *  _filtered_states 
)

retrieves the filtered states for given response.

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_response_namezero terminated character string containing the name of the response
[out]_filtered_statespointer to array of filtered states, 0 is not filtered, 1 is filtered, if the last entry is 1 this means that there is no total CoP. The length of the array is to be expected dmop_getDimensions._num_inputs+1.
Returns
zero if the name arrays were created and filled

◆ dmop2_getInputBounds()

DYNARDO_MOPSOLVER_API int dmop2_getInputBounds ( const char *  _omdbfile,
double *  _limits 
)

retrieves the sampling bounds for all parameters. The array size depends on the number of inputs.

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[out]_limitspointer to array of parameter limits, been given alternetly min1, max1, min2, max2 ... . The length of the array is to be expected as ( 2 * dmop_getDimensions._num_inputs ).
Returns
zero if the name arrays were created and filled

◆ dmop2_getInputBoundsPerParameter()

DYNARDO_MOPSOLVER_API int dmop2_getInputBoundsPerParameter ( const char *  _omdbfile,
const char *  _param_name,
double *  _limits 
)

retrieves the sampling bounds for given parameters.

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_param_namezero terminated character string containing the name of the parameter
[out]_limitspointer to array of parameter limits, first element is min, second is max. The length of the array is 2.
Returns
zero if the name arrays were created and filled

◆ dmop2_getNames()

DYNARDO_MOPSOLVER_API int dmop2_getNames ( const char *  _omdbfile,
DMOP2_NAME_FLAG  _flag,
char **  _names 
)

retrieves the names of all criteria. The array sizes depend on the number of criteria determined in dmop_getDimensions

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_flagDMOP_NAME_FLAG value specifying which names to return (see enum DMOP_NAME_FLAG)
[out]_namesthis must be null on the method call. It is created internally and will contain the names after the call. It is required to manually free the memory, e.g. by calling dmop_free2(void*)
Returns
zero if the name arrays were created and filled

◆ dmop2_getNamesWithDelimiter()

DYNARDO_MOPSOLVER_API int dmop2_getNamesWithDelimiter ( const char *  _omdbfile,
DMOP2_NAME_FLAG  _flag,
char **  _names,
const char *  _delimiter 
)

retrieves the names of all criteria. The array sizes depend on the number of criteria determined in dmop_getDimensions

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_flagDMOP_NAME_FLAG value specifying which names to return (see enum DMOP_NAME_FLAG)
[out]_namesthis must be null on the method call. It is created internally and will contain the names after the call. It is required to manually free the memory, e.g. by calling dmop_free2(void*)
[in]_delimiterCharacter to use as a delimiter for the different variable names. Can be used to achieve connectivity to different programs which cannot handle '\0' properly. Passing an empty string will use '\0'.
Returns
zero if the name arrays were created and filled

◆ dmop2_getReferenceValuePerParameter()

DYNARDO_MOPSOLVER_API int dmop2_getReferenceValuePerParameter ( const char *  _omdbfile,
const char *  _param_name,
double *  _ref_val 
)

retrieves the Reference Value for given parameter.

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_param_namezero terminated character string containing the name of the parameter
[out]_ref_valpointer to reference value.
Returns
zero if the name arrays were created and filled

◆ dmop2_hasSurrogate()

DYNARDO_MOPSOLVER_API int dmop2_hasSurrogate ( const char *  _omdbfile)

test binfile if it contains Surrogate Data

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang database file (*.omdb) containing MOP
Returns
zero if Surrogate is found

◆ dmop2_solve()

DYNARDO_MOPSOLVER_API int dmop2_solve ( const char *  _omdbfile,
unsigned int  _num_designs,
const double *  _inputs,
unsigned int  _size_inputs,
unsigned int  _flags,
double *  _responses,
unsigned int  _size_responses 
)

approximates the active response values based on their best metamodel for any given design point

Parameters
[in]_omdbfilezero terminated character string containing the filesystem path to the optiSLang monitoring database file (*.omdb) containing MOP
[in]_num_designsnumber of design points for which response values should be approximated
[in]_inputspointer to array of consecutive input values per design point. The length of the array is to be expected as ( _num_designs * dmop_getDimensions._num_inputs )
[in]_size_inputsnumber of elements of _inputs
[in]_flagsinteger value representing the set flags (see enum DMOP_SOLVE_FLAG)
[out]_responsespointer to array of consecutive response values approximated per design point. The length of the array depends on set flags: 1: SOLVE_RESPONSES : Number of designs * number of responses 2: SOLVE_CRITERIA : Number of designs * number of criteria 3: SOLVE_DENSITIES : Number of designs 4: SOLVE_ERRORS : Number of designs * 4
[in]_size_responsesthe size of the preallocated response array
Returns
zero if the approximation succeeded