FMI Library: part of JModelica.org
Functions
General information retrieval

Functions for retrieving general model information. Memory for the strings is allocated and deallocated in the module. All the functions take an FMU object as returned by fmi2_import_parse_xml() as a parameter. The information is retrieved from the XML file. More...

Functions

FMILIB_EXPORT const char * fmi2_import_get_model_name (fmi2_import_t *fmu)
 Get model name. More...
 
FMILIB_EXPORT unsigned int fmi2_import_get_capability (fmi2_import_t *, fmi2_capabilities_enu_t id)
 Retrieve capability flags by ID. More...
 
FMILIB_EXPORT const char * fmi2_import_get_model_identifier_ME (fmi2_import_t *fmu)
 Get model identifier for ModelExchange. More...
 
FMILIB_EXPORT const char * fmi2_import_get_model_identifier_CS (fmi2_import_t *fmu)
 Get model identifier for CoSimulation. More...
 
FMILIB_EXPORT const char * fmi2_import_get_GUID (fmi2_import_t *fmu)
 Get FMU GUID. More...
 
FMILIB_EXPORT const char * fmi2_import_get_description (fmi2_import_t *fmu)
 Get FMU description. More...
 
FMILIB_EXPORT const char * fmi2_import_get_author (fmi2_import_t *fmu)
 Get FMU author. More...
 
FMILIB_EXPORT const char * fmi2_import_get_copyright (fmi2_import_t *fmu)
 Get FMU copyright information. More...
 
FMILIB_EXPORT const char * fmi2_import_get_license (fmi2_import_t *fmu)
 Get FMU license information. More...
 
FMILIB_EXPORT const char * fmi2_import_get_model_version (fmi2_import_t *fmu)
 Get FMU version. More...
 
FMILIB_EXPORT const char * fmi2_import_get_model_standard_version (fmi2_import_t *fmu)
 Get FMI standard version (always 2.0). More...
 
FMILIB_EXPORT const char * fmi2_import_get_generation_tool (fmi2_import_t *fmu)
 Get FMU generation tool. More...
 
FMILIB_EXPORT const char * fmi2_import_get_generation_date_and_time (fmi2_import_t *fmu)
 Get FMU generation date and time. More...
 
FMILIB_EXPORT fmi2_variable_naming_convension_enu_t fmi2_import_get_naming_convention (fmi2_import_t *fmu)
 Get variable naming convention used. More...
 
FMILIB_EXPORT size_t fmi2_import_get_number_of_continuous_states (fmi2_import_t *fmu)
 Get the number of continuous states. More...
 
FMILIB_EXPORT size_t fmi2_import_get_number_of_event_indicators (fmi2_import_t *fmu)
 Get the number of event indicators. More...
 
FMILIB_EXPORT double fmi2_import_get_default_experiment_start (fmi2_import_t *fmu)
 Get the start time for default experiment as specified in the XML file. More...
 
FMILIB_EXPORT double fmi2_import_get_default_experiment_stop (fmi2_import_t *fmu)
 Get the stop time for default experiment as specified in the XML file. More...
 
FMILIB_EXPORT double fmi2_import_get_default_experiment_tolerance (fmi2_import_t *fmu)
 Get the tolerance for default experiment as specified in the XML file. More...
 
FMILIB_EXPORT double fmi2_import_get_default_experiment_step (fmi2_import_t *fmu)
 Get the step size for default experiment as specified in the XML file. More...
 
FMILIB_EXPORT fmi2_fmu_kind_enu_t fmi2_import_get_fmu_kind (fmi2_import_t *fmu)
 Get the type of the FMU (model exchange or co-simulation) More...
 
FMILIB_EXPORT fmi2_import_type_definitions_t * fmi2_import_get_type_definitions (fmi2_import_t *)
 Get the list of all the type definitions in the model. More...
 
FMILIB_EXPORT fmi2_import_unit_definitions_t * fmi2_import_get_unit_definitions (fmi2_import_t *fmu)
 Get a list of all the unit definitions in the model. More...
 
FMILIB_EXPORT fmi2_import_variable_t * fmi2_import_get_variable_alias_base (fmi2_import_t *fmu, fmi2_import_variable_t *)
 Get the variable with the same value reference that is not an alias. More...
 
FMILIB_EXPORT fmi2_import_variable_list_t * fmi2_import_get_variable_aliases (fmi2_import_t *fmu, fmi2_import_variable_t *)
 
FMILIB_EXPORT fmi2_import_variable_list_t * fmi2_import_get_variable_list (fmi2_import_t *fmu, int sortOrder)
 Get the list of all the variables in the model. More...
 
FMILIB_EXPORT fmi2_import_variable_list_t * fmi2_import_create_var_list (fmi2_import_t *fmu, fmi2_import_variable_t *v)
 Create a variable list with a single variable. More...
 
FMILIB_EXPORT size_t fmi2_import_get_vendors_num (fmi2_import_t *fmu)
 Get the number of vendors that had annotations in the XML. More...
 
FMILIB_EXPORT const char * fmi2_import_get_vendor_name (fmi2_import_t *fmu, size_t index)
 Get the name of the vendor with that had annotations in the XML by index. More...
 
FMILIB_EXPORT size_t fmi2_import_get_log_categories_num (fmi2_import_t *fmu)
 Get the number of log categories defined in the XML. More...
 
FMILIB_EXPORT const char * fmi2_import_get_log_category (fmi2_import_t *fmu, size_t index)
 Get the log category by index. More...
 
FMILIB_EXPORT const char * fmi2_import_get_log_category_description (fmi2_import_t *fmu, size_t index)
 Get the log category description by index. More...
 
FMILIB_EXPORT size_t fmi2_import_get_source_files_me_num (fmi2_import_t *fmu)
 Get the number of source files for ME defined in the XML. More...
 
FMILIB_EXPORT const char * fmi2_import_get_source_file_me (fmi2_import_t *fmu, size_t index)
 Get the ME source file by index. More...
 
FMILIB_EXPORT size_t fmi2_import_get_source_files_cs_num (fmi2_import_t *fmu)
 Get the number of source files for CS defined in the XML. More...
 
FMILIB_EXPORT const char * fmi2_import_get_source_file_cs (fmi2_import_t *fmu, size_t index)
 Get the CS source file by index. More...
 
FMILIB_EXPORT fmi2_import_variable_t * fmi2_import_get_variable_by_name (fmi2_import_t *fmu, const char *name)
 Get variable by variable name. More...
 
FMILIB_EXPORT fmi2_import_variable_t * fmi2_import_get_variable_by_vr (fmi2_import_t *fmu, fmi2_base_type_enu_t baseType, fmi2_value_reference_t vr)
 Get variable by value reference. More...
 
FMILIB_EXPORT fmi2_import_variable_list_t * fmi2_import_get_outputs_list (fmi2_import_t *fmu)
 Get the list of all the output variables in the model. More...
 
FMILIB_EXPORT fmi2_import_variable_list_t * fmi2_import_get_derivatives_list (fmi2_import_t *fmu)
 Get the list of all the derivative variables in the model. More...
 
FMILIB_EXPORT fmi2_import_variable_list_t * fmi2_import_get_discrete_states_list (fmi2_import_t *fmu)
 Get the list of all the discrete state variables in the model. More...
 
FMILIB_EXPORT fmi2_import_variable_list_t * fmi2_import_get_initial_unknowns_list (fmi2_import_t *fmu)
 Get the list of all the initial unknown variables in the model. More...
 
FMILIB_EXPORT void fmi2_import_get_outputs_dependencies (fmi2_import_t *fmu, size_t **startIndex, size_t **dependency, char **factorKind)
 Get dependency information in row-compressed format. More...
 
FMILIB_EXPORT void fmi2_import_get_derivatives_dependencies (fmi2_import_t *fmu, size_t **startIndex, size_t **dependency, char **factorKind)
 Get dependency information in row-compressed format. More...
 
FMILIB_EXPORT void fmi2_import_get_discrete_states_dependencies (fmi2_import_t *fmu, size_t **startIndex, size_t **dependency, char **factorKind)
 Get dependency information in row-compressed format. More...
 
FMILIB_EXPORT void fmi2_import_get_initial_unknowns_dependencies (fmi2_import_t *fmu, size_t **startIndex, size_t **dependency, char **factorKind)
 Get dependency information in row-compressed format. More...
 

Detailed Description

Functions for retrieving general model information. Memory for the strings is allocated and deallocated in the module. All the functions take an FMU object as returned by fmi2_import_parse_xml() as a parameter. The information is retrieved from the XML file.

Function Documentation

FMILIB_EXPORT const char* fmi2_import_get_model_name ( fmi2_import_t *  fmu)

Get model name.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT unsigned int fmi2_import_get_capability ( fmi2_import_t *  ,
fmi2_capabilities_enu_t  id 
)

Retrieve capability flags by ID.

FMILIB_EXPORT const char* fmi2_import_get_model_identifier_ME ( fmi2_import_t *  fmu)

Get model identifier for ModelExchange.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_model_identifier_CS ( fmi2_import_t *  fmu)

Get model identifier for CoSimulation.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_GUID ( fmi2_import_t *  fmu)

Get FMU GUID.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_description ( fmi2_import_t *  fmu)

Get FMU description.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_author ( fmi2_import_t *  fmu)

Get FMU author.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_copyright ( fmi2_import_t *  fmu)

Get FMU copyright information.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_license ( fmi2_import_t *  fmu)

Get FMU license information.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_model_version ( fmi2_import_t *  fmu)

Get FMU version.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_model_standard_version ( fmi2_import_t *  fmu)

Get FMI standard version (always 2.0).

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_generation_tool ( fmi2_import_t *  fmu)

Get FMU generation tool.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT const char* fmi2_import_get_generation_date_and_time ( fmi2_import_t *  fmu)

Get FMU generation date and time.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT fmi2_variable_naming_convension_enu_t fmi2_import_get_naming_convention ( fmi2_import_t *  fmu)

Get variable naming convention used.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().
FMILIB_EXPORT size_t fmi2_import_get_number_of_continuous_states ( fmi2_import_t *  fmu)

Get the number of continuous states.

FMILIB_EXPORT size_t fmi2_import_get_number_of_event_indicators ( fmi2_import_t *  fmu)

Get the number of event indicators.

FMILIB_EXPORT double fmi2_import_get_default_experiment_start ( fmi2_import_t *  fmu)

Get the start time for default experiment as specified in the XML file.

FMILIB_EXPORT double fmi2_import_get_default_experiment_stop ( fmi2_import_t *  fmu)

Get the stop time for default experiment as specified in the XML file.

FMILIB_EXPORT double fmi2_import_get_default_experiment_tolerance ( fmi2_import_t *  fmu)

Get the tolerance for default experiment as specified in the XML file.

FMILIB_EXPORT double fmi2_import_get_default_experiment_step ( fmi2_import_t *  fmu)

Get the step size for default experiment as specified in the XML file.

FMILIB_EXPORT fmi2_fmu_kind_enu_t fmi2_import_get_fmu_kind ( fmi2_import_t *  fmu)

Get the type of the FMU (model exchange or co-simulation)

FMILIB_EXPORT fmi2_import_type_definitions_t* fmi2_import_get_type_definitions ( fmi2_import_t *  )

Get the list of all the type definitions in the model.

FMILIB_EXPORT fmi2_import_unit_definitions_t* fmi2_import_get_unit_definitions ( fmi2_import_t *  fmu)

Get a list of all the unit definitions in the model.

FMILIB_EXPORT fmi2_import_variable_t* fmi2_import_get_variable_alias_base ( fmi2_import_t *  fmu,
fmi2_import_variable_t *   
)

Get the variable with the same value reference that is not an alias.

FMILIB_EXPORT fmi2_import_variable_list_t* fmi2_import_get_variable_aliases ( fmi2_import_t *  fmu,
fmi2_import_variable_t *   
)

Get the list of all the variables aliased to the given one (including the base one).

Note that the list is ordered: base variable, aliases, negated aliases.

FMILIB_EXPORT fmi2_import_variable_list_t* fmi2_import_get_variable_list ( fmi2_import_t *  fmu,
int  sortOrder 
)

Get the list of all the variables in the model.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
sortOrderSpecifies the order of the variables in the list: 0 - original order as found in the XML file; 1 - sorted alfabetically by variable name; 2 sorted by types/value references.
Returns
a variable list with all the variables in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

FMILIB_EXPORT fmi2_import_variable_list_t* fmi2_import_create_var_list ( fmi2_import_t *  fmu,
fmi2_import_variable_t *  v 
)

Create a variable list with a single variable.

Parameters
fmuAn FMU object that this variable list will reference.
vA variable.
FMILIB_EXPORT size_t fmi2_import_get_vendors_num ( fmi2_import_t *  fmu)

Get the number of vendors that had annotations in the XML.

FMILIB_EXPORT const char* fmi2_import_get_vendor_name ( fmi2_import_t *  fmu,
size_t  index 
)

Get the name of the vendor with that had annotations in the XML by index.

FMILIB_EXPORT size_t fmi2_import_get_log_categories_num ( fmi2_import_t *  fmu)

Get the number of log categories defined in the XML.

FMILIB_EXPORT const char* fmi2_import_get_log_category ( fmi2_import_t *  fmu,
size_t  index 
)

Get the log category by index.

FMILIB_EXPORT const char* fmi2_import_get_log_category_description ( fmi2_import_t *  fmu,
size_t  index 
)

Get the log category description by index.

FMILIB_EXPORT size_t fmi2_import_get_source_files_me_num ( fmi2_import_t *  fmu)

Get the number of source files for ME defined in the XML.

FMILIB_EXPORT const char* fmi2_import_get_source_file_me ( fmi2_import_t *  fmu,
size_t  index 
)

Get the ME source file by index.

FMILIB_EXPORT size_t fmi2_import_get_source_files_cs_num ( fmi2_import_t *  fmu)

Get the number of source files for CS defined in the XML.

FMILIB_EXPORT const char* fmi2_import_get_source_file_cs ( fmi2_import_t *  fmu,
size_t  index 
)

Get the CS source file by index.

FMILIB_EXPORT fmi2_import_variable_t* fmi2_import_get_variable_by_name ( fmi2_import_t *  fmu,
const char *  name 
)

Get variable by variable name.

Parameters
fmu- An fmu object as returned by fmi2_import_parse_xml().
name- variable name
Returns
variable pointer.
FMILIB_EXPORT fmi2_import_variable_t* fmi2_import_get_variable_by_vr ( fmi2_import_t *  fmu,
fmi2_base_type_enu_t  baseType,
fmi2_value_reference_t  vr 
)

Get variable by value reference.

Parameters
fmu- An fmu object as returned by fmi2_import_parse_xml().
baseType- basic data type
vr- value reference
Returns
variable pointer.
FMILIB_EXPORT fmi2_import_variable_list_t* fmi2_import_get_outputs_list ( fmi2_import_t *  fmu)

Get the list of all the output variables in the model.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
Returns
a variable list with all the output variables in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

FMILIB_EXPORT fmi2_import_variable_list_t* fmi2_import_get_derivatives_list ( fmi2_import_t *  fmu)

Get the list of all the derivative variables in the model.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
Returns
a variable list with all the continuous state derivatives in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

FMILIB_EXPORT fmi2_import_variable_list_t* fmi2_import_get_discrete_states_list ( fmi2_import_t *  fmu)

Get the list of all the discrete state variables in the model.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
Returns
a variable list with all the discrete state variables in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

FMILIB_EXPORT fmi2_import_variable_list_t* fmi2_import_get_initial_unknowns_list ( fmi2_import_t *  fmu)

Get the list of all the initial unknown variables in the model.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
Returns
a variable list with all the initial unknowns in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

FMILIB_EXPORT void fmi2_import_get_outputs_dependencies ( fmi2_import_t *  fmu,
size_t **  startIndex,
size_t **  dependency,
char **  factorKind 
)

Get dependency information in row-compressed format.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
startIndex- outputs a pointer to an array of start indices (size of array is number of outputs + 1). First element is zero, last is equal to the number of elements in the dependency and factor arrays. NULL pointer is returned if no dependency information was provided in the XML.
dependency- outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zero means "depends on all" (no information in the XML).
factorKind- outputs a pointer to the factor kind data. The values can be converted to fmi2_dependency_factor_kind_enu_t
FMILIB_EXPORT void fmi2_import_get_derivatives_dependencies ( fmi2_import_t *  fmu,
size_t **  startIndex,
size_t **  dependency,
char **  factorKind 
)

Get dependency information in row-compressed format.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
startIndex- outputs a pointer to an array of start indices (size of array is number of derivatives + 1). First element is zero, last is equal to the number of elements in the dependency and factor arrays. NULL pointer is returned if no dependency information was provided in the XML.
dependency- outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zero means "depends on all" (no information in the XML).
factorKind- outputs a pointer to the factor kind data. The values can be converted to fmi2_dependency_factor_kind_enu_t
FMILIB_EXPORT void fmi2_import_get_discrete_states_dependencies ( fmi2_import_t *  fmu,
size_t **  startIndex,
size_t **  dependency,
char **  factorKind 
)

Get dependency information in row-compressed format.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
startIndex- outputs a pointer to an array of start indices (size of array is number of discrete states + 1). First element is zero, last is equal to the number of elements in the dependency and factor arrays. NULL pointer is returned if no dependency information was provided in the XML.
dependency- outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zero means "depends on all" (no information in the XML).
factorKind- outputs a pointer to the factor kind data. The values can be converted to fmi2_dependency_factor_kind_enu_t
FMILIB_EXPORT void fmi2_import_get_initial_unknowns_dependencies ( fmi2_import_t *  fmu,
size_t **  startIndex,
size_t **  dependency,
char **  factorKind 
)

Get dependency information in row-compressed format.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
startIndex- outputs a pointer to an array of start indices (size of array is number of initial unknowns + 1). First element is zero, last is equal to the number of elements in the dependency and factor arrays. NULL pointer is returned if no dependency information was provided in the XML.
dependency- outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zero means "depends on all" (no information in the XML).
factorKind- outputs a pointer to the factor kind data. The values can be converted to fmi2_dependency_factor_kind_enu_t