]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/XML/src/FMI2/fmi2_xml_model_structure_impl.h
84c70156d7cfed259f8c56a2aafbbf8937155791
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / src / FMI2 / fmi2_xml_model_structure_impl.h
1 /*
2     Copyright (C) 2012 Modelon AB
3
4     This program is free software: you can redistribute it and/or modify
5     it under the terms of the BSD style license.
6
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.
11
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>.
14 */
15
16 /** \file fmi2_xml_model_structure_impl.h
17 *  \brief Private header file. Definitions for the model structure interface.
18 */
19
20 #ifndef FMI2_XML_MODELSTRUCTURE_IMPL_H_
21 #define FMI2_XML_MODELSTRUCTURE_IMPL_H_
22
23 #include <FMI2/fmi2_xml_model_structure.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /** \brief Structure for keeping information about variable dependencies.
30 */
31 typedef struct fmi2_xml_dependencies_t {
32         int isRowMajor; /** Information is stored in row-major format flag */
33
34         /** Start index in dependency data for the corresponding row (isRowMajor=1) or column (isRowMajor = 0) */
35         jm_vector(size_t) startIndex;  
36
37         /** Column indices (isRowMajor=1) or row indices (isRowMajor=0)
38                 Note that indices are 1-based. 0 has a special meaning - depends on all.
39         */
40         jm_vector(size_t) dependencyIndex;
41         jm_vector(char)   dependencyFactorKind;
42 } fmi2_xml_dependencies_t;
43
44 fmi2_xml_dependencies_t* fmi2_xml_allocate_dependencies(jm_callbacks* cb);
45 void fmi2_xml_free_dependencies(fmi2_xml_dependencies_t* dep);
46         
47 struct fmi2_xml_model_structure_t {
48         jm_vector(jm_voidp) outputs;
49         jm_vector(jm_voidp) derivatives;
50         jm_vector(jm_voidp) discreteStates;
51         jm_vector(jm_voidp) initialUnknowns;
52
53     fmi2_xml_dependencies_t* outputDeps;
54     fmi2_xml_dependencies_t* derivativeDeps;
55     fmi2_xml_dependencies_t* discreteStateDeps;
56     fmi2_xml_dependencies_t* initialUnknownDeps;
57
58         int isValidFlag;  /**\ brief The flag is used to signal if an error was discovered and the model structure is not usable */
59 };
60
61 #ifdef __cplusplus
62 }
63 #endif
64 #endif