Skip to main content

optiSLang C API of FMOPSolver Library 2025 R1

Data handling

Last update: 10.02.2025

Create / Initialize Data Objects

API handling data object life time

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. More...
 
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. More...
 
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. More...
 
DYNARDO_FMOP_API fmop_error_t FMOP_releaseModel (fmop_handle_t *fmop)
 Releases a fmop_handle_t object and dedicated memory. More...
 
DYNARDO_FMOP_API fmop_error_t FMOP_releaseDb (fmop_db_handle_t *database)
 Releases a fmop_db_handle_t object and dedicated memory. More...
 
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. More...
 

Detailed Description

Function Documentation

◆ 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
[in]databaseThe already initialized database handle
[in]data_typeThe data type in question
[in]fmop_identThe FMOP ident to be loaded from the database given
[in,out]fmopOn 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
Call FMOP_getErrnoString() to get a human readable representation
Note
Assumes that FMOP_initialize() returned fmop_model_success
Returns
A success indicator. Call FMOP_getErrnoString to get a human readable representation

◆ 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
[in,out]databaseOn 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.
[in]pathThe 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
Call FMOP_getErrnoString() to get a human readable representation.

◆ 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
[in,out]databaseOn 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.
[in]pathThe 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
Call FMOP_getErrnoString() to get a human readable representation.

◆ 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
[in,out]databaseThe fmop_db_handle_t to be released. Set to NULLptr on return.
Returns
Call FMOP_getErrnoString() to get a human readable representation

◆ 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
[in,out]identsA pointer to an array of char arrays. Set to NULLptr on return.
[in]num_identsAn already initialized scalar data object. Contains the number of idents in the char** array [] given
Returns
Call FMOP_getErrnoString() to get a human readable representation

◆ FMOP_releaseModel()

DYNARDO_FMOP_API fmop_error_t FMOP_releaseModel ( fmop_handle_t *  fmop)

Releases a fmop_handle_t object and dedicated memory.

Parameters
[in,out]fmopThe fmop_handle_t to be released. Set to NULLptr on return.
Returns
Call FMOP_getErrnoString() to get a human readable representation

Connect with Ansys