2 Copyright (C) 2012 Modelon AB
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the BSD style license.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 FMILIB_License.txt file for more details.
12 You should have received a copy of the FMILIB_License.txt file
13 along with this program. If not, contact Modelon AB <http://www.modelon.com>.
16 /** \file fmi2_xml_model_structure.h
17 * \brief Public interface to the FMI XML C-library. Handling of vendor annotations.
20 #ifndef FMI2_XML_MODELSTRUCTURE_H_
21 #define FMI2_XML_MODELSTRUCTURE_H_
23 #include "fmi2_xml_model_description.h"
29 fmi2_xml_model_structure_t* fmi2_xml_allocate_model_structure(jm_callbacks* cb);
31 void fmi2_xml_free_model_structure(fmi2_xml_model_structure_t* ms);
33 /** \brief Get the list of all the output variables in the model.
\r
34 * @param ms A model structure pointer (returned by fmi2_xml_get_model_structure)
\r
35 * @return a variable list with all the output variables in the model.
\r
37 jm_vector(jm_voidp)* fmi2_xml_get_outputs(fmi2_xml_model_structure_t* ms);
39 /** \brief Get the list of all the derivative variables in the model.
\r
40 * @param ms A model structure pointer (returned by fmi2_xml_get_model_structure)
\r
41 * @return a variable list with all the continuous state derivatives in the model.
\r
43 jm_vector(jm_voidp)* fmi2_xml_get_derivatives(fmi2_xml_model_structure_t* ms);
45 /** \brief Get the list of all the discrete state variables in the model.
\r
46 * @param ms A model structure pointer (returned by fmi2_xml_get_model_structure)
\r
47 * @return a variable list with all the discrete state variables in the model.
\r
49 jm_vector(jm_voidp)* fmi2_xml_get_discrete_states(fmi2_xml_model_structure_t* ms);
51 /** \brief Get the list of all the initial unknown variables in the model.
\r
52 * @param ms A model structure pointer (returned by fmi2_xml_get_model_structure)
\r
53 * @return a variable list with all the initial unknowns in the model.
\r
55 jm_vector(jm_voidp)* fmi2_xml_get_initial_unknowns(fmi2_xml_model_structure_t* ms);
57 /** \brief Get dependency information in row-compressed format.
58 * @param startIndex - outputs a pointer to an array of start indices (size of array is number of outputs + 1).
59 * First element is zero, last is equal to the number of elements in the dependency and factor arrays.
60 * NULL pointer is returned if no dependency information was provided in the XML.
61 * @param dependency - outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zero
62 * means "depends on all" (no information in the XML).
63 * @param factorKind - outputs a pointer to the factor kind data. The values can be converted to ::fmi2_dependency_factor_kind_enu_t
65 void fmi2_xml_get_outputs_dependencies(fmi2_xml_model_structure_t* ms, size_t** startIndex, size_t** dependency, char** factorKind);
67 /** \brief Get dependency information in row-compressed format.
68 * @param startIndex - outputs a pointer to an array of start indices (size of array is number of derivatives + 1).
69 * First element is zero, last is equal to the number of elements in the dependency and factor arrays.
70 * NULL pointer is returned if no dependency information was provided in the XML.
71 * @param dependency - outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zero
72 * means "depends on all" (no information in the XML).
73 * @param factorKind - outputs a pointer to the factor kind data. The values can be converted to ::fmi2_dependency_factor_kind_enu_t
75 void fmi2_xml_get_derivatives_dependencies(fmi2_xml_model_structure_t* ms, size_t** startIndex, size_t** dependency, char** factorKind);
77 /** \brief Get dependency information in row-compressed format.
78 * @param startIndex - outputs a pointer to an array of start indices (size of array is number of discrete states + 1).
79 * First element is zero, last is equal to the number of elements in the dependency and factor arrays.
80 * NULL pointer is returned if no dependency information was provided in the XML.
81 * @param dependency - outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zero
82 * means "depends on all" (no information in the XML).
83 * @param factorKind - outputs a pointer to the factor kind data. The values can be converted to ::fmi2_dependency_factor_kind_enu_t
85 void fmi2_xml_get_discrete_states_dependencies(fmi2_xml_model_structure_t* ms, size_t** startIndex, size_t** dependency, char** factorKind);
87 /** \brief Get dependency information in row-compressed format.
88 * @param startIndex - outputs a pointer to an array of start indices (size of array is number of initial unknowns + 1).
89 * First element is zero, last is equal to the number of elements in the dependency and factor arrays.
90 * NULL pointer is returned if no dependency information was provided in the XML.
91 * @param dependency - outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zero
92 * means "depends on all" (no information in the XML).
93 * @param factorKind - outputs a pointer to the factor kind data. The values can be converted to ::fmi2_dependency_factor_kind_enu_t
95 void fmi2_xml_get_initial_unknowns_dependencies(fmi2_xml_model_structure_t* ms, size_t** startIndex, size_t** dependency, char** factorKind);