File fmop_solver.h
Last update: 30.07.2026Location: fmop_solver.h
C-API to evaluate a Field Meta model of Optimal Prognosis (FMOP)
copyright
DYNARDO Austria GmbH
-
This API follows the Basic exception safety rule. If any of the operations fail, the original data, e.g. the fmop_handle*_t, might have been overwritten, but there should be no resource leak.
-
Return values are typically of type fmop_error_t. To get a human readalbe interpretation forward this value to FMOP_getErrnoString() or call FMOP_getLastErrorString(). More information can be found in the Error Handling section
-
Log messages from the SoS kernel are all bufferd in an internal variable. Unless otherwise stated in a function description, this internal variable gets reset(!) right at the beginning of each function call. Therefore, the user is forced into fetching all log messages of interest before proceeding.
!> Warning
Concurrent library calls are NOT supported
!> Warning
Unless otherwise stated, every function call overwrites any log message of any previous function call
Includes
graph LR
1["fmop_solver.h"]
click 1 "fmop__solver_8h.md#fmop__solver_8h"
1 --> 2
2["sos_capi_common.h"]
click 2 "sos__capi__common_8h.md#sos__capi__common_8h"
Included by
graph RL
2["FMOPSolver.h"]
1["fmop_solver.h"]
click 1 "fmop__solver_8h.md#fmop__solver_8h"
2 --> 1
Create / Initialize Data Objects
API handling data object life time
Function FMOP_getModel
DYNARDO_FMOP_API fmop_error_t FMOP_getModel(fmop_db_handle_t database, fmop_dataobject_types data_type, const char *const fmop_ident, fmop_handle_t *fmop)
Loads a fmop_handle_t data object from the database given.
Parameters:
- database: The already initialized database handle
- data_type: The data type in question
- fmop_ident: The FMOP ident to be loaded from the database given
- fmop: On input *fmop must point to NULL. Returns an initialized fmop handle to the requested fmop_ident on output. Pointer ownership is up to the caller after return. Call FMOP_releaseModel (fmop_handle_t *) at the end of lifetime.
Returns:
-
fmop_invalid_handle if the database or fmop_ident argument is a NULL pointer
-
fmop_invalid_handle if the fmop argument does not hold a NULL pointer on input
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to load a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_model_missing if the handle initialization fails
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_initialize() returned fmop_model_success
Returns:
A success indicator. Call FMOP_getErrnoString to get a human readable representation
Parameters:
- fmop_db_handle_t database
- fmop_dataobject_types data_type
- const char *const fmop_ident
- fmop_handle_t * fmop
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_loadDbBuf
DYNARDO_FMOP_API fmop_error_t FMOP_loadDbBuf(fmop_db_handle_t *database, const char *buffer, size_t length)
Initializes a fmop_db_handle_t object from a previously saved Statistics on Structures (SoS) database array.
!> Warning
Draft only. CURRENTLY NOT IMPLEMENTED. Returns fmop_not_implemented
Parameters:
- database: On input *database must point to NULL. Returns an initialized handle to the loaded database on ouptut. The database of the returned handle has been set to the buffer content given. Pointer ownership is up to the caller after return. Call FMOP_releaseDb (fmop_db_handle_t *) at the end of lifetime.
- buffer: A character array
- length: The length of the character array
Returns:
-
fmop_invalid_handle if the database argument does not hold a NULL pointer on input
-
fmop_settings_error if the buffer or length argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to load a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success if the database handle has been initialized successfully
Returns:
Call FMOP_getErrnoString() to get a human readable representation.
Parameters:
- fmop_db_handle_t * database
- const char * buffer
- size_t length
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_loadDbBufWMesh
DYNARDO_FMOP_API fmop_error_t FMOP_loadDbBufWMesh(fmop_db_handle_t *database, const char *buffer, size_t length)
Initializes a fmop_db_handle_t object from a previously saved Statistics on Structures (SoS) database array This function also builds up all internal data structures needed to represent FEM meshes. Hence it may need more CPU time and RAM.
!> Warning
Draft only. CURRENTLY NOT IMPLEMENTED. Returns fmop_not_implemented
Parameters:
- database: On input *database must point to NULL. Returns an initialized handle to the loaded database on ouptut. The database of the returned handle has been set to the buffer content given. Pointer ownership is up to the caller after return. Call FMOP_releaseDb (fmop_db_handle_t *) at the end of lifetime.
- buffer: A character array
- length: The length of the character array
Returns:
-
fmop_invalid_handle if the database argument does not hold a NULL pointer on input
-
fmop_settings_error if the buffer or length argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to load a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success if the database handle has been initialized successfully
Returns:
Call FMOP_getErrnoString() to get a human readable representation.
Parameters:
- fmop_db_handle_t * database
- const char * buffer
- size_t length
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_loadDbFile
DYNARDO_FMOP_API fmop_error_t FMOP_loadDbFile(fmop_db_handle_t *database, const char *path)
Initializes a fmop_db_handle_t object from a previously saved Statistics on Structures (SoS) database.
Parameters:
- database: On input *database must point to NULL. Returns an initialized handle to the loaded database on ouptut. The database of the returned handle has been set to the content of the file path given. Pointer ownership is up to the caller after return. Call FMOP_releaseDb (fmop_db_handle_t *) at the end of lifetime.
- path: The path to the SoS database file as a NULL terminated character array
Returns:
-
fmop_invalid_handle if the database argument does not hold a NULL pointer on input
-
fmop_settings_error if the path argument doesn't point to an existing file
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to load a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success if the fmop_db_handle_t has been initialized successfully
Returns:
Call FMOP_getErrnoString() to get a human readable representation.
Parameters:
- fmop_db_handle_t * database
- const char * path
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_loadDbFileWMesh
DYNARDO_FMOP_API fmop_error_t FMOP_loadDbFileWMesh(fmop_db_handle_t *database, const char *path)
Initializes a fmop_db_handle_t object from a previously saved Statistics on Structures (SoS) database This function also builds up all internal data structures needed to represent FEM meshes. Hence it may need more CPU time and RAM.
Parameters:
- database: On input *database must point to NULL. Returns an initialized handle to the loaded database on ouptut. The database of the returned handle has been set to the content of the file path given. Pointer ownership is up to the caller after return. Call FMOP_releaseDb (fmop_db_handle_t *) at the end of lifetime.
- path: The path to the SoS database file as a NULL terminated character array
Returns:
-
fmop_invalid_handle if the database argument does not hold a NULL pointer on input
-
fmop_settings_error if the path argument doesn't point to an existing file
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to load a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success if the fmop_db_handle_t has been initialized successfully
Returns:
Call FMOP_getErrnoString() to get a human readable representation.
Parameters:
- fmop_db_handle_t * database
- const char * path
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_releaseDb
DYNARDO_FMOP_API fmop_error_t FMOP_releaseDb(fmop_db_handle_t *database)
Releases a fmop_db_handle_t object and dedicated memory.
Parameters:
- database: The fmop_db_handle_t to be released. Set to NULLptr on return.
Returns:
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
Parameters:
- fmop_db_handle_t * database
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_releaseIdents
DYNARDO_FMOP_API fmop_error_t FMOP_releaseIdents(char ***const idents, const size_t *num_idents)
An auxiliary function to releases an array of char arrays and dedicated memory.
Parameters:
- idents: A pointer to an array of char arrays. Set to NULLptr on return.
- num_idents: An already initialized scalar data object. Contains the number of idents in the char** array [] given
Returns:
-
fmop_invalid_handle if the array argument is a NULL pointer or if *array points to NULL
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far
-
fmop_settings_error if the num_idents argument is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
Parameters:
- char ***const idents
- const size_t * num_idents
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_releaseModel
DYNARDO_FMOP_API fmop_error_t FMOP_releaseModel(fmop_handle_t *fmop)
Releases a fmop_handle_t object and dedicated memory.
Parameters:
- fmop: The fmop_handle_t to be released. Set to NULLptr on return.
Returns:
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
Parameters:
- fmop_handle_t * fmop
Return type: DYNARDO_FMOP_API fmop_error_t
Query properties
API to query idents and properties of a "Field Meta Model of Optimal Prognosis" (FMOP)
Function FMOP_getDataDim
DYNARDO_FMOP_API fmop_error_t FMOP_getDataDim(const fmop_db_handle_t database, fmop_dataobject_types data_type, size_t *num_mesh_items)
Returns the size of the FCoP vector, aka the number of mesh items.
Parameters:
- database: A successfully initialized fmop_db_handle_t data object
- data_type: The data type to be queried (node, element, scalar)
- num_mesh_items: An already initialized scalar data object. Contains the size of the data vectors for the givvemn data type on return
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the num_mesh_items pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_initialize() returned fmop_model_success
Parameters:
- const fmop_db_handle_t database
- fmop_dataobject_types data_type
- size_t * num_mesh_items
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getDataPointCoors
DYNARDO_FMOP_API fmop_error_t FMOP_getDataPointCoors(fmop_handle_t fmop, char axis, double *coors)
Returns the cartesian data point coordinates for each data point.
Parameters:
-
fmop: A successfully initialized fmop_handle_t data object
-
axis: Controls coordinate output. The following integers are accepted:
-
0... asks for x-coordinates only
-
1... asks for y-coordinates only
-
2... asks for z-coordinates only
-
3... asks for x-, y- and z-coordinates
-
coors: An already initialized array of size
formula {"type":"element","name":"formula","attributes":{"id":"0"},"children":[{"type":"text","text":"$ ( 1 + \\lfloor \\frac{\\mathit{axis}}{3} \\rfloor ) * \\mathit{num\_mesh\_items} $"}]}. Call FMOP_getModelDim() to get num_mesh_items. On output contains the following coordinate values: -
finite element nodes for an FMOP of type fmop_node_data
-
finite elements using their center coordinate in space for an FMOP of type fmop_element_data
-
an FMOP of type fmop_scalar_data invokes an fmop_exception_occurred error Follows the scheme:
formula {"type":"element","name":"formula","attributes":{"id":"1"},"children":[{"type":"text","text":"$ \\mathit{coors} \\lbrack k+ \\mathit{axis} \\bmod 3 \\rbrack $"}]}with
k...internal mesh item ident, e.g. internal signal position, internal element number
Call FMOP_getDataPointIndices() to map internal to external numbering scheme
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the axis parameter is out-of-bounds, or the coors pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
!> Warning
Calling this function for FMOP models of type fmop_element_data multiplies resource consumption!
Parameters:
- fmop_handle_t fmop
- char axis
- double * coors
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getDataPointIndices
DYNARDO_FMOP_API fmop_error_t FMOP_getDataPointIndices(fmop_handle_t fmop, unsigned int *part_ids, unsigned int *item_ids)
Maps internal node/element numbering to the external scheme consisting of part and item ID.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- part_ids: Either an already initialized array of size num_mesh_items as returned by FMOP_getModelDim(), or a NULL pointer. Note, most of the meshes consists of a single part only, e.g. signals. If the argument is initialized, it contains the external part IDs on output. A NULL pointer otherwise
external( internal[k] ) = PART_ID [k], item_id [k]
k...mesh item, e.g. signal position, element number
- item_ids: An already initialized array of size num_mesh_items as returned by FMOP_getModelDim(). On output contains the external node/element ID
external( internal[k] ) = part_id [k], ITEM_ID [k]
k...mesh item, e.g. signal position, element number
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the item_id pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- fmop_handle_t fmop
- unsigned int * part_ids
- unsigned int * item_ids
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getElementsAtNode
DYNARDO_FMOP_API fmop_error_t FMOP_getElementsAtNode(fmop_handle_t fmop, unsigned int node_idx, unsigned int *elements)
Identifies the elements connected to a given node.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- node_idx: the node index (0.. numNodes). This node index refers to the index in the FMOP data vectors.
- elements: An already initialized array of size as returned by FMOP_getNumElementsAtNode(). On output contains the internal element ID that are connected to the given node.
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the item_id pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- fmop_handle_t fmop
- unsigned int node_idx
- unsigned int * elements
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getElementTypeIdent
DYNARDO_FMOP_API const char * FMOP_getElementTypeIdent(fmop_handle_t fmop, unsigned int element_idx)
Identifies the element type ident of a given element.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- element_idx: the element index (0.. numElements). This element index refers to the index in the FMOP data vectors.
Returns:
On success the element type identifier at array position num_ident from the database given, othewise an empty string.
?> Calling this function changes the error number to:
-
fmop_invalid_handle if the database or fmop_idents arguments is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the param_ident pointer does not hold a NULL pointer on input
-
fmop_settings_error if the value of num_param given is greater than, or equal to the size of the param_idents char* array []
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise. Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- fmop_handle_t fmop
- unsigned int element_idx
Return type: DYNARDO_FMOP_API const char *
Function FMOP_getModelAvgFCoP
DYNARDO_FMOP_API fmop_error_t FMOP_getModelAvgFCoP(const fmop_handle_t fmop, double *fcops)
Returns the Field Coefficients of Prognosis per active scalar input parameter.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- fcops: An already initialized array of size num_params as returned by FMOP_getModelNumParams() On output contains the average Field Coefficient of Prognosis per active scalar input parameter Follows the scheme: fcops[i] (i..i'th active scalar input parameter).
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the fcops pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_handle_t fmop
- double * fcops
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getModelDim
DYNARDO_FMOP_API fmop_error_t FMOP_getModelDim(const fmop_handle_t fmop, size_t *num_mesh_items)
Returns the size of the FCoP vector, aka the number of mesh items.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- num_mesh_items: An already initialized scalar data object. Contains the size of the FCoP vector on return
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the num_mesh_items pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_handle_t fmop
- size_t * num_mesh_items
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getModelIdent
DYNARDO_FMOP_API const char * FMOP_getModelIdent(const fmop_db_handle_t database, fmop_dataobject_types data_type, size_t num_ident)
Returns the n-th known FMOP identifier from the fmop_db_handle_t given.
Parameters:
- database: A successfully initialized fmop_db_handle_t data object
- data_type: The data type in question
- num_ident: Defines the position in the fmop_idents char* array []. Notice that the first element has a position of 0
Returns:
On succes the FMOP identifier at array position num_ident from the database given, otherwise an empty string. The returned string will be overwritten by this function at the next call and will be destroyed on program termination
?> Calling this function changes the error number to:
-
fmop_invalid_handle if the database or fmop_idents arguments is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the fmop_idents pointer does not hold a NULL pointer on input
-
fmop_settings_error if the value of num_ident given is greater than, or equal to the size of the fmop_idents char* array []
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise. Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_db_handle_t database
- fmop_dataobject_types data_type
- size_t num_ident
Return type: DYNARDO_FMOP_API const char *
Function FMOP_getModelIdents
DYNARDO_FMOP_API fmop_error_t FMOP_getModelIdents(const fmop_db_handle_t database, fmop_dataobject_types data_type, char ***const fmop_idents, size_t *num_idents)
Returns all known FMOP identifier from the fmop_db_handle_t given.
Parameters:
- database: A successfully initialized fmop_db_handle_t data object
- data_type: The data type in question
- fmop_idents: On input *fmop_idents must point to NULL. On return contains all known FMOP identifier from the database given. Pointer ownership is up to the caller after return. Call FMOP_releaseIdents() at the end of life
- num_idents: An already initialized scalar data object. Contains the number of FMOP idents, aka the size of the fmop_idents char* array []
Returns:
-
fmop_invalid_handle if the database or fmop_idents arguments is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the fmop_idents pointer does not hold a NULL pointer on input
-
fmop_settings_error if the num_idents pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
?> Many languages offers the possiblity to call functions from an external C-library, e.g. Java, python and Matlab. If you are running in some limitations due to our tripple pointer requirement, please use the wrapper functions FMOP_getModelIdentsDim() followed by FMOP_getModelIdent() to query known idents one by one
Parameters:
- const fmop_db_handle_t database
- fmop_dataobject_types data_type
- char ***const fmop_idents
- size_t * num_idents
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getModelIdentsDim
DYNARDO_FMOP_API fmop_error_t FMOP_getModelIdentsDim(const fmop_db_handle_t database, fmop_dataobject_types data_type, size_t *num_idents)
Returns the total number of known FMOP identifiers from the fmop_db_handle_t given.
Parameters:
- database: A successfully initialized fmop_db_handle_t data object
- data_type: The data type in question
- num_idents: An already initialized scalar data object. Contains the number of FMOP idents, aka the size of the fmop_idents char* array []
Returns:
-
fmop_invalid_handle if the database or fmop_idents arguments is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the num_idents pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_db_handle_t database
- fmop_dataobject_types data_type
- size_t * num_idents
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getModelParamIdent
DYNARDO_FMOP_API const char * FMOP_getModelParamIdent(const fmop_handle_t fmop, size_t num_param)
Returns the n-th active parameter identifier from the fmop handle given.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- num_param: Defines the position in the fmop_idents char* array []. Notice that the first element has a position of 0
Returns:
On success the parameter identifier at array position num_ident from the database given, othewise an empty string. The returned string will be overwritten by this function at the next call and will be destroyed on program termination
?> Calling this function changes the error number to:
-
fmop_invalid_handle if the database or fmop_idents arguments is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the param_ident pointer does not hold a NULL pointer on input
-
fmop_settings_error if the value of num_param given is greater than, or equal to the size of the param_idents char* array []
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise. Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_handle_t fmop
- size_t num_param
Return type: DYNARDO_FMOP_API const char *
Function FMOP_getModelParamIdents
DYNARDO_FMOP_API fmop_error_t FMOP_getModelParamIdents(const fmop_handle_t fmop, char ***const param_idents, size_t *num_params)
Returns all active scalar inputer parameters for the fmop handle given.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- param_idents: Requires a NULL pointer on input. On return contains all active scalar input parameters used in the fmop handle given. Pointer ownership is up to the caller after return. Call FMOP_releaseIdents() at the end of life
- num_params: An already initialized scalar data object. Contains the number of active scalar input parameters used in the fmop handle given, aka the size of the param_idents char* array []
Returns:
-
fmop_invalid_handle if the fmop or param_idents arguments is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the param_idents pointer does not hold a NULL pointer on input
-
fmop_settings_error if the num_params pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
?> Many languages offers the possiblity to call functions from an external C-library, e.g. Java, python and Matlab. If you are running in some limitations due to our tripple pointer requirement, please use the wrapper functions FMOP_getModelParamIdentsDim() followed by FMOP_getModelParamIdent() to query known idents one by one
Parameters:
- const fmop_handle_t fmop
- char ***const param_idents
- size_t * num_params
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getModelParamIdentsDim
DYNARDO_FMOP_API fmop_error_t FMOP_getModelParamIdentsDim(const fmop_handle_t fmop, size_t *num_params)
Returns the total number of active parameter identifiers from the fmop handle given.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- num_params: An already initialized scalar data object. Contains the number of active scalar input parameters used in the fmop handle given, aka the size of the param_idents char* array []
Returns:
-
fmop_invalid_handle if the fmop or param_idents arguments is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the num_params pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_handle_t fmop
- size_t * num_params
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getModelTotalAvgFCoP
DYNARDO_FMOP_API fmop_error_t FMOP_getModelTotalAvgFCoP(const fmop_handle_t fmop, double *fcop)
Returns the total average Field Coefficient of Prognosis for the fmop handle given.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- fcop: An already initialized scalar data object on input. On output contains the total average Field Coefficient of Prognosis
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the fcop pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_handle_t fmop
- double * fcop
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getNodesAtElement
DYNARDO_FMOP_API fmop_error_t FMOP_getNodesAtElement(fmop_handle_t fmop, unsigned int element_idx, unsigned int *nodes)
Identifies the nodes connected to a given element.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- element_idx: the element index (0.. numElements). This element index refers to the index in the FMOP data vectors.
- nodes: An already initialized array of size as returned by FMOP_getNumNodesAtElement(). On output contains the internal node ID that are connected to the given element.
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the item_id pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- fmop_handle_t fmop
- unsigned int element_idx
- unsigned int * nodes
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getNumElementsAtNode
DYNARDO_FMOP_API fmop_error_t FMOP_getNumElementsAtNode(fmop_handle_t fmop, unsigned int node_idx, unsigned int *num_elements)
Identifies the elements connected to a given node.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- node_idx: the node index (0.. numNodes). This node index refers to the index in the FMOP data vectors.
- num_elements: a pointer to an unsigned integer number. On output it will contain the number of connected elements.
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the item_id pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- fmop_handle_t fmop
- unsigned int node_idx
- unsigned int * num_elements
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getNumNodesAtElement
DYNARDO_FMOP_API fmop_error_t FMOP_getNumNodesAtElement(fmop_handle_t fmop, unsigned int element_idx, unsigned int *num_nodes)
Identifies the nodes connected to a given element.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- element_idx: the element index (0.. numElements). This element index refers to the index in the FMOP data vectors.
- num_nodes: a pointer to an unsigned integer number. On output it will contain the number of connected nodes.
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the item_id pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- fmop_handle_t fmop
- unsigned int element_idx
- unsigned int * num_nodes
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getParamLowerBounds
DYNARDO_FMOP_API fmop_error_t FMOP_getParamLowerBounds(const fmop_handle_t fmop, double *lower_bounds)
Returns lower bound values of input parameters used to train the FMOP, aka the lower bound values of Design of Experiment input parameters.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- lower_bounds: An already initialized array of size num_params as returned by FMOP_getModelParamIdents() On output contains the vector of lower bound values of all active scalar input parameters used to train the FMOP, e.g. lower_bounds[j] (j..index of the active scalar input parameter).
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the lower_bounds pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString() to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_handle_t fmop
- double * lower_bounds
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_getParamUpperBounds
DYNARDO_FMOP_API fmop_error_t FMOP_getParamUpperBounds(const fmop_handle_t fmop, double *upper_bounds)
Returns upper bound values of input parameters used to train the FMOP, aka the upper bound values of Design of Experiment input parameters.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- upper_bounds: An already initialized array of size num_params as returned by FMOP_getModelParamIdents() On output contains the vector of upper bound values of all active scalar input parameters used to train the FMOP, e.g. upper_bounds[j] (j..index of the active scalar input parameter).
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the upper_bounds pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise.
Returns:
Call FMOP_getErrnoString to get a human readable representation
?> Assumes that FMOP_getModel() returned fmop_success
Parameters:
- const fmop_handle_t fmop
- double * upper_bounds
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_isNodePartOfBoundary
DYNARDO_FMOP_API fmop_error_t FMOP_isNodePartOfBoundary(fmop_handle_t fmop, unsigned int node_idx, unsigned int *is_part_of_boundary)
Identifies if the given node is on the surface.
Parameters:
-
fmop: A successfully initialized fmop_handle_t data object
-
node_idx: the node index (0.. numNodes). This node index refers to the index in the FMOP data vectors.
-
is_part_of_boundary: a pointer to an unsigned integer number. On output it will contain
-
1 if the node is on the boundary
-
0 if the node is not on the boundary
Returns:
-
fmop_invalid_handle if the fmop argument is a NULL pointer
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the item_id pointer is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation
Parameters:
- fmop_handle_t fmop
- unsigned int node_idx
- unsigned int * is_part_of_boundary
Return type: DYNARDO_FMOP_API fmop_error_t
Operations
API used to evalute a Field Meta Model of Optimal Prognosis (FMOP)
Function FMOP_approxField
DYNARDO_FMOP_API fmop_error_t FMOP_approxField(const fmop_handle_t fmop, const double *param_values, double *field)
Approximates a field response based on a vector of given active scalar input parameters.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- param_values: Vector of a single sample of all active scalar input parameters. Size and parameter order are defined by the return values of FMOP_getModelParamIdents()
param_values [j]... the index j matches the parameter input name position returned in the param_idents argument of FMOP_getModelParamIdents()
sizeof ( param_values ) ... must match the num_params argument of FMOP_getModelParamIdents() The values must not be located outside the initial sampling bounds. - field: An already initialized array of size num_mesh_items as returned by FMOP_getModelDim() On output contains the approximated field response.
Follows the scheme:formula {"type":"element","name":"formula","attributes":{"id":"2"},"children":[{"type":"text","text":"$ field[k] $"}]}
k...internal mesh item ident, e.g. internal signal position, internal element number
Call FMOP_getDataPointIndices() to map internal to external numbering scheme
Returns:
-
fmop_invalid_handle if the fmop handle is not allocated.
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the param_values or field array argument is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation. For detailed log messages call FMOP_getLastError() which outputs internal log messages.
Parameters:
- const fmop_handle_t fmop
- const double * param_values
- double * field
Return type: DYNARDO_FMOP_API fmop_error_t
Function FMOP_approxFieldExtrapolate
DYNARDO_FMOP_API fmop_error_t FMOP_approxFieldExtrapolate(const fmop_handle_t fmop, const double *param_values, double *field)
Approximates a field response based on a vector of given active scalar input parameters.
Parameters:
- fmop: A successfully initialized fmop_handle_t data object
- param_values: Vector of a single sample of all active scalar input parameters. Size and parameter order are defined by the return values of FMOP_getModelParamIdents()
param_values [j]... the index j matches the parameter input name position returned in the param_idents argument of FMOP_getModelParamIdents()
sizeof ( param_values ) ... must match the num_params argument of FMOP_getModelParamIdents() The values may be located outside the initial sampling bounds. - field: An already initialized array of size num_mesh_items as returned by FMOP_getModelDim() On output contains the approximated field response.
Follows the scheme:formula {"type":"element","name":"formula","attributes":{"id":"2"},"children":[{"type":"text","text":"$ field[k] $"}]}
k...internal mesh item ident, e.g. internal signal position, internal element number
Call FMOP_getDataPointIndices() to map internal to external numbering scheme
Returns:
-
fmop_invalid_handle if the fmop handle is not allocated.
-
fmop_license_error if a license error occurs, e.g. no license has been acquired so far or one tries to release a 3D mesh but acquired a SoS license for 1D meshes, e.g. signals, only
-
fmop_settings_error if the param_values or field array argument is a NULL pointer
-
fmop_exception_occurred if any other failure get invoked
-
fmop_success elsewise
Returns:
Call FMOP_getErrnoString() to get a human readable representation. For detailed log messages call FMOP_getLastError() which outputs internal log messages.
Parameters:
- const fmop_handle_t fmop
- const double * param_values
- double * field
Return type: DYNARDO_FMOP_API fmop_error_t
Typedefs
Typedef fmop_db_handle_t
Definition: fmop_solver.h (line 42)
typedef void* fmop_db_handle_t
Contains all the data being required to post-process any FMOP.
?> Since we had some unresolved troubles in Matlab using the forward declaration
typedef struct FMOP_Database* fmop_db_handle_t;
we now prefer to write for the public definition 'void*' only
Return type: void *
Typedef fmop_handle_t
Definition: fmop_solver.h (line 53)
typedef void* fmop_handle_t
Contains one specific single or cross correlated FMOP.
?> Since we had some unresolved troubles in Matlab using the forward declaration
typedef struct FMOP* fmop_handle_t;
we now prefer to write for the public defintion 'void*' only
Return type: void *
Source
#ifndef DYNARDO_FMOP_H
#define DYNARDO_FMOP_H
#include "sos_capi_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef DYNARDO_FMOP_DLL_EXPORTS
typedef struct FMOP_Database* fmop_db_handle_t;
#else
typedef void* fmop_db_handle_t;
#endif
#ifdef DYNARDO_FMOP_DLL_EXPORTS
typedef struct FMOP* fmop_handle_t;
#else
typedef void* fmop_handle_t;
#endif
/*********************************************/
DYNARDO_FMOP_API fmop_error_t FMOP_loadDbFile ( fmop_db_handle_t * database, const char* path );
DYNARDO_FMOP_API fmop_error_t FMOP_loadDbFileWMesh ( fmop_db_handle_t * database, const char* path );
#ifndef DOXYGEN_IGNORE
DYNARDO_FMOP_API fmop_error_t FMOP_loadDbBuf
( fmop_db_handle_t * database, const char* buffer, size_t length );
DYNARDO_FMOP_API fmop_error_t FMOP_loadDbBufWMesh
( fmop_db_handle_t * database, const char* buffer, size_t length );
#endif
DYNARDO_FMOP_API fmop_error_t FMOP_getModel ( fmop_db_handle_t database, fmop_dataobject_types data_type,
const char * const fmop_ident, fmop_handle_t * fmop );
DYNARDO_FMOP_API fmop_error_t FMOP_releaseModel ( fmop_handle_t * fmop );
DYNARDO_FMOP_API fmop_error_t FMOP_releaseDb ( fmop_db_handle_t * database );
DYNARDO_FMOP_API fmop_error_t FMOP_releaseIdents ( char *** const idents, const size_t * num_idents );
/*********************************************/
DYNARDO_FMOP_API fmop_error_t FMOP_getModelIdents
( const fmop_db_handle_t database, fmop_dataobject_types data_type, char *** const fmop_idents, size_t * num_idents );
DYNARDO_FMOP_API fmop_error_t FMOP_getModelIdentsDim
( const fmop_db_handle_t database, fmop_dataobject_types data_type, size_t * num_idents );
DYNARDO_FMOP_API const char * FMOP_getModelIdent
( const fmop_db_handle_t database, fmop_dataobject_types data_type, size_t num_ident );
DYNARDO_FMOP_API fmop_error_t FMOP_getModelParamIdents
( const fmop_handle_t fmop, char *** const param_idents, size_t * num_params );
DYNARDO_FMOP_API fmop_error_t FMOP_getModelParamIdentsDim ( const fmop_handle_t fmop, size_t * num_params );
DYNARDO_FMOP_API const char * FMOP_getModelParamIdent ( const fmop_handle_t fmop, size_t num_param );
DYNARDO_FMOP_API fmop_error_t FMOP_getParamLowerBounds ( const fmop_handle_t fmop, double * lower_bounds );
DYNARDO_FMOP_API fmop_error_t FMOP_getParamUpperBounds ( const fmop_handle_t fmop, double * upper_bounds );
DYNARDO_FMOP_API fmop_error_t FMOP_getModelTotalAvgFCoP ( const fmop_handle_t fmop, double * fcop );
DYNARDO_FMOP_API fmop_error_t FMOP_getModelAvgFCoP ( const fmop_handle_t fmop, double * fcops );
DYNARDO_FMOP_API fmop_error_t FMOP_getModelDim ( const fmop_handle_t fmop, size_t * num_mesh_items );
DYNARDO_FMOP_API fmop_error_t FMOP_getDataDim ( const fmop_db_handle_t database, fmop_dataobject_types data_type, size_t * num_mesh_items );
DYNARDO_FMOP_API fmop_error_t FMOP_getDataPointIndices ( fmop_handle_t fmop, unsigned int * part_ids, unsigned int * item_ids );
DYNARDO_FMOP_API fmop_error_t FMOP_getDataPointCoors (fmop_handle_t fmop, char axis, double * coors );
DYNARDO_FMOP_API fmop_error_t FMOP_getNumElementsAtNode ( fmop_handle_t fmop, unsigned int node_idx, unsigned int * num_elements );
DYNARDO_FMOP_API fmop_error_t FMOP_getElementsAtNode ( fmop_handle_t fmop, unsigned int node_idx, unsigned int * elements );
DYNARDO_FMOP_API fmop_error_t FMOP_isNodePartOfBoundary (fmop_handle_t fmop, unsigned int node_idx, unsigned int * is_part_of_boundary);
DYNARDO_FMOP_API fmop_error_t FMOP_getNumNodesAtElement ( fmop_handle_t fmop, unsigned int element_idx, unsigned int * num_nodes );
DYNARDO_FMOP_API fmop_error_t FMOP_getNodesAtElement ( fmop_handle_t fmop, unsigned int element_idx, unsigned int * nodes );
DYNARDO_FMOP_API const char * FMOP_getElementTypeIdent ( fmop_handle_t fmop, unsigned int element_idx );
/*********************************************/
DYNARDO_FMOP_API fmop_error_t FMOP_approxField
( const fmop_handle_t fmop, const double * param_values, double * field );
DYNARDO_FMOP_API fmop_error_t FMOP_approxFieldExtrapolate
( const fmop_handle_t fmop, const double * param_values, double * field );
#ifdef __cplusplus
}
#endif
#endif // DYNARDO_FMOP_H
// (c) 2017, DYNARDO Austria GmbH (proprietary license)