Skip to main content

SoS C API of FMOPSolver library 2023 R2

sos_capi_common

Last update: 16.07.2025
Go to the documentation of this file.
1 
2 #ifndef DYNARDO_SOS_CAPI_COMMON_H
3  #define DYNARDO_SOS_CAPI_COMMON_H
4 
6 
7 // Generic helper definitions for shared library support
8 //#if (defined _WIN32 || defined __CYGWIN__) && (not defined MINGW)
9 #if defined _WIN32 || defined __CYGWIN__
10  #define DYNARDO_HELPER_DLL_IMPORT __declspec(dllimport)
11  #define DYNARDO_HELPER_DLL_EXPORT __declspec(dllexport)
12  #define DYNARDO_HELPER_DLL_LOCAL
13 #else
14  #if __GNUC__ >= 4
15  #define DYNARDO_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
16  #define DYNARDO_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
17  #define DYNARDO_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
18  #else
19  #define DYNARDO_HELPER_DLL_IMPORT
20  #define DYNARDO_HELPER_DLL_EXPORT
21  #define DYNARDO_HELPER_DLL_LOCAL
22  #endif
23 #endif
24 
25 // Now we use the generic helper definitions above to define DYNARDO_FMOP_API and DYNARDO_FMOP_LOCAL.
26 // DYNARDO_FMOP_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing
27 // for static build)
28 // DYNARDO_FMOP_LOCAL is used for non-api symbols.
29 
30 #ifdef DYNARDO_DLL // defined if the library is compiled as a DLL
31  #ifdef DYNARDO_FMOP_DLL_EXPORTS // defined if we are building the DYNARDO DLL (instead of using it)
32  #define DYNARDO_FMOP_API DYNARDO_HELPER_DLL_EXPORT
33  #else
34  #define DYNARDO_FMOP_API DYNARDO_HELPER_DLL_IMPORT
35  #endif // DYNARDO_FMOP_DLL_EXPORTS
36  #define DYNARDO_FMOP_LOCAL DYNARDO_HELPER_DLL_LOCAL
37 #else // DYNARDO_DLL is not defined: this means we compile a static lib.
38  #define DYNARDO_FMOP_API
39  #define DYNARDO_FMOP_LOCAL
40 #endif // DYNARDO_DLL
41 
42 #ifndef __cplusplus
43  #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
44  #include <stdbool.h>
45  #elif !defined(false) && !defined(true)
46  typedef int bool;
47  #define false 0
48  #define true 1
49  #endif
50  #include <stddef.h>
51 #else
52  #include <cstddef>
53 #endif
54 
55 
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
62 
67 
68 /*********************************************/
75 
79 typedef enum
80 {
90 
92 
93  fmop_const_max = 16383
94 
96 
100 typedef enum
101 {
102  // Mesh related features
103  // Predefined feature combinations
105  fmop_mesh_all = 30
107 
111 typedef enum
112 {
115  fmop_scalar_data = 3
117 
118 
120 
121 /*********************************************/
127 
145 DYNARDO_FMOP_API fmop_error_t FMOP_appendLicenseSearchPath ( const char * abs_path );
156 DYNARDO_FMOP_API fmop_error_t FMOP_acquireLicense ( );
161 DYNARDO_FMOP_API bool FMOP_licenseLocked ();
173 DYNARDO_FMOP_API fmop_error_t FMOP_releaseLicense ();
174 
176 
177 
178 /*********************************************/
184 
199 DYNARDO_FMOP_API const char* FMOP_getLastErrorString ();
205 DYNARDO_FMOP_API fmop_error_t FMOP_getLastErrno ();
215 DYNARDO_FMOP_API const char* FMOP_getLastErrnoString ();
216 
229 DYNARDO_FMOP_API const char* FMOP_getLastLogString ();
246 DYNARDO_FMOP_API int FMOP_setLogLevel ( int log_level );
247 
259 DYNARDO_FMOP_API const char* FMOP_getErrnoString ( fmop_error_t error_num );
260 
262 
263 /*********************************************/
268 
275 DYNARDO_FMOP_API const char* FMOP_getVersionString ();
276 
278 
279 /*********************************************/
284 
293 DYNARDO_FMOP_API fmop_error_t FMOP_unloadLibrary();
294 
295 #ifdef __cplusplus
296 }
297 #endif
298 
299 #endif // DYNARDO_SOS_CAPI_COMMON_H
300 
301 // (c) 2017, DYNARDO Austria GmbH (proprietary license)
DYNARDO_FMOP_API fmop_error_t FMOP_acquireLicense()
Acquires an optiSLang enterprise license.
DYNARDO_FMOP_API bool FMOP_licenseLocked()
Check whether any license feature was acquired.
fmop_error_t
Error code definitions.
Definition: sos_capi_common.h:80
@ fmop_script_wrong_type
Object with ident has wrong type.
Definition: sos_capi_common.h:89
@ fmop_settings_error
Input argument(s) is invalid or missing.
Definition: sos_capi_common.h:84
@ fmop_success
Function execution returned successfully.
Definition: sos_capi_common.h:81
@ fmop_const_max
2^14-1 non-modifiable for each API version
Definition: sos_capi_common.h:93
@ fmop_script_no_object
Object with ident not found in script engine.
Definition: sos_capi_common.h:88
@ fmop_not_implemented
This function is yet not implemented or has been removed.
Definition: sos_capi_common.h:91
@ fmop_script_error
An error appeare while executing Lua script.
Definition: sos_capi_common.h:87
@ fmop_invalid_handle
The function got an unexpected NULL pointer.
Definition: sos_capi_common.h:82
@ fmop_license_error
No valid license available.
Definition: sos_capi_common.h:86
@ fmop_exception_occurred
An internal error occurred. Request log messages.
Definition: sos_capi_common.h:83
@ fmop_model_missing
The requested model identifier is not known.
Definition: sos_capi_common.h:85
DYNARDO_FMOP_API const char * FMOP_getVersionString()
Returns a version string.
DYNARDO_FMOP_API const char * FMOP_getLastErrorString()
Returns internal log messages of level warning and above.
DYNARDO_FMOP_API fmop_error_t FMOP_releaseLicense()
Release the acquired license.
fmop_dataobject_types
Data type definitions.
Definition: sos_capi_common.h:112
@ fmop_scalar_data
scalar data (vector of size 1)
Definition: sos_capi_common.h:115
@ fmop_element_data
element data (one scalar per element)
Definition: sos_capi_common.h:114
@ fmop_node_data
node data (one scalar per node)
Definition: sos_capi_common.h:113
DYNARDO_FMOP_API fmop_error_t FMOP_appendLicenseSearchPath(const char *abs_path)
Appends another license search path to the default ones.
DYNARDO_FMOP_API const char * FMOP_getErrnoString(fmop_error_t error_num)
Returns a string description for the error number given.
DYNARDO_FMOP_API fmop_error_t FMOP_initializeLibrary()
Initialize the FMOP library Allocates memory for the global script engine. Call FMOP_unloadLibrary() ...
DYNARDO_FMOP_API const char * FMOP_getLastErrnoString()
Returns a pointer to a string that describes the error code which has been set at the last library ca...
DYNARDO_FMOP_API int FMOP_setLogLevel(int log_level)
Defines the new log level filter. Valid for all subsequent library calls until a new log level gets s...
DYNARDO_FMOP_API fmop_error_t FMOP_getLastErrno()
Returns the error number which has been set at the last library call.
DYNARDO_FMOP_API const char * FMOP_getLastLogString()
Returns internal log messages of log levels defined by FMOP_setLogLevel. Serves as debug logger.
DYNARDO_FMOP_API fmop_error_t FMOP_unloadLibrary()
Unload the FMOP library Clears the FMOP library from memory. A warning is logged if the library was u...
fmop_license_t
FMOP mesh features which need to be unlocked by a valid license.
Definition: sos_capi_common.h:101
@ fmop_mesh_signal
Unlocks signal meshes.
Definition: sos_capi_common.h:104
@ fmop_mesh_all
Unlocks all mesh features.
Definition: sos_capi_common.h:105

Connect with Ansys