Browse Source

found bug with open modelica FMUs

Cláudio Gomes 7 years ago
parent
commit
3e6f04cab1
100 changed files with 32319 additions and 0 deletions
  1. 2 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/build_run_all.bat
  2. 27 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/ACKNOWLEDGEMENTS-FMUChecker.txt
  3. 64 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/BUILD-FMUChecker.txt
  4. 27 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/LICENCE-FMUChecker.txt
  5. 101 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/README-FMUChecker.txt
  6. 83 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/RELEASE-NOTES-FMUChecker.txt
  7. 5 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/.svn/all-wcprops
  8. 34 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/.svn/entries
  9. 35 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/all-wcprops
  10. 198 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/entries
  11. 9 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/FMILIB_FMI1_Readme.txt.svn-base
  12. 231 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/fmiFunctions.h.svn-base
  13. 210 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/fmiModelFunctions.h.svn-base
  14. 91 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/fmiModelTypes.h.svn-base
  15. 73 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/fmiPlatformTypes.h.svn-base
  16. 9 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/FMILIB_FMI1_Readme.txt
  17. 231 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/fmiFunctions.h
  18. 210 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/fmiModelFunctions.h
  19. 91 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/fmiModelTypes.h
  20. 73 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/fmiPlatformTypes.h
  21. 23 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/all-wcprops
  22. 130 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/entries
  23. 243 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/text-base/fmi2FunctionTypes.h.svn-base
  24. 333 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/text-base/fmi2Functions.h.svn-base
  25. 115 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/text-base/fmi2TypesPlatform.h.svn-base
  26. 243 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/fmi2FunctionTypes.h
  27. 333 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/fmi2Functions.h
  28. 115 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/fmi2TypesPlatform.h
  29. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/Modelica_Electrical_Machines_Examples_DCMachines_DCEE_Start.fmu
  30. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem.fmu
  31. 0 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/binaries/win32/PW_PowerSystem_FMU.libs
  32. 20 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/build.bat
  33. 4113 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/modelDescription.xml
  34. 65 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/Makefile
  35. 62 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/Makefile.in
  36. 1359 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem.c
  37. 2 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem.makefile
  38. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem.o
  39. 26 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_01exo.c
  40. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_01exo.o
  41. 12 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_02nls.c
  42. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_02nls.o
  43. 492 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_03lsy.c
  44. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_03lsy.o
  45. 16 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_04set.c
  46. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_04set.o
  47. 107 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_05evt.c
  48. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_05evt.o
  49. 1630 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_06inz.c
  50. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_06inz.o
  51. 19 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_07dly.c
  52. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_07dly.o
  53. 3261 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_08bnd.c
  54. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_08bnd.o
  55. 123 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_09alg.c
  56. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_09alg.o
  57. 20 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_10asr.c
  58. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_10asr.o
  59. 10 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_11mix.c
  60. 0 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_11mix.h
  61. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_11mix.o
  62. 814 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_12jac.c
  63. 210 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_12jac.h
  64. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_12jac.o
  65. 14 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_13opt.c
  66. 11 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_13opt.h
  67. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_13opt.o
  68. 44 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_14lnz.c
  69. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_14lnz.o
  70. 59 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_15syn.c
  71. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_15syn.o
  72. 9 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_16dae.c
  73. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_16dae.o
  74. 1792 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_FMU.c
  75. 0 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_FMU.libs
  76. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_FMU.o
  77. 248 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_functions.c
  78. 195 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_functions.h
  79. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_functions.o
  80. 0 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_includes.h
  81. 1 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_info.c
  82. 3822 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_init_fmu.c
  83. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_init_fmu.o
  84. 26 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_literals.h
  85. 102 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_model.h
  86. 92 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_records.c
  87. BIN
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_records.o
  88. 242 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/configure.ac
  89. 183 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/Makefile.objs
  90. 113 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ModelicaUtilities.h
  91. 910 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ParModelica/explicit/openclrt/OCLRuntimeUtil.cl
  92. 116 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ParModelica/explicit/openclrt/omc_ocl_common_header.h
  93. 195 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ParModelica/explicit/openclrt/omc_ocl_interface.h
  94. 106 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ParModelica/explicit/openclrt/omc_ocl_memory_ops.h
  95. 158 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/blaswrap.h
  96. 160 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/blaswrap.h
  97. 7262 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/clapack.h
  98. 370 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/cminpack.h
  99. 389 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/dgemm.c
  100. 0 0
      SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/dger.c

+ 2 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/build_run_all.bat

@@ -1,5 +1,7 @@
 @echo off 
 
+mode 200,1000
+
 call build_all %1
 
 setlocal

+ 27 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/ACKNOWLEDGEMENTS-FMUChecker.txt

@@ -0,0 +1,27 @@
+File: ACKNOWLEDGEMENTS_FMUChecker.txt
+Acknowledgements for third-party software used.
+
+The FMI Compliance Checker uses code from third party tools and packages.
+The respective copyright information and licenses are listed with URL 
+references to the full texts.
+
+- FMI Library
+A library for working with FMUs, part of JModelica platform.
+Homepage: <http://www.jmodelica.org/FMILibrary/>
+License identical to FMI Compliance Checker.
+
+- eXPat
+The parsing of the file modelDescription.xml is using eXpat.
+Homepage: <http://www.libexpat.org/> 
+MIT License: <http://www.jclark.com/xml/copying.txt>
+
+-  Minizip 
+The unziping of the FMU is performed partially by using Minizip library.
+Homepage: <http://www.winimage.com/zLibDll/minizip.html>.
+Condition of use and distribution are the same as Zlib
+<http://www.zlib.net/zlib_license.html>.
+
+-  Zlib 
+The unziping is performed by using Zlib library called via \e minizip library.
+Homepage: <http://www.zlib.net/>.
+Zlib License: <http://www.zlib.net/zlib_license.html>. 

+ 64 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/BUILD-FMUChecker.txt

@@ -0,0 +1,64 @@
+File: BUILD-FMUChecker.txt
+Build instructions for FMI Compliance Checker (FMUChecker) application.
+
+FMUChecker build system utilizes CMake (see <http://www.cmake.org/>)
+to generate the native build scripts for the application.
+It is recommended to use "cmake-gui" on Windows or "ccmake"
+to configure the build. 
+
+To build from a terminal command line on Linux or Mac with default settings use:
+    mkdir build; cd build
+    cmake -DFMUCHK_INSTALL_PREFIX=<dir name> <checker dir>
+    make install test
+To build in MSYS terminal with g++/gcc on Windows:
+    mkdir build; cd build
+    cmake -DFMUCHK_INSTALL_PREFIX=<dir name> -G "MSYS Makefiles" <checker dir>
+    make install test
+To build from command line with Microsoft Visual Studio 10 compilers on Windows:
+    mkdir build; cd build
+    cmake -DFMUCHK_INSTALL_PREFIX=<dir name> -G "Visual Studio 10" <checker dir>    
+    cmake --build . --config MinSizeRel --target install
+The generated solution files can be used in the Microsoft Visual Studio IDE as
+well.
+
+The primary target of the library build script is a command-line
+executable:  <prefix>/bin/fmuChecket.<platform>[.extention]
+
+Note that FMUChecker depends on FMI Library that is stored in the FMIL
+subdirectory of the source tree. For more information on FMI Library, see
+<http://www.fmi-library.org>. The current version of the FMUChecker
+depends on FMI Library v2.0a5.
+
+The following FMUChecker specific build configuration options are provided:
+
+FMUCHK_INSTALL_PREFIX - Prefix prepended to install directories. 
+    Default: <build_dir>/../install
+    
+FMUCHK_FMI_STANDARD_HEADERS  - Path to the FMI standard headers directory. 
+    Leave empty to use the headers from FMIL, which is the default.
+    Headers for specific standards versions are expected in subdirectories 
+    FMI1, FMI2, etc.
+    
+FMUCHK_ENABLE_LOG_LEVEL_DEBUG - Enable log level 'debug'. If the option 
+    is of then the debug level is not compiled in. Default: OFF
+   
+FMUCHK_TEST_FMUS_DIR - Directory with FMUs to be used in tests (checker 
+    will run for each FMU). Output files can be found in <build>/TestOutput/
+    Default: ${FMUCHK_HOME}/TestFMUs.
+    
+FMUCHK_BUILD_WITH_STATIC_RTLIB - Use static run-time libraries (/MT or 
+    /MTd linker flags). Default: ON. Only available for Microsoft Visual
+    Studio projects.
+
+FMUCHK_FMI_PLATFORM - Defines the subdirectory within FMU where binaries 
+    should be searched, e.g., win32. Default: detected automatically
+    for win32/64, linux32/64, darwin32/64. Overriding the default
+    value normally requires modification to compiler and linker flags
+    to get a consistent build. May be used to build 32-bit binary
+    on a 64-bit system.
+
+FMUCHK_FMI_PUBLIC - Specifies a directory with Subversion check-out from 
+    https://svn.fmi-standard.org/fmi/branches/public with test fmus. The 
+    directory is expected to contain Test_FMUs and CrossCheck_Results 
+    subdirectories. Checker will run cross-check with FMI Library for
+    all the FMUs found as a part of test suit.

+ 27 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/LICENCE-FMUChecker.txt

@@ -0,0 +1,27 @@
+File: LICENCE-FMUChecker.txt
+Licence information for FMI Compliance Checker (FMUChecker) application.
+
+Copyright (c) 2013, Modelon AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the Modelon AB nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 101 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/README-FMUChecker.txt

@@ -0,0 +1,101 @@
+File: README-FMUChecker.txt
+Background information for FMI Compliance Checker (FMUChecker) application.
+
+For build instructions see: BUILD-FMUChecker.txt
+Licence information is provided in: LICENCE-FMUChecker.txt
+Acknowledgements for used software: ACKNOWLEDGEMENTS-FMUChecker.txt
+
+The FMI Compliance Checker is intended for
+validation of FMU 1.0 and 2.0RC2 compliance to the standard specification
+as published at <http://www.fmi-standard.org>
+
+The basic features include:
+ - automatic unzipping into a temporary directory;
+ - checking of XML model description
+	- for syntax errors;
+	- for correct order of elements and correct cardinality or relations;
+	- for correct cross-references;
+	- for semantic consistency;
+ - validation of binary FMUs compiled for "standard32/default" platform for 
+	Windows (.dll), Linux (.so) and Mac OS (.dylib).
+	- loading of the binary module;
+	- checking whether all required functions are available
+	- for model exchange FMUs test whether the FMU can be simulated with 
+    explicit (forward) Euler method
+		- fixed step size is used;
+		- no iterations for exact location of state events;
+    - for co-simulation FMUs test whether the FMU can be simulated with
+    fixed communication step size;
+	- log computed solution to csv result file (comma separated values,
+    file format is by default compatible with RFC4180, http://www.ietf.org/rfc/rfc4180.txt;
+	the header containt variable names, first column is time, alternative 
+    field separator may be specified as an option).
+    - can supply numerical input data to the simulation from an CSV file. 
+    String inputs are currently not supported. The input file is expected to be 
+    RFC4180 compatible with following modifications:
+      - The file must be in UTF-8 encoding;
+      - First line must be a header listing the variable names;
+      - First column must be time;
+      - Variable names shall match the names in the modelDescription.xml
+      file exactly;
+      - Variable names may be put in double quotes according to the RFC4180
+      rules;
+      - Decimal separator for numerical data is a dot;
+      - Numerical data shall not be quoted;
+      - Boolean data must be represented with 0 for false and 1 for true;
+      - Field separator may be any printable ASCII character (detected 
+      automatically);
+      - End of line may be either CR-LF or just LF.
+ - validation log messages are written to stderr. Can be redirected to file.
+ 
+Usage: fmuCheck.<platform> [options] <model.fmu>
+
+Options:
+
+-c <separator>   Separator character to be used in CSV output. Default is ','.
+
+-e <filename>    Error log file name. Default is to use standard error.
+
+-f               Print all variables to the output file. Default is to only print outputs.
+
+-h <stepSize>    Step size to use in forward Euler. Default is to use
+                 step size based on the number of output points.
+
+-i <infile>      Name of the CSV file name with input data.
+
+-l <log level>   Log level: 0 - no logging, 1 - fatal errors only,
+                 2 - errors, 3 - warnings, 4 - info, 5 - verbose, 6 - debug.
+
+-m               Mangle variable names to avoid quoting (needed for some CSV
+                 importing applications).
+
+-n <num_steps>   Maximum number of output points. Zero means output
+                 in every step. Default is 500.
+
+-o <filename>    Simulation result output CSV file name. Default is to use standard output.
+
+-s <stopTime>    Simulation stop time, default is to use information from
+                'DefaultExperiment' as specified in the model description XML.
+
+-t <tmp-dir>     Temporary dir to use for unpacking the FMU.
+                 Default is to use system-wide directory, e.g., C:\Temp.
+
+-x               Check XML and stop, default is to load the DLL and simulate
+                 after this.
+
+-z <unzip-dir>   Do not create and remove temp directory but use the specified one
+                 for unpacking the FMU. The option takes precendence over -t.
+
+Command line examples:
+
+fmuCheck.win32 model.fmu 
+        The checker on win32 platform will process "model.fmu"  with default 
+		options.
+                
+fmuCheck.win64 -e log.txt -o result.csv -c , -s 2 -h 1e-3 -l 5 -t . model.fmu 
+        The checker on win64 platform will process "model.fmu". The log 
+        messages will be saved in log.txt, simulation output in 
+        result.csv and comma will be used for field separation in the CSV
+        file. The checker will simulate the FMU until 2 seconds with 
+        time step 1e-3 seconds. Verbose messages will be generated.
+        Temporary files will be created in the current directory.

+ 83 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/RELEASE-NOTES-FMUChecker.txt

@@ -0,0 +1,83 @@
+File: REALEASE-NOTES-FMUChecker.txt
+Release notes for FMI Compliance Checker (FMUChecker) application.
+
+2014-05-09 Version 2.0b3
+- Feature updates:
+ - Added Support for FMIL 2.0b3 resp. FMI 2.0 RC2. Prior versions (RC1 and below) not supported any more.
+ - Simultaneous identifiers for ModelExchange and CoSimulation in 2.0 now legal and will both be verified.
+ - updated model structure output for 2.0 due to new variabilities.
+
+ 
+2014-03-10 Version 2.0b2
+- Bug fix release:
+  - Corrected reduced output for the 2.0RC1 FMUs
+  - Handling of co-simulation FMUs with fixed time step
+  - Improved error handling and better error messages.
+
+2013-12-17 Version 2.0b1
+- Feature updates:
+ - Added Support for FMIL 2.0b1 resp. FMI 2.0 RC1. Prior versions (beta4) not supported any more.
+  - New event handling for FMU 2.0 in ModelExchange simulation.
+ - Added support for CSV input files for FMUs in 2.0 standard
+
+2013-06-20 Version 2.0a2
+- Feature updates:
+ - Output format modified:
+  - CSV files are now RFC 4180 compatible by default (comma is the 
+  default field separator; CR-LF is used as end of line; variable
+  names are enclosed in double quotes as needed).
+  - -m switch is itroduced to support mangling of variable names 
+  as needed by CSV importers that don't handle quoting.
+  - Only variable names are written out in the header line (no
+  aliasing information is provided).
+  - Numerical values are printed for enum and boolean variables.
+  - -n switch only controls the number of output points and works
+  orthogonal to the -h switch specifying the time step length.
+  - Only variables with causality output are written out by default.
+  -f switch may be used to write out all variables.
+ - Support for input CSV files.
+   -i <file name> - flag is now used to specify file name with input
+   signals for the FMU. Details on the file format are given in
+   the README-FMUChecker.txt.
+ - Version information printed as a part of the help screen.
+- Packaging updates:
+ - FMI Library is distirbuted as a part of checker's source. 
+ - Build script supports automatic cross-checking with FMI Library driven by
+    compliance checker. See information on FMUCHK_FMI_PUBLIC in 
+    BUILD-FMUChecker.txt for details.
+ - Updated the header files for FMI 2.0 (still beta4 compatible).
+
+2012-10-18 Version 2.0a1
+- Added support for FMI 2.0beta4 with the following modifications:
+  - Modified and corrected standard header files as proposed in
+  tickets #86, #87, #88 and #108 at https://trac.fmi-standard.org/
+  Header files are distributed with the FMU checker.
+  - Removed fmiGetPartialDerivatives interface function as decided 
+  during the FMI meeting Sep 07, 2012
+  Note that FMU Checker 2.0a1 supports both FMI 1.0 and 2.0 beta 4 
+  specifications and contains a number of bug fixes as compared to the 1.0.2
+  release. The ‘alpha’ status concerns FMI 2.0 support due to limited testing
+  and beta status of the specification.
+- Added logging of memory callbacks calls
+- The '-z <dir>' switch simplifies debugging for FMU developers
+- Fixed the bugs:
+  - empty and malfored XML files could result in segmentation fault;
+  - instance name pointer can be legally used in fmiInitialize
+
+2012-08-22 Version 1.0.2
+- Fixed the bugs:
+  - parsing of 'Model' element in XML
+  - indexing of enum items
+- Improved CSV file output making sure it can be easily imported into Excel
+- Provided additional program options for convenience
+- Linux version now uses 'RTLD_NOW' mode for loading the FMU binary and
+  reports underfined symbols if there are such.
+
+2012-07-16 Version 1.0.1
+- Added output for the simulation start time
+- Improved simulation output file header. Alias information 
+is now provided as "a=b" or "a=-b" in the first output row.
+- Improved readability for a number of log messages
+
+2012-07-06 Version 1.0
+Initial release submitted to Modelica Association

+ 5 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/.svn/all-wcprops

@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default
+END

+ 34 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/.svn/entries

@@ -0,0 +1,34 @@
+10
+
+dir
+6333
+https://svn.jmodelica.org/FMILibrary/tags/2.0b3/ThirdParty/FMI/default
+https://svn.jmodelica.org
+
+
+
+2014-05-08T16:23:10.613934Z
+6322
+ziegler
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7ae51c65-13d5-4921-9d80-6511ddd1419c
+
+FMI1
+dir
+
+FMI2
+dir
+

+ 35 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/all-wcprops

@@ -0,0 +1,35 @@
+K 25
+svn:wc:ra_dav:version-url
+V 64
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI1
+END
+fmiModelTypes.h
+K 25
+svn:wc:ra_dav:version-url
+V 80
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI1/fmiModelTypes.h
+END
+FMILIB_FMI1_Readme.txt
+K 25
+svn:wc:ra_dav:version-url
+V 87
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI1/FMILIB_FMI1_Readme.txt
+END
+fmiFunctions.h
+K 25
+svn:wc:ra_dav:version-url
+V 79
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI1/fmiFunctions.h
+END
+fmiModelFunctions.h
+K 25
+svn:wc:ra_dav:version-url
+V 84
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI1/fmiModelFunctions.h
+END
+fmiPlatformTypes.h
+K 25
+svn:wc:ra_dav:version-url
+V 83
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI1/fmiPlatformTypes.h
+END

+ 198 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/entries

@@ -0,0 +1,198 @@
+10
+
+dir
+6333
+https://svn.jmodelica.org/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI1
+https://svn.jmodelica.org
+
+
+
+2012-09-18T08:57:48.795732Z
+3845
+iakov
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7ae51c65-13d5-4921-9d80-6511ddd1419c
+
+fmiModelTypes.h
+file
+
+
+
+
+2014-05-09T14:13:52.863600Z
+0e9799f58c5b36d96a18af4fdd35b391
+2012-09-18T08:57:48.795732Z
+3845
+iakov
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4160
+
+FMILIB_FMI1_Readme.txt
+file
+
+
+
+
+2014-05-09T14:13:52.863600Z
+703cff1d93afb37223622d1257fc1d5c
+2012-09-18T08:57:48.795732Z
+3845
+iakov
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+394
+
+fmiFunctions.h
+file
+
+
+
+
+2014-05-09T14:13:52.863600Z
+c67b8f8cf69f89bd20e01ea369a472ea
+2012-09-18T08:57:48.795732Z
+3845
+iakov
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11298
+
+fmiModelFunctions.h
+file
+
+
+
+
+2014-05-09T14:13:52.863600Z
+b9224509882d0aff5e30535db94cdbf1
+2012-09-18T08:57:48.795732Z
+3845
+iakov
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11201
+
+fmiPlatformTypes.h
+file
+
+
+
+
+2014-05-09T14:13:52.879200Z
+d0f3079d54f237bafdbd633860a4a921
+2012-09-18T08:57:48.795732Z
+3845
+iakov
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3057
+

+ 9 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/FMILIB_FMI1_Readme.txt.svn-base

@@ -0,0 +1,9 @@
+FMILIB_FMI1_Readme.txt
+======================
+Note that "fmiPlatformTypes.h" is used for compilation of FMILIB.
+It is expected that its contents is consistent with the definitions 
+in "fmiModelTypes.h". Therefore, make sure to provide all the 4 
+header files (both ME and CS interfaces) if you are building for
+non-standard platform.
+
+All the 4 header files are used in FMILIB tests. 

+ 231 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/fmiFunctions.h.svn-base

@@ -0,0 +1,231 @@
+#ifndef fmiFunctions_h
+#define fmiFunctions_h
+
+/* This header file must be utilized when compiling a FMU.
+   It defines all functions of Co-Simulation Interface.
+   In order to have unique function names even if several FMUs
+   are compiled together (e.g. for embedded systems), every "real" function name
+   is constructed by prepending the function name by
+   "MODEL_IDENTIFIER" + "_" where "MODEL_IDENTIFIER" is the short name
+   of the model used as the name of the zip-file where the model is stored.
+   Therefore, the typical usage is:
+
+      #define MODEL_IDENTIFIER MyModel
+      #include "fmiFunctions.h"
+
+   As a result, a function that is defined as "fmiGetDerivatives" in this header file,
+   is actually getting the name "MyModel_fmiGetDerivatives".
+
+   Revisions:
+   - November 4, 2010: Adapted to specification text:
+                       o fmiGetModelTypesPlatform renamed to fmiGetTypesPlatform
+                       o fmiInstantiateSlave: Argument GUID     replaced by fmuGUID
+                                              Argument mimetype replaced by mimeType
+                       o tabs replaced by spaces
+   - October 16, 2010: First public Version
+
+
+   Copyright © 2008-2010, MODELISAR consortium. All rights reserved.
+   This file is licensed by the copyright holders under the BSD License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+*/
+
+#include "fmiPlatformTypes.h"
+#include <stdlib.h>
+
+/* Export fmi functions on Windows */
+#ifdef _MSC_VER
+#define DllExport __declspec( dllexport )
+#else
+#define DllExport
+#endif
+
+/* Macros to construct the real function name
+   (prepend function name by MODEL_IDENTIFIER + "_") */
+
+#define fmiPaste(a,b)     a ## b
+#define fmiPasteB(a,b)    fmiPaste(a,b)
+#define fmiFullName(name) fmiPasteB(MODEL_IDENTIFIER, name)
+
+/***************************************************
+Common Functions
+****************************************************/
+#define fmiGetTypesPlatform fmiFullName(_fmiGetTypesPlatform)
+#define fmiGetVersion       fmiFullName(_fmiGetVersion)
+#define fmiSetDebugLogging  fmiFullName(_fmiSetDebugLogging)
+
+/*Data Exchange*/
+#define fmiSetReal               fmiFullName(_fmiSetReal)
+#define fmiSetInteger            fmiFullName(_fmiSetInteger)
+#define fmiSetBoolean            fmiFullName(_fmiSetBoolean)
+#define fmiSetString             fmiFullName(_fmiSetString)
+
+#define fmiGetReal               fmiFullName(_fmiGetReal)
+#define fmiGetInteger            fmiFullName(_fmiGetInteger)
+#define fmiGetBoolean            fmiFullName(_fmiGetBoolean)
+#define fmiGetString             fmiFullName(_fmiGetString)
+
+/***************************************************
+Functions for FMI for Co-Simulation
+****************************************************/
+#define fmiInstantiateSlave         fmiFullName(_fmiInstantiateSlave)
+#define fmiInitializeSlave          fmiFullName(_fmiInitializeSlave)
+#define fmiTerminateSlave           fmiFullName(_fmiTerminateSlave)
+#define fmiResetSlave               fmiFullName(_fmiResetSlave)
+#define fmiFreeSlaveInstance        fmiFullName(_fmiFreeSlaveInstance)
+#define fmiSetRealInputDerivatives  fmiFullName(_fmiSetRealInputDerivatives)
+#define fmiGetRealOutputDerivatives fmiFullName(_fmiGetRealOutputDerivatives)
+#define fmiDoStep                   fmiFullName(_fmiDoStep)
+#define fmiCancelStep               fmiFullName(_fmiCancelStep)
+#define fmiGetStatus                fmiFullName(_fmiGetStatus)
+#define fmiGetRealStatus            fmiFullName(_fmiGetRealStatus)
+#define fmiGetIntegerStatus         fmiFullName(_fmiGetIntegerStatus)
+#define fmiGetBooleanStatus         fmiFullName(_fmiGetBooleanStatus)
+#define fmiGetStringStatus          fmiFullName(_fmiGetStringStatus)
+
+/* Version number */
+#define fmiVersion "1.0"
+
+/* make sure all compiler use the same alignment policies for structures */
+#ifdef WIN32
+#pragma pack(push,8)
+#endif
+
+
+/* Type definitions */
+     typedef enum {fmiOK,
+                   fmiWarning,
+                   fmiDiscard,
+                   fmiError,
+                   fmiFatal,
+                   fmiPending} fmiStatus;
+
+     typedef void  (*fmiCallbackLogger) (fmiComponent c, fmiString instanceName, fmiStatus status,
+                                         fmiString category, fmiString message, ...);
+     typedef void* (*fmiCallbackAllocateMemory)(size_t nobj, size_t size);
+     typedef void  (*fmiCallbackFreeMemory)    (void* obj);
+     typedef void  (*fmiStepFinished)          (fmiComponent c, fmiStatus status);
+
+     typedef struct {
+     fmiCallbackLogger         logger;
+     fmiCallbackAllocateMemory allocateMemory;
+     fmiCallbackFreeMemory     freeMemory;
+     fmiStepFinished           stepFinished;
+     } fmiCallbackFunctions;
+
+   typedef struct {
+      fmiBoolean iterationConverged;
+      fmiBoolean stateValueReferencesChanged;
+      fmiBoolean stateValuesChanged;
+      fmiBoolean terminateSimulation;
+      fmiBoolean upcomingTimeEvent;
+      fmiReal    nextEventTime;
+   } fmiEventInfo;
+
+/* reset alignment policy to the one set before reading this file */
+#ifdef WIN32
+#pragma pack(pop)
+#endif
+
+/***************************************************
+Common Functions
+****************************************************/
+
+/* Inquire version numbers of header files */
+   DllExport const char* fmiGetTypesPlatform();
+   DllExport const char* fmiGetVersion();
+
+   DllExport fmiStatus fmiSetDebugLogging  (fmiComponent c, fmiBoolean loggingOn);
+
+/* Data Exchange Functions*/
+   DllExport fmiStatus fmiGetReal   (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiReal    value[]);
+   DllExport fmiStatus fmiGetInteger(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiInteger value[]);
+   DllExport fmiStatus fmiGetBoolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiBoolean value[]);
+   DllExport fmiStatus fmiGetString (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiString  value[]);
+
+   DllExport fmiStatus fmiSetReal    (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiReal    value[]);
+   DllExport fmiStatus fmiSetInteger (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiInteger value[]);
+   DllExport fmiStatus fmiSetBoolean (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiBoolean value[]);
+   DllExport fmiStatus fmiSetString  (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiString  value[]);
+
+/***************************************************
+Functions for FMI for Co-Simulation
+****************************************************/
+
+/* Creation and destruction of slave instances and setting debug status */
+   DllExport fmiComponent fmiInstantiateSlave(fmiString  instanceName,
+                                              fmiString  fmuGUID,
+                                              fmiString  fmuLocation,
+                                              fmiString  mimeType,
+                                              fmiReal    timeout,
+                                              fmiBoolean visible,
+                                              fmiBoolean interactive,
+                                              fmiCallbackFunctions functions,
+                                              fmiBoolean loggingOn);
+
+   DllExport fmiStatus fmiInitializeSlave(fmiComponent c,
+                                          fmiReal      tStart,
+                                          fmiBoolean   StopTimeDefined,
+                                          fmiReal      tStop);
+
+   DllExport fmiStatus fmiTerminateSlave   (fmiComponent c);
+   DllExport fmiStatus fmiResetSlave       (fmiComponent c);
+   DllExport void      fmiFreeSlaveInstance(fmiComponent c);
+
+   DllExport fmiStatus fmiSetRealInputDerivatives(fmiComponent c,
+                                                  const  fmiValueReference vr[],
+                                                  size_t nvr,
+                                                  const  fmiInteger order[],
+                                                  const  fmiReal value[]);
+
+   DllExport fmiStatus fmiGetRealOutputDerivatives(fmiComponent c,
+                                                   const   fmiValueReference vr[],
+                                                   size_t  nvr,
+                                                   const   fmiInteger order[],
+                                                   fmiReal value[]);
+
+   DllExport fmiStatus fmiCancelStep(fmiComponent c);
+   DllExport fmiStatus fmiDoStep    (fmiComponent c,
+                                     fmiReal      currentCommunicationPoint,
+                                     fmiReal      communicationStepSize,
+                                     fmiBoolean   newStep);
+
+
+   typedef enum {fmiDoStepStatus,
+                 fmiPendingStatus,
+                 fmiLastSuccessfulTime} fmiStatusKind;
+
+   DllExport fmiStatus fmiGetStatus       (fmiComponent c, const fmiStatusKind s, fmiStatus*  value);
+   DllExport fmiStatus fmiGetRealStatus   (fmiComponent c, const fmiStatusKind s, fmiReal*    value);
+   DllExport fmiStatus fmiGetIntegerStatus(fmiComponent c, const fmiStatusKind s, fmiInteger* value);
+   DllExport fmiStatus fmiGetBooleanStatus(fmiComponent c, const fmiStatusKind s, fmiBoolean* value);
+   DllExport fmiStatus fmiGetStringStatus (fmiComponent c, const fmiStatusKind s, fmiString*  value);
+
+
+#endif // fmiFunctions_h

+ 210 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/fmiModelFunctions.h.svn-base

@@ -0,0 +1,210 @@
+#ifndef fmiModelFunctions_h
+#define fmiModelFunctions_h
+
+/* This header file must be utilized when compiling a model.
+   It defines all functions of the Model Execution Interface.
+   In order to have unique function names even if several models
+   are compiled together (e.g. for embedded systems), every "real" function name
+   is constructed by prepending the function name by
+   "MODEL_IDENTIFIER" + "_" where "MODEL_IDENTIFIER" is the short name
+   of the model used as the name of the zip-file where the model is stored.
+   Therefore, the typical usage is:
+
+      #define MODEL_IDENTIFIER MyModel
+      #include "fmiModelFunctions.h"
+
+   As a result, a function that is defined as "fmiGetDerivatives" in this header file,
+   is actually getting the name "MyModel_fmiGetDerivatives".
+
+   Revisions:
+   - Jan. 20, 2010: stateValueReferencesChanged added to struct fmiEventInfo (ticket #27)
+                    (by M. Otter, DLR)
+                    Added WIN32 pragma to define the struct layout (ticket #34)
+                    (by J. Mauss, QTronic)
+   - Jan.  4, 2010: Removed argument intermediateResults from fmiInitialize
+                    Renamed macro fmiGetModelFunctionsVersion to fmiGetVersion
+                    Renamed macro fmiModelFunctionsVersion to fmiVersion
+                    Replaced fmiModel by fmiComponent in decl of fmiInstantiateModel
+                    (by J. Mauss, QTronic)
+   - Dec. 17, 2009: Changed extension "me" to "fmi" (by Martin Otter, DLR).
+   - Dez. 14, 2009: Added eventInfo to meInitialize and added
+                    meGetNominalContinuousStates (by Martin Otter, DLR)
+   - Sept. 9, 2009: Added DllExport (according to Peter Nilsson's suggestion)
+                    (by A. Junghanns, QTronic)
+   - Sept. 9, 2009: Changes according to FMI-meeting on July 21:
+                    meInquireModelTypesVersion     -> meGetModelTypesPlatform
+                    meInquireModelFunctionsVersion -> meGetModelFunctionsVersion
+                    meSetStates                    -> meSetContinuousStates
+                    meGetStates                    -> meGetContinuousStates
+                    removal of meInitializeModelClass
+                    removal of meGetTime
+                    change of arguments of meInstantiateModel
+                    change of arguments of meCompletedIntegratorStep
+                    (by Martin Otter, DLR):
+   - July 19, 2009: Added "me" as prefix to file names (by Martin Otter, DLR).
+   - March 2, 2009: Changed function definitions according to the last design
+                    meeting with additional improvements (by Martin Otter, DLR).
+   - Dec. 3 , 2008: First version by Martin Otter (DLR) and Hans Olsson (Dynasim).
+
+
+   Copyright © 2008-2009, MODELISAR consortium. All rights reserved.
+   This file is licensed by the copyright holders under the BSD License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+*/
+
+#include "fmiModelTypes.h"
+#include <stdlib.h>
+
+/* Export fmi functions on Windows */
+#ifdef _MSC_VER
+#define DllExport __declspec( dllexport )
+#else
+#define DllExport
+#endif
+
+/* Macros to construct the real function name
+   (prepend function name by MODEL_IDENTIFIER + "_") */
+
+#define fmiPaste(a,b)     a ## b
+#define fmiPasteB(a,b)    fmiPaste(a,b)
+#define fmiFullName(name) fmiPasteB(MODEL_IDENTIFIER, name)
+
+#define fmiGetModelTypesPlatform      fmiFullName(_fmiGetModelTypesPlatform)
+#define fmiGetVersion                 fmiFullName(_fmiGetVersion)
+#define fmiInstantiateModel           fmiFullName(_fmiInstantiateModel)
+#define fmiFreeModelInstance          fmiFullName(_fmiFreeModelInstance)
+#define fmiSetDebugLogging            fmiFullName(_fmiSetDebugLogging)
+#define fmiSetTime                    fmiFullName(_fmiSetTime)
+#define fmiSetContinuousStates        fmiFullName(_fmiSetContinuousStates)
+#define fmiCompletedIntegratorStep    fmiFullName(_fmiCompletedIntegratorStep)
+#define fmiSetReal                    fmiFullName(_fmiSetReal)
+#define fmiSetInteger                 fmiFullName(_fmiSetInteger)
+#define fmiSetBoolean                 fmiFullName(_fmiSetBoolean)
+#define fmiSetString                  fmiFullName(_fmiSetString)
+#define fmiInitialize                 fmiFullName(_fmiInitialize)
+#define fmiGetDerivatives             fmiFullName(_fmiGetDerivatives)
+#define fmiGetEventIndicators         fmiFullName(_fmiGetEventIndicators)
+#define fmiGetReal                    fmiFullName(_fmiGetReal)
+#define fmiGetInteger                 fmiFullName(_fmiGetInteger)
+#define fmiGetBoolean                 fmiFullName(_fmiGetBoolean)
+#define fmiGetString                  fmiFullName(_fmiGetString)
+#define fmiEventUpdate                fmiFullName(_fmiEventUpdate)
+#define fmiGetContinuousStates        fmiFullName(_fmiGetContinuousStates)
+#define fmiGetNominalContinuousStates fmiFullName(_fmiGetNominalContinuousStates)
+#define fmiGetStateValueReferences    fmiFullName(_fmiGetStateValueReferences)
+#define fmiTerminate                  fmiFullName(_fmiTerminate)
+
+
+/* Version number */
+#define fmiVersion "1.0"
+
+/* Inquire version numbers of header files */
+   DllExport const char* fmiGetModelTypesPlatform();
+   DllExport const char* fmiGetVersion();
+
+/* make sure all compiler use the same alignment policies for structures */
+#ifdef WIN32
+#pragma pack(push,8)
+#endif
+
+/* Type definitions */
+   typedef enum  {fmiOK,
+                  fmiWarning,
+                  fmiDiscard,
+                  fmiError,
+                  fmiFatal} fmiStatus;
+
+   typedef void  (*fmiCallbackLogger)        (fmiComponent c, fmiString instanceName, fmiStatus status,
+                                              fmiString category, fmiString message, ...);
+   typedef void* (*fmiCallbackAllocateMemory)(size_t nobj, size_t size);
+   typedef void  (*fmiCallbackFreeMemory)    (void* obj);
+
+   typedef struct {
+     fmiCallbackLogger         logger;
+     fmiCallbackAllocateMemory allocateMemory;
+     fmiCallbackFreeMemory     freeMemory;
+   } fmiCallbackFunctions;
+
+   typedef struct {
+      fmiBoolean iterationConverged;
+      fmiBoolean stateValueReferencesChanged;
+      fmiBoolean stateValuesChanged;
+      fmiBoolean terminateSimulation;
+      fmiBoolean upcomingTimeEvent;
+      fmiReal    nextEventTime;
+   } fmiEventInfo;
+
+/* reset alignment policy to the one set before reading this file */
+#ifdef WIN32
+#pragma pack(pop)
+#endif
+
+/* Creation and destruction of model instances and setting debug status */
+   DllExport fmiComponent fmiInstantiateModel (fmiString            instanceName,
+                                               fmiString            GUID,
+                                               fmiCallbackFunctions functions,
+                                               fmiBoolean           loggingOn);
+   DllExport void      fmiFreeModelInstance(fmiComponent c);
+   DllExport fmiStatus fmiSetDebugLogging  (fmiComponent c, fmiBoolean loggingOn);
+
+
+/* Providing independent variables and re-initialization of caching */
+   DllExport fmiStatus fmiSetTime                (fmiComponent c, fmiReal time);
+   DllExport fmiStatus fmiSetContinuousStates    (fmiComponent c, const fmiReal x[], size_t nx);
+   DllExport fmiStatus fmiCompletedIntegratorStep(fmiComponent c, fmiBoolean* callEventUpdate);
+   DllExport fmiStatus fmiSetReal                (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiReal    value[]);
+   DllExport fmiStatus fmiSetInteger             (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiInteger value[]);
+   DllExport fmiStatus fmiSetBoolean             (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiBoolean value[]);
+   DllExport fmiStatus fmiSetString              (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiString  value[]);
+
+
+/* Evaluation of the model equations */
+   DllExport fmiStatus fmiInitialize(fmiComponent c, fmiBoolean toleranceControlled,
+                                     fmiReal relativeTolerance, fmiEventInfo* eventInfo);
+
+   DllExport fmiStatus fmiGetDerivatives    (fmiComponent c, fmiReal derivatives[]    , size_t nx);
+   DllExport fmiStatus fmiGetEventIndicators(fmiComponent c, fmiReal eventIndicators[], size_t ni);
+
+   DllExport fmiStatus fmiGetReal   (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiReal    value[]);
+   DllExport fmiStatus fmiGetInteger(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiInteger value[]);
+   DllExport fmiStatus fmiGetBoolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiBoolean value[]);
+   DllExport fmiStatus fmiGetString (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiString  value[]);
+
+   DllExport fmiStatus fmiEventUpdate               (fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo* eventInfo);
+   DllExport fmiStatus fmiGetContinuousStates       (fmiComponent c, fmiReal states[], size_t nx);
+   DllExport fmiStatus fmiGetNominalContinuousStates(fmiComponent c, fmiReal x_nominal[], size_t nx);
+   DllExport fmiStatus fmiGetStateValueReferences   (fmiComponent c, fmiValueReference vrx[], size_t nx);
+   DllExport fmiStatus fmiTerminate                 (fmiComponent c);
+
+#endif // fmiModelFunctions_h

+ 91 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/fmiModelTypes.h.svn-base

@@ -0,0 +1,91 @@
+#ifndef fmiModelTypes_h
+#define fmiModelTypes_h
+
+/* Standard header file to define the argument types of the
+   functions of the Model Execution Interface.
+   This header file must be utilized both by the model and
+   by the simulation engine.
+
+   Revisions:
+   - Jan.  4, 2010: Renamed meModelTypes_h to fmiModelTypes_h (by Mauss, QTronic)
+   - Dec. 21, 2009: Changed "me" to "fmi" and "meModel" to "fmiComponent"
+                    according to meeting on Dec. 18 (by Martin Otter, DLR)
+   - Dec.  6, 2009: Added meUndefinedValueReference (by Martin Otter, DLR)
+   - Sept. 9, 2009: Changes according to FMI-meeting on July 21:
+                    Changed "version" to "platform", "standard" to "standard32",
+                    Added a precise definition of "standard32" as comment
+                    (by Martin Otter, DLR)
+   - July 19, 2009: Added "me" as prefix to file names, added meTrue/meFalse,
+                    and changed meValueReferenced from int to unsigned int
+                    (by Martin Otter, DLR).
+   - March 2, 2009: Moved enums and function pointer definitions to
+                    ModelFunctions.h (by Martin Otter, DLR).
+   - Dec. 3, 2008 : First version by Martin Otter (DLR) and
+                    Hans Olsson (Dynasim).
+
+
+   Copyright © 2008-2010, MODELISAR consortium. All rights reserved.
+   This file is licensed by the copyright holders under the BSD License
+   (http://www.opensource.org/licenses/bsd-license.html)
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+*/
+
+/* Platform (combination of machine, compiler, operating system) */
+#define fmiModelTypesPlatform "standard32"
+
+/* Type definitions of variables passed as arguments
+   Version "standard32" means:
+
+   fmiComponent     : 32 bit pointer
+   fmiValueReference: 32 bit
+   fmiReal          : 64 bit
+   fmiInteger       : 32 bit
+   fmiBoolean       :  8 bit
+   fmiString        : 32 bit pointer
+
+*/
+   typedef void*        fmiComponent;
+   typedef unsigned int fmiValueReference;
+   typedef double       fmiReal   ;
+   typedef int          fmiInteger;
+   typedef char         fmiBoolean;
+   typedef const char*  fmiString ;
+
+/* Values for fmiBoolean  */
+#define fmiTrue  1
+#define fmiFalse 0
+
+/* Undefined value for fmiValueReference (largest unsigned int value) */
+#define fmiUndefinedValueReference (fmiValueReference)(-1)
+
+#endif

+ 73 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/.svn/text-base/fmiPlatformTypes.h.svn-base

@@ -0,0 +1,73 @@
+#ifndef fmiPlatformTypes_h
+#define fmiPlatformTypes_h
+
+/* Standard header file to define the argument types of the
+   functions of the Model Execution Interface.
+   This header file must be utilized both by the model and
+   by the simulation engine.
+
+   Revisions:
+   - October 2010: First public Version
+
+
+   Copyright © 2008-2010, MODELISAR consortium. All rights reserved.
+   This file is licensed by the copyright holders under the BSD License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+*/
+
+/* Platform (combination of machine, compiler, operating system) */
+#define fmiPlatform "standard32"
+
+/* Type definitions of variables passed as arguments
+   Version "standard32" means:
+
+   fmiComponent     : 32 bit pointer
+   fmiValueReference: 32 bit
+   fmiReal          : 64 bit
+   fmiInteger       : 32 bit
+   fmiBoolean       :  8 bit
+   fmiString        : 32 bit pointer
+
+*/
+   typedef void*        fmiComponent;
+   typedef unsigned int fmiValueReference;
+   typedef double       fmiReal   ;
+   typedef int          fmiInteger;
+   typedef char         fmiBoolean;
+   typedef const char*  fmiString ;
+
+/* Values for fmiBoolean  */
+#define fmiTrue  1
+#define fmiFalse 0
+
+/* Undefined value for fmiValueReference (largest unsigned int value) */
+#define fmiUndefinedValueReference (fmiValueReference)(-1)
+
+#endif

+ 9 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/FMILIB_FMI1_Readme.txt

@@ -0,0 +1,9 @@
+FMILIB_FMI1_Readme.txt
+======================
+Note that "fmiPlatformTypes.h" is used for compilation of FMILIB.
+It is expected that its contents is consistent with the definitions 
+in "fmiModelTypes.h". Therefore, make sure to provide all the 4 
+header files (both ME and CS interfaces) if you are building for
+non-standard platform.
+
+All the 4 header files are used in FMILIB tests. 

+ 231 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/fmiFunctions.h

@@ -0,0 +1,231 @@
+#ifndef fmiFunctions_h
+#define fmiFunctions_h
+
+/* This header file must be utilized when compiling a FMU.
+   It defines all functions of Co-Simulation Interface.
+   In order to have unique function names even if several FMUs
+   are compiled together (e.g. for embedded systems), every "real" function name
+   is constructed by prepending the function name by
+   "MODEL_IDENTIFIER" + "_" where "MODEL_IDENTIFIER" is the short name
+   of the model used as the name of the zip-file where the model is stored.
+   Therefore, the typical usage is:
+
+      #define MODEL_IDENTIFIER MyModel
+      #include "fmiFunctions.h"
+
+   As a result, a function that is defined as "fmiGetDerivatives" in this header file,
+   is actually getting the name "MyModel_fmiGetDerivatives".
+
+   Revisions:
+   - November 4, 2010: Adapted to specification text:
+                       o fmiGetModelTypesPlatform renamed to fmiGetTypesPlatform
+                       o fmiInstantiateSlave: Argument GUID     replaced by fmuGUID
+                                              Argument mimetype replaced by mimeType
+                       o tabs replaced by spaces
+   - October 16, 2010: First public Version
+
+
+   Copyright © 2008-2010, MODELISAR consortium. All rights reserved.
+   This file is licensed by the copyright holders under the BSD License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+*/
+
+#include "fmiPlatformTypes.h"
+#include <stdlib.h>
+
+/* Export fmi functions on Windows */
+#ifdef _MSC_VER
+#define DllExport __declspec( dllexport )
+#else
+#define DllExport
+#endif
+
+/* Macros to construct the real function name
+   (prepend function name by MODEL_IDENTIFIER + "_") */
+
+#define fmiPaste(a,b)     a ## b
+#define fmiPasteB(a,b)    fmiPaste(a,b)
+#define fmiFullName(name) fmiPasteB(MODEL_IDENTIFIER, name)
+
+/***************************************************
+Common Functions
+****************************************************/
+#define fmiGetTypesPlatform fmiFullName(_fmiGetTypesPlatform)
+#define fmiGetVersion       fmiFullName(_fmiGetVersion)
+#define fmiSetDebugLogging  fmiFullName(_fmiSetDebugLogging)
+
+/*Data Exchange*/
+#define fmiSetReal               fmiFullName(_fmiSetReal)
+#define fmiSetInteger            fmiFullName(_fmiSetInteger)
+#define fmiSetBoolean            fmiFullName(_fmiSetBoolean)
+#define fmiSetString             fmiFullName(_fmiSetString)
+
+#define fmiGetReal               fmiFullName(_fmiGetReal)
+#define fmiGetInteger            fmiFullName(_fmiGetInteger)
+#define fmiGetBoolean            fmiFullName(_fmiGetBoolean)
+#define fmiGetString             fmiFullName(_fmiGetString)
+
+/***************************************************
+Functions for FMI for Co-Simulation
+****************************************************/
+#define fmiInstantiateSlave         fmiFullName(_fmiInstantiateSlave)
+#define fmiInitializeSlave          fmiFullName(_fmiInitializeSlave)
+#define fmiTerminateSlave           fmiFullName(_fmiTerminateSlave)
+#define fmiResetSlave               fmiFullName(_fmiResetSlave)
+#define fmiFreeSlaveInstance        fmiFullName(_fmiFreeSlaveInstance)
+#define fmiSetRealInputDerivatives  fmiFullName(_fmiSetRealInputDerivatives)
+#define fmiGetRealOutputDerivatives fmiFullName(_fmiGetRealOutputDerivatives)
+#define fmiDoStep                   fmiFullName(_fmiDoStep)
+#define fmiCancelStep               fmiFullName(_fmiCancelStep)
+#define fmiGetStatus                fmiFullName(_fmiGetStatus)
+#define fmiGetRealStatus            fmiFullName(_fmiGetRealStatus)
+#define fmiGetIntegerStatus         fmiFullName(_fmiGetIntegerStatus)
+#define fmiGetBooleanStatus         fmiFullName(_fmiGetBooleanStatus)
+#define fmiGetStringStatus          fmiFullName(_fmiGetStringStatus)
+
+/* Version number */
+#define fmiVersion "1.0"
+
+/* make sure all compiler use the same alignment policies for structures */
+#ifdef WIN32
+#pragma pack(push,8)
+#endif
+
+
+/* Type definitions */
+     typedef enum {fmiOK,
+                   fmiWarning,
+                   fmiDiscard,
+                   fmiError,
+                   fmiFatal,
+                   fmiPending} fmiStatus;
+
+     typedef void  (*fmiCallbackLogger) (fmiComponent c, fmiString instanceName, fmiStatus status,
+                                         fmiString category, fmiString message, ...);
+     typedef void* (*fmiCallbackAllocateMemory)(size_t nobj, size_t size);
+     typedef void  (*fmiCallbackFreeMemory)    (void* obj);
+     typedef void  (*fmiStepFinished)          (fmiComponent c, fmiStatus status);
+
+     typedef struct {
+     fmiCallbackLogger         logger;
+     fmiCallbackAllocateMemory allocateMemory;
+     fmiCallbackFreeMemory     freeMemory;
+     fmiStepFinished           stepFinished;
+     } fmiCallbackFunctions;
+
+   typedef struct {
+      fmiBoolean iterationConverged;
+      fmiBoolean stateValueReferencesChanged;
+      fmiBoolean stateValuesChanged;
+      fmiBoolean terminateSimulation;
+      fmiBoolean upcomingTimeEvent;
+      fmiReal    nextEventTime;
+   } fmiEventInfo;
+
+/* reset alignment policy to the one set before reading this file */
+#ifdef WIN32
+#pragma pack(pop)
+#endif
+
+/***************************************************
+Common Functions
+****************************************************/
+
+/* Inquire version numbers of header files */
+   DllExport const char* fmiGetTypesPlatform();
+   DllExport const char* fmiGetVersion();
+
+   DllExport fmiStatus fmiSetDebugLogging  (fmiComponent c, fmiBoolean loggingOn);
+
+/* Data Exchange Functions*/
+   DllExport fmiStatus fmiGetReal   (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiReal    value[]);
+   DllExport fmiStatus fmiGetInteger(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiInteger value[]);
+   DllExport fmiStatus fmiGetBoolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiBoolean value[]);
+   DllExport fmiStatus fmiGetString (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiString  value[]);
+
+   DllExport fmiStatus fmiSetReal    (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiReal    value[]);
+   DllExport fmiStatus fmiSetInteger (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiInteger value[]);
+   DllExport fmiStatus fmiSetBoolean (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiBoolean value[]);
+   DllExport fmiStatus fmiSetString  (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiString  value[]);
+
+/***************************************************
+Functions for FMI for Co-Simulation
+****************************************************/
+
+/* Creation and destruction of slave instances and setting debug status */
+   DllExport fmiComponent fmiInstantiateSlave(fmiString  instanceName,
+                                              fmiString  fmuGUID,
+                                              fmiString  fmuLocation,
+                                              fmiString  mimeType,
+                                              fmiReal    timeout,
+                                              fmiBoolean visible,
+                                              fmiBoolean interactive,
+                                              fmiCallbackFunctions functions,
+                                              fmiBoolean loggingOn);
+
+   DllExport fmiStatus fmiInitializeSlave(fmiComponent c,
+                                          fmiReal      tStart,
+                                          fmiBoolean   StopTimeDefined,
+                                          fmiReal      tStop);
+
+   DllExport fmiStatus fmiTerminateSlave   (fmiComponent c);
+   DllExport fmiStatus fmiResetSlave       (fmiComponent c);
+   DllExport void      fmiFreeSlaveInstance(fmiComponent c);
+
+   DllExport fmiStatus fmiSetRealInputDerivatives(fmiComponent c,
+                                                  const  fmiValueReference vr[],
+                                                  size_t nvr,
+                                                  const  fmiInteger order[],
+                                                  const  fmiReal value[]);
+
+   DllExport fmiStatus fmiGetRealOutputDerivatives(fmiComponent c,
+                                                   const   fmiValueReference vr[],
+                                                   size_t  nvr,
+                                                   const   fmiInteger order[],
+                                                   fmiReal value[]);
+
+   DllExport fmiStatus fmiCancelStep(fmiComponent c);
+   DllExport fmiStatus fmiDoStep    (fmiComponent c,
+                                     fmiReal      currentCommunicationPoint,
+                                     fmiReal      communicationStepSize,
+                                     fmiBoolean   newStep);
+
+
+   typedef enum {fmiDoStepStatus,
+                 fmiPendingStatus,
+                 fmiLastSuccessfulTime} fmiStatusKind;
+
+   DllExport fmiStatus fmiGetStatus       (fmiComponent c, const fmiStatusKind s, fmiStatus*  value);
+   DllExport fmiStatus fmiGetRealStatus   (fmiComponent c, const fmiStatusKind s, fmiReal*    value);
+   DllExport fmiStatus fmiGetIntegerStatus(fmiComponent c, const fmiStatusKind s, fmiInteger* value);
+   DllExport fmiStatus fmiGetBooleanStatus(fmiComponent c, const fmiStatusKind s, fmiBoolean* value);
+   DllExport fmiStatus fmiGetStringStatus (fmiComponent c, const fmiStatusKind s, fmiString*  value);
+
+
+#endif // fmiFunctions_h

+ 210 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/fmiModelFunctions.h

@@ -0,0 +1,210 @@
+#ifndef fmiModelFunctions_h
+#define fmiModelFunctions_h
+
+/* This header file must be utilized when compiling a model.
+   It defines all functions of the Model Execution Interface.
+   In order to have unique function names even if several models
+   are compiled together (e.g. for embedded systems), every "real" function name
+   is constructed by prepending the function name by
+   "MODEL_IDENTIFIER" + "_" where "MODEL_IDENTIFIER" is the short name
+   of the model used as the name of the zip-file where the model is stored.
+   Therefore, the typical usage is:
+
+      #define MODEL_IDENTIFIER MyModel
+      #include "fmiModelFunctions.h"
+
+   As a result, a function that is defined as "fmiGetDerivatives" in this header file,
+   is actually getting the name "MyModel_fmiGetDerivatives".
+
+   Revisions:
+   - Jan. 20, 2010: stateValueReferencesChanged added to struct fmiEventInfo (ticket #27)
+                    (by M. Otter, DLR)
+                    Added WIN32 pragma to define the struct layout (ticket #34)
+                    (by J. Mauss, QTronic)
+   - Jan.  4, 2010: Removed argument intermediateResults from fmiInitialize
+                    Renamed macro fmiGetModelFunctionsVersion to fmiGetVersion
+                    Renamed macro fmiModelFunctionsVersion to fmiVersion
+                    Replaced fmiModel by fmiComponent in decl of fmiInstantiateModel
+                    (by J. Mauss, QTronic)
+   - Dec. 17, 2009: Changed extension "me" to "fmi" (by Martin Otter, DLR).
+   - Dez. 14, 2009: Added eventInfo to meInitialize and added
+                    meGetNominalContinuousStates (by Martin Otter, DLR)
+   - Sept. 9, 2009: Added DllExport (according to Peter Nilsson's suggestion)
+                    (by A. Junghanns, QTronic)
+   - Sept. 9, 2009: Changes according to FMI-meeting on July 21:
+                    meInquireModelTypesVersion     -> meGetModelTypesPlatform
+                    meInquireModelFunctionsVersion -> meGetModelFunctionsVersion
+                    meSetStates                    -> meSetContinuousStates
+                    meGetStates                    -> meGetContinuousStates
+                    removal of meInitializeModelClass
+                    removal of meGetTime
+                    change of arguments of meInstantiateModel
+                    change of arguments of meCompletedIntegratorStep
+                    (by Martin Otter, DLR):
+   - July 19, 2009: Added "me" as prefix to file names (by Martin Otter, DLR).
+   - March 2, 2009: Changed function definitions according to the last design
+                    meeting with additional improvements (by Martin Otter, DLR).
+   - Dec. 3 , 2008: First version by Martin Otter (DLR) and Hans Olsson (Dynasim).
+
+
+   Copyright © 2008-2009, MODELISAR consortium. All rights reserved.
+   This file is licensed by the copyright holders under the BSD License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+*/
+
+#include "fmiModelTypes.h"
+#include <stdlib.h>
+
+/* Export fmi functions on Windows */
+#ifdef _MSC_VER
+#define DllExport __declspec( dllexport )
+#else
+#define DllExport
+#endif
+
+/* Macros to construct the real function name
+   (prepend function name by MODEL_IDENTIFIER + "_") */
+
+#define fmiPaste(a,b)     a ## b
+#define fmiPasteB(a,b)    fmiPaste(a,b)
+#define fmiFullName(name) fmiPasteB(MODEL_IDENTIFIER, name)
+
+#define fmiGetModelTypesPlatform      fmiFullName(_fmiGetModelTypesPlatform)
+#define fmiGetVersion                 fmiFullName(_fmiGetVersion)
+#define fmiInstantiateModel           fmiFullName(_fmiInstantiateModel)
+#define fmiFreeModelInstance          fmiFullName(_fmiFreeModelInstance)
+#define fmiSetDebugLogging            fmiFullName(_fmiSetDebugLogging)
+#define fmiSetTime                    fmiFullName(_fmiSetTime)
+#define fmiSetContinuousStates        fmiFullName(_fmiSetContinuousStates)
+#define fmiCompletedIntegratorStep    fmiFullName(_fmiCompletedIntegratorStep)
+#define fmiSetReal                    fmiFullName(_fmiSetReal)
+#define fmiSetInteger                 fmiFullName(_fmiSetInteger)
+#define fmiSetBoolean                 fmiFullName(_fmiSetBoolean)
+#define fmiSetString                  fmiFullName(_fmiSetString)
+#define fmiInitialize                 fmiFullName(_fmiInitialize)
+#define fmiGetDerivatives             fmiFullName(_fmiGetDerivatives)
+#define fmiGetEventIndicators         fmiFullName(_fmiGetEventIndicators)
+#define fmiGetReal                    fmiFullName(_fmiGetReal)
+#define fmiGetInteger                 fmiFullName(_fmiGetInteger)
+#define fmiGetBoolean                 fmiFullName(_fmiGetBoolean)
+#define fmiGetString                  fmiFullName(_fmiGetString)
+#define fmiEventUpdate                fmiFullName(_fmiEventUpdate)
+#define fmiGetContinuousStates        fmiFullName(_fmiGetContinuousStates)
+#define fmiGetNominalContinuousStates fmiFullName(_fmiGetNominalContinuousStates)
+#define fmiGetStateValueReferences    fmiFullName(_fmiGetStateValueReferences)
+#define fmiTerminate                  fmiFullName(_fmiTerminate)
+
+
+/* Version number */
+#define fmiVersion "1.0"
+
+/* Inquire version numbers of header files */
+   DllExport const char* fmiGetModelTypesPlatform();
+   DllExport const char* fmiGetVersion();
+
+/* make sure all compiler use the same alignment policies for structures */
+#ifdef WIN32
+#pragma pack(push,8)
+#endif
+
+/* Type definitions */
+   typedef enum  {fmiOK,
+                  fmiWarning,
+                  fmiDiscard,
+                  fmiError,
+                  fmiFatal} fmiStatus;
+
+   typedef void  (*fmiCallbackLogger)        (fmiComponent c, fmiString instanceName, fmiStatus status,
+                                              fmiString category, fmiString message, ...);
+   typedef void* (*fmiCallbackAllocateMemory)(size_t nobj, size_t size);
+   typedef void  (*fmiCallbackFreeMemory)    (void* obj);
+
+   typedef struct {
+     fmiCallbackLogger         logger;
+     fmiCallbackAllocateMemory allocateMemory;
+     fmiCallbackFreeMemory     freeMemory;
+   } fmiCallbackFunctions;
+
+   typedef struct {
+      fmiBoolean iterationConverged;
+      fmiBoolean stateValueReferencesChanged;
+      fmiBoolean stateValuesChanged;
+      fmiBoolean terminateSimulation;
+      fmiBoolean upcomingTimeEvent;
+      fmiReal    nextEventTime;
+   } fmiEventInfo;
+
+/* reset alignment policy to the one set before reading this file */
+#ifdef WIN32
+#pragma pack(pop)
+#endif
+
+/* Creation and destruction of model instances and setting debug status */
+   DllExport fmiComponent fmiInstantiateModel (fmiString            instanceName,
+                                               fmiString            GUID,
+                                               fmiCallbackFunctions functions,
+                                               fmiBoolean           loggingOn);
+   DllExport void      fmiFreeModelInstance(fmiComponent c);
+   DllExport fmiStatus fmiSetDebugLogging  (fmiComponent c, fmiBoolean loggingOn);
+
+
+/* Providing independent variables and re-initialization of caching */
+   DllExport fmiStatus fmiSetTime                (fmiComponent c, fmiReal time);
+   DllExport fmiStatus fmiSetContinuousStates    (fmiComponent c, const fmiReal x[], size_t nx);
+   DllExport fmiStatus fmiCompletedIntegratorStep(fmiComponent c, fmiBoolean* callEventUpdate);
+   DllExport fmiStatus fmiSetReal                (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiReal    value[]);
+   DllExport fmiStatus fmiSetInteger             (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiInteger value[]);
+   DllExport fmiStatus fmiSetBoolean             (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiBoolean value[]);
+   DllExport fmiStatus fmiSetString              (fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmiString  value[]);
+
+
+/* Evaluation of the model equations */
+   DllExport fmiStatus fmiInitialize(fmiComponent c, fmiBoolean toleranceControlled,
+                                     fmiReal relativeTolerance, fmiEventInfo* eventInfo);
+
+   DllExport fmiStatus fmiGetDerivatives    (fmiComponent c, fmiReal derivatives[]    , size_t nx);
+   DllExport fmiStatus fmiGetEventIndicators(fmiComponent c, fmiReal eventIndicators[], size_t ni);
+
+   DllExport fmiStatus fmiGetReal   (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiReal    value[]);
+   DllExport fmiStatus fmiGetInteger(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiInteger value[]);
+   DllExport fmiStatus fmiGetBoolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiBoolean value[]);
+   DllExport fmiStatus fmiGetString (fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiString  value[]);
+
+   DllExport fmiStatus fmiEventUpdate               (fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo* eventInfo);
+   DllExport fmiStatus fmiGetContinuousStates       (fmiComponent c, fmiReal states[], size_t nx);
+   DllExport fmiStatus fmiGetNominalContinuousStates(fmiComponent c, fmiReal x_nominal[], size_t nx);
+   DllExport fmiStatus fmiGetStateValueReferences   (fmiComponent c, fmiValueReference vrx[], size_t nx);
+   DllExport fmiStatus fmiTerminate                 (fmiComponent c);
+
+#endif // fmiModelFunctions_h

+ 91 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/fmiModelTypes.h

@@ -0,0 +1,91 @@
+#ifndef fmiModelTypes_h
+#define fmiModelTypes_h
+
+/* Standard header file to define the argument types of the
+   functions of the Model Execution Interface.
+   This header file must be utilized both by the model and
+   by the simulation engine.
+
+   Revisions:
+   - Jan.  4, 2010: Renamed meModelTypes_h to fmiModelTypes_h (by Mauss, QTronic)
+   - Dec. 21, 2009: Changed "me" to "fmi" and "meModel" to "fmiComponent"
+                    according to meeting on Dec. 18 (by Martin Otter, DLR)
+   - Dec.  6, 2009: Added meUndefinedValueReference (by Martin Otter, DLR)
+   - Sept. 9, 2009: Changes according to FMI-meeting on July 21:
+                    Changed "version" to "platform", "standard" to "standard32",
+                    Added a precise definition of "standard32" as comment
+                    (by Martin Otter, DLR)
+   - July 19, 2009: Added "me" as prefix to file names, added meTrue/meFalse,
+                    and changed meValueReferenced from int to unsigned int
+                    (by Martin Otter, DLR).
+   - March 2, 2009: Moved enums and function pointer definitions to
+                    ModelFunctions.h (by Martin Otter, DLR).
+   - Dec. 3, 2008 : First version by Martin Otter (DLR) and
+                    Hans Olsson (Dynasim).
+
+
+   Copyright © 2008-2010, MODELISAR consortium. All rights reserved.
+   This file is licensed by the copyright holders under the BSD License
+   (http://www.opensource.org/licenses/bsd-license.html)
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+*/
+
+/* Platform (combination of machine, compiler, operating system) */
+#define fmiModelTypesPlatform "standard32"
+
+/* Type definitions of variables passed as arguments
+   Version "standard32" means:
+
+   fmiComponent     : 32 bit pointer
+   fmiValueReference: 32 bit
+   fmiReal          : 64 bit
+   fmiInteger       : 32 bit
+   fmiBoolean       :  8 bit
+   fmiString        : 32 bit pointer
+
+*/
+   typedef void*        fmiComponent;
+   typedef unsigned int fmiValueReference;
+   typedef double       fmiReal   ;
+   typedef int          fmiInteger;
+   typedef char         fmiBoolean;
+   typedef const char*  fmiString ;
+
+/* Values for fmiBoolean  */
+#define fmiTrue  1
+#define fmiFalse 0
+
+/* Undefined value for fmiValueReference (largest unsigned int value) */
+#define fmiUndefinedValueReference (fmiValueReference)(-1)
+
+#endif

+ 73 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI1/fmiPlatformTypes.h

@@ -0,0 +1,73 @@
+#ifndef fmiPlatformTypes_h
+#define fmiPlatformTypes_h
+
+/* Standard header file to define the argument types of the
+   functions of the Model Execution Interface.
+   This header file must be utilized both by the model and
+   by the simulation engine.
+
+   Revisions:
+   - October 2010: First public Version
+
+
+   Copyright © 2008-2010, MODELISAR consortium. All rights reserved.
+   This file is licensed by the copyright holders under the BSD License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+*/
+
+/* Platform (combination of machine, compiler, operating system) */
+#define fmiPlatform "standard32"
+
+/* Type definitions of variables passed as arguments
+   Version "standard32" means:
+
+   fmiComponent     : 32 bit pointer
+   fmiValueReference: 32 bit
+   fmiReal          : 64 bit
+   fmiInteger       : 32 bit
+   fmiBoolean       :  8 bit
+   fmiString        : 32 bit pointer
+
+*/
+   typedef void*        fmiComponent;
+   typedef unsigned int fmiValueReference;
+   typedef double       fmiReal   ;
+   typedef int          fmiInteger;
+   typedef char         fmiBoolean;
+   typedef const char*  fmiString ;
+
+/* Values for fmiBoolean  */
+#define fmiTrue  1
+#define fmiFalse 0
+
+/* Undefined value for fmiValueReference (largest unsigned int value) */
+#define fmiUndefinedValueReference (fmiValueReference)(-1)
+
+#endif

+ 23 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/all-wcprops

@@ -0,0 +1,23 @@
+K 25
+svn:wc:ra_dav:version-url
+V 64
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI2
+END
+fmi2Functions.h
+K 25
+svn:wc:ra_dav:version-url
+V 80
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI2/fmi2Functions.h
+END
+fmi2TypesPlatform.h
+K 25
+svn:wc:ra_dav:version-url
+V 84
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI2/fmi2TypesPlatform.h
+END
+fmi2FunctionTypes.h
+K 25
+svn:wc:ra_dav:version-url
+V 84
+/!svn/ver/6332/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI2/fmi2FunctionTypes.h
+END

+ 130 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/entries

@@ -0,0 +1,130 @@
+10
+
+dir
+6333
+https://svn.jmodelica.org/FMILibrary/tags/2.0b3/ThirdParty/FMI/default/FMI2
+https://svn.jmodelica.org
+
+
+
+2014-05-08T16:23:10.613934Z
+6322
+ziegler
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7ae51c65-13d5-4921-9d80-6511ddd1419c
+
+fmi2Functions.h
+file
+
+
+
+
+2014-05-09T14:13:52.957200Z
+a776ded36da7892a6e514b213b363ab9
+2014-05-08T16:23:10.613934Z
+6322
+ziegler
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+17300
+
+fmi2TypesPlatform.h
+file
+
+
+
+
+2014-05-09T14:13:52.957200Z
+97f4e9d2590e0287d86addf943d76f71
+2014-05-08T16:23:10.613934Z
+6322
+ziegler
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6203
+
+fmi2FunctionTypes.h
+file
+
+
+
+
+2014-05-09T14:13:52.957200Z
+05ef7408dda62a6031558b0e7c6eae01
+2014-05-08T16:23:10.613934Z
+6322
+ziegler
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+12483
+

+ 243 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/text-base/fmi2FunctionTypes.h.svn-base

@@ -0,0 +1,243 @@
+#ifndef fmi2FunctionTypes_h
+#define fmi2FunctionTypes_h
+
+#include "fmi2TypesPlatform.h"
+
+/* This header file must be utilized when compiling an FMU or an FMI master.
+   It declares data and function types for FMI 2.0
+
+   Revisions:
+   - Apr.  9, 2014: all prefixes "fmi" renamed to "fmi2" (decision from April 8)
+   - Apr.  3, 2014: Added #include <stddef.h> for size_t definition
+   - Mar. 27, 2014: Added #include "fmiTypesPlatform.h" (#179)
+   - Mar. 26, 2014: Introduced function argument "void" for the functions (#171)
+                      fmiGetTypesPlatformTYPE and fmiGetVersionTYPE
+   - Oct. 11, 2013: Functions of ModelExchange and CoSimulation merged:
+                      fmiInstantiateModelTYPE , fmiInstantiateSlaveTYPE  -> fmiInstantiateTYPE
+                      fmiFreeModelInstanceTYPE, fmiFreeSlaveInstanceTYPE -> fmiFreeInstanceTYPE
+                      fmiEnterModelInitializationModeTYPE, fmiEnterSlaveInitializationModeTYPE -> fmiEnterInitializationModeTYPE
+                      fmiExitModelInitializationModeTYPE , fmiExitSlaveInitializationModeTYPE  -> fmiExitInitializationModeTYPE
+                      fmiTerminateModelTYPE , fmiTerminateSlaveTYPE  -> fmiTerminate
+                      fmiResetSlave -> fmiReset (now also for ModelExchange and not only for CoSimulation)
+                    Functions renamed
+                      fmiUpdateDiscreteStatesTYPE -> fmiNewDiscreteStatesTYPE
+                    Renamed elements of the enumeration fmiEventInfo
+                      upcomingTimeEvent             -> nextEventTimeDefined // due to generic naming scheme: varDefined + var
+                      newUpdateDiscreteStatesNeeded -> newDiscreteStatesNeeded;
+   - June 13, 2013: Changed type fmiEventInfo
+                    Functions removed:
+                       fmiInitializeModelTYPE
+                       fmiEventUpdateTYPE
+                       fmiCompletedEventIterationTYPE
+                       fmiInitializeSlaveTYPE
+                    Functions added:
+                       fmiEnterModelInitializationModeTYPE
+                       fmiExitModelInitializationModeTYPE
+                       fmiEnterEventModeTYPE
+                       fmiUpdateDiscreteStatesTYPE
+                       fmiEnterContinuousTimeModeTYPE
+                       fmiEnterSlaveInitializationModeTYPE;
+                       fmiExitSlaveInitializationModeTYPE;
+   - Feb. 17, 2013: Added third argument to fmiCompletedIntegratorStepTYPE
+                    Changed function name "fmiTerminateType" to "fmiTerminateModelType" (due to #113)
+                    Changed function name "fmiGetNominalContinuousStateTYPE" to
+                                          "fmiGetNominalsOfContinuousStatesTYPE"
+                    Removed fmiGetStateValueReferencesTYPE.
+   - Nov. 14, 2011: First public Version
+
+
+   Copyright © 2011 MODELISAR consortium,
+               2012-2013 Modelica Association Project "FMI"
+               All rights reserved.
+   This file is licensed by the copyright holders under the BSD 2-Clause License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+   (Note, this means that if you distribute a modified file,
+    the modified file must also be provided under this license).
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* make sure all compiler use the same alignment policies for structures */
+#if defined _MSC_VER || defined __GNUC__
+#pragma pack(push,8)
+#endif
+
+/* Include stddef.h, in order that size_t etc. is defined */
+#include <stddef.h>
+
+
+/* Type definitions */
+typedef enum {
+    fmi2OK,
+    fmi2Warning,
+    fmi2Discard,
+    fmi2Error,
+    fmi2Fatal,
+    fmi2Pending
+} fmi2Status;
+
+typedef enum {
+    fmi2ModelExchange,
+    fmi2CoSimulation
+} fmi2Type;
+
+typedef enum {
+    fmi2DoStepStatus,
+    fmi2PendingStatus,
+    fmi2LastSuccessfulTime,
+    fmi2Terminated
+} fmi2StatusKind;
+
+typedef void      (*fmi2CallbackLogger)        (fmi2ComponentEnvironment, fmi2String, fmi2Status, fmi2String, fmi2String, ...);
+typedef void*     (*fmi2CallbackAllocateMemory)(size_t, size_t);
+typedef void      (*fmi2CallbackFreeMemory)    (void*);
+typedef void      (*fmi2StepFinished)          (fmi2ComponentEnvironment, fmi2Status);
+
+typedef struct {
+   const fmi2CallbackLogger         logger;
+   const fmi2CallbackAllocateMemory allocateMemory;
+   const fmi2CallbackFreeMemory     freeMemory;
+   const fmi2StepFinished           stepFinished;
+   const fmi2ComponentEnvironment   componentEnvironment;
+} fmi2CallbackFunctions;
+
+typedef struct {
+	 fmi2Boolean newDiscreteStatesNeeded;
+   fmi2Boolean terminateSimulation;
+   fmi2Boolean nominalsOfContinuousStatesChanged;
+   fmi2Boolean valuesOfContinuousStatesChanged;
+   fmi2Boolean nextEventTimeDefined;
+   fmi2Real    nextEventTime;
+} fmi2EventInfo;
+
+
+/* reset alignment policy to the one set before reading this file */
+#if defined _MSC_VER || defined __GNUC__
+#pragma pack(pop)
+#endif
+
+
+/* Define fmi2 function pointer types to simplify dynamic loading */
+
+/***************************************************
+Types for Common Functions
+****************************************************/
+
+/* Inquire version numbers of header files and setting logging status */
+   typedef const char* fmi2GetTypesPlatformTYPE(void);
+   typedef const char* fmi2GetVersionTYPE(void);
+   typedef fmi2Status  fmi2SetDebugLoggingTYPE(fmi2Component, fmi2Boolean, size_t, const fmi2String[]);
+
+/* Creation and destruction of FMU instances and setting debug status */
+   typedef fmi2Component fmi2InstantiateTYPE (fmi2String, fmi2Type, fmi2String, fmi2String, const fmi2CallbackFunctions*, fmi2Boolean, fmi2Boolean);
+   typedef void          fmi2FreeInstanceTYPE(fmi2Component);
+
+/* Enter and exit initialization mode, terminate and reset */
+   typedef fmi2Status fmi2SetupExperimentTYPE        (fmi2Component, fmi2Boolean, fmi2Real, fmi2Real, fmi2Boolean, fmi2Real);
+   typedef fmi2Status fmi2EnterInitializationModeTYPE(fmi2Component);
+   typedef fmi2Status fmi2ExitInitializationModeTYPE (fmi2Component);
+   typedef fmi2Status fmi2TerminateTYPE              (fmi2Component);
+   typedef fmi2Status fmi2ResetTYPE                  (fmi2Component);
+
+/* Getting and setting variable values */
+   typedef fmi2Status fmi2GetRealTYPE   (fmi2Component, const fmi2ValueReference[], size_t, fmi2Real   []);
+   typedef fmi2Status fmi2GetIntegerTYPE(fmi2Component, const fmi2ValueReference[], size_t, fmi2Integer[]);
+   typedef fmi2Status fmi2GetBooleanTYPE(fmi2Component, const fmi2ValueReference[], size_t, fmi2Boolean[]);
+   typedef fmi2Status fmi2GetStringTYPE (fmi2Component, const fmi2ValueReference[], size_t, fmi2String []);
+
+   typedef fmi2Status fmi2SetRealTYPE   (fmi2Component, const fmi2ValueReference[], size_t, const fmi2Real   []);
+   typedef fmi2Status fmi2SetIntegerTYPE(fmi2Component, const fmi2ValueReference[], size_t, const fmi2Integer[]);
+   typedef fmi2Status fmi2SetBooleanTYPE(fmi2Component, const fmi2ValueReference[], size_t, const fmi2Boolean[]);
+   typedef fmi2Status fmi2SetStringTYPE (fmi2Component, const fmi2ValueReference[], size_t, const fmi2String []);
+
+/* Getting and setting the internal FMU state */
+   typedef fmi2Status fmi2GetFMUstateTYPE           (fmi2Component, fmi2FMUstate*);
+   typedef fmi2Status fmi2SetFMUstateTYPE           (fmi2Component, fmi2FMUstate);
+   typedef fmi2Status fmi2FreeFMUstateTYPE          (fmi2Component, fmi2FMUstate*);
+   typedef fmi2Status fmi2SerializedFMUstateSizeTYPE(fmi2Component, fmi2FMUstate, size_t*);
+   typedef fmi2Status fmi2SerializeFMUstateTYPE     (fmi2Component, fmi2FMUstate, fmi2Byte[], size_t);
+   typedef fmi2Status fmi2DeSerializeFMUstateTYPE   (fmi2Component, const fmi2Byte[], size_t, fmi2FMUstate*);
+
+/* Getting partial derivatives */
+   typedef fmi2Status fmi2GetDirectionalDerivativeTYPE(fmi2Component, const fmi2ValueReference[], size_t,
+                                                                   const fmi2ValueReference[], size_t,
+                                                                   const fmi2Real[], fmi2Real[]);
+
+/***************************************************
+Types for Functions for FMI2 for Model Exchange
+****************************************************/
+
+/* Enter and exit the different modes */
+   typedef fmi2Status fmi2EnterEventModeTYPE         (fmi2Component);
+   typedef fmi2Status fmi2NewDiscreteStatesTYPE      (fmi2Component, fmi2EventInfo*);
+   typedef fmi2Status fmi2EnterContinuousTimeModeTYPE(fmi2Component);
+   typedef fmi2Status fmi2CompletedIntegratorStepTYPE(fmi2Component, fmi2Boolean, fmi2Boolean*, fmi2Boolean*);
+
+/* Providing independent variables and re-initialization of caching */
+   typedef fmi2Status fmi2SetTimeTYPE            (fmi2Component, fmi2Real);
+   typedef fmi2Status fmi2SetContinuousStatesTYPE(fmi2Component, const fmi2Real[], size_t);
+
+/* Evaluation of the model equations */
+   typedef fmi2Status fmi2GetDerivativesTYPE               (fmi2Component, fmi2Real[], size_t);
+   typedef fmi2Status fmi2GetEventIndicatorsTYPE           (fmi2Component, fmi2Real[], size_t);
+   typedef fmi2Status fmi2GetContinuousStatesTYPE          (fmi2Component, fmi2Real[], size_t);
+   typedef fmi2Status fmi2GetNominalsOfContinuousStatesTYPE(fmi2Component, fmi2Real[], size_t);
+
+
+/***************************************************
+Types for Functions for FMI2 for Co-Simulation
+****************************************************/
+
+/* Simulating the slave */
+   typedef fmi2Status fmi2SetRealInputDerivativesTYPE (fmi2Component, const fmi2ValueReference [], size_t, const fmi2Integer [], const fmi2Real []);
+   typedef fmi2Status fmi2GetRealOutputDerivativesTYPE(fmi2Component, const fmi2ValueReference [], size_t, const fmi2Integer [], fmi2Real []);
+
+   typedef fmi2Status fmi2DoStepTYPE     (fmi2Component, fmi2Real, fmi2Real, fmi2Boolean);
+   typedef fmi2Status fmi2CancelStepTYPE (fmi2Component);
+
+/* Inquire slave status */
+   typedef fmi2Status fmi2GetStatusTYPE       (fmi2Component, const fmi2StatusKind, fmi2Status* );
+   typedef fmi2Status fmi2GetRealStatusTYPE   (fmi2Component, const fmi2StatusKind, fmi2Real*   );
+   typedef fmi2Status fmi2GetIntegerStatusTYPE(fmi2Component, const fmi2StatusKind, fmi2Integer*);
+   typedef fmi2Status fmi2GetBooleanStatusTYPE(fmi2Component, const fmi2StatusKind, fmi2Boolean*);
+   typedef fmi2Status fmi2GetStringStatusTYPE (fmi2Component, const fmi2StatusKind, fmi2String* );
+
+
+#ifdef __cplusplus
+}  /* end of extern "C" { */
+#endif
+
+#endif /* fmi2FunctionTypes_h */

+ 333 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/text-base/fmi2Functions.h.svn-base

@@ -0,0 +1,333 @@
+#ifndef fmi2Functions_h
+#define fmi2Functions_h
+
+/* This header file must be utilized when compiling a FMU.
+   It defines all functions of the
+         FMI 2.0 Model Exchange and Co-Simulation Interface.
+
+   In order to have unique function names even if several FMUs
+   are compiled together (e.g. for embedded systems), every "real" function name
+   is constructed by prepending the function name by "FMI2_FUNCTION_PREFIX".
+   Therefore, the typical usage is:
+
+      #define FMI2_FUNCTION_PREFIX MyModel_
+      #include "fmi2Functions.h"
+
+   As a result, a function that is defined as "fmi2GetDerivatives" in this header file,
+   is actually getting the name "MyModel_fmi2GetDerivatives".
+
+   This only holds if the FMU is shipped in C source code, or is compiled in a
+   static link library. For FMUs compiled in a DLL/sharedObject, the "actual" function
+   names are used and "FMI2_FUNCTION_PREFIX" must not be defined.
+
+   Revisions:
+   - Apr.  9, 2014: all prefixes "fmi" renamed to "fmi2" (decision from April 8)
+   - Mar. 26, 2014: FMI_Export set to empty value if FMI_Export and FMI_FUNCTION_PREFIX
+                    are not defined (#173)
+   - Oct. 11, 2013: Functions of ModelExchange and CoSimulation merged:
+                      fmiInstantiateModel , fmiInstantiateSlave  -> fmiInstantiate
+                      fmiFreeModelInstance, fmiFreeSlaveInstance -> fmiFreeInstance
+                      fmiEnterModelInitializationMode, fmiEnterSlaveInitializationMode -> fmiEnterInitializationMode
+                      fmiExitModelInitializationMode , fmiExitSlaveInitializationMode  -> fmiExitInitializationMode
+                      fmiTerminateModel, fmiTerminateSlave  -> fmiTerminate
+                      fmiResetSlave -> fmiReset (now also for ModelExchange and not only for CoSimulation)
+                    Functions renamed:
+                      fmiUpdateDiscreteStates -> fmiNewDiscreteStates
+   - June 13, 2013: Functions removed:
+                       fmiInitializeModel
+                       fmiEventUpdate
+                       fmiCompletedEventIteration
+                       fmiInitializeSlave
+                    Functions added:
+                       fmiEnterModelInitializationMode
+                       fmiExitModelInitializationMode
+                       fmiEnterEventMode
+                       fmiUpdateDiscreteStates
+                       fmiEnterContinuousTimeMode
+                       fmiEnterSlaveInitializationMode;
+                       fmiExitSlaveInitializationMode;
+   - Feb. 17, 2013: Portability improvements:
+                       o DllExport changed to FMI_Export
+                       o FUNCTION_PREFIX changed to FMI_FUNCTION_PREFIX
+                       o Allow undefined FMI_FUNCTION_PREFIX (meaning no prefix is used)
+                    Changed function name "fmiTerminate" to "fmiTerminateModel" (due to #113)
+                    Changed function name "fmiGetNominalContinuousState" to
+                                          "fmiGetNominalsOfContinuousStates"
+                    Removed fmiGetStateValueReferences.
+   - Nov. 14, 2011: Adapted to FMI 2.0:
+                       o Split into two files (fmiFunctions.h, fmiTypes.h) in order
+                         that code that dynamically loads an FMU can directly
+                         utilize the header files).
+                       o Added C++ encapsulation of C-part, in order that the header
+                         file can be directly utilized in C++ code.
+                       o fmiCallbackFunctions is passed as pointer to fmiInstantiateXXX
+                       o stepFinished within fmiCallbackFunctions has as first
+                         argument "fmiComponentEnvironment" and not "fmiComponent".
+                       o New functions to get and set the complete FMU state
+                         and to compute partial derivatives.
+   - Nov.  4, 2010: Adapted to specification text:
+                       o fmiGetModelTypesPlatform renamed to fmiGetTypesPlatform
+                       o fmiInstantiateSlave: Argument GUID     replaced by fmuGUID
+                                              Argument mimetype replaced by mimeType
+                       o tabs replaced by spaces
+   - Oct. 16, 2010: Functions for FMI for Co-simulation added
+   - Jan. 20, 2010: stateValueReferencesChanged added to struct fmiEventInfo (ticket #27)
+                    (by M. Otter, DLR)
+                    Added WIN32 pragma to define the struct layout (ticket #34)
+                    (by J. Mauss, QTronic)
+   - Jan.  4, 2010: Removed argument intermediateResults from fmiInitialize
+                    Renamed macro fmiGetModelFunctionsVersion to fmiGetVersion
+                    Renamed macro fmiModelFunctionsVersion to fmiVersion
+                    Replaced fmiModel by fmiComponent in decl of fmiInstantiateModel
+                    (by J. Mauss, QTronic)
+   - Dec. 17, 2009: Changed extension "me" to "fmi" (by Martin Otter, DLR).
+   - Dez. 14, 2009: Added eventInfo to meInitialize and added
+                    meGetNominalContinuousStates (by Martin Otter, DLR)
+   - Sept. 9, 2009: Added DllExport (according to Peter Nilsson's suggestion)
+                    (by A. Junghanns, QTronic)
+   - Sept. 9, 2009: Changes according to FMI-meeting on July 21:
+                    meInquireModelTypesVersion     -> meGetModelTypesPlatform
+                    meInquireModelFunctionsVersion -> meGetModelFunctionsVersion
+                    meSetStates                    -> meSetContinuousStates
+                    meGetStates                    -> meGetContinuousStates
+                    removal of meInitializeModelClass
+                    removal of meGetTime
+                    change of arguments of meInstantiateModel
+                    change of arguments of meCompletedIntegratorStep
+                    (by Martin Otter, DLR):
+   - July 19, 2009: Added "me" as prefix to file names (by Martin Otter, DLR).
+   - March 2, 2009: Changed function definitions according to the last design
+                    meeting with additional improvements (by Martin Otter, DLR).
+   - Dec. 3 , 2008: First version by Martin Otter (DLR) and Hans Olsson (Dynasim).
+
+   Copyright © 2008-2011 MODELISAR consortium,
+               2012-2013 Modelica Association Project "FMI"
+               All rights reserved.
+   This file is licensed by the copyright holders under the BSD 2-Clause License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+   (Note, this means that if you distribute a modified file,
+    the modified file must also be provided under this license).
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "fmi2TypesPlatform.h"
+#include "fmi2FunctionTypes.h"
+#include <stdlib.h>
+
+
+/*
+  Export FMI2 API functions on Windows and under GCC.
+  If custom linking is desired then the FMI2_Export must be
+  defined before including this file. For instance,
+  it may be set to __declspec(dllimport).
+*/
+#if !defined(FMI2_Export)
+  #if !defined(FMI2_FUNCTION_PREFIX)
+    #if defined _WIN32 || defined __CYGWIN__
+     /* Note: both gcc & MSVC on Windows support this syntax. */
+        #define FMI2_Export __declspec(dllexport)
+    #else
+      #if __GNUC__ >= 4
+        #define FMI2_Export __attribute__ ((visibility ("default")))
+      #else
+        #define FMI2_Export
+      #endif
+    #endif
+  #else
+    #define FMI2_Export
+  #endif
+#endif
+
+/* Macros to construct the real function name
+   (prepend function name by FMI2_FUNCTION_PREFIX) */
+#if defined(FMI2_FUNCTION_PREFIX)
+  #define fmi2Paste(a,b)     a ## b
+  #define fmi2PasteB(a,b)    fmi2Paste(a,b)
+  #define fmi2FullName(name) fmi2PasteB(FMI2_FUNCTION_PREFIX, name)
+#else
+  #define fmi2FullName(name) name
+#endif
+
+/***************************************************
+Common Functions
+****************************************************/
+#define fmi2GetTypesPlatform         fmi2FullName(fmi2GetTypesPlatform)
+#define fmi2GetVersion               fmi2FullName(fmi2GetVersion)
+#define fmi2SetDebugLogging          fmi2FullName(fmi2SetDebugLogging)
+#define fmi2Instantiate              fmi2FullName(fmi2Instantiate)
+#define fmi2FreeInstance             fmi2FullName(fmi2FreeInstance)
+#define fmi2SetupExperiment          fmi2FullName(fmi2SetupExperiment)
+#define fmi2EnterInitializationMode  fmi2FullName(fmi2EnterInitializationMode)
+#define fmi2ExitInitializationMode   fmi2FullName(fmi2ExitInitializationMode)
+#define fmi2Terminate                fmi2FullName(fmi2Terminate)
+#define fmi2Reset                    fmi2FullName(fmi2Reset)
+#define fmi2GetReal                  fmi2FullName(fmi2GetReal)
+#define fmi2GetInteger               fmi2FullName(fmi2GetInteger)
+#define fmi2GetBoolean               fmi2FullName(fmi2GetBoolean)
+#define fmi2GetString                fmi2FullName(fmi2GetString)
+#define fmi2SetReal                  fmi2FullName(fmi2SetReal)
+#define fmi2SetInteger               fmi2FullName(fmi2SetInteger)
+#define fmi2SetBoolean               fmi2FullName(fmi2SetBoolean)
+#define fmi2SetString                fmi2FullName(fmi2SetString)
+#define fmi2GetFMUstate              fmi2FullName(fmi2GetFMUstate)
+#define fmi2SetFMUstate              fmi2FullName(fmi2SetFMUstate)
+#define fmi2FreeFMUstate             fmi2FullName(fmi2FreeFMUstate)
+#define fmi2SerializedFMUstateSize   fmi2FullName(fmi2SerializedFMUstateSize)
+#define fmi2SerializeFMUstate        fmi2FullName(fmi2SerializeFMUstate)
+#define fmi2DeSerializeFMUstate      fmi2FullName(fmi2DeSerializeFMUstate)
+#define fmi2GetDirectionalDerivative fmi2FullName(fmi2GetDirectionalDerivative)
+
+
+/***************************************************
+Functions for FMI2 for Model Exchange
+****************************************************/
+#define fmi2EnterEventMode                fmi2FullName(fmi2EnterEventMode)
+#define fmi2NewDiscreteStates             fmi2FullName(fmi2NewDiscreteStates)
+#define fmi2EnterContinuousTimeMode       fmi2FullName(fmi2EnterContinuousTimeMode)
+#define fmi2CompletedIntegratorStep       fmi2FullName(fmi2CompletedIntegratorStep)
+#define fmi2SetTime                       fmi2FullName(fmi2SetTime)
+#define fmi2SetContinuousStates           fmi2FullName(fmi2SetContinuousStates)
+#define fmi2GetDerivatives                fmi2FullName(fmi2GetDerivatives)
+#define fmi2GetEventIndicators            fmi2FullName(fmi2GetEventIndicators)
+#define fmi2GetContinuousStates           fmi2FullName(fmi2GetContinuousStates)
+#define fmi2GetNominalsOfContinuousStates fmi2FullName(fmi2GetNominalsOfContinuousStates)
+
+
+/***************************************************
+Functions for FMI2 for Co-Simulation
+****************************************************/
+#define fmi2SetRealInputDerivatives      fmi2FullName(fmi2SetRealInputDerivatives)
+#define fmi2GetRealOutputDerivatives     fmi2FullName(fmi2GetRealOutputDerivatives)
+#define fmi2DoStep                       fmi2FullName(fmi2DoStep)
+#define fmi2CancelStep                   fmi2FullName(fmi2CancelStep)
+#define fmi2GetStatus                    fmi2FullName(fmi2GetStatus)
+#define fmi2GetRealStatus                fmi2FullName(fmi2GetRealStatus)
+#define fmi2GetIntegerStatus             fmi2FullName(fmi2GetIntegerStatus)
+#define fmi2GetBooleanStatus             fmi2FullName(fmi2GetBooleanStatus)
+#define fmi2GetStringStatus              fmi2FullName(fmi2GetStringStatus)
+
+/* Version number */
+#define fmi2Version "2.0"
+
+
+/***************************************************
+Common Functions
+****************************************************/
+
+/* Inquire version numbers of header files */
+   FMI2_Export fmi2GetTypesPlatformTYPE fmi2GetTypesPlatform;
+   FMI2_Export fmi2GetVersionTYPE       fmi2GetVersion;
+   FMI2_Export fmi2SetDebugLoggingTYPE  fmi2SetDebugLogging;
+
+/* Creation and destruction of FMU instances */
+   FMI2_Export fmi2InstantiateTYPE  fmi2Instantiate;
+   FMI2_Export fmi2FreeInstanceTYPE fmi2FreeInstance;
+
+/* Enter and exit initialization mode, terminate and reset */
+   FMI2_Export fmi2SetupExperimentTYPE         fmi2SetupExperiment;
+   FMI2_Export fmi2EnterInitializationModeTYPE fmi2EnterInitializationMode;
+   FMI2_Export fmi2ExitInitializationModeTYPE  fmi2ExitInitializationMode;
+   FMI2_Export fmi2TerminateTYPE               fmi2Terminate;
+   FMI2_Export fmi2ResetTYPE                   fmi2Reset;
+
+/* Getting and setting variables values */
+   FMI2_Export fmi2GetRealTYPE    fmi2GetReal;
+   FMI2_Export fmi2GetIntegerTYPE fmi2GetInteger;
+   FMI2_Export fmi2GetBooleanTYPE fmi2GetBoolean;
+   FMI2_Export fmi2GetStringTYPE  fmi2GetString;
+
+   FMI2_Export fmi2SetRealTYPE    fmi2SetReal;
+   FMI2_Export fmi2SetIntegerTYPE fmi2SetInteger;
+   FMI2_Export fmi2SetBooleanTYPE fmi2SetBoolean;
+   FMI2_Export fmi2SetStringTYPE  fmi2SetString;
+
+/* Getting and setting the internal FMU state */
+   FMI2_Export fmi2GetFMUstateTYPE            fmi2GetFMUstate;
+   FMI2_Export fmi2SetFMUstateTYPE            fmi2SetFMUstate;
+   FMI2_Export fmi2FreeFMUstateTYPE           fmi2FreeFMUstate;
+   FMI2_Export fmi2SerializedFMUstateSizeTYPE fmi2SerializedFMUstateSize;
+   FMI2_Export fmi2SerializeFMUstateTYPE      fmi2SerializeFMUstate;
+   FMI2_Export fmi2DeSerializeFMUstateTYPE    fmi2DeSerializeFMUstate;
+
+/* Getting partial derivatives */
+   FMI2_Export fmi2GetDirectionalDerivativeTYPE fmi2GetDirectionalDerivative;
+
+
+/***************************************************
+Functions for FMI2 for Model Exchange
+****************************************************/
+
+/* Enter and exit the different modes */
+   FMI2_Export fmi2EnterEventModeTYPE               fmi2EnterEventMode;
+   FMI2_Export fmi2NewDiscreteStatesTYPE            fmi2NewDiscreteStates;
+   FMI2_Export fmi2EnterContinuousTimeModeTYPE      fmi2EnterContinuousTimeMode;
+   FMI2_Export fmi2CompletedIntegratorStepTYPE      fmi2CompletedIntegratorStep;
+
+/* Providing independent variables and re-initialization of caching */
+   FMI2_Export fmi2SetTimeTYPE             fmi2SetTime;
+   FMI2_Export fmi2SetContinuousStatesTYPE fmi2SetContinuousStates;
+
+/* Evaluation of the model equations */
+   FMI2_Export fmi2GetDerivativesTYPE                fmi2GetDerivatives;
+   FMI2_Export fmi2GetEventIndicatorsTYPE            fmi2GetEventIndicators;
+   FMI2_Export fmi2GetContinuousStatesTYPE           fmi2GetContinuousStates;
+   FMI2_Export fmi2GetNominalsOfContinuousStatesTYPE fmi2GetNominalsOfContinuousStates;
+
+
+/***************************************************
+Functions for FMI2 for Co-Simulation
+****************************************************/
+
+/* Simulating the slave */
+   FMI2_Export fmi2SetRealInputDerivativesTYPE  fmi2SetRealInputDerivatives;
+   FMI2_Export fmi2GetRealOutputDerivativesTYPE fmi2GetRealOutputDerivatives;
+
+   FMI2_Export fmi2DoStepTYPE     fmi2DoStep;
+   FMI2_Export fmi2CancelStepTYPE fmi2CancelStep;
+
+/* Inquire slave status */
+   FMI2_Export fmi2GetStatusTYPE        fmi2GetStatus;
+   FMI2_Export fmi2GetRealStatusTYPE    fmi2GetRealStatus;
+   FMI2_Export fmi2GetIntegerStatusTYPE fmi2GetIntegerStatus;
+   FMI2_Export fmi2GetBooleanStatusTYPE fmi2GetBooleanStatus;
+   FMI2_Export fmi2GetStringStatusTYPE  fmi2GetStringStatus;
+
+#ifdef __cplusplus
+}  /* end of extern "C" { */
+#endif
+
+#endif /* fmi2Functions_h */

+ 115 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/.svn/text-base/fmi2TypesPlatform.h.svn-base

@@ -0,0 +1,115 @@
+#ifndef fmi2TypesPlatform_h
+#define fmi2TypesPlatform_h
+
+/* Standard header file to define the argument types of the
+   functions of the Functional Mock-up Interface 2.0.
+   This header file must be utilized both by the model and
+   by the simulation engine.
+
+   Revisions:
+   - Apr.  9, 2014: all prefixes "fmi" renamed to "fmi2" (decision from April 8)
+   - Mar   31, 2014: New datatype fmiChar introduced.
+   - Feb.  17, 2013: Changed fmiTypesPlatform from "standard32" to "default".
+                     Removed fmiUndefinedValueReference since no longer needed
+                     (because every state is defined in ScalarVariables).
+   - March 20, 2012: Renamed from fmiPlatformTypes.h to fmiTypesPlatform.h
+   - Nov.  14, 2011: Use the header file "fmiPlatformTypes.h" for FMI 2.0
+                     both for "FMI for model exchange" and for "FMI for co-simulation"
+                     New types "fmiComponentEnvironment", "fmiState", and "fmiByte".
+                     The implementation of "fmiBoolean" is change from "char" to "int".
+                     The #define "fmiPlatform" changed to "fmiTypesPlatform"
+                     (in order that #define and function call are consistent)
+   - Oct.   4, 2010: Renamed header file from "fmiModelTypes.h" to fmiPlatformTypes.h"
+                     for the co-simulation interface
+   - Jan.   4, 2010: Renamed meModelTypes_h to fmiModelTypes_h (by Mauss, QTronic)
+   - Dec.  21, 2009: Changed "me" to "fmi" and "meModel" to "fmiComponent"
+                     according to meeting on Dec. 18 (by Martin Otter, DLR)
+   - Dec.   6, 2009: Added meUndefinedValueReference (by Martin Otter, DLR)
+   - Sept.  9, 2009: Changes according to FMI-meeting on July 21:
+                     Changed "version" to "platform", "standard" to "standard32",
+                     Added a precise definition of "standard32" as comment
+                     (by Martin Otter, DLR)
+   - July  19, 2009: Added "me" as prefix to file names, added meTrue/meFalse,
+                     and changed meValueReferenced from int to unsigned int
+                     (by Martin Otter, DLR).
+   - March  2, 2009: Moved enums and function pointer definitions to
+                     ModelFunctions.h (by Martin Otter, DLR).
+   - Dec.  3, 2008 : First version by Martin Otter (DLR) and
+                     Hans Olsson (Dynasim).
+
+
+   Copyright © 2008-2011 MODELISAR consortium,
+               2012-2013 Modelica Association Project "FMI"
+               All rights reserved.
+   This file is licensed by the copyright holders under the BSD 2-Clause License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+   (Note, this means that if you distribute a modified file,
+    the modified file must also be provided under this license).
+*/
+
+/* Platform (unique identification of this header file) */
+#define fmi2TypesPlatform "default"
+
+/* Type definitions of variables passed as arguments
+   Version "default" means:
+
+   fmi2Component           : an opaque object pointer
+   fmi2ComponentEnvironment: an opaque object pointer
+   fmi2FMUstate            : an opaque object pointer
+   fmi2ValueReference      : handle to the value of a variable
+   fmi2Real                : double precision floating-point data type
+   fmi2Integer             : basic signed integer data type
+   fmi2Boolean             : basic signed integer data type
+   fmi2Char                : character data type
+   fmi2String              : a pointer to a vector of fmi2Char characters
+                             ('\0' terminated, UTF8 encoded)
+   fmi2Byte                : smallest addressable unit of the machine, typically one byte.
+*/
+   typedef void*           fmi2Component;               /* Pointer to FMU instance       */
+   typedef void*           fmi2ComponentEnvironment;    /* Pointer to FMU environment    */
+   typedef void*           fmi2FMUstate;                /* Pointer to internal FMU state */
+   typedef unsigned int    fmi2ValueReference;
+   typedef double          fmi2Real   ;
+   typedef int             fmi2Integer;
+   typedef int             fmi2Boolean;
+   typedef char            fmi2Char;
+   typedef const fmi2Char* fmi2String;
+   typedef char            fmi2Byte;
+
+/* Values for fmi2Boolean  */
+#define fmi2True  1
+#define fmi2False 0
+
+
+#endif /* fmi2TypesPlatform_h */

+ 243 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/fmi2FunctionTypes.h

@@ -0,0 +1,243 @@
+#ifndef fmi2FunctionTypes_h
+#define fmi2FunctionTypes_h
+
+#include "fmi2TypesPlatform.h"
+
+/* This header file must be utilized when compiling an FMU or an FMI master.
+   It declares data and function types for FMI 2.0
+
+   Revisions:
+   - Apr.  9, 2014: all prefixes "fmi" renamed to "fmi2" (decision from April 8)
+   - Apr.  3, 2014: Added #include <stddef.h> for size_t definition
+   - Mar. 27, 2014: Added #include "fmiTypesPlatform.h" (#179)
+   - Mar. 26, 2014: Introduced function argument "void" for the functions (#171)
+                      fmiGetTypesPlatformTYPE and fmiGetVersionTYPE
+   - Oct. 11, 2013: Functions of ModelExchange and CoSimulation merged:
+                      fmiInstantiateModelTYPE , fmiInstantiateSlaveTYPE  -> fmiInstantiateTYPE
+                      fmiFreeModelInstanceTYPE, fmiFreeSlaveInstanceTYPE -> fmiFreeInstanceTYPE
+                      fmiEnterModelInitializationModeTYPE, fmiEnterSlaveInitializationModeTYPE -> fmiEnterInitializationModeTYPE
+                      fmiExitModelInitializationModeTYPE , fmiExitSlaveInitializationModeTYPE  -> fmiExitInitializationModeTYPE
+                      fmiTerminateModelTYPE , fmiTerminateSlaveTYPE  -> fmiTerminate
+                      fmiResetSlave -> fmiReset (now also for ModelExchange and not only for CoSimulation)
+                    Functions renamed
+                      fmiUpdateDiscreteStatesTYPE -> fmiNewDiscreteStatesTYPE
+                    Renamed elements of the enumeration fmiEventInfo
+                      upcomingTimeEvent             -> nextEventTimeDefined // due to generic naming scheme: varDefined + var
+                      newUpdateDiscreteStatesNeeded -> newDiscreteStatesNeeded;
+   - June 13, 2013: Changed type fmiEventInfo
+                    Functions removed:
+                       fmiInitializeModelTYPE
+                       fmiEventUpdateTYPE
+                       fmiCompletedEventIterationTYPE
+                       fmiInitializeSlaveTYPE
+                    Functions added:
+                       fmiEnterModelInitializationModeTYPE
+                       fmiExitModelInitializationModeTYPE
+                       fmiEnterEventModeTYPE
+                       fmiUpdateDiscreteStatesTYPE
+                       fmiEnterContinuousTimeModeTYPE
+                       fmiEnterSlaveInitializationModeTYPE;
+                       fmiExitSlaveInitializationModeTYPE;
+   - Feb. 17, 2013: Added third argument to fmiCompletedIntegratorStepTYPE
+                    Changed function name "fmiTerminateType" to "fmiTerminateModelType" (due to #113)
+                    Changed function name "fmiGetNominalContinuousStateTYPE" to
+                                          "fmiGetNominalsOfContinuousStatesTYPE"
+                    Removed fmiGetStateValueReferencesTYPE.
+   - Nov. 14, 2011: First public Version
+
+
+   Copyright © 2011 MODELISAR consortium,
+               2012-2013 Modelica Association Project "FMI"
+               All rights reserved.
+   This file is licensed by the copyright holders under the BSD 2-Clause License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+   (Note, this means that if you distribute a modified file,
+    the modified file must also be provided under this license).
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* make sure all compiler use the same alignment policies for structures */
+#if defined _MSC_VER || defined __GNUC__
+#pragma pack(push,8)
+#endif
+
+/* Include stddef.h, in order that size_t etc. is defined */
+#include <stddef.h>
+
+
+/* Type definitions */
+typedef enum {
+    fmi2OK,
+    fmi2Warning,
+    fmi2Discard,
+    fmi2Error,
+    fmi2Fatal,
+    fmi2Pending
+} fmi2Status;
+
+typedef enum {
+    fmi2ModelExchange,
+    fmi2CoSimulation
+} fmi2Type;
+
+typedef enum {
+    fmi2DoStepStatus,
+    fmi2PendingStatus,
+    fmi2LastSuccessfulTime,
+    fmi2Terminated
+} fmi2StatusKind;
+
+typedef void      (*fmi2CallbackLogger)        (fmi2ComponentEnvironment, fmi2String, fmi2Status, fmi2String, fmi2String, ...);
+typedef void*     (*fmi2CallbackAllocateMemory)(size_t, size_t);
+typedef void      (*fmi2CallbackFreeMemory)    (void*);
+typedef void      (*fmi2StepFinished)          (fmi2ComponentEnvironment, fmi2Status);
+
+typedef struct {
+   const fmi2CallbackLogger         logger;
+   const fmi2CallbackAllocateMemory allocateMemory;
+   const fmi2CallbackFreeMemory     freeMemory;
+   const fmi2StepFinished           stepFinished;
+   const fmi2ComponentEnvironment   componentEnvironment;
+} fmi2CallbackFunctions;
+
+typedef struct {
+	 fmi2Boolean newDiscreteStatesNeeded;
+   fmi2Boolean terminateSimulation;
+   fmi2Boolean nominalsOfContinuousStatesChanged;
+   fmi2Boolean valuesOfContinuousStatesChanged;
+   fmi2Boolean nextEventTimeDefined;
+   fmi2Real    nextEventTime;
+} fmi2EventInfo;
+
+
+/* reset alignment policy to the one set before reading this file */
+#if defined _MSC_VER || defined __GNUC__
+#pragma pack(pop)
+#endif
+
+
+/* Define fmi2 function pointer types to simplify dynamic loading */
+
+/***************************************************
+Types for Common Functions
+****************************************************/
+
+/* Inquire version numbers of header files and setting logging status */
+   typedef const char* fmi2GetTypesPlatformTYPE(void);
+   typedef const char* fmi2GetVersionTYPE(void);
+   typedef fmi2Status  fmi2SetDebugLoggingTYPE(fmi2Component, fmi2Boolean, size_t, const fmi2String[]);
+
+/* Creation and destruction of FMU instances and setting debug status */
+   typedef fmi2Component fmi2InstantiateTYPE (fmi2String, fmi2Type, fmi2String, fmi2String, const fmi2CallbackFunctions*, fmi2Boolean, fmi2Boolean);
+   typedef void          fmi2FreeInstanceTYPE(fmi2Component);
+
+/* Enter and exit initialization mode, terminate and reset */
+   typedef fmi2Status fmi2SetupExperimentTYPE        (fmi2Component, fmi2Boolean, fmi2Real, fmi2Real, fmi2Boolean, fmi2Real);
+   typedef fmi2Status fmi2EnterInitializationModeTYPE(fmi2Component);
+   typedef fmi2Status fmi2ExitInitializationModeTYPE (fmi2Component);
+   typedef fmi2Status fmi2TerminateTYPE              (fmi2Component);
+   typedef fmi2Status fmi2ResetTYPE                  (fmi2Component);
+
+/* Getting and setting variable values */
+   typedef fmi2Status fmi2GetRealTYPE   (fmi2Component, const fmi2ValueReference[], size_t, fmi2Real   []);
+   typedef fmi2Status fmi2GetIntegerTYPE(fmi2Component, const fmi2ValueReference[], size_t, fmi2Integer[]);
+   typedef fmi2Status fmi2GetBooleanTYPE(fmi2Component, const fmi2ValueReference[], size_t, fmi2Boolean[]);
+   typedef fmi2Status fmi2GetStringTYPE (fmi2Component, const fmi2ValueReference[], size_t, fmi2String []);
+
+   typedef fmi2Status fmi2SetRealTYPE   (fmi2Component, const fmi2ValueReference[], size_t, const fmi2Real   []);
+   typedef fmi2Status fmi2SetIntegerTYPE(fmi2Component, const fmi2ValueReference[], size_t, const fmi2Integer[]);
+   typedef fmi2Status fmi2SetBooleanTYPE(fmi2Component, const fmi2ValueReference[], size_t, const fmi2Boolean[]);
+   typedef fmi2Status fmi2SetStringTYPE (fmi2Component, const fmi2ValueReference[], size_t, const fmi2String []);
+
+/* Getting and setting the internal FMU state */
+   typedef fmi2Status fmi2GetFMUstateTYPE           (fmi2Component, fmi2FMUstate*);
+   typedef fmi2Status fmi2SetFMUstateTYPE           (fmi2Component, fmi2FMUstate);
+   typedef fmi2Status fmi2FreeFMUstateTYPE          (fmi2Component, fmi2FMUstate*);
+   typedef fmi2Status fmi2SerializedFMUstateSizeTYPE(fmi2Component, fmi2FMUstate, size_t*);
+   typedef fmi2Status fmi2SerializeFMUstateTYPE     (fmi2Component, fmi2FMUstate, fmi2Byte[], size_t);
+   typedef fmi2Status fmi2DeSerializeFMUstateTYPE   (fmi2Component, const fmi2Byte[], size_t, fmi2FMUstate*);
+
+/* Getting partial derivatives */
+   typedef fmi2Status fmi2GetDirectionalDerivativeTYPE(fmi2Component, const fmi2ValueReference[], size_t,
+                                                                   const fmi2ValueReference[], size_t,
+                                                                   const fmi2Real[], fmi2Real[]);
+
+/***************************************************
+Types for Functions for FMI2 for Model Exchange
+****************************************************/
+
+/* Enter and exit the different modes */
+   typedef fmi2Status fmi2EnterEventModeTYPE         (fmi2Component);
+   typedef fmi2Status fmi2NewDiscreteStatesTYPE      (fmi2Component, fmi2EventInfo*);
+   typedef fmi2Status fmi2EnterContinuousTimeModeTYPE(fmi2Component);
+   typedef fmi2Status fmi2CompletedIntegratorStepTYPE(fmi2Component, fmi2Boolean, fmi2Boolean*, fmi2Boolean*);
+
+/* Providing independent variables and re-initialization of caching */
+   typedef fmi2Status fmi2SetTimeTYPE            (fmi2Component, fmi2Real);
+   typedef fmi2Status fmi2SetContinuousStatesTYPE(fmi2Component, const fmi2Real[], size_t);
+
+/* Evaluation of the model equations */
+   typedef fmi2Status fmi2GetDerivativesTYPE               (fmi2Component, fmi2Real[], size_t);
+   typedef fmi2Status fmi2GetEventIndicatorsTYPE           (fmi2Component, fmi2Real[], size_t);
+   typedef fmi2Status fmi2GetContinuousStatesTYPE          (fmi2Component, fmi2Real[], size_t);
+   typedef fmi2Status fmi2GetNominalsOfContinuousStatesTYPE(fmi2Component, fmi2Real[], size_t);
+
+
+/***************************************************
+Types for Functions for FMI2 for Co-Simulation
+****************************************************/
+
+/* Simulating the slave */
+   typedef fmi2Status fmi2SetRealInputDerivativesTYPE (fmi2Component, const fmi2ValueReference [], size_t, const fmi2Integer [], const fmi2Real []);
+   typedef fmi2Status fmi2GetRealOutputDerivativesTYPE(fmi2Component, const fmi2ValueReference [], size_t, const fmi2Integer [], fmi2Real []);
+
+   typedef fmi2Status fmi2DoStepTYPE     (fmi2Component, fmi2Real, fmi2Real, fmi2Boolean);
+   typedef fmi2Status fmi2CancelStepTYPE (fmi2Component);
+
+/* Inquire slave status */
+   typedef fmi2Status fmi2GetStatusTYPE       (fmi2Component, const fmi2StatusKind, fmi2Status* );
+   typedef fmi2Status fmi2GetRealStatusTYPE   (fmi2Component, const fmi2StatusKind, fmi2Real*   );
+   typedef fmi2Status fmi2GetIntegerStatusTYPE(fmi2Component, const fmi2StatusKind, fmi2Integer*);
+   typedef fmi2Status fmi2GetBooleanStatusTYPE(fmi2Component, const fmi2StatusKind, fmi2Boolean*);
+   typedef fmi2Status fmi2GetStringStatusTYPE (fmi2Component, const fmi2StatusKind, fmi2String* );
+
+
+#ifdef __cplusplus
+}  /* end of extern "C" { */
+#endif
+
+#endif /* fmi2FunctionTypes_h */

+ 333 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/fmi2Functions.h

@@ -0,0 +1,333 @@
+#ifndef fmi2Functions_h
+#define fmi2Functions_h
+
+/* This header file must be utilized when compiling a FMU.
+   It defines all functions of the
+         FMI 2.0 Model Exchange and Co-Simulation Interface.
+
+   In order to have unique function names even if several FMUs
+   are compiled together (e.g. for embedded systems), every "real" function name
+   is constructed by prepending the function name by "FMI2_FUNCTION_PREFIX".
+   Therefore, the typical usage is:
+
+      #define FMI2_FUNCTION_PREFIX MyModel_
+      #include "fmi2Functions.h"
+
+   As a result, a function that is defined as "fmi2GetDerivatives" in this header file,
+   is actually getting the name "MyModel_fmi2GetDerivatives".
+
+   This only holds if the FMU is shipped in C source code, or is compiled in a
+   static link library. For FMUs compiled in a DLL/sharedObject, the "actual" function
+   names are used and "FMI2_FUNCTION_PREFIX" must not be defined.
+
+   Revisions:
+   - Apr.  9, 2014: all prefixes "fmi" renamed to "fmi2" (decision from April 8)
+   - Mar. 26, 2014: FMI_Export set to empty value if FMI_Export and FMI_FUNCTION_PREFIX
+                    are not defined (#173)
+   - Oct. 11, 2013: Functions of ModelExchange and CoSimulation merged:
+                      fmiInstantiateModel , fmiInstantiateSlave  -> fmiInstantiate
+                      fmiFreeModelInstance, fmiFreeSlaveInstance -> fmiFreeInstance
+                      fmiEnterModelInitializationMode, fmiEnterSlaveInitializationMode -> fmiEnterInitializationMode
+                      fmiExitModelInitializationMode , fmiExitSlaveInitializationMode  -> fmiExitInitializationMode
+                      fmiTerminateModel, fmiTerminateSlave  -> fmiTerminate
+                      fmiResetSlave -> fmiReset (now also for ModelExchange and not only for CoSimulation)
+                    Functions renamed:
+                      fmiUpdateDiscreteStates -> fmiNewDiscreteStates
+   - June 13, 2013: Functions removed:
+                       fmiInitializeModel
+                       fmiEventUpdate
+                       fmiCompletedEventIteration
+                       fmiInitializeSlave
+                    Functions added:
+                       fmiEnterModelInitializationMode
+                       fmiExitModelInitializationMode
+                       fmiEnterEventMode
+                       fmiUpdateDiscreteStates
+                       fmiEnterContinuousTimeMode
+                       fmiEnterSlaveInitializationMode;
+                       fmiExitSlaveInitializationMode;
+   - Feb. 17, 2013: Portability improvements:
+                       o DllExport changed to FMI_Export
+                       o FUNCTION_PREFIX changed to FMI_FUNCTION_PREFIX
+                       o Allow undefined FMI_FUNCTION_PREFIX (meaning no prefix is used)
+                    Changed function name "fmiTerminate" to "fmiTerminateModel" (due to #113)
+                    Changed function name "fmiGetNominalContinuousState" to
+                                          "fmiGetNominalsOfContinuousStates"
+                    Removed fmiGetStateValueReferences.
+   - Nov. 14, 2011: Adapted to FMI 2.0:
+                       o Split into two files (fmiFunctions.h, fmiTypes.h) in order
+                         that code that dynamically loads an FMU can directly
+                         utilize the header files).
+                       o Added C++ encapsulation of C-part, in order that the header
+                         file can be directly utilized in C++ code.
+                       o fmiCallbackFunctions is passed as pointer to fmiInstantiateXXX
+                       o stepFinished within fmiCallbackFunctions has as first
+                         argument "fmiComponentEnvironment" and not "fmiComponent".
+                       o New functions to get and set the complete FMU state
+                         and to compute partial derivatives.
+   - Nov.  4, 2010: Adapted to specification text:
+                       o fmiGetModelTypesPlatform renamed to fmiGetTypesPlatform
+                       o fmiInstantiateSlave: Argument GUID     replaced by fmuGUID
+                                              Argument mimetype replaced by mimeType
+                       o tabs replaced by spaces
+   - Oct. 16, 2010: Functions for FMI for Co-simulation added
+   - Jan. 20, 2010: stateValueReferencesChanged added to struct fmiEventInfo (ticket #27)
+                    (by M. Otter, DLR)
+                    Added WIN32 pragma to define the struct layout (ticket #34)
+                    (by J. Mauss, QTronic)
+   - Jan.  4, 2010: Removed argument intermediateResults from fmiInitialize
+                    Renamed macro fmiGetModelFunctionsVersion to fmiGetVersion
+                    Renamed macro fmiModelFunctionsVersion to fmiVersion
+                    Replaced fmiModel by fmiComponent in decl of fmiInstantiateModel
+                    (by J. Mauss, QTronic)
+   - Dec. 17, 2009: Changed extension "me" to "fmi" (by Martin Otter, DLR).
+   - Dez. 14, 2009: Added eventInfo to meInitialize and added
+                    meGetNominalContinuousStates (by Martin Otter, DLR)
+   - Sept. 9, 2009: Added DllExport (according to Peter Nilsson's suggestion)
+                    (by A. Junghanns, QTronic)
+   - Sept. 9, 2009: Changes according to FMI-meeting on July 21:
+                    meInquireModelTypesVersion     -> meGetModelTypesPlatform
+                    meInquireModelFunctionsVersion -> meGetModelFunctionsVersion
+                    meSetStates                    -> meSetContinuousStates
+                    meGetStates                    -> meGetContinuousStates
+                    removal of meInitializeModelClass
+                    removal of meGetTime
+                    change of arguments of meInstantiateModel
+                    change of arguments of meCompletedIntegratorStep
+                    (by Martin Otter, DLR):
+   - July 19, 2009: Added "me" as prefix to file names (by Martin Otter, DLR).
+   - March 2, 2009: Changed function definitions according to the last design
+                    meeting with additional improvements (by Martin Otter, DLR).
+   - Dec. 3 , 2008: First version by Martin Otter (DLR) and Hans Olsson (Dynasim).
+
+   Copyright © 2008-2011 MODELISAR consortium,
+               2012-2013 Modelica Association Project "FMI"
+               All rights reserved.
+   This file is licensed by the copyright holders under the BSD 2-Clause License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+   (Note, this means that if you distribute a modified file,
+    the modified file must also be provided under this license).
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "fmi2TypesPlatform.h"
+#include "fmi2FunctionTypes.h"
+#include <stdlib.h>
+
+
+/*
+  Export FMI2 API functions on Windows and under GCC.
+  If custom linking is desired then the FMI2_Export must be
+  defined before including this file. For instance,
+  it may be set to __declspec(dllimport).
+*/
+#if !defined(FMI2_Export)
+  #if !defined(FMI2_FUNCTION_PREFIX)
+    #if defined _WIN32 || defined __CYGWIN__
+     /* Note: both gcc & MSVC on Windows support this syntax. */
+        #define FMI2_Export __declspec(dllexport)
+    #else
+      #if __GNUC__ >= 4
+        #define FMI2_Export __attribute__ ((visibility ("default")))
+      #else
+        #define FMI2_Export
+      #endif
+    #endif
+  #else
+    #define FMI2_Export
+  #endif
+#endif
+
+/* Macros to construct the real function name
+   (prepend function name by FMI2_FUNCTION_PREFIX) */
+#if defined(FMI2_FUNCTION_PREFIX)
+  #define fmi2Paste(a,b)     a ## b
+  #define fmi2PasteB(a,b)    fmi2Paste(a,b)
+  #define fmi2FullName(name) fmi2PasteB(FMI2_FUNCTION_PREFIX, name)
+#else
+  #define fmi2FullName(name) name
+#endif
+
+/***************************************************
+Common Functions
+****************************************************/
+#define fmi2GetTypesPlatform         fmi2FullName(fmi2GetTypesPlatform)
+#define fmi2GetVersion               fmi2FullName(fmi2GetVersion)
+#define fmi2SetDebugLogging          fmi2FullName(fmi2SetDebugLogging)
+#define fmi2Instantiate              fmi2FullName(fmi2Instantiate)
+#define fmi2FreeInstance             fmi2FullName(fmi2FreeInstance)
+#define fmi2SetupExperiment          fmi2FullName(fmi2SetupExperiment)
+#define fmi2EnterInitializationMode  fmi2FullName(fmi2EnterInitializationMode)
+#define fmi2ExitInitializationMode   fmi2FullName(fmi2ExitInitializationMode)
+#define fmi2Terminate                fmi2FullName(fmi2Terminate)
+#define fmi2Reset                    fmi2FullName(fmi2Reset)
+#define fmi2GetReal                  fmi2FullName(fmi2GetReal)
+#define fmi2GetInteger               fmi2FullName(fmi2GetInteger)
+#define fmi2GetBoolean               fmi2FullName(fmi2GetBoolean)
+#define fmi2GetString                fmi2FullName(fmi2GetString)
+#define fmi2SetReal                  fmi2FullName(fmi2SetReal)
+#define fmi2SetInteger               fmi2FullName(fmi2SetInteger)
+#define fmi2SetBoolean               fmi2FullName(fmi2SetBoolean)
+#define fmi2SetString                fmi2FullName(fmi2SetString)
+#define fmi2GetFMUstate              fmi2FullName(fmi2GetFMUstate)
+#define fmi2SetFMUstate              fmi2FullName(fmi2SetFMUstate)
+#define fmi2FreeFMUstate             fmi2FullName(fmi2FreeFMUstate)
+#define fmi2SerializedFMUstateSize   fmi2FullName(fmi2SerializedFMUstateSize)
+#define fmi2SerializeFMUstate        fmi2FullName(fmi2SerializeFMUstate)
+#define fmi2DeSerializeFMUstate      fmi2FullName(fmi2DeSerializeFMUstate)
+#define fmi2GetDirectionalDerivative fmi2FullName(fmi2GetDirectionalDerivative)
+
+
+/***************************************************
+Functions for FMI2 for Model Exchange
+****************************************************/
+#define fmi2EnterEventMode                fmi2FullName(fmi2EnterEventMode)
+#define fmi2NewDiscreteStates             fmi2FullName(fmi2NewDiscreteStates)
+#define fmi2EnterContinuousTimeMode       fmi2FullName(fmi2EnterContinuousTimeMode)
+#define fmi2CompletedIntegratorStep       fmi2FullName(fmi2CompletedIntegratorStep)
+#define fmi2SetTime                       fmi2FullName(fmi2SetTime)
+#define fmi2SetContinuousStates           fmi2FullName(fmi2SetContinuousStates)
+#define fmi2GetDerivatives                fmi2FullName(fmi2GetDerivatives)
+#define fmi2GetEventIndicators            fmi2FullName(fmi2GetEventIndicators)
+#define fmi2GetContinuousStates           fmi2FullName(fmi2GetContinuousStates)
+#define fmi2GetNominalsOfContinuousStates fmi2FullName(fmi2GetNominalsOfContinuousStates)
+
+
+/***************************************************
+Functions for FMI2 for Co-Simulation
+****************************************************/
+#define fmi2SetRealInputDerivatives      fmi2FullName(fmi2SetRealInputDerivatives)
+#define fmi2GetRealOutputDerivatives     fmi2FullName(fmi2GetRealOutputDerivatives)
+#define fmi2DoStep                       fmi2FullName(fmi2DoStep)
+#define fmi2CancelStep                   fmi2FullName(fmi2CancelStep)
+#define fmi2GetStatus                    fmi2FullName(fmi2GetStatus)
+#define fmi2GetRealStatus                fmi2FullName(fmi2GetRealStatus)
+#define fmi2GetIntegerStatus             fmi2FullName(fmi2GetIntegerStatus)
+#define fmi2GetBooleanStatus             fmi2FullName(fmi2GetBooleanStatus)
+#define fmi2GetStringStatus              fmi2FullName(fmi2GetStringStatus)
+
+/* Version number */
+#define fmi2Version "2.0"
+
+
+/***************************************************
+Common Functions
+****************************************************/
+
+/* Inquire version numbers of header files */
+   FMI2_Export fmi2GetTypesPlatformTYPE fmi2GetTypesPlatform;
+   FMI2_Export fmi2GetVersionTYPE       fmi2GetVersion;
+   FMI2_Export fmi2SetDebugLoggingTYPE  fmi2SetDebugLogging;
+
+/* Creation and destruction of FMU instances */
+   FMI2_Export fmi2InstantiateTYPE  fmi2Instantiate;
+   FMI2_Export fmi2FreeInstanceTYPE fmi2FreeInstance;
+
+/* Enter and exit initialization mode, terminate and reset */
+   FMI2_Export fmi2SetupExperimentTYPE         fmi2SetupExperiment;
+   FMI2_Export fmi2EnterInitializationModeTYPE fmi2EnterInitializationMode;
+   FMI2_Export fmi2ExitInitializationModeTYPE  fmi2ExitInitializationMode;
+   FMI2_Export fmi2TerminateTYPE               fmi2Terminate;
+   FMI2_Export fmi2ResetTYPE                   fmi2Reset;
+
+/* Getting and setting variables values */
+   FMI2_Export fmi2GetRealTYPE    fmi2GetReal;
+   FMI2_Export fmi2GetIntegerTYPE fmi2GetInteger;
+   FMI2_Export fmi2GetBooleanTYPE fmi2GetBoolean;
+   FMI2_Export fmi2GetStringTYPE  fmi2GetString;
+
+   FMI2_Export fmi2SetRealTYPE    fmi2SetReal;
+   FMI2_Export fmi2SetIntegerTYPE fmi2SetInteger;
+   FMI2_Export fmi2SetBooleanTYPE fmi2SetBoolean;
+   FMI2_Export fmi2SetStringTYPE  fmi2SetString;
+
+/* Getting and setting the internal FMU state */
+   FMI2_Export fmi2GetFMUstateTYPE            fmi2GetFMUstate;
+   FMI2_Export fmi2SetFMUstateTYPE            fmi2SetFMUstate;
+   FMI2_Export fmi2FreeFMUstateTYPE           fmi2FreeFMUstate;
+   FMI2_Export fmi2SerializedFMUstateSizeTYPE fmi2SerializedFMUstateSize;
+   FMI2_Export fmi2SerializeFMUstateTYPE      fmi2SerializeFMUstate;
+   FMI2_Export fmi2DeSerializeFMUstateTYPE    fmi2DeSerializeFMUstate;
+
+/* Getting partial derivatives */
+   FMI2_Export fmi2GetDirectionalDerivativeTYPE fmi2GetDirectionalDerivative;
+
+
+/***************************************************
+Functions for FMI2 for Model Exchange
+****************************************************/
+
+/* Enter and exit the different modes */
+   FMI2_Export fmi2EnterEventModeTYPE               fmi2EnterEventMode;
+   FMI2_Export fmi2NewDiscreteStatesTYPE            fmi2NewDiscreteStates;
+   FMI2_Export fmi2EnterContinuousTimeModeTYPE      fmi2EnterContinuousTimeMode;
+   FMI2_Export fmi2CompletedIntegratorStepTYPE      fmi2CompletedIntegratorStep;
+
+/* Providing independent variables and re-initialization of caching */
+   FMI2_Export fmi2SetTimeTYPE             fmi2SetTime;
+   FMI2_Export fmi2SetContinuousStatesTYPE fmi2SetContinuousStates;
+
+/* Evaluation of the model equations */
+   FMI2_Export fmi2GetDerivativesTYPE                fmi2GetDerivatives;
+   FMI2_Export fmi2GetEventIndicatorsTYPE            fmi2GetEventIndicators;
+   FMI2_Export fmi2GetContinuousStatesTYPE           fmi2GetContinuousStates;
+   FMI2_Export fmi2GetNominalsOfContinuousStatesTYPE fmi2GetNominalsOfContinuousStates;
+
+
+/***************************************************
+Functions for FMI2 for Co-Simulation
+****************************************************/
+
+/* Simulating the slave */
+   FMI2_Export fmi2SetRealInputDerivativesTYPE  fmi2SetRealInputDerivatives;
+   FMI2_Export fmi2GetRealOutputDerivativesTYPE fmi2GetRealOutputDerivatives;
+
+   FMI2_Export fmi2DoStepTYPE     fmi2DoStep;
+   FMI2_Export fmi2CancelStepTYPE fmi2CancelStep;
+
+/* Inquire slave status */
+   FMI2_Export fmi2GetStatusTYPE        fmi2GetStatus;
+   FMI2_Export fmi2GetRealStatusTYPE    fmi2GetRealStatus;
+   FMI2_Export fmi2GetIntegerStatusTYPE fmi2GetIntegerStatus;
+   FMI2_Export fmi2GetBooleanStatusTYPE fmi2GetBooleanStatus;
+   FMI2_Export fmi2GetStringStatusTYPE  fmi2GetStringStatus;
+
+#ifdef __cplusplus
+}  /* end of extern "C" { */
+#endif
+
+#endif /* fmi2Functions_h */

+ 115 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/FMUChecker-2.0b3-win32/include/FMI2/fmi2TypesPlatform.h

@@ -0,0 +1,115 @@
+#ifndef fmi2TypesPlatform_h
+#define fmi2TypesPlatform_h
+
+/* Standard header file to define the argument types of the
+   functions of the Functional Mock-up Interface 2.0.
+   This header file must be utilized both by the model and
+   by the simulation engine.
+
+   Revisions:
+   - Apr.  9, 2014: all prefixes "fmi" renamed to "fmi2" (decision from April 8)
+   - Mar   31, 2014: New datatype fmiChar introduced.
+   - Feb.  17, 2013: Changed fmiTypesPlatform from "standard32" to "default".
+                     Removed fmiUndefinedValueReference since no longer needed
+                     (because every state is defined in ScalarVariables).
+   - March 20, 2012: Renamed from fmiPlatformTypes.h to fmiTypesPlatform.h
+   - Nov.  14, 2011: Use the header file "fmiPlatformTypes.h" for FMI 2.0
+                     both for "FMI for model exchange" and for "FMI for co-simulation"
+                     New types "fmiComponentEnvironment", "fmiState", and "fmiByte".
+                     The implementation of "fmiBoolean" is change from "char" to "int".
+                     The #define "fmiPlatform" changed to "fmiTypesPlatform"
+                     (in order that #define and function call are consistent)
+   - Oct.   4, 2010: Renamed header file from "fmiModelTypes.h" to fmiPlatformTypes.h"
+                     for the co-simulation interface
+   - Jan.   4, 2010: Renamed meModelTypes_h to fmiModelTypes_h (by Mauss, QTronic)
+   - Dec.  21, 2009: Changed "me" to "fmi" and "meModel" to "fmiComponent"
+                     according to meeting on Dec. 18 (by Martin Otter, DLR)
+   - Dec.   6, 2009: Added meUndefinedValueReference (by Martin Otter, DLR)
+   - Sept.  9, 2009: Changes according to FMI-meeting on July 21:
+                     Changed "version" to "platform", "standard" to "standard32",
+                     Added a precise definition of "standard32" as comment
+                     (by Martin Otter, DLR)
+   - July  19, 2009: Added "me" as prefix to file names, added meTrue/meFalse,
+                     and changed meValueReferenced from int to unsigned int
+                     (by Martin Otter, DLR).
+   - March  2, 2009: Moved enums and function pointer definitions to
+                     ModelFunctions.h (by Martin Otter, DLR).
+   - Dec.  3, 2008 : First version by Martin Otter (DLR) and
+                     Hans Olsson (Dynasim).
+
+
+   Copyright © 2008-2011 MODELISAR consortium,
+               2012-2013 Modelica Association Project "FMI"
+               All rights reserved.
+   This file is licensed by the copyright holders under the BSD 2-Clause License
+   (http://www.opensource.org/licenses/bsd-license.html):
+
+   ----------------------------------------------------------------------------
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+   - Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+   - Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+   - Neither the name of the copyright holders nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   ----------------------------------------------------------------------------
+
+   with the extension:
+
+   You may distribute or publicly perform any modification only under the
+   terms of this license.
+   (Note, this means that if you distribute a modified file,
+    the modified file must also be provided under this license).
+*/
+
+/* Platform (unique identification of this header file) */
+#define fmi2TypesPlatform "default"
+
+/* Type definitions of variables passed as arguments
+   Version "default" means:
+
+   fmi2Component           : an opaque object pointer
+   fmi2ComponentEnvironment: an opaque object pointer
+   fmi2FMUstate            : an opaque object pointer
+   fmi2ValueReference      : handle to the value of a variable
+   fmi2Real                : double precision floating-point data type
+   fmi2Integer             : basic signed integer data type
+   fmi2Boolean             : basic signed integer data type
+   fmi2Char                : character data type
+   fmi2String              : a pointer to a vector of fmi2Char characters
+                             ('\0' terminated, UTF8 encoded)
+   fmi2Byte                : smallest addressable unit of the machine, typically one byte.
+*/
+   typedef void*           fmi2Component;               /* Pointer to FMU instance       */
+   typedef void*           fmi2ComponentEnvironment;    /* Pointer to FMU environment    */
+   typedef void*           fmi2FMUstate;                /* Pointer to internal FMU state */
+   typedef unsigned int    fmi2ValueReference;
+   typedef double          fmi2Real   ;
+   typedef int             fmi2Integer;
+   typedef int             fmi2Boolean;
+   typedef char            fmi2Char;
+   typedef const fmi2Char* fmi2String;
+   typedef char            fmi2Byte;
+
+/* Values for fmi2Boolean  */
+#define fmi2True  1
+#define fmi2False 0
+
+
+#endif /* fmi2TypesPlatform_h */

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/Modelica_Electrical_Machines_Examples_DCMachines_DCEE_Start.fmu


BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem.fmu


+ 0 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/binaries/win32/PW_PowerSystem_FMU.libs


+ 20 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/build.bat

@@ -0,0 +1,20 @@
+@echo off
+
+mode 230,1000
+
+setlocal
+
+set PATH=%PATH%;C:\MinGW\msys\1.0\bin
+
+pushd sources
+
+make clean
+
+make
+
+popd
+
+if "%1"=="nopause" goto skip
+	pause
+:skip
+

File diff suppressed because it is too large
+ 4113 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/modelDescription.xml


File diff suppressed because it is too large
+ 65 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/Makefile


+ 62 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/Makefile.in

@@ -0,0 +1,62 @@
+# Makefile generated by OpenModelica
+CC=@CC@
+AR=@AR@
+CFLAGS=@CFLAGS@
+LD=$(CC) -shared
+LDFLAGS=@LDFLAGS@ @LIBS@
+DLLEXT=@DLLEXT@
+NEED_RUNTIME=@NEED_RUNTIME@
+NEED_DGESV=@NEED_DGESV@
+FMIPLATFORM=@FMIPLATFORM@
+# Note: Simulation of the fmu with dymola does not work with -finline-small-functions (enabled by most optimization levels)
+CPPFLAGS=@CPPFLAGS@
+OMC_NUM_LINEAR_SYSTEMS=6
+OMC_NUM_NONLINEAR_SYSTEMS=0
+OMC_NUM_MIXED_SYSTEMS=0
+OMC_NDELAY_EXPRESSIONS=0
+OMC_NVAR_STRING=0
+
+override CPPFLAGS += -Iinclude/ -Iinclude/fmi2 -I.    -DOMC_MODEL_PREFIX=PW_PowerSystem -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=6 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0
+
+MAINFILE=PW_PowerSystem_FMU.c
+MAINOBJ=PW_PowerSystem_FMU.o
+CFILES=PW_PowerSystem.c PW_PowerSystem_functions.c PW_PowerSystem_records.c \
+PW_PowerSystem_01exo.c PW_PowerSystem_02nls.c PW_PowerSystem_03lsy.c PW_PowerSystem_04set.c PW_PowerSystem_05evt.c PW_PowerSystem_06inz.c PW_PowerSystem_07dly.c \
+PW_PowerSystem_08bnd.c PW_PowerSystem_09alg.c PW_PowerSystem_10asr.c PW_PowerSystem_11mix.c PW_PowerSystem_12jac.c PW_PowerSystem_13opt.c PW_PowerSystem_14lnz.c \
+PW_PowerSystem_15syn.c PW_PowerSystem_16dae.c PW_PowerSystem_init_fmu.c
+OFILES=$(CFILES:.c=.o)
+GENERATEDFILES=$(MAINFILE) PW_PowerSystem_FMU.makefile PW_PowerSystem_literals.h PW_PowerSystem_model.h PW_PowerSystem_includes.h PW_PowerSystem_functions.h  PW_PowerSystem_11mix.h PW_PowerSystem_12jac.h PW_PowerSystem_13opt.h PW_PowerSystem_init_fmu.c PW_PowerSystem_info.c $(CFILES) PW_PowerSystem_FMU.libs
+
+# FIXME: before you push into master...
+RUNTIMEDIR=include
+OMC_MINIMAL_RUNTIME=1
+OMC_FMI_RUNTIME=1
+include $(RUNTIMEDIR)/Makefile.objs
+ifneq ($(NEED_RUNTIME),)
+RUNTIMEFILES=$(FMI_ME_OBJS:%=$(RUNTIMEDIR)/%.o)
+endif
+
+PHONY: PW_PowerSystem_FMU
+PW_PowerSystem_FMU: $(MAINOBJ) PW_PowerSystem_functions.h PW_PowerSystem_literals.h $(OFILES) $(RUNTIMEFILES)
+	$(CXX) -shared -I. -o PW_PowerSystem$(DLLEXT) $(MAINOBJ) $(RUNTIMEFILES) $(OFILES) $(CPPFLAGS) -L"C:/Users/clagms/Source Control/Git_HybridCosimulation/ModelicaModels"   $(CFLAGS) $(LDFLAGS) -llis -Wl,--kill-at
+	mkdir.exe -p ../binaries/win32
+	dlltool -d PW_PowerSystem.def --dllname PW_PowerSystem$(DLLEXT) --output-lib PW_PowerSystem.lib --kill-at
+	cp PW_PowerSystem$(DLLEXT) PW_PowerSystem.lib PW_PowerSystem_FMU.libs ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libsundials_*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libopenblas.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libexpat*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libgfortran*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libquadmath*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libwinpthread*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/zlib*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libszip*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libhdf5*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libsystre*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libtre*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libintl*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libiconv*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libgcc_s_*.dll ../binaries/win32/
+	cp C:/OpenModelica1.12.0-dev-32bit//bin/libstdc*.dll ../binaries/win32/
+	rm -f PW_PowerSystem.def PW_PowerSystem.o PW_PowerSystem$(DLLEXT) $(OFILES) $(RUNTIMEFILES)
+	cd .. && rm -f ../PW_PowerSystem.fmu && zip -r ../PW_PowerSystem.fmu *
+

File diff suppressed because it is too large
+ 1359 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem.c


+ 2 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem.makefile

@@ -0,0 +1,2 @@
+# Dummy file so OMDEV Compile.bat works
+include Makefile

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem.o


+ 26 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_01exo.c

@@ -0,0 +1,26 @@
+/* External objects file */
+#include "PW_PowerSystem_model.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Has to be performed after _init.xml file has been read */
+void PW_PowerSystem_callExternalObjectConstructors(DATA *data, threadData_t *threadData)
+{
+  /* data->simulationInfo->extObjs = NULL; */
+  infoStreamPrint(LOG_DEBUG, 0, "call external Object Constructors");
+  infoStreamPrint(LOG_DEBUG, 0, "call external Object Constructors finished");
+}
+
+void PW_PowerSystem_callExternalObjectDestructors(DATA *data, threadData_t *threadData)
+{
+  if(data->simulationInfo->extObjs)
+  {
+    free(data->simulationInfo->extObjs);
+    data->simulationInfo->extObjs = 0;
+  }
+}
+#if defined(__cplusplus)
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_01exo.o


+ 12 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_02nls.c

@@ -0,0 +1,12 @@
+/* Non Linear Systems */
+#include "PW_PowerSystem_model.h"
+#include "PW_PowerSystem_12jac.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+
+#if defined(__cplusplus)
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_02nls.o


+ 492 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_03lsy.c

@@ -0,0 +1,492 @@
+/* Linear Systems */
+#include "PW_PowerSystem_model.h"
+#include "PW_PowerSystem_12jac.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* initial linear systems */
+
+/*
+ equation index: 37
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._n2._i = (-idealCommutingSwitch2.s2) * (if convertToBoolean.y then 1.0 else idealCommutingSwitch2.Goff)
+ */
+void PW_PowerSystem_eqFunction_37(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,37};
+  data->localData[0]->realVars[22] /* idealCommutingSwitch2._n2._i variable */ = ((-data->localData[0]->realVars[25] /* idealCommutingSwitch2._s2 variable */)) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?1.0:data->simulationInfo->realParameter[6] /* idealCommutingSwitch2._Goff PARAM */));
+  TRACE_POP
+}
+/*
+ equation index: 38
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._n1._i = (-idealCommutingSwitch2.s1) * (if convertToBoolean.y then idealCommutingSwitch2.Goff else 1.0)
+ */
+void PW_PowerSystem_eqFunction_38(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,38};
+  data->localData[0]->realVars[21] /* idealCommutingSwitch2._n1._i variable */ = ((-data->localData[0]->realVars[24] /* idealCommutingSwitch2._s1 variable */)) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?data->simulationInfo->realParameter[6] /* idealCommutingSwitch2._Goff PARAM */:1.0));
+  TRACE_POP
+}
+/*
+ equation index: 39
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._p._v = idealCommutingSwitch2.s1 * (if convertToBoolean.y then 1.0 else idealCommutingSwitch2.Ron) + up_voltage.V
+ */
+void PW_PowerSystem_eqFunction_39(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,39};
+  data->localData[0]->realVars[23] /* idealCommutingSwitch2._p._v variable */ = (data->localData[0]->realVars[24] /* idealCommutingSwitch2._s1 variable */) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?1.0:data->simulationInfo->realParameter[7] /* idealCommutingSwitch2._Ron PARAM */)) + data->simulationInfo->realParameter[103] /* up_voltage._V PARAM */;
+  TRACE_POP
+}
+
+void residualFunc47(void** dataIn, const double* xloc, double* res, const int* iflag)
+{
+  TRACE_PUSH
+  DATA *data = (DATA*) ((void**)dataIn[0]);
+  threadData_t *threadData = (threadData_t*) ((void**)dataIn[1]);
+  const int equationIndexes[2] = {1,47};
+  data->localData[0]->realVars[24] /* idealCommutingSwitch2._s1 variable */ = xloc[0];
+  data->localData[0]->realVars[25] /* idealCommutingSwitch2._s2 variable */ = xloc[1];
+  PW_PowerSystem_eqFunction_37(data, threadData);
+
+  PW_PowerSystem_eqFunction_38(data, threadData);
+
+  PW_PowerSystem_eqFunction_39(data, threadData);
+  res[0] = (data->localData[0]->realVars[25] /* idealCommutingSwitch2._s2 variable */) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?data->simulationInfo->realParameter[7] /* idealCommutingSwitch2._Ron PARAM */:1.0)) - data->localData[0]->realVars[23] /* idealCommutingSwitch2._p._v variable */;
+
+  res[1] = data->localData[0]->realVars[21] /* idealCommutingSwitch2._n1._i variable */ + data->localData[0]->realVars[22] /* idealCommutingSwitch2._n2._i variable */ + data->localData[0]->realVars[2] /* motor._la._i STATE(1) */;
+  TRACE_POP
+}
+void initializeStaticLSData47(void *inData, threadData_t *threadData, void *systemData)
+{
+  DATA* data = (DATA*) inData;
+  LINEAR_SYSTEM_DATA* linearSystemData = (LINEAR_SYSTEM_DATA*) systemData;
+  int i=0;
+  /* static ls data for idealCommutingSwitch2.s1 */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[24].attribute /* idealCommutingSwitch2._s1 */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[24].attribute /* idealCommutingSwitch2._s1 */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[24].attribute /* idealCommutingSwitch2._s1 */.max;
+  /* static ls data for idealCommutingSwitch2.s2 */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[25].attribute /* idealCommutingSwitch2._s2 */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[25].attribute /* idealCommutingSwitch2._s2 */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[25].attribute /* idealCommutingSwitch2._s2 */.max;
+}
+
+
+/*
+ equation index: 67
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch1._n2._i = (-idealCommutingSwitch1.s2) * (if greaterThreshold1.y then 1.0 else idealCommutingSwitch1.Goff)
+ */
+void PW_PowerSystem_eqFunction_67(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,67};
+  data->localData[0]->realVars[17] /* idealCommutingSwitch1._n2._i variable */ = ((-data->localData[0]->realVars[19] /* idealCommutingSwitch1._s2 variable */)) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?1.0:data->simulationInfo->realParameter[3] /* idealCommutingSwitch1._Goff PARAM */));
+  TRACE_POP
+}
+/*
+ equation index: 68
+ type: SIMPLE_ASSIGN
+ arm_sensor._p._v = idealCommutingSwitch1.s2 * (if greaterThreshold1.y then idealCommutingSwitch1.Ron else 1.0)
+ */
+void PW_PowerSystem_eqFunction_68(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,68};
+  data->localData[0]->realVars[13] /* arm_sensor._p._v variable */ = (data->localData[0]->realVars[19] /* idealCommutingSwitch1._s2 variable */) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?data->simulationInfo->realParameter[4] /* idealCommutingSwitch1._Ron PARAM */:1.0));
+  TRACE_POP
+}
+/*
+ equation index: 69
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch1._n1._i = (-arm_current) - idealCommutingSwitch1.n2.i
+ */
+void PW_PowerSystem_eqFunction_69(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,69};
+  data->localData[0]->realVars[16] /* idealCommutingSwitch1._n1._i variable */ = (-data->localData[0]->realVars[12] /* arm_current variable */) - data->localData[0]->realVars[17] /* idealCommutingSwitch1._n2._i variable */;
+  TRACE_POP
+}
+
+void residualFunc76(void** dataIn, const double* xloc, double* res, const int* iflag)
+{
+  TRACE_PUSH
+  DATA *data = (DATA*) ((void**)dataIn[0]);
+  threadData_t *threadData = (threadData_t*) ((void**)dataIn[1]);
+  const int equationIndexes[2] = {1,76};
+  data->localData[0]->realVars[19] /* idealCommutingSwitch1._s2 variable */ = xloc[0];
+  data->localData[0]->realVars[18] /* idealCommutingSwitch1._s1 variable */ = xloc[1];
+  PW_PowerSystem_eqFunction_67(data, threadData);
+
+  PW_PowerSystem_eqFunction_68(data, threadData);
+
+  PW_PowerSystem_eqFunction_69(data, threadData);
+  res[0] = ((-data->localData[0]->realVars[18] /* idealCommutingSwitch1._s1 variable */)) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?data->simulationInfo->realParameter[3] /* idealCommutingSwitch1._Goff PARAM */:1.0)) - data->localData[0]->realVars[16] /* idealCommutingSwitch1._n1._i variable */;
+
+  res[1] = data->localData[0]->realVars[13] /* arm_sensor._p._v variable */ + (-data->simulationInfo->realParameter[103] /* up_voltage._V PARAM */) - ((data->localData[0]->realVars[18] /* idealCommutingSwitch1._s1 variable */) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?1.0:data->simulationInfo->realParameter[4] /* idealCommutingSwitch1._Ron PARAM */)));
+  TRACE_POP
+}
+void initializeStaticLSData76(void *inData, threadData_t *threadData, void *systemData)
+{
+  DATA* data = (DATA*) inData;
+  LINEAR_SYSTEM_DATA* linearSystemData = (LINEAR_SYSTEM_DATA*) systemData;
+  int i=0;
+  /* static ls data for idealCommutingSwitch1.s2 */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[19].attribute /* idealCommutingSwitch1._s2 */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[19].attribute /* idealCommutingSwitch1._s2 */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[19].attribute /* idealCommutingSwitch1._s2 */.max;
+  /* static ls data for idealCommutingSwitch1.s1 */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[18].attribute /* idealCommutingSwitch1._s1 */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[18].attribute /* idealCommutingSwitch1._s1 */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[18].attribute /* idealCommutingSwitch1._s1 */.max;
+}
+
+
+/*
+ equation index: 91
+ type: SIMPLE_ASSIGN
+ motor._lesigma._v = motor.lesigma.p.v - motor.airGapDC.vei
+ */
+void PW_PowerSystem_eqFunction_91(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,91};
+  data->localData[0]->realVars[67] /* motor._lesigma._v variable */ = data->localData[0]->realVars[66] /* motor._lesigma._p._v variable */ - data->localData[0]->realVars[29] /* motor._airGapDC._vei variable */;
+  TRACE_POP
+}
+/*
+ equation index: 92
+ type: SIMPLE_ASSIGN
+ der(motor._lesigma._i) = 0.3125 * motor.airGapDC.vei
+ */
+void PW_PowerSystem_eqFunction_92(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,92};
+  data->localData[0]->realVars[9] /* der(motor._lesigma._i) DUMMY_DER */ = (0.3125) * (data->localData[0]->realVars[29] /* motor._airGapDC._vei variable */);
+  TRACE_POP
+}
+
+void residualFunc96(void** dataIn, const double* xloc, double* res, const int* iflag)
+{
+  TRACE_PUSH
+  DATA *data = (DATA*) ((void**)dataIn[0]);
+  threadData_t *threadData = (threadData_t*) ((void**)dataIn[1]);
+  const int equationIndexes[2] = {1,96};
+  data->localData[0]->realVars[29] /* motor._airGapDC._vei variable */ = xloc[0];
+  PW_PowerSystem_eqFunction_91(data, threadData);
+
+  PW_PowerSystem_eqFunction_92(data, threadData);
+  res[0] = (0.8) * (data->localData[0]->realVars[9] /* der(motor._lesigma._i) DUMMY_DER */) - data->localData[0]->realVars[67] /* motor._lesigma._v variable */;
+  TRACE_POP
+}
+void initializeStaticLSData96(void *inData, threadData_t *threadData, void *systemData)
+{
+  DATA* data = (DATA*) inData;
+  LINEAR_SYSTEM_DATA* linearSystemData = (LINEAR_SYSTEM_DATA*) systemData;
+  int i=0;
+  /* static ls data for motor.airGapDC.vei */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[29].attribute /* motor._airGapDC._vei */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[29].attribute /* motor._airGapDC._vei */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[29].attribute /* motor._airGapDC._vei */.max;
+}
+/* initial_lambda0 linear systems */
+/* parameter linear systems */
+/* model linear systems */
+
+/*
+ equation index: 126
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._n1._i = (-idealCommutingSwitch2.s1) * (if convertToBoolean.y then idealCommutingSwitch2.Goff else 1.0)
+ */
+void PW_PowerSystem_eqFunction_126(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,126};
+  data->localData[0]->realVars[21] /* idealCommutingSwitch2._n1._i variable */ = ((-data->localData[0]->realVars[24] /* idealCommutingSwitch2._s1 variable */)) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?data->simulationInfo->realParameter[6] /* idealCommutingSwitch2._Goff PARAM */:1.0));
+  TRACE_POP
+}
+/*
+ equation index: 127
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._p._v = idealCommutingSwitch2.s1 * (if convertToBoolean.y then 1.0 else idealCommutingSwitch2.Ron) + up_voltage.V
+ */
+void PW_PowerSystem_eqFunction_127(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,127};
+  data->localData[0]->realVars[23] /* idealCommutingSwitch2._p._v variable */ = (data->localData[0]->realVars[24] /* idealCommutingSwitch2._s1 variable */) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?1.0:data->simulationInfo->realParameter[7] /* idealCommutingSwitch2._Ron PARAM */)) + data->simulationInfo->realParameter[103] /* up_voltage._V PARAM */;
+  TRACE_POP
+}
+/*
+ equation index: 128
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._n2._i = (-idealCommutingSwitch2.s2) * (if convertToBoolean.y then 1.0 else idealCommutingSwitch2.Goff)
+ */
+void PW_PowerSystem_eqFunction_128(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,128};
+  data->localData[0]->realVars[22] /* idealCommutingSwitch2._n2._i variable */ = ((-data->localData[0]->realVars[25] /* idealCommutingSwitch2._s2 variable */)) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?1.0:data->simulationInfo->realParameter[6] /* idealCommutingSwitch2._Goff PARAM */));
+  TRACE_POP
+}
+
+void residualFunc136(void** dataIn, const double* xloc, double* res, const int* iflag)
+{
+  TRACE_PUSH
+  DATA *data = (DATA*) ((void**)dataIn[0]);
+  threadData_t *threadData = (threadData_t*) ((void**)dataIn[1]);
+  const int equationIndexes[2] = {1,136};
+  data->localData[0]->realVars[24] /* idealCommutingSwitch2._s1 variable */ = xloc[0];
+  data->localData[0]->realVars[25] /* idealCommutingSwitch2._s2 variable */ = xloc[1];
+  PW_PowerSystem_eqFunction_126(data, threadData);
+
+  PW_PowerSystem_eqFunction_127(data, threadData);
+
+  PW_PowerSystem_eqFunction_128(data, threadData);
+  res[0] = data->localData[0]->realVars[21] /* idealCommutingSwitch2._n1._i variable */ + data->localData[0]->realVars[22] /* idealCommutingSwitch2._n2._i variable */ + data->localData[0]->realVars[2] /* motor._la._i STATE(1) */;
+
+  res[1] = (data->localData[0]->realVars[25] /* idealCommutingSwitch2._s2 variable */) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?data->simulationInfo->realParameter[7] /* idealCommutingSwitch2._Ron PARAM */:1.0)) - data->localData[0]->realVars[23] /* idealCommutingSwitch2._p._v variable */;
+  TRACE_POP
+}
+void initializeStaticLSData136(void *inData, threadData_t *threadData, void *systemData)
+{
+  DATA* data = (DATA*) inData;
+  LINEAR_SYSTEM_DATA* linearSystemData = (LINEAR_SYSTEM_DATA*) systemData;
+  int i=0;
+  /* static ls data for idealCommutingSwitch2.s1 */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[24].attribute /* idealCommutingSwitch2._s1 */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[24].attribute /* idealCommutingSwitch2._s1 */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[24].attribute /* idealCommutingSwitch2._s1 */.max;
+  /* static ls data for idealCommutingSwitch2.s2 */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[25].attribute /* idealCommutingSwitch2._s2 */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[25].attribute /* idealCommutingSwitch2._s2 */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[25].attribute /* idealCommutingSwitch2._s2 */.max;
+}
+
+
+/*
+ equation index: 157
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch1._n2._i = (-idealCommutingSwitch1.s2) * (if greaterThreshold1.y then 1.0 else idealCommutingSwitch1.Goff)
+ */
+void PW_PowerSystem_eqFunction_157(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,157};
+  data->localData[0]->realVars[17] /* idealCommutingSwitch1._n2._i variable */ = ((-data->localData[0]->realVars[19] /* idealCommutingSwitch1._s2 variable */)) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?1.0:data->simulationInfo->realParameter[3] /* idealCommutingSwitch1._Goff PARAM */));
+  TRACE_POP
+}
+/*
+ equation index: 158
+ type: SIMPLE_ASSIGN
+ arm_sensor._p._v = idealCommutingSwitch1.s2 * (if greaterThreshold1.y then idealCommutingSwitch1.Ron else 1.0)
+ */
+void PW_PowerSystem_eqFunction_158(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,158};
+  data->localData[0]->realVars[13] /* arm_sensor._p._v variable */ = (data->localData[0]->realVars[19] /* idealCommutingSwitch1._s2 variable */) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?data->simulationInfo->realParameter[4] /* idealCommutingSwitch1._Ron PARAM */:1.0));
+  TRACE_POP
+}
+/*
+ equation index: 159
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch1._n1._i = (-arm_current) - idealCommutingSwitch1.n2.i
+ */
+void PW_PowerSystem_eqFunction_159(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,159};
+  data->localData[0]->realVars[16] /* idealCommutingSwitch1._n1._i variable */ = (-data->localData[0]->realVars[12] /* arm_current variable */) - data->localData[0]->realVars[17] /* idealCommutingSwitch1._n2._i variable */;
+  TRACE_POP
+}
+
+void residualFunc166(void** dataIn, const double* xloc, double* res, const int* iflag)
+{
+  TRACE_PUSH
+  DATA *data = (DATA*) ((void**)dataIn[0]);
+  threadData_t *threadData = (threadData_t*) ((void**)dataIn[1]);
+  const int equationIndexes[2] = {1,166};
+  data->localData[0]->realVars[19] /* idealCommutingSwitch1._s2 variable */ = xloc[0];
+  data->localData[0]->realVars[18] /* idealCommutingSwitch1._s1 variable */ = xloc[1];
+  PW_PowerSystem_eqFunction_157(data, threadData);
+
+  PW_PowerSystem_eqFunction_158(data, threadData);
+
+  PW_PowerSystem_eqFunction_159(data, threadData);
+  res[0] = ((-data->localData[0]->realVars[18] /* idealCommutingSwitch1._s1 variable */)) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?data->simulationInfo->realParameter[3] /* idealCommutingSwitch1._Goff PARAM */:1.0)) - data->localData[0]->realVars[16] /* idealCommutingSwitch1._n1._i variable */;
+
+  res[1] = data->localData[0]->realVars[13] /* arm_sensor._p._v variable */ + (-data->simulationInfo->realParameter[103] /* up_voltage._V PARAM */) - ((data->localData[0]->realVars[18] /* idealCommutingSwitch1._s1 variable */) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?1.0:data->simulationInfo->realParameter[4] /* idealCommutingSwitch1._Ron PARAM */)));
+  TRACE_POP
+}
+void initializeStaticLSData166(void *inData, threadData_t *threadData, void *systemData)
+{
+  DATA* data = (DATA*) inData;
+  LINEAR_SYSTEM_DATA* linearSystemData = (LINEAR_SYSTEM_DATA*) systemData;
+  int i=0;
+  /* static ls data for idealCommutingSwitch1.s2 */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[19].attribute /* idealCommutingSwitch1._s2 */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[19].attribute /* idealCommutingSwitch1._s2 */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[19].attribute /* idealCommutingSwitch1._s2 */.max;
+  /* static ls data for idealCommutingSwitch1.s1 */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[18].attribute /* idealCommutingSwitch1._s1 */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[18].attribute /* idealCommutingSwitch1._s1 */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[18].attribute /* idealCommutingSwitch1._s1 */.max;
+}
+
+
+/*
+ equation index: 181
+ type: SIMPLE_ASSIGN
+ motor._airGapDC._vei = motor.lesigma.p.v - motor.lesigma.v
+ */
+void PW_PowerSystem_eqFunction_181(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,181};
+  data->localData[0]->realVars[29] /* motor._airGapDC._vei variable */ = data->localData[0]->realVars[66] /* motor._lesigma._p._v variable */ - data->localData[0]->realVars[67] /* motor._lesigma._v variable */;
+  TRACE_POP
+}
+/*
+ equation index: 182
+ type: SIMPLE_ASSIGN
+ der(motor._lesigma._i) = 1.25 * motor.lesigma.v
+ */
+void PW_PowerSystem_eqFunction_182(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,182};
+  data->localData[0]->realVars[9] /* der(motor._lesigma._i) DUMMY_DER */ = (1.25) * (data->localData[0]->realVars[67] /* motor._lesigma._v variable */);
+  TRACE_POP
+}
+
+void residualFunc186(void** dataIn, const double* xloc, double* res, const int* iflag)
+{
+  TRACE_PUSH
+  DATA *data = (DATA*) ((void**)dataIn[0]);
+  threadData_t *threadData = (threadData_t*) ((void**)dataIn[1]);
+  const int equationIndexes[2] = {1,186};
+  data->localData[0]->realVars[67] /* motor._lesigma._v variable */ = xloc[0];
+  PW_PowerSystem_eqFunction_181(data, threadData);
+
+  PW_PowerSystem_eqFunction_182(data, threadData);
+  res[0] = (3.2) * (data->localData[0]->realVars[9] /* der(motor._lesigma._i) DUMMY_DER */) - data->localData[0]->realVars[29] /* motor._airGapDC._vei variable */;
+  TRACE_POP
+}
+void initializeStaticLSData186(void *inData, threadData_t *threadData, void *systemData)
+{
+  DATA* data = (DATA*) inData;
+  LINEAR_SYSTEM_DATA* linearSystemData = (LINEAR_SYSTEM_DATA*) systemData;
+  int i=0;
+  /* static ls data for motor.lesigma.v */
+  linearSystemData->nominal[i] = data->modelData->realVarsData[67].attribute /* motor._lesigma._v */.nominal;
+  linearSystemData->min[i]     = data->modelData->realVarsData[67].attribute /* motor._lesigma._v */.min;
+  linearSystemData->max[i++]   = data->modelData->realVarsData[67].attribute /* motor._lesigma._v */.max;
+}
+/* jacobians linear systems */
+
+/* function initialize linear systems */
+
+void PW_PowerSystem_initialLinearSystem(int nLinearSystems, LINEAR_SYSTEM_DATA* linearSystemData)
+{
+  /* initial linear systems */
+  assertStreamPrint(NULL, nLinearSystems > 0, "Internal Error: indexlinearSystem mismatch!");
+  linearSystemData[0].equationIndex = 47;
+  linearSystemData[0].size = 2;
+  linearSystemData[0].nnz = 0;
+  linearSystemData[0].method = 1;
+  linearSystemData[0].residualFunc = residualFunc47;
+  linearSystemData[0].strictTearingFunctionCall = NULL;
+  linearSystemData[0].analyticalJacobianColumn = PW_PowerSystem_functionJacLSJac48_column;
+  linearSystemData[0].initialAnalyticalJacobian = PW_PowerSystem_initialAnalyticJacobianLSJac48;
+  linearSystemData[0].jacobianIndex = 0;
+  linearSystemData[0].setA = NULL;//setLinearMatrixA47;
+  linearSystemData[0].setb = NULL; //setLinearVectorb47;
+  linearSystemData[0].initializeStaticLSData = initializeStaticLSData47;
+  
+  assertStreamPrint(NULL, nLinearSystems > 1, "Internal Error: indexlinearSystem mismatch!");
+  linearSystemData[1].equationIndex = 76;
+  linearSystemData[1].size = 2;
+  linearSystemData[1].nnz = 0;
+  linearSystemData[1].method = 1;
+  linearSystemData[1].residualFunc = residualFunc76;
+  linearSystemData[1].strictTearingFunctionCall = NULL;
+  linearSystemData[1].analyticalJacobianColumn = PW_PowerSystem_functionJacLSJac49_column;
+  linearSystemData[1].initialAnalyticalJacobian = PW_PowerSystem_initialAnalyticJacobianLSJac49;
+  linearSystemData[1].jacobianIndex = 1;
+  linearSystemData[1].setA = NULL;//setLinearMatrixA76;
+  linearSystemData[1].setb = NULL; //setLinearVectorb76;
+  linearSystemData[1].initializeStaticLSData = initializeStaticLSData76;
+  
+  assertStreamPrint(NULL, nLinearSystems > 2, "Internal Error: indexlinearSystem mismatch!");
+  linearSystemData[2].equationIndex = 96;
+  linearSystemData[2].size = 1;
+  linearSystemData[2].nnz = 0;
+  linearSystemData[2].method = 1;
+  linearSystemData[2].residualFunc = residualFunc96;
+  linearSystemData[2].strictTearingFunctionCall = NULL;
+  linearSystemData[2].analyticalJacobianColumn = PW_PowerSystem_functionJacLSJac50_column;
+  linearSystemData[2].initialAnalyticalJacobian = PW_PowerSystem_initialAnalyticJacobianLSJac50;
+  linearSystemData[2].jacobianIndex = 2;
+  linearSystemData[2].setA = NULL;//setLinearMatrixA96;
+  linearSystemData[2].setb = NULL; //setLinearVectorb96;
+  linearSystemData[2].initializeStaticLSData = initializeStaticLSData96;
+  /* initial_lambda0 linear systems */
+  /* parameter linear systems */
+  /* model linear systems */
+  assertStreamPrint(NULL, nLinearSystems > 3, "Internal Error: indexlinearSystem mismatch!");
+  linearSystemData[3].equationIndex = 136;
+  linearSystemData[3].size = 2;
+  linearSystemData[3].nnz = 0;
+  linearSystemData[3].method = 1;
+  linearSystemData[3].residualFunc = residualFunc136;
+  linearSystemData[3].strictTearingFunctionCall = NULL;
+  linearSystemData[3].analyticalJacobianColumn = PW_PowerSystem_functionJacLSJac51_column;
+  linearSystemData[3].initialAnalyticalJacobian = PW_PowerSystem_initialAnalyticJacobianLSJac51;
+  linearSystemData[3].jacobianIndex = 3;
+  linearSystemData[3].setA = NULL;//setLinearMatrixA136;
+  linearSystemData[3].setb = NULL; //setLinearVectorb136;
+  linearSystemData[3].initializeStaticLSData = initializeStaticLSData136;
+  
+  assertStreamPrint(NULL, nLinearSystems > 4, "Internal Error: indexlinearSystem mismatch!");
+  linearSystemData[4].equationIndex = 166;
+  linearSystemData[4].size = 2;
+  linearSystemData[4].nnz = 0;
+  linearSystemData[4].method = 1;
+  linearSystemData[4].residualFunc = residualFunc166;
+  linearSystemData[4].strictTearingFunctionCall = NULL;
+  linearSystemData[4].analyticalJacobianColumn = PW_PowerSystem_functionJacLSJac52_column;
+  linearSystemData[4].initialAnalyticalJacobian = PW_PowerSystem_initialAnalyticJacobianLSJac52;
+  linearSystemData[4].jacobianIndex = 4;
+  linearSystemData[4].setA = NULL;//setLinearMatrixA166;
+  linearSystemData[4].setb = NULL; //setLinearVectorb166;
+  linearSystemData[4].initializeStaticLSData = initializeStaticLSData166;
+  
+  assertStreamPrint(NULL, nLinearSystems > 5, "Internal Error: indexlinearSystem mismatch!");
+  linearSystemData[5].equationIndex = 186;
+  linearSystemData[5].size = 1;
+  linearSystemData[5].nnz = 0;
+  linearSystemData[5].method = 1;
+  linearSystemData[5].residualFunc = residualFunc186;
+  linearSystemData[5].strictTearingFunctionCall = NULL;
+  linearSystemData[5].analyticalJacobianColumn = PW_PowerSystem_functionJacLSJac53_column;
+  linearSystemData[5].initialAnalyticalJacobian = PW_PowerSystem_initialAnalyticJacobianLSJac53;
+  linearSystemData[5].jacobianIndex = 5;
+  linearSystemData[5].setA = NULL;//setLinearMatrixA186;
+  linearSystemData[5].setb = NULL; //setLinearVectorb186;
+  linearSystemData[5].initializeStaticLSData = initializeStaticLSData186;
+  /* jacobians linear systems */
+}
+
+#if defined(__cplusplus)
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_03lsy.o


+ 16 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_04set.c

@@ -0,0 +1,16 @@
+/* Initial State Set */
+#include "PW_PowerSystem_model.h"
+#include "PW_PowerSystem_11mix.h"
+#include "PW_PowerSystem_12jac.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+/* funtion initialize state sets */
+void PW_PowerSystem_initializeStateSets(int nStateSets, STATE_SET_DATA* statesetData, DATA *data)
+{
+}
+
+#if defined(__cplusplus)
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_04set.o


+ 107 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_05evt.c

@@ -0,0 +1,107 @@
+/* Events: Sample, Zero Crossings, Relations, Discrete Changes */
+#include "PW_PowerSystem_model.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Initializes the raw time events of the simulation using the now
+   calcualted parameters. */
+void PW_PowerSystem_function_initSample(DATA *data, threadData_t *threadData)
+{
+  long i=0;
+}
+
+const char *PW_PowerSystem_zeroCrossingDescription(int i, int **out_EquationIndexes)
+{
+  static const char *res[] = {"down_input > greaterThreshold1.threshold",
+  "up_input > convertToBoolean.threshold"};
+  static const int occurEqs0[] = {1,139};
+  static const int occurEqs1[] = {1,125};
+  static const int *occurEqs[] = {occurEqs0,occurEqs1};
+  *out_EquationIndexes = (int*) occurEqs[i];
+  return res[i];
+}
+
+/* forwarded equations */
+
+int PW_PowerSystem_function_ZeroCrossingsEquations(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  data->simulationInfo->callStatistics.functionZeroCrossingsEquations++;
+
+  
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_function_ZeroCrossings(DATA *data, threadData_t *threadData, double *gout)
+{
+  TRACE_PUSH
+  modelica_boolean tmp5;
+  modelica_boolean tmp6;
+  
+  data->simulationInfo->callStatistics.functionZeroCrossings++;
+  
+  tmp5 = GreaterZC(data->localData[0]->realVars[14] /* down_input variable */, data->simulationInfo->realParameter[2] /* greaterThreshold1._threshold PARAM */, data->simulationInfo->storedRelations[0]);
+  gout[0] = (tmp5) ? 1 : -1;
+  tmp6 = GreaterZC(data->localData[0]->realVars[102] /* up_input variable */, data->simulationInfo->realParameter[0] /* convertToBoolean._threshold PARAM */, data->simulationInfo->storedRelations[1]);
+  gout[1] = (tmp6) ? 1 : -1;
+  
+  TRACE_POP
+  return 0;
+}
+
+const char *PW_PowerSystem_relationDescription(int i)
+{
+  const char *res[] = {"down_input > greaterThreshold1.threshold",
+  "up_input > convertToBoolean.threshold"};
+  return res[i];
+}
+
+int PW_PowerSystem_function_updateRelations(DATA *data, threadData_t *threadData, int evalforZeroCross)
+{
+  TRACE_PUSH
+  modelica_boolean tmp7;
+  modelica_boolean tmp8;
+  
+  if(evalforZeroCross) {
+    tmp7 = GreaterZC(data->localData[0]->realVars[14] /* down_input variable */, data->simulationInfo->realParameter[2] /* greaterThreshold1._threshold PARAM */, data->simulationInfo->storedRelations[0]);
+    data->simulationInfo->relations[0] = tmp7;
+    tmp8 = GreaterZC(data->localData[0]->realVars[102] /* up_input variable */, data->simulationInfo->realParameter[0] /* convertToBoolean._threshold PARAM */, data->simulationInfo->storedRelations[1]);
+    data->simulationInfo->relations[1] = tmp8;
+  } else {
+    data->simulationInfo->relations[0] = (data->localData[0]->realVars[14] /* down_input variable */ > data->simulationInfo->realParameter[2] /* greaterThreshold1._threshold PARAM */);
+    data->simulationInfo->relations[1] = (data->localData[0]->realVars[102] /* up_input variable */ > data->simulationInfo->realParameter[0] /* convertToBoolean._threshold PARAM */);
+  }
+  
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_checkForDiscreteChanges(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  int needToIterate = 0;
+
+  infoStreamPrint(LOG_EVENTS_V, 1, "check for discrete changes at time=%.12g", data->localData[0]->timeValue);
+  if(data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */ != data->simulationInfo->booleanVarsPre[0] /* convertToBoolean._y DISCRETE */)
+  {
+    infoStreamPrint(LOG_EVENTS_V, 0, "discrete var changed: convertToBoolean._y from %d to %d", data->simulationInfo->booleanVarsPre[0] /* convertToBoolean._y DISCRETE */, data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */);
+    needToIterate = 1;
+  }
+  if(data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */ != data->simulationInfo->booleanVarsPre[1] /* greaterThreshold1._y DISCRETE */)
+  {
+    infoStreamPrint(LOG_EVENTS_V, 0, "discrete var changed: greaterThreshold1._y from %d to %d", data->simulationInfo->booleanVarsPre[1] /* greaterThreshold1._y DISCRETE */, data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */);
+    needToIterate = 1;
+  }
+  if (ACTIVE_STREAM(LOG_EVENTS_V)) messageClose(LOG_EVENTS_V);
+  
+  TRACE_POP
+  return needToIterate;
+}
+
+#if defined(__cplusplus)
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_05evt.o


File diff suppressed because it is too large
+ 1630 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_06inz.c


BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_06inz.o


+ 19 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_07dly.c

@@ -0,0 +1,19 @@
+/* Delay */
+#include "PW_PowerSystem_model.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+int PW_PowerSystem_function_storeDelayed(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  
+  TRACE_POP
+  return 0;
+}
+
+#if defined(__cplusplus)
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_07dly.o


File diff suppressed because it is too large
+ 3261 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_08bnd.c


BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_08bnd.o


+ 123 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_09alg.c

@@ -0,0 +1,123 @@
+/* Algebraic */
+#include "PW_PowerSystem_model.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* forwarded equations */
+extern void PW_PowerSystem_eqFunction_122(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_137(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_144(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_146(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_147(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_149(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_150(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_151(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_152(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_153(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_154(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_155(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_167(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_168(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_169(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_170(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_175(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_176(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_177(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_188(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_189(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_190(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_191(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_192(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_193(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_194(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_195(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_121(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_198(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_197(DATA* data, threadData_t *threadData);
+extern void PW_PowerSystem_eqFunction_196(DATA* data, threadData_t *threadData);
+
+static void functionAlg_system0(DATA *data, threadData_t *threadData)
+{
+  PW_PowerSystem_eqFunction_122(data, threadData);
+
+  PW_PowerSystem_eqFunction_137(data, threadData);
+
+  PW_PowerSystem_eqFunction_144(data, threadData);
+
+  PW_PowerSystem_eqFunction_146(data, threadData);
+
+  PW_PowerSystem_eqFunction_147(data, threadData);
+
+  PW_PowerSystem_eqFunction_149(data, threadData);
+
+  PW_PowerSystem_eqFunction_150(data, threadData);
+
+  PW_PowerSystem_eqFunction_151(data, threadData);
+
+  PW_PowerSystem_eqFunction_152(data, threadData);
+
+  PW_PowerSystem_eqFunction_153(data, threadData);
+
+  PW_PowerSystem_eqFunction_154(data, threadData);
+
+  PW_PowerSystem_eqFunction_155(data, threadData);
+
+  PW_PowerSystem_eqFunction_167(data, threadData);
+
+  PW_PowerSystem_eqFunction_168(data, threadData);
+
+  PW_PowerSystem_eqFunction_169(data, threadData);
+
+  PW_PowerSystem_eqFunction_170(data, threadData);
+
+  PW_PowerSystem_eqFunction_175(data, threadData);
+
+  PW_PowerSystem_eqFunction_176(data, threadData);
+
+  PW_PowerSystem_eqFunction_177(data, threadData);
+
+  PW_PowerSystem_eqFunction_188(data, threadData);
+
+  PW_PowerSystem_eqFunction_189(data, threadData);
+
+  PW_PowerSystem_eqFunction_190(data, threadData);
+
+  PW_PowerSystem_eqFunction_191(data, threadData);
+
+  PW_PowerSystem_eqFunction_192(data, threadData);
+
+  PW_PowerSystem_eqFunction_193(data, threadData);
+
+  PW_PowerSystem_eqFunction_194(data, threadData);
+
+  PW_PowerSystem_eqFunction_195(data, threadData);
+
+  PW_PowerSystem_eqFunction_121(data, threadData);
+
+  PW_PowerSystem_eqFunction_198(data, threadData);
+
+  PW_PowerSystem_eqFunction_197(data, threadData);
+
+  PW_PowerSystem_eqFunction_196(data, threadData);
+}
+/* for continuous time variables */
+int PW_PowerSystem_functionAlgebraics(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  
+  data->simulationInfo->callStatistics.functionAlgebraics++;
+  
+  functionAlg_system0(data, threadData);
+
+  PW_PowerSystem_function_savePreSynchronous(data, threadData);
+  
+  TRACE_POP
+  return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_09alg.o


+ 20 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_10asr.c

@@ -0,0 +1,20 @@
+/* Asserts */
+#include "PW_PowerSystem_model.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* function to check assert after a step is done */
+int PW_PowerSystem_checkForAsserts(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  
+  TRACE_POP
+  return 0;
+}
+
+#if defined(__cplusplus)
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_10asr.o


+ 10 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_11mix.c

@@ -0,0 +1,10 @@
+/* Mixed Systems */
+#include "PW_PowerSystem_model.h"
+#include "PW_PowerSystem_11mix.h"
+/* initial mixed systems */
+/* initial_lambda0 mixed systems */
+/* parameter mixed systems */
+/* model mixed systems */
+/* jacobians mixed systems */
+
+

+ 0 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_11mix.h


BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_11mix.o


+ 814 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_12jac.c

@@ -0,0 +1,814 @@
+/* Jacobians */
+#include "PW_PowerSystem_model.h"
+#include "PW_PowerSystem_12jac.h"
+
+int PW_PowerSystem_initialAnalyticJacobianLSJac53(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac53;
+  const int colPtrIndex[1+1] = {0,1};
+  const int rowIndex[1] = {0};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 1;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 1;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 3;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(1,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(1,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(3,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((1+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(1*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(1*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 1;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (1+1)*sizeof(int));
+  
+  for(i=2;i<1+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 1*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 1;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianLSJac52(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac52;
+  const int colPtrIndex[1+2] = {0,2,2};
+  const int rowIndex[4] = {0,1,0,1};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 2;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 2;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 5;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(5,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((2+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(4*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 4;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(2*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 2;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (2+1)*sizeof(int));
+  
+  for(i=2;i<2+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 4*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[1] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 2;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianLSJac51(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac51;
+  const int colPtrIndex[1+2] = {0,2,2};
+  const int rowIndex[4] = {0,1,0,1};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 2;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 2;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 5;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(5,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((2+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(4*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 4;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(2*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 2;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (2+1)*sizeof(int));
+  
+  for(i=2;i<2+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 4*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[1] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 2;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianLSJac50(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac50;
+  const int colPtrIndex[1+1] = {0,1};
+  const int rowIndex[1] = {0};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 1;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 1;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 3;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(1,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(1,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(3,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((1+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(1*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(1*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 1;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (1+1)*sizeof(int));
+  
+  for(i=2;i<1+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 1*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 1;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianLSJac49(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac49;
+  const int colPtrIndex[1+2] = {0,2,2};
+  const int rowIndex[4] = {0,1,0,1};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 2;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 2;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 5;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(5,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((2+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(4*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 4;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(2*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 2;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (2+1)*sizeof(int));
+  
+  for(i=2;i<2+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 4*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[1] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 2;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianLSJac48(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac48;
+  const int colPtrIndex[1+2] = {0,2,2};
+  const int rowIndex[4] = {0,1,0,1};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 2;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 2;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 5;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(5,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((2+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(4*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 4;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(2*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 2;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (2+1)*sizeof(int));
+  
+  for(i=2;i<2+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 4*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[1] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 2;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianD(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_D;
+  const int colPtrIndex[1+3] = {0,0,0,0};
+  const int rowIndex[0] = {};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 3;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 2;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 0;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(3,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(0,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((3+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(0*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 0;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(3*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 1;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (3+1)*sizeof(int));
+  
+  for(i=2;i<3+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 0*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[1] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[2] = 1;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianC(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_C;
+  const int colPtrIndex[1+4] = {0,0,1,1,0};
+  const int rowIndex[2] = {1,0};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 4;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 2;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 0;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(4,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(2,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(0,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((4+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(2*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 2;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(4*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 1;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (4+1)*sizeof(int));
+  
+  for(i=2;i<4+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 2*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[3] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[1] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[2] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 1;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianB(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_B;
+  const int colPtrIndex[1+3] = {0,1,1,1};
+  const int rowIndex[3] = {2,1,2};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 3;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 4;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 0;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(3,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(4,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(0,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((3+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(3*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 3;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(3*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 2;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (3+1)*sizeof(int));
+  
+  for(i=2;i<3+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 3*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[2] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[1] = 2;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 2;
+  TRACE_POP
+  return 0;
+}
+
+int PW_PowerSystem_initialAnalyticJacobianA(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_A;
+  const int colPtrIndex[1+4] = {0,3,3,2,0};
+  const int rowIndex[8] = {0,1,2,1,2,3,1,2};
+  int i = 0;
+  
+  data->simulationInfo->analyticJacobians[index].sizeCols = 4;
+  data->simulationInfo->analyticJacobians[index].sizeRows = 4;
+  data->simulationInfo->analyticJacobians[index].sizeTmpVars = 0;
+  data->simulationInfo->analyticJacobians[index].seedVars = (modelica_real*) calloc(4,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].resultVars = (modelica_real*) calloc(4,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].tmpVars = (modelica_real*) calloc(0,sizeof(modelica_real));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex = (unsigned int*) malloc((4+1)*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.index = (unsigned int*) malloc(8*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.numberOfNoneZeros = 8;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols = (unsigned int*) malloc(4*sizeof(int));
+  data->simulationInfo->analyticJacobians[index].sparsePattern.maxColors = 3;
+  data->simulationInfo->analyticJacobians[index].jacobian = NULL;
+  
+  /* write lead index of compressed sparse column */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex, colPtrIndex, (4+1)*sizeof(int));
+  
+  for(i=2;i<4+1;++i)
+    data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i] += data->simulationInfo->analyticJacobians[index].sparsePattern.leadindex[i-1];
+  
+  /* call sparse index */
+  memcpy(data->simulationInfo->analyticJacobians[index].sparsePattern.index, rowIndex, 8*sizeof(int));
+  
+  /* write color array */
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[0] = 1;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[2] = 2;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[3] = 3;
+  data->simulationInfo->analyticJacobians[index].sparsePattern.colorCols[1] = 3;
+  TRACE_POP
+  return 0;
+}
+
+
+/*
+ equation index: 184
+ type: SIMPLE_ASSIGN
+ der(motor._lesigma._i._$pDERLSJac53._dummyVarLSJac53) = 1.25 * motor_lesigma_vSeedLSJac53
+ */
+void PW_PowerSystem_eqFunction_184(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,184};
+  $P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac53$PdummyVarLSJac53 = (1.25) * ($Pmotor_lesigma_vSeedLSJac53);
+  TRACE_POP
+}
+
+/*
+ equation index: 185
+ type: SIMPLE_ASSIGN
+ $res._1._$pDERLSJac53._dummyVarLSJac53 = 3.2 * $DER.motor.lesigma.i.$pDERLSJac53.dummyVarLSJac53 + motor_lesigma_vSeedLSJac53
+ */
+void PW_PowerSystem_eqFunction_185(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,185};
+  $P$res$P1$P$pDERLSJac53$PdummyVarLSJac53 = (3.2) * ($P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac53$PdummyVarLSJac53) + $Pmotor_lesigma_vSeedLSJac53;
+  TRACE_POP
+}
+int PW_PowerSystem_functionJacLSJac53_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac53;
+  PW_PowerSystem_eqFunction_184(data, threadData);
+
+  PW_PowerSystem_eqFunction_185(data, threadData);
+  
+  TRACE_POP
+  return 0;
+}
+
+/*
+ equation index: 162
+ type: SIMPLE_ASSIGN
+ arm_sensor._p._v._$pDERLSJac52._dummyVarLSJac52 = idealCommutingSwitch1_s2SeedLSJac52 * (if greaterThreshold1.y then idealCommutingSwitch1.Ron else 1.0)
+ */
+void PW_PowerSystem_eqFunction_162(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,162};
+  $Parm_sensor$Pp$Pv$P$pDERLSJac52$PdummyVarLSJac52 = ($PidealCommutingSwitch1_s2SeedLSJac52) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?data->simulationInfo->realParameter[4] /* idealCommutingSwitch1._Ron PARAM */:1.0));
+  TRACE_POP
+}
+
+/*
+ equation index: 163
+ type: SIMPLE_ASSIGN
+ $res._2._$pDERLSJac52._dummyVarLSJac52 = arm_sensor.p.v.$pDERLSJac52.dummyVarLSJac52 - idealCommutingSwitch1_s1SeedLSJac52 * (if greaterThreshold1.y then 1.0 else idealCommutingSwitch1.Ron)
+ */
+void PW_PowerSystem_eqFunction_163(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,163};
+  $P$res$P2$P$pDERLSJac52$PdummyVarLSJac52 = $Parm_sensor$Pp$Pv$P$pDERLSJac52$PdummyVarLSJac52 - (($PidealCommutingSwitch1_s1SeedLSJac52) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?1.0:data->simulationInfo->realParameter[4] /* idealCommutingSwitch1._Ron PARAM */)));
+  TRACE_POP
+}
+
+/*
+ equation index: 164
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch1._n2._i._$pDERLSJac52._dummyVarLSJac52 = (-idealCommutingSwitch1_s2SeedLSJac52) * (if greaterThreshold1.y then 1.0 else idealCommutingSwitch1.Goff)
+ */
+void PW_PowerSystem_eqFunction_164(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,164};
+  $PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac52$PdummyVarLSJac52 = ((-$PidealCommutingSwitch1_s2SeedLSJac52)) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?1.0:data->simulationInfo->realParameter[3] /* idealCommutingSwitch1._Goff PARAM */));
+  TRACE_POP
+}
+
+/*
+ equation index: 165
+ type: SIMPLE_ASSIGN
+ $res._1._$pDERLSJac52._dummyVarLSJac52 = idealCommutingSwitch1.n2.i.$pDERLSJac52.dummyVarLSJac52 - idealCommutingSwitch1_s1SeedLSJac52 * (if greaterThreshold1.y then idealCommutingSwitch1.Goff else 1.0)
+ */
+void PW_PowerSystem_eqFunction_165(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,165};
+  $P$res$P1$P$pDERLSJac52$PdummyVarLSJac52 = $PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac52$PdummyVarLSJac52 - (($PidealCommutingSwitch1_s1SeedLSJac52) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?data->simulationInfo->realParameter[3] /* idealCommutingSwitch1._Goff PARAM */:1.0)));
+  TRACE_POP
+}
+int PW_PowerSystem_functionJacLSJac52_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac52;
+  PW_PowerSystem_eqFunction_162(data, threadData);
+
+  PW_PowerSystem_eqFunction_163(data, threadData);
+
+  PW_PowerSystem_eqFunction_164(data, threadData);
+
+  PW_PowerSystem_eqFunction_165(data, threadData);
+  
+  TRACE_POP
+  return 0;
+}
+
+/*
+ equation index: 131
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._n1._i._$pDERLSJac51._dummyVarLSJac51 = (-idealCommutingSwitch2_s1SeedLSJac51) * (if convertToBoolean.y then idealCommutingSwitch2.Goff else 1.0)
+ */
+void PW_PowerSystem_eqFunction_131(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,131};
+  $PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac51$PdummyVarLSJac51 = ((-$PidealCommutingSwitch2_s1SeedLSJac51)) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?data->simulationInfo->realParameter[6] /* idealCommutingSwitch2._Goff PARAM */:1.0));
+  TRACE_POP
+}
+
+/*
+ equation index: 132
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._p._v._$pDERLSJac51._dummyVarLSJac51 = idealCommutingSwitch2_s1SeedLSJac51 * (if convertToBoolean.y then 1.0 else idealCommutingSwitch2.Ron)
+ */
+void PW_PowerSystem_eqFunction_132(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,132};
+  $PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac51$PdummyVarLSJac51 = ($PidealCommutingSwitch2_s1SeedLSJac51) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?1.0:data->simulationInfo->realParameter[7] /* idealCommutingSwitch2._Ron PARAM */));
+  TRACE_POP
+}
+
+/*
+ equation index: 133
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._n2._i._$pDERLSJac51._dummyVarLSJac51 = (-idealCommutingSwitch2_s2SeedLSJac51) * (if convertToBoolean.y then 1.0 else idealCommutingSwitch2.Goff)
+ */
+void PW_PowerSystem_eqFunction_133(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,133};
+  $PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac51$PdummyVarLSJac51 = ((-$PidealCommutingSwitch2_s2SeedLSJac51)) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?1.0:data->simulationInfo->realParameter[6] /* idealCommutingSwitch2._Goff PARAM */));
+  TRACE_POP
+}
+
+/*
+ equation index: 134
+ type: SIMPLE_ASSIGN
+ $res._1._$pDERLSJac51._dummyVarLSJac51 = idealCommutingSwitch2.n2.i.$pDERLSJac51.dummyVarLSJac51 + idealCommutingSwitch2.n1.i.$pDERLSJac51.dummyVarLSJac51
+ */
+void PW_PowerSystem_eqFunction_134(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,134};
+  $P$res$P1$P$pDERLSJac51$PdummyVarLSJac51 = $PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac51$PdummyVarLSJac51 + $PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac51$PdummyVarLSJac51;
+  TRACE_POP
+}
+
+/*
+ equation index: 135
+ type: SIMPLE_ASSIGN
+ $res._2._$pDERLSJac51._dummyVarLSJac51 = idealCommutingSwitch2_s2SeedLSJac51 * (if convertToBoolean.y then idealCommutingSwitch2.Ron else 1.0) - idealCommutingSwitch2.p.v.$pDERLSJac51.dummyVarLSJac51
+ */
+void PW_PowerSystem_eqFunction_135(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,135};
+  $P$res$P2$P$pDERLSJac51$PdummyVarLSJac51 = ($PidealCommutingSwitch2_s2SeedLSJac51) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?data->simulationInfo->realParameter[7] /* idealCommutingSwitch2._Ron PARAM */:1.0)) - $PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac51$PdummyVarLSJac51;
+  TRACE_POP
+}
+int PW_PowerSystem_functionJacLSJac51_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac51;
+  PW_PowerSystem_eqFunction_131(data, threadData);
+
+  PW_PowerSystem_eqFunction_132(data, threadData);
+
+  PW_PowerSystem_eqFunction_133(data, threadData);
+
+  PW_PowerSystem_eqFunction_134(data, threadData);
+
+  PW_PowerSystem_eqFunction_135(data, threadData);
+  
+  TRACE_POP
+  return 0;
+}
+
+/*
+ equation index: 94
+ type: SIMPLE_ASSIGN
+ der(motor._lesigma._i._$pDERLSJac50._dummyVarLSJac50) = 0.3125 * motor_airGapDC_veiSeedLSJac50
+ */
+void PW_PowerSystem_eqFunction_94(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,94};
+  $P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac50$PdummyVarLSJac50 = (0.3125) * ($Pmotor_airGapDC_veiSeedLSJac50);
+  TRACE_POP
+}
+
+/*
+ equation index: 95
+ type: SIMPLE_ASSIGN
+ $res._1._$pDERLSJac50._dummyVarLSJac50 = 0.8 * $DER.motor.lesigma.i.$pDERLSJac50.dummyVarLSJac50 + motor_airGapDC_veiSeedLSJac50
+ */
+void PW_PowerSystem_eqFunction_95(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,95};
+  $P$res$P1$P$pDERLSJac50$PdummyVarLSJac50 = (0.8) * ($P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac50$PdummyVarLSJac50) + $Pmotor_airGapDC_veiSeedLSJac50;
+  TRACE_POP
+}
+int PW_PowerSystem_functionJacLSJac50_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac50;
+  PW_PowerSystem_eqFunction_94(data, threadData);
+
+  PW_PowerSystem_eqFunction_95(data, threadData);
+  
+  TRACE_POP
+  return 0;
+}
+
+/*
+ equation index: 72
+ type: SIMPLE_ASSIGN
+ arm_sensor._p._v._$pDERLSJac49._dummyVarLSJac49 = idealCommutingSwitch1_s2SeedLSJac49 * (if greaterThreshold1.y then idealCommutingSwitch1.Ron else 1.0)
+ */
+void PW_PowerSystem_eqFunction_72(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,72};
+  $Parm_sensor$Pp$Pv$P$pDERLSJac49$PdummyVarLSJac49 = ($PidealCommutingSwitch1_s2SeedLSJac49) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?data->simulationInfo->realParameter[4] /* idealCommutingSwitch1._Ron PARAM */:1.0));
+  TRACE_POP
+}
+
+/*
+ equation index: 73
+ type: SIMPLE_ASSIGN
+ $res._2._$pDERLSJac49._dummyVarLSJac49 = arm_sensor.p.v.$pDERLSJac49.dummyVarLSJac49 - idealCommutingSwitch1_s1SeedLSJac49 * (if greaterThreshold1.y then 1.0 else idealCommutingSwitch1.Ron)
+ */
+void PW_PowerSystem_eqFunction_73(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,73};
+  $P$res$P2$P$pDERLSJac49$PdummyVarLSJac49 = $Parm_sensor$Pp$Pv$P$pDERLSJac49$PdummyVarLSJac49 - (($PidealCommutingSwitch1_s1SeedLSJac49) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?1.0:data->simulationInfo->realParameter[4] /* idealCommutingSwitch1._Ron PARAM */)));
+  TRACE_POP
+}
+
+/*
+ equation index: 74
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch1._n2._i._$pDERLSJac49._dummyVarLSJac49 = (-idealCommutingSwitch1_s2SeedLSJac49) * (if greaterThreshold1.y then 1.0 else idealCommutingSwitch1.Goff)
+ */
+void PW_PowerSystem_eqFunction_74(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,74};
+  $PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac49$PdummyVarLSJac49 = ((-$PidealCommutingSwitch1_s2SeedLSJac49)) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?1.0:data->simulationInfo->realParameter[3] /* idealCommutingSwitch1._Goff PARAM */));
+  TRACE_POP
+}
+
+/*
+ equation index: 75
+ type: SIMPLE_ASSIGN
+ $res._1._$pDERLSJac49._dummyVarLSJac49 = idealCommutingSwitch1.n2.i.$pDERLSJac49.dummyVarLSJac49 - idealCommutingSwitch1_s1SeedLSJac49 * (if greaterThreshold1.y then idealCommutingSwitch1.Goff else 1.0)
+ */
+void PW_PowerSystem_eqFunction_75(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,75};
+  $P$res$P1$P$pDERLSJac49$PdummyVarLSJac49 = $PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac49$PdummyVarLSJac49 - (($PidealCommutingSwitch1_s1SeedLSJac49) * ((data->localData[0]->booleanVars[1] /* greaterThreshold1._y DISCRETE */?data->simulationInfo->realParameter[3] /* idealCommutingSwitch1._Goff PARAM */:1.0)));
+  TRACE_POP
+}
+int PW_PowerSystem_functionJacLSJac49_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac49;
+  PW_PowerSystem_eqFunction_72(data, threadData);
+
+  PW_PowerSystem_eqFunction_73(data, threadData);
+
+  PW_PowerSystem_eqFunction_74(data, threadData);
+
+  PW_PowerSystem_eqFunction_75(data, threadData);
+  
+  TRACE_POP
+  return 0;
+}
+
+/*
+ equation index: 42
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._n2._i._$pDERLSJac48._dummyVarLSJac48 = (-idealCommutingSwitch2_s2SeedLSJac48) * (if convertToBoolean.y then 1.0 else idealCommutingSwitch2.Goff)
+ */
+void PW_PowerSystem_eqFunction_42(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,42};
+  $PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac48$PdummyVarLSJac48 = ((-$PidealCommutingSwitch2_s2SeedLSJac48)) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?1.0:data->simulationInfo->realParameter[6] /* idealCommutingSwitch2._Goff PARAM */));
+  TRACE_POP
+}
+
+/*
+ equation index: 43
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._n1._i._$pDERLSJac48._dummyVarLSJac48 = (-idealCommutingSwitch2_s1SeedLSJac48) * (if convertToBoolean.y then idealCommutingSwitch2.Goff else 1.0)
+ */
+void PW_PowerSystem_eqFunction_43(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,43};
+  $PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac48$PdummyVarLSJac48 = ((-$PidealCommutingSwitch2_s1SeedLSJac48)) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?data->simulationInfo->realParameter[6] /* idealCommutingSwitch2._Goff PARAM */:1.0));
+  TRACE_POP
+}
+
+/*
+ equation index: 44
+ type: SIMPLE_ASSIGN
+ idealCommutingSwitch2._p._v._$pDERLSJac48._dummyVarLSJac48 = idealCommutingSwitch2_s1SeedLSJac48 * (if convertToBoolean.y then 1.0 else idealCommutingSwitch2.Ron)
+ */
+void PW_PowerSystem_eqFunction_44(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,44};
+  $PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac48$PdummyVarLSJac48 = ($PidealCommutingSwitch2_s1SeedLSJac48) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?1.0:data->simulationInfo->realParameter[7] /* idealCommutingSwitch2._Ron PARAM */));
+  TRACE_POP
+}
+
+/*
+ equation index: 45
+ type: SIMPLE_ASSIGN
+ $res._1._$pDERLSJac48._dummyVarLSJac48 = idealCommutingSwitch2_s2SeedLSJac48 * (if convertToBoolean.y then idealCommutingSwitch2.Ron else 1.0) - idealCommutingSwitch2.p.v.$pDERLSJac48.dummyVarLSJac48
+ */
+void PW_PowerSystem_eqFunction_45(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,45};
+  $P$res$P1$P$pDERLSJac48$PdummyVarLSJac48 = ($PidealCommutingSwitch2_s2SeedLSJac48) * ((data->localData[0]->booleanVars[0] /* convertToBoolean._y DISCRETE */?data->simulationInfo->realParameter[7] /* idealCommutingSwitch2._Ron PARAM */:1.0)) - $PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac48$PdummyVarLSJac48;
+  TRACE_POP
+}
+
+/*
+ equation index: 46
+ type: SIMPLE_ASSIGN
+ $res._2._$pDERLSJac48._dummyVarLSJac48 = idealCommutingSwitch2.n2.i.$pDERLSJac48.dummyVarLSJac48 + idealCommutingSwitch2.n1.i.$pDERLSJac48.dummyVarLSJac48
+ */
+void PW_PowerSystem_eqFunction_46(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  const int equationIndexes[2] = {1,46};
+  $P$res$P2$P$pDERLSJac48$PdummyVarLSJac48 = $PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac48$PdummyVarLSJac48 + $PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac48$PdummyVarLSJac48;
+  TRACE_POP
+}
+int PW_PowerSystem_functionJacLSJac48_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_LSJac48;
+  PW_PowerSystem_eqFunction_42(data, threadData);
+
+  PW_PowerSystem_eqFunction_43(data, threadData);
+
+  PW_PowerSystem_eqFunction_44(data, threadData);
+
+  PW_PowerSystem_eqFunction_45(data, threadData);
+
+  PW_PowerSystem_eqFunction_46(data, threadData);
+  
+  TRACE_POP
+  return 0;
+}
+int PW_PowerSystem_functionJacD_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_D;
+  
+  TRACE_POP
+  return 0;
+}
+int PW_PowerSystem_functionJacC_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_C;
+  
+  TRACE_POP
+  return 0;
+}
+int PW_PowerSystem_functionJacB_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_B;
+  
+  TRACE_POP
+  return 0;
+}
+int PW_PowerSystem_functionJacA_column(void* inData, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  DATA* data = ((DATA*)inData);
+  int index = PW_PowerSystem_INDEX_JAC_A;
+  
+  TRACE_POP
+  return 0;
+}
+
+

+ 210 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_12jac.h

@@ -0,0 +1,210 @@
+/* Jacobians */
+static const REAL_ATTRIBUTE dummyREAL_ATTRIBUTE = omc_dummyRealAttribute;
+/* Jacobian Variables */
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_LSJac53 5
+  int PW_PowerSystem_functionJacLSJac53_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianLSJac53(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* LSJac53 */
+#define $Pmotor_lesigma_vSeedLSJac53 data->simulationInfo->analyticJacobians[5].seedVars[0]
+#define _$P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac53$PdummyVarLSJac53(i) data->simulationInfo->analyticJacobians[5].tmpVars[0]
+#define $P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac53$PdummyVarLSJac53 _$P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac53$PdummyVarLSJac53(0)
+
+#define _$Pmotor$PairGapDC$Pvei$P$pDERLSJac53$PdummyVarLSJac53(i) data->simulationInfo->analyticJacobians[5].tmpVars[1]
+#define $Pmotor$PairGapDC$Pvei$P$pDERLSJac53$PdummyVarLSJac53 _$Pmotor$PairGapDC$Pvei$P$pDERLSJac53$PdummyVarLSJac53(0)
+
+#define _$P$res$P1$P$pDERLSJac53$PdummyVarLSJac53(i) data->simulationInfo->analyticJacobians[5].resultVars[0]
+#define $P$res$P1$P$pDERLSJac53$PdummyVarLSJac53 _$P$res$P1$P$pDERLSJac53$PdummyVarLSJac53(0)
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_LSJac52 4
+  int PW_PowerSystem_functionJacLSJac52_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianLSJac52(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* LSJac52 */
+#define $PidealCommutingSwitch1_s2SeedLSJac52 data->simulationInfo->analyticJacobians[4].seedVars[0]
+#define $PidealCommutingSwitch1_s1SeedLSJac52 data->simulationInfo->analyticJacobians[4].seedVars[1]
+#define _$PidealCommutingSwitch1$Pn1$Pi$P$pDERLSJac52$PdummyVarLSJac52(i) data->simulationInfo->analyticJacobians[4].tmpVars[0]
+#define $PidealCommutingSwitch1$Pn1$Pi$P$pDERLSJac52$PdummyVarLSJac52 _$PidealCommutingSwitch1$Pn1$Pi$P$pDERLSJac52$PdummyVarLSJac52(0)
+
+#define _$Parm_sensor$Pp$Pv$P$pDERLSJac52$PdummyVarLSJac52(i) data->simulationInfo->analyticJacobians[4].tmpVars[1]
+#define $Parm_sensor$Pp$Pv$P$pDERLSJac52$PdummyVarLSJac52 _$Parm_sensor$Pp$Pv$P$pDERLSJac52$PdummyVarLSJac52(0)
+
+#define _$PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac52$PdummyVarLSJac52(i) data->simulationInfo->analyticJacobians[4].tmpVars[2]
+#define $PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac52$PdummyVarLSJac52 _$PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac52$PdummyVarLSJac52(0)
+
+#define _$P$res$P2$P$pDERLSJac52$PdummyVarLSJac52(i) data->simulationInfo->analyticJacobians[4].resultVars[1]
+#define $P$res$P2$P$pDERLSJac52$PdummyVarLSJac52 _$P$res$P2$P$pDERLSJac52$PdummyVarLSJac52(0)
+
+#define _$P$res$P1$P$pDERLSJac52$PdummyVarLSJac52(i) data->simulationInfo->analyticJacobians[4].resultVars[0]
+#define $P$res$P1$P$pDERLSJac52$PdummyVarLSJac52 _$P$res$P1$P$pDERLSJac52$PdummyVarLSJac52(0)
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_LSJac51 3
+  int PW_PowerSystem_functionJacLSJac51_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianLSJac51(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* LSJac51 */
+#define $PidealCommutingSwitch2_s1SeedLSJac51 data->simulationInfo->analyticJacobians[3].seedVars[0]
+#define $PidealCommutingSwitch2_s2SeedLSJac51 data->simulationInfo->analyticJacobians[3].seedVars[1]
+#define _$PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac51$PdummyVarLSJac51(i) data->simulationInfo->analyticJacobians[3].tmpVars[0]
+#define $PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac51$PdummyVarLSJac51 _$PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac51$PdummyVarLSJac51(0)
+
+#define _$PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac51$PdummyVarLSJac51(i) data->simulationInfo->analyticJacobians[3].tmpVars[1]
+#define $PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac51$PdummyVarLSJac51 _$PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac51$PdummyVarLSJac51(0)
+
+#define _$PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac51$PdummyVarLSJac51(i) data->simulationInfo->analyticJacobians[3].tmpVars[2]
+#define $PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac51$PdummyVarLSJac51 _$PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac51$PdummyVarLSJac51(0)
+
+#define _$P$res$P2$P$pDERLSJac51$PdummyVarLSJac51(i) data->simulationInfo->analyticJacobians[3].resultVars[1]
+#define $P$res$P2$P$pDERLSJac51$PdummyVarLSJac51 _$P$res$P2$P$pDERLSJac51$PdummyVarLSJac51(0)
+
+#define _$P$res$P1$P$pDERLSJac51$PdummyVarLSJac51(i) data->simulationInfo->analyticJacobians[3].resultVars[0]
+#define $P$res$P1$P$pDERLSJac51$PdummyVarLSJac51 _$P$res$P1$P$pDERLSJac51$PdummyVarLSJac51(0)
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_LSJac50 2
+  int PW_PowerSystem_functionJacLSJac50_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianLSJac50(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* LSJac50 */
+#define $Pmotor_airGapDC_veiSeedLSJac50 data->simulationInfo->analyticJacobians[2].seedVars[0]
+#define _$P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac50$PdummyVarLSJac50(i) data->simulationInfo->analyticJacobians[2].tmpVars[0]
+#define $P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac50$PdummyVarLSJac50 _$P$DER$Pmotor$Plesigma$Pi$P$pDERLSJac50$PdummyVarLSJac50(0)
+
+#define _$Pmotor$Plesigma$Pv$P$pDERLSJac50$PdummyVarLSJac50(i) data->simulationInfo->analyticJacobians[2].tmpVars[1]
+#define $Pmotor$Plesigma$Pv$P$pDERLSJac50$PdummyVarLSJac50 _$Pmotor$Plesigma$Pv$P$pDERLSJac50$PdummyVarLSJac50(0)
+
+#define _$P$res$P1$P$pDERLSJac50$PdummyVarLSJac50(i) data->simulationInfo->analyticJacobians[2].resultVars[0]
+#define $P$res$P1$P$pDERLSJac50$PdummyVarLSJac50 _$P$res$P1$P$pDERLSJac50$PdummyVarLSJac50(0)
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_LSJac49 1
+  int PW_PowerSystem_functionJacLSJac49_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianLSJac49(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* LSJac49 */
+#define $PidealCommutingSwitch1_s2SeedLSJac49 data->simulationInfo->analyticJacobians[1].seedVars[0]
+#define $PidealCommutingSwitch1_s1SeedLSJac49 data->simulationInfo->analyticJacobians[1].seedVars[1]
+#define _$PidealCommutingSwitch1$Pn1$Pi$P$pDERLSJac49$PdummyVarLSJac49(i) data->simulationInfo->analyticJacobians[1].tmpVars[0]
+#define $PidealCommutingSwitch1$Pn1$Pi$P$pDERLSJac49$PdummyVarLSJac49 _$PidealCommutingSwitch1$Pn1$Pi$P$pDERLSJac49$PdummyVarLSJac49(0)
+
+#define _$Parm_sensor$Pp$Pv$P$pDERLSJac49$PdummyVarLSJac49(i) data->simulationInfo->analyticJacobians[1].tmpVars[1]
+#define $Parm_sensor$Pp$Pv$P$pDERLSJac49$PdummyVarLSJac49 _$Parm_sensor$Pp$Pv$P$pDERLSJac49$PdummyVarLSJac49(0)
+
+#define _$PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac49$PdummyVarLSJac49(i) data->simulationInfo->analyticJacobians[1].tmpVars[2]
+#define $PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac49$PdummyVarLSJac49 _$PidealCommutingSwitch1$Pn2$Pi$P$pDERLSJac49$PdummyVarLSJac49(0)
+
+#define _$P$res$P2$P$pDERLSJac49$PdummyVarLSJac49(i) data->simulationInfo->analyticJacobians[1].resultVars[1]
+#define $P$res$P2$P$pDERLSJac49$PdummyVarLSJac49 _$P$res$P2$P$pDERLSJac49$PdummyVarLSJac49(0)
+
+#define _$P$res$P1$P$pDERLSJac49$PdummyVarLSJac49(i) data->simulationInfo->analyticJacobians[1].resultVars[0]
+#define $P$res$P1$P$pDERLSJac49$PdummyVarLSJac49 _$P$res$P1$P$pDERLSJac49$PdummyVarLSJac49(0)
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_LSJac48 0
+  int PW_PowerSystem_functionJacLSJac48_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianLSJac48(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* LSJac48 */
+#define $PidealCommutingSwitch2_s1SeedLSJac48 data->simulationInfo->analyticJacobians[0].seedVars[0]
+#define $PidealCommutingSwitch2_s2SeedLSJac48 data->simulationInfo->analyticJacobians[0].seedVars[1]
+#define _$PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac48$PdummyVarLSJac48(i) data->simulationInfo->analyticJacobians[0].tmpVars[0]
+#define $PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac48$PdummyVarLSJac48 _$PidealCommutingSwitch2$Pp$Pv$P$pDERLSJac48$PdummyVarLSJac48(0)
+
+#define _$PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac48$PdummyVarLSJac48(i) data->simulationInfo->analyticJacobians[0].tmpVars[1]
+#define $PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac48$PdummyVarLSJac48 _$PidealCommutingSwitch2$Pn1$Pi$P$pDERLSJac48$PdummyVarLSJac48(0)
+
+#define _$PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac48$PdummyVarLSJac48(i) data->simulationInfo->analyticJacobians[0].tmpVars[2]
+#define $PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac48$PdummyVarLSJac48 _$PidealCommutingSwitch2$Pn2$Pi$P$pDERLSJac48$PdummyVarLSJac48(0)
+
+#define _$P$res$P2$P$pDERLSJac48$PdummyVarLSJac48(i) data->simulationInfo->analyticJacobians[0].resultVars[1]
+#define $P$res$P2$P$pDERLSJac48$PdummyVarLSJac48 _$P$res$P2$P$pDERLSJac48$PdummyVarLSJac48(0)
+
+#define _$P$res$P1$P$pDERLSJac48$PdummyVarLSJac48(i) data->simulationInfo->analyticJacobians[0].resultVars[0]
+#define $P$res$P1$P$pDERLSJac48$PdummyVarLSJac48 _$P$res$P1$P$pDERLSJac48$PdummyVarLSJac48(0)
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_D 9
+  int PW_PowerSystem_functionJacD_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianD(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* D */
+#define $Pdown_inputSeedD data->simulationInfo->analyticJacobians[9].seedVars[0]
+#define $Pinput_torqueSeedD data->simulationInfo->analyticJacobians[9].seedVars[1]
+#define $Pup_inputSeedD data->simulationInfo->analyticJacobians[9].seedVars[2]
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_C 8
+  int PW_PowerSystem_functionJacC_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianC(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* C */
+#define $Pmotor_airGapDC_psi_eSeedC data->simulationInfo->analyticJacobians[8].seedVars[0]
+#define $Pmotor_inertiaRotor_wSeedC data->simulationInfo->analyticJacobians[8].seedVars[1]
+#define $Pmotor_la_iSeedC data->simulationInfo->analyticJacobians[8].seedVars[2]
+#define $Pmotor_phiMechanicalSeedC data->simulationInfo->analyticJacobians[8].seedVars[3]
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_B 7
+  int PW_PowerSystem_functionJacB_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianB(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* B */
+#define $Pdown_inputSeedB data->simulationInfo->analyticJacobians[7].seedVars[0]
+#define $Pinput_torqueSeedB data->simulationInfo->analyticJacobians[7].seedVars[1]
+#define $Pup_inputSeedB data->simulationInfo->analyticJacobians[7].seedVars[2]
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  #define PW_PowerSystem_INDEX_JAC_A 6
+  int PW_PowerSystem_functionJacA_column(void* data, threadData_t *threadData);
+  int PW_PowerSystem_initialAnalyticJacobianA(void* data, threadData_t *threadData);
+#if defined(__cplusplus)
+}
+#endif
+/* A */
+#define $Pmotor_airGapDC_psi_eSeedA data->simulationInfo->analyticJacobians[6].seedVars[0]
+#define $Pmotor_inertiaRotor_wSeedA data->simulationInfo->analyticJacobians[6].seedVars[1]
+#define $Pmotor_la_iSeedA data->simulationInfo->analyticJacobians[6].seedVars[2]
+#define $Pmotor_phiMechanicalSeedA data->simulationInfo->analyticJacobians[6].seedVars[3]
+
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_12jac.o


+ 14 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_13opt.c

@@ -0,0 +1,14 @@
+/* Optimization */
+#include "PW_PowerSystem_model.h"
+#include "PW_PowerSystem_12jac.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+int PW_PowerSystem_mayer(DATA* data, modelica_real** res,short *i){return -1;}
+int PW_PowerSystem_lagrange(DATA* data, modelica_real** res, short * i1, short*i2){return -1;}
+int PW_PowerSystem_pickUpBoundsForInputsInOptimization(DATA* data, modelica_real* min, modelica_real* max, modelica_real*nominal, modelica_boolean *useNominal, char ** name, modelica_real * start, modelica_real * startTimeOpt){return -1;}
+int PW_PowerSystem_setInputData(DATA *data, const modelica_boolean file){return -1;}
+int PW_PowerSystem_getTimeGrid(DATA *data, modelica_integer * nsi, modelica_real**t){return -1;}
+#if defined(__cplusplus)
+}
+#endif

+ 11 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_13opt.h

@@ -0,0 +1,11 @@
+#if defined(__cplusplus)
+  extern "C" {
+#endif
+  int PW_PowerSystem_mayer(DATA* data, modelica_real** res, short*);
+  int PW_PowerSystem_lagrange(DATA* data, modelica_real** res, short *, short *);
+  int PW_PowerSystem_pickUpBoundsForInputsInOptimization(DATA* data, modelica_real* min, modelica_real* max, modelica_real*nominal, modelica_boolean *useNominal, char ** name, modelica_real * start, modelica_real * startTimeOpt);
+  int PW_PowerSystem_setInputData(DATA *data, const modelica_boolean file);
+  int PW_PowerSystem_getTimeGrid(DATA *data, modelica_integer * nsi, modelica_real**t);
+#if defined(__cplusplus)
+}
+#endif

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_13opt.o


File diff suppressed because it is too large
+ 44 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_14lnz.c


BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_14lnz.o


+ 59 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_15syn.c

@@ -0,0 +1,59 @@
+/* Synchronous systems */
+#include "PW_PowerSystem_model.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Initializes the clocks of model. */
+void PW_PowerSystem_function_initSynchronous(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+  long i=0, j=0;
+  TRACE_POP
+}
+
+/* Update the base clock. */
+void PW_PowerSystem_function_updateSynchronous(DATA *data, threadData_t *threadData, long i)
+{
+  TRACE_PUSH
+  modelica_boolean ret;
+  switch (i) {
+    default:
+      throwStreamPrint(NULL, "Internal Error: unknown base partition %ld", i);
+      break;
+  }
+  TRACE_POP
+}
+
+
+
+/*Clocked systems equations */
+int PW_PowerSystem_function_equationsSynchronous(DATA *data, threadData_t *threadData, long i)
+{
+  TRACE_PUSH
+  int ret;
+
+  switch (i) {
+    default:
+      throwStreamPrint(NULL, "Internal Error: unknown sub partition %ld", i);
+      ret = 1;
+      break;
+  }
+
+  TRACE_POP
+  return ret;
+}
+
+/* pre(%v%) = %v% */
+void PW_PowerSystem_function_savePreSynchronous(DATA *data, threadData_t *threadData)
+{
+  TRACE_PUSH
+
+  
+  TRACE_POP
+}
+
+#if defined(__cplusplus)
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_15syn.o


+ 9 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_16dae.c

@@ -0,0 +1,9 @@
+/* DAE residuals is empty */
+ #include "PW_PowerSystem_model.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+int PW_PowerSystem_initializeDAEmodeData(DATA *inData, DAEMODE_DATA* daeModeData){ return -1; }
+#ifdef __cplusplus
+}
+#endif

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_16dae.o


File diff suppressed because it is too large
+ 1792 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_FMU.c


+ 0 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_FMU.libs


BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_FMU.o


File diff suppressed because it is too large
+ 248 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_functions.c


File diff suppressed because it is too large
+ 195 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_functions.h


BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_functions.o


+ 0 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_includes.h


File diff suppressed because it is too large
+ 1 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_info.c


File diff suppressed because it is too large
+ 3822 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_init_fmu.c


BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_init_fmu.o


+ 26 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_literals.h

@@ -0,0 +1,26 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define _OMC_LIT0_data "'p"
+static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,2,_OMC_LIT0_data);
+#define _OMC_LIT0 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)
+#define _OMC_LIT1_data "'p/s"
+static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,4,_OMC_LIT1_data);
+#define _OMC_LIT1 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)
+#define _OMC_LIT2_data "ElectricCurrent"
+static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,15,_OMC_LIT2_data);
+#define _OMC_LIT2 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT2)
+#define _OMC_LIT3_data "A"
+static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT3,1,_OMC_LIT3_data);
+#define _OMC_LIT3 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT3)
+#define _OMC_LIT4_data "ElectricPotential"
+static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT4,17,_OMC_LIT4_data);
+#define _OMC_LIT4 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT4)
+#define _OMC_LIT5_data "V"
+static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT5,1,_OMC_LIT5_data);
+#define _OMC_LIT5 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT5)
+
+#ifdef __cplusplus
+}
+#endif

+ 102 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_model.h

@@ -0,0 +1,102 @@
+/* Simulation code for PW_PowerSystem generated by the OpenModelica Compiler v1.12.0-dev-77-g56dc448 (32-bit). */
+#if !defined(PW_PowerSystem__MODEL_H)
+#define PW_PowerSystem__MODEL_H
+#include "openmodelica.h"
+#include "openmodelica_func.h"
+#include "simulation_data.h"
+#include "simulation/simulation_info_json.h"
+#include "simulation/simulation_runtime.h"
+#include "util/omc_error.h"
+#include "simulation/solver/model_help.h"
+#include "simulation/solver/delay.h"
+#include "simulation/solver/linearSystem.h"
+#include "simulation/solver/nonlinearSystem.h"
+#include "simulation/solver/mixedSystem.h"
+
+#include <string.h>
+
+#include "PW_PowerSystem_functions.h"
+
+#define Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE_index 0
+#define Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance_index 1
+#define Modelica_Electrical_Machines_Losses_BrushParameters_index 2
+#define Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters_index 3
+#define Modelica_Electrical_Machines_Losses_CoreParameters_index 4
+#define Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters_index 5
+#define Modelica_Electrical_Machines_Losses_FrictionParameters_index 6
+#define Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters_index 7
+#define Modelica_Electrical_Machines_Losses_StrayLoadParameters_index 8
+#define Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters_index 9
+#define Modelica_Electrical_Machines_Losses_DCMachines_brushVoltageDrop_index 10
+
+extern void PW_PowerSystem_callExternalObjectConstructors(DATA *data, threadData_t *threadData);
+extern void PW_PowerSystem_callExternalObjectDestructors(DATA *_data, threadData_t *threadData);
+#if !defined(OMC_NUM_NONLINEAR_SYSTEMS) || OMC_NUM_NONLINEAR_SYSTEMS>0
+#endif
+#if !defined(OMC_NUM_LINEAR_SYSTEMS) || OMC_NUM_LINEAR_SYSTEMS>0
+extern void PW_PowerSystem_initialLinearSystem(int nLinearSystems, LINEAR_SYSTEM_DATA *data);
+#endif
+#if !defined(OMC_NUM_MIXED_SYSTEMS) || OMC_NUM_MIXED_SYSTEMS>0
+#endif
+#if !defined(OMC_NO_STATESELECTION)
+extern void PW_PowerSystem_initializeStateSets(int nStateSets, STATE_SET_DATA* statesetData, DATA *data);
+#endif
+extern int PW_PowerSystem_functionAlgebraics(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_function_storeDelayed(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_updateBoundVariableAttributes(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_functionInitialEquations(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_functionInitialEquations_lambda0(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_functionRemovedInitialEquations(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_updateBoundParameters(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_checkForAsserts(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_function_ZeroCrossingsEquations(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_function_ZeroCrossings(DATA *data, threadData_t *threadData, double* gout);
+extern int PW_PowerSystem_function_updateRelations(DATA *data, threadData_t *threadData, int evalZeroCross);
+extern int PW_PowerSystem_checkForDiscreteChanges(DATA *data, threadData_t *threadData);
+extern const char* PW_PowerSystem_zeroCrossingDescription(int i, int **out_EquationIndexes);
+extern const char* PW_PowerSystem_relationDescription(int i);
+extern void PW_PowerSystem_function_initSample(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_initialAnalyticJacobianG(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_initialAnalyticJacobianA(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_initialAnalyticJacobianB(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_initialAnalyticJacobianC(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_initialAnalyticJacobianD(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_functionJacG_column(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_functionJacA_column(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_functionJacB_column(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_functionJacC_column(void* data, threadData_t *threadData);
+extern int PW_PowerSystem_functionJacD_column(void* data, threadData_t *threadData);
+extern const char* PW_PowerSystem_linear_model_frame(void);
+extern const char* PW_PowerSystem_linear_model_datarecovery_frame(void);
+extern int PW_PowerSystem_mayer(DATA* data, modelica_real** res, short *);
+extern int PW_PowerSystem_lagrange(DATA* data, modelica_real** res, short *, short *);
+extern int PW_PowerSystem_pickUpBoundsForInputsInOptimization(DATA* data, modelica_real* min, modelica_real* max, modelica_real*nominal, modelica_boolean *useNominal, char ** name, modelica_real * start, modelica_real * startTimeOpt);
+extern int PW_PowerSystem_setInputData(DATA *data, const modelica_boolean file);
+extern int PW_PowerSystem_getTimeGrid(DATA *data, modelica_integer * nsi, modelica_real**t);
+extern void PW_PowerSystem_function_initSynchronous(DATA * data, threadData_t *threadData);
+extern void PW_PowerSystem_function_updateSynchronous(DATA * data, threadData_t *threadData, long i);
+extern int PW_PowerSystem_function_equationsSynchronous(DATA * data, threadData_t *threadData, long i);
+extern void PW_PowerSystem_read_input_fmu(MODEL_DATA* modelData, SIMULATION_INFO* simulationData);
+extern void PW_PowerSystem_function_savePreSynchronous(DATA *data, threadData_t *threadData);
+extern int PW_PowerSystem_inputNames(DATA* data, char ** names);
+extern int PW_PowerSystem_initializeDAEmodeData(DATA *data, DAEMODE_DATA*);
+extern int PW_PowerSystem_functionLocalKnownVars(DATA*, threadData_t*);
+
+#include "PW_PowerSystem_literals.h"
+
+
+
+
+#if defined(HPCOM) && !defined(_OPENMP)
+  #error "HPCOM requires OpenMP or the results are wrong"
+#endif
+#if defined(_OPENMP)
+  #include <omp.h>
+#else
+  /* dummy omp defines */
+  #define omp_get_max_threads() 1
+#endif
+
+#endif
+
+

+ 92 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_records.c

@@ -0,0 +1,92 @@
+/* Additional record code for PW_PowerSystem generated by the OpenModelica Compiler v1.12.0-dev-77-g56dc448 (32-bit). */
+
+#include "meta/meta_modelica.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE__desc_added 1
+const char* Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE__desc__fields[12] = {"lossPowerArmature","lossPowerBrush","lossPowerCore","lossPowerExcitation","lossPowerFriction","lossPowerStrayLoad","lossPowerTotal","powerArmature","powerExcitation","powerInertiaRotor","powerInertiaStator","powerMechanical"};
+struct record_description Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE__desc = {
+  "Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE", /* package_record__X */
+  "Modelica.Electrical.Machines.Interfaces.DCMachines.PowerBalanceDCEE", /* package.record_X */
+  Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Losses_BrushParameters__desc_added 1
+const char* Modelica_Electrical_Machines_Losses_BrushParameters__desc__fields[2] = {"ILinear","V"};
+struct record_description Modelica_Electrical_Machines_Losses_BrushParameters__desc = {
+  "Modelica_Electrical_Machines_Losses_BrushParameters", /* package_record__X */
+  "Modelica.Electrical.Machines.Losses.BrushParameters", /* package.record_X */
+  Modelica_Electrical_Machines_Losses_BrushParameters__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Losses_CoreParameters__desc_added 1
+const char* Modelica_Electrical_Machines_Losses_CoreParameters__desc__fields[7] = {"GcRef","PRef","VRef","m","ratioHysteresis","wMin","wRef"};
+struct record_description Modelica_Electrical_Machines_Losses_CoreParameters__desc = {
+  "Modelica_Electrical_Machines_Losses_CoreParameters", /* package_record__X */
+  "Modelica.Electrical.Machines.Losses.CoreParameters", /* package.record_X */
+  Modelica_Electrical_Machines_Losses_CoreParameters__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Losses_FrictionParameters__desc_added 1
+const char* Modelica_Electrical_Machines_Losses_FrictionParameters__desc__fields[7] = {"PRef","linear","power_w","tauLinear","tauRef","wLinear","wRef"};
+struct record_description Modelica_Electrical_Machines_Losses_FrictionParameters__desc = {
+  "Modelica_Electrical_Machines_Losses_FrictionParameters", /* package_record__X */
+  "Modelica.Electrical.Machines.Losses.FrictionParameters", /* package.record_X */
+  Modelica_Electrical_Machines_Losses_FrictionParameters__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Losses_StrayLoadParameters__desc_added 1
+const char* Modelica_Electrical_Machines_Losses_StrayLoadParameters__desc__fields[5] = {"IRef","PRef","power_w","tauRef","wRef"};
+struct record_description Modelica_Electrical_Machines_Losses_StrayLoadParameters__desc = {
+  "Modelica_Electrical_Machines_Losses_StrayLoadParameters", /* package_record__X */
+  "Modelica.Electrical.Machines.Losses.StrayLoadParameters", /* package.record_X */
+  Modelica_Electrical_Machines_Losses_StrayLoadParameters__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance__desc_added 1
+const char* Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance__desc__fields[12] = {"lossPowerArmature","lossPowerBrush","lossPowerCore","lossPowerExcitation","lossPowerFriction","lossPowerStrayLoad","lossPowerTotal","powerArmature","powerExcitation","powerInertiaRotor","powerInertiaStator","powerMechanical"};
+struct record_description Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance__desc = {
+  "Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance", /* package_record__X */
+  "Modelica.Electrical.Machines.Interfaces.DCMachines.PowerBalanceDCEE$motor$powerBalance", /* package.record_X */
+  Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters__desc_added 1
+const char* Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters__desc__fields[2] = {"ILinear","V"};
+struct record_description Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters__desc = {
+  "Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters", /* package_record__X */
+  "Modelica.Electrical.Machines.Losses.BrushParameters$motor$brushParameters", /* package.record_X */
+  Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters__desc_added 1
+const char* Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters__desc__fields[7] = {"GcRef","PRef","VRef","m","ratioHysteresis","wMin","wRef"};
+struct record_description Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters__desc = {
+  "Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters", /* package_record__X */
+  "Modelica.Electrical.Machines.Losses.CoreParameters$motor$coreParameters", /* package.record_X */
+  Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters__desc_added 1
+const char* Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters__desc__fields[7] = {"PRef","linear","power_w","tauLinear","tauRef","wLinear","wRef"};
+struct record_description Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters__desc = {
+  "Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters", /* package_record__X */
+  "Modelica.Electrical.Machines.Losses.FrictionParameters$motor_frictionParameters", /* package.record_X */
+  Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters__desc__fields
+};
+
+#define Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters__desc_added 1
+const char* Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters__desc__fields[5] = {"IRef","PRef","power_w","tauRef","wRef"};
+struct record_description Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters__desc = {
+  "Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters", /* package_record__X */
+  "Modelica.Electrical.Machines.Losses.StrayLoadParameters$motor$strayLoadParameters", /* package.record_X */
+  Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters__desc__fields
+};
+
+#ifdef __cplusplus
+}
+#endif
+

BIN
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/PW_PowerSystem_records.o


+ 242 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/configure.ac

@@ -0,0 +1,242 @@
+ Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.63])
+AC_INIT([OpenModelica Exported FMU],[dev],[https://trac.openmodelica.org/OpenModelica],[openmodelica],[https://openmodelica.org])
+
+AC_SUBST(AR)
+AC_SUBST(DLLEXT)
+AC_SUBST(FMIPLATFORM)
+AC_SUBST(NEED_DGESV)
+AC_SUBST(NEED_RUNTIME)
+AC_SUBST(LIBTYPE_STATIC)
+AC_SUBST(LIBTYPE_DYNAMIC)
+
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+build_short=$build_cpu-$build_os
+if test "$host_os" = "none"; then
+  host_short=$host_cpu
+else
+  host_short=$host_cpu-$host_os
+fi
+
+echo "build_short: $build_short"
+echo "host_short: $host_short"
+
+ORIGCC="$CC"
+
+dnl Checks for programs.
+AC_LANG([C])
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_MAKE_SET
+
+AC_MSG_CHECKING([for cross-compilation flags])
+if test "$host_short" = "$build_short"; then
+  # Not cross-compiling or found a good tool; don't need special flags
+  AC_MSG_RESULT([not cross-compiling])
+elif echo "$CC" | grep -q "$host_short" || echo "$CC" | grep -q "$host" || echo "$CC" | grep -q "$host_cpu"; then
+  AC_MSG_RESULT([not needed; $CC contains the prefix])
+elif test "$host_os" = "$build_os" && test "$host_short" = "x86_64"; then
+  CFLAGS_BEFORE="$CFLAGS"
+  CFLAGS="$CFLAGS -m64"
+  AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([-m64])], [AC_MSG_ERROR([-m64 not working])])
+elif test "$host_os" = "$build_os" && echo "$host_short" | grep -q "i.86"; then
+  CFLAGS_BEFORE="$CFLAGS"
+  CFLAGS="$CFLAGS -m32"
+  LDFLAGS="$LDFLAGS -m32"
+  AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([-m32])], [AC_MSG_ERROR([-m32 not working])])
+elif test ! -z "$ORIGCC"; then
+  AC_MSG_RESULT([user sent an explicit CC=$ORIGCC. Trusting the user.])
+else
+  CC="$host-cc"
+  if which $host-cc > /dev/null 2>&1; then
+    CC="$host-cc"
+  else
+    CC=clang
+    CFLAGS="$CFLAGS -target $host"
+  fi
+  AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([$CC $CFLAGS])], [AC_MSG_ERROR([unknown platform and $CC $CFLAGS not working])])
+fi
+
+if false; then
+CC_BEFORE="$CC"
+CC="clang -target $host_short"
+AC_MSG_CHECKING([looking for $CC to replace $CC_BEFORE])
+AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([yes])], [CC="$CC_BEFORE";AC_MSG_RESULT([no])])
+fi
+
+CFLAGS_BEFORE="$CFLAGS"
+CFLAGS="$CFLAGS -Werror"
+AC_MSG_CHECKING([if -Werror works])
+AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([ok])], [AC_MSG_ERROR([failed (check your CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS CPPFLAGS=$CPPFLAGS)])])
+CFLAGS="$CFLAGS_BEFORE"
+
+LDFLAGS_BEFORE="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,--no-undefined -Werror"
+AC_MSG_CHECKING([looking for --no-undefined])
+AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([yes]);LD_NOUNDEFINED=" -Wl,--no-undefined"], [AC_MSG_RESULT([no])])
+LDFLAGS="$LDFLAGS_BEFORE"
+
+dnl Enable to handle AVR pre-processor not handling $ as symbol names; but fails on assembler anyway
+
+AC_MSG_CHECKING([looking for dollars in identifiers])
+AC_TRY_LINK([
+void $a$b$c() {}
+#define $a$b$c$d $a$b$c
+], [$a$b$c$d();], [AC_MSG_RESULT([not needed])], [
+  CPPFLAGS="$CPPFLAGS -fdollars-in-identifiers"
+  AC_TRY_LINK([
+    void fx() {}
+    #define \$a\$b fx
+    ], [\$a\$b();], [AC_MSG_RESULT([CPPFLAGS: -fdollars-in-identifiers])], [
+    AC_MSG_ERROR([the compiler does not handle dollar in identifiers])
+  ])
+])
+
+dnl Disables the default CFLAGS="-g -O2"
+
+AC_ARG_ENABLE(static, [  --enable-static], [
+  if test "$enableval" = "yes"; then
+    LIBTYPE_STATIC=1
+  elif test "$enableval" = "no"; then
+    LIBTYPE_STATIC=0
+  else
+    AC_MSG_ERROR([Unknown value --enable-static=$withval (use yes or no, or no value)])
+  fi
+], [LIBTYPE_STATIC=0])
+
+AC_ARG_ENABLE(shared, [  --disable-shared], [
+  if test "$enableval" = "yes"; then
+    LIBTYPE_DYNAMIC=1
+  elif test "$enableval" = "no"; then
+    LIBTYPE_DYNAMIC=0
+  else
+    AC_MSG_ERROR([Unknown value --enable-dynamic=$withval (use yes or no, or no value)])
+  fi
+], [LIBTYPE_DYNAMIC=1])
+
+if test "$LIBTYPE_DYNAMIC" = 0 -a "$LIBTYPE_STATIC" = 0; then
+  AC_MSG_ERROR([Need to --enable-shared or --enable-static (both were disabled)])
+fi
+
+if test "$LIBTYPE_DYNAMIC" = 1; then
+  LDFLAGS="$LDFLAGS -shared"
+fi
+
+if test "$LIBTYPE_STATIC" = 1; then
+  AC_CHECK_TOOL([AR], [ar], [:])
+  if test "$AR" = ":"; then
+    AC_MSG_ERROR([Did not find a suitable ar])
+  fi
+fi
+
+
+TRY_FLAGS="-fno-stack-protector -Wno-parentheses-equality -Wno-unused-variable -fPIC"
+
+for flag in $TRY_FLAGS; do
+  OLD_CFLAGS="$CFLAGS"
+  CFLAGS="$RUNTIMECFLAGS $flag -Werror"
+  AC_TRY_LINK([], [return 0;], [CFLAGS="$OLD_CFLAGS $flag"],[CFLAGS="$OLD_CFLAGS"])
+done
+
+TRY_FLAGS="-static-libgcc"
+for flag in $TRY_FLAGS; do
+  OLD_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $flag"
+  AC_TRY_LINK([], [return 0;], [LDFLAGS="$OLD_LDFLAGS $flag"],[LDFLAGS="$OLD_LDFLAGS"])
+done
+
+if test "`getconf LONG_BIT`" = "32"; then
+dnl Simulations spin forever unless -msse2 -mfpmath=sse is set
+
+CFLAGS_BEFORE=$CFLAGS
+CFLAGS="-mfpmath=sse -Werror"
+AC_MSG_CHECKING([for floating point bugs])
+AC_TRY_LINK([int abc() {}], [abc();], [AC_MSG_RESULT([force SSE2]); FPMATHFORTRAN="-msse -mfpmath=sse"], [AC_MSG_RESULT([no]); FPMATHFORTRAN=-ffloat-store])
+CFLAGS=$CFLAGS_BEFORE
+
+fi # End x86-specific CFLAGS
+
+dnl Checks for libraries.
+
+dnl Checks for header files.
+AC_HEADER_STDC
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+
+dnl Checks for library functions.
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(strdup strerror)
+
+m4_include([../../../../m4/lapack.m4])
+OMC_AC_LAPACK(static)
+if test -z "$LD_LAPACK"; then
+  NEED_DGESV=1
+else
+  LIBS="$LIBS $LD_LAPACK"
+fi
+
+AC_MSG_CHECKING([for static pthreads])
+OLDLIBS=$LIBS
+LIBS="$OLDLIBS -Wl,-Bstatic -lpthread -Wl,-Bdynamic"
+AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_mutex_lock])],[AC_MSG_RESULT([OK (static)])],[
+  AC_MSG_RESULT([no])
+  LIBS="$OLDLIBS"
+  AC_CHECK_LIB(pthread,[pthread_mutex_lock],[],[
+    if test "$LIBTYPE_DYNAMIC" = 1; then
+      AC_MSG_ERROR([pthreads not found and requested dynamic linking])
+    else
+      AC_MSG_RESULT([pthreads disabled])
+      CPPFLAGS="$CPPFLAGS -DOMC_NO_THREADS"
+    fi
+  ])
+])
+
+AC_CHECK_LIB([m],[cos],[],[AC_MSG_ERROR([math library not found])])
+
+AC_MSG_CHECKING([for filesystem access])
+AC_TRY_LINK([#include <stdio.h>], [fopen("a.txt", "r");], [AC_MSG_RESULT([OK])], [AC_MSG_RESULT([no]); CPPFLAGS="$CPPFLAGS -DOMC_NO_FILESYSTEM"])
+
+AC_ARG_WITH(dynamic-om-runtime,  [  --with-dynamic-om-runtime    (uses the OMC runtime as a shared object instead of compiling it statically into the the FMU.)],[OPENMODELICADYNAMIC=yes],[OPENMODELICADYNAMIC=no])
+
+if test "$OPENMODELICADYNAMIC" = "no"; then
+  CPPFLAGS="$CPPFLAGS -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1"
+  NEED_RUNTIME=1
+fi
+
+if echo "$host_os" | grep -q darwin; then
+  DLLEXT=".dylib"
+  if echo "$host_cpu" | grep -q i@<:@3456@:>@86; then
+    FMIPLATFORM=darwin32
+  elif echo "$host_cpu" | grep -q x86_64; then
+    FMIPLATFORM=darwin64
+  fi
+elif echo "$host_os" | grep -q mingw; then
+  DLLEXT=".dll"
+  if echo "$host_cpu" | grep -q i@<:@3456@:>@86; then
+    FMIPLATFORM=win32
+  elif echo "$host_cpu" | grep -q x86_64; then
+    FMIPLATFORM=win64
+  fi
+elif echo "$host_os" | grep -q linux; then
+  DLLEXT=".so"
+  if echo "$host_cpu" | grep -q i@<:@3456@:>@86; then
+    FMIPLATFORM=linux32
+  elif echo "$host_cpu" | grep -q x86_64; then
+    FMIPLATFORM=linux64
+  fi
+else
+  DLLEXT=".so"
+fi
+
+# Non-standard platforms also need some love
+if test -z "$FMIPLATFORM"; then
+  FMIPLATFORM=$host_short
+fi
+
+AC_OUTPUT(Makefile)

File diff suppressed because it is too large
+ 183 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/Makefile.objs


+ 113 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ModelicaUtilities.h

@@ -0,0 +1,113 @@
+#ifndef MODELICA_UTILITIES_H
+#define MODELICA_UTILITIES_H
+
+#include <stddef.h>
+#include <stdarg.h>
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Utility functions which can be called by external Modelica functions.
+
+   These functions are defined in section 12.8.6 of the
+   Modelica Specification 3.0 and section 12.9.6 of the
+   Modelica Specification 3.1 and 3.2.
+
+   A generic C-implementation of these functions cannot be given,
+   because it is tool dependent how strings are output in a
+   window of the respective simulation tool. Therefore, only
+   this header file is shipped with the Modelica Standard Library.
+*/
+
+/*
+ * Some of the functions never return to the caller. In order to compile
+ * external Modelica C-code in most compilers, noreturn attributes need to
+ * be present to avoid warnings or errors.
+ *
+ * The following macros handle noreturn attributes according to the latest
+ * C11/C++11 standard with fallback to GNU or MSVC extensions if using an
+ * older compiler.
+ */
+#if __STDC_VERSION__ >= 201112L
+#define MODELICA_NORETURN _Noreturn
+#define MODELICA_NORETURNATTR
+#elif __cplusplus >= 201103L
+#define MODELICA_NORETURN [[noreturn]]
+#define MODELICA_NORETURNATTR
+#elif defined(__GNUC__)
+#define MODELICA_NORETURN
+#define MODELICA_NORETURNATTR __attribute__((noreturn))
+#elif defined(_MSC_VER)
+#define MODELICA_NORETURN __declspec(noreturn)
+#define MODELICA_NORETURNATTR
+#else
+#define MODELICA_NORETURN
+#define MODELICA_NORETURNATTR
+#endif
+
+void ModelicaMessage(const char *string);
+/*
+Output the message string (no format control).
+*/
+
+
+void ModelicaFormatMessage(const char *string,...);
+  /*
+Output the message under the same format control as the C-function printf.
+  */
+
+
+void ModelicaVFormatMessage(const char *string, va_list);
+  /*
+Output the message under the same format control as the C-function vprintf.
+  */
+
+
+MODELICA_NORETURN void ModelicaError(const char *string) MODELICA_NORETURNATTR;
+/*
+Output the error message string (no format control). This function
+never returns to the calling function, but handles the error
+similarly to an assert in the Modelica code.
+*/
+
+
+MODELICA_NORETURN void ModelicaFormatError(const char *string,...) MODELICA_NORETURNATTR;
+/*
+Output the error message under the same format control as the C-function
+printf. This function never returns to the calling function,
+but handles the error similarly to an assert in the Modelica code.
+*/
+
+
+MODELICA_NORETURN void ModelicaVFormatError(const char *string, va_list) MODELICA_NORETURNATTR;
+/*
+Output the error message under the same format control as the C-function
+vprintf. This function never returns to the calling function,
+but handles the error similarly to an assert in the Modelica code.
+*/
+
+
+char* ModelicaAllocateString(size_t len);
+/*
+Allocate memory for a Modelica string which is used as return
+argument of an external Modelica function. Note, that the storage
+for string arrays (= pointer to string array) is still provided by the
+calling program, as for any other array. If an error occurs, this
+function does not return, but calls "ModelicaError".
+*/
+
+
+char* ModelicaAllocateStringWithErrorReturn(size_t len);
+/*
+Same as ModelicaAllocateString, except that in case of error, the
+function returns 0. This allows the external function to close files
+and free other open resources in case of error. After cleaning up
+resources use ModelicaError or ModelicaFormatError to signal
+the error.
+*/
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif

+ 910 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ParModelica/explicit/openclrt/OCLRuntimeUtil.cl

@@ -0,0 +1,910 @@
+/*
+ * This file is part of OpenModelica.
+ *
+ * Copyright (c) 1998-CurrentYear, Linköping University,
+ * Department of Computer and Information Science,
+ * SE-58183 Linköping, Sweden.
+ *
+ * All rights reserved.
+ *
+ * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
+ * AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
+ * ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
+ *
+ * The OpenModelica software and the Open Source Modelica
+ * Consortium (OSMC) Public License (OSMC-PL) are obtained
+ * from Linköping University, either from the above address,
+ * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
+ * http://www.openmodelica.org, and in the OpenModelica distribution.
+ * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This program is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of  MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
+ * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
+ * OF OSMC-PL.
+ *
+ * See the full OSMC Public License conditions for more details.
+ *
+ */
+
+
+/*
+
+ This file contains functions and objects used at runtime
+ by OpenCL code. This file is included in every OpenCL
+ computation from modelica. It provides utilities when running
+ computations on GPUs and also on CPUs in OpenCL mode.
+
+ It is the OpenCL counterpart of the C runtime for
+ normal modelica execution.
+
+ Mahder.Gebremedhin@liu.se  2012-03-31
+
+*/
+
+
+#ifdef cl_amd_printf
+  #pragma OPENCL EXTENSION cl_amd_printf : enable
+  #define PRINTF_AVAILABLE
+#endif
+
+#ifdef cl_intel_printf
+  #pragma OPENCL EXTENSION cl_intel_printf : enable
+  #define PRINTF_AVAILABLE
+#endif
+
+#ifdef PRINTF_AVAILABLE
+  #define omc_assert(td,i,s) (printf("Assertion: %s, Line %d, info %d\n", s, __LINE__, i))
+  #define omc_assert_withEquationIndexes(td,i,idx,s) (printf("Assertion: %s, Line %d, info %d\n", s, __LINE__, i))
+  #define throwStreamPrint(td,str,exp) (printf("Assertion: %s\n, expression %s, Line %d\n", str, exp, __LINE__))
+  #define printline() printf("At line %d\n", __LINE__)
+#else
+  #define omc_assert(td,i,s)
+  #define omc_assert_withEquationIndexes(td,i,idx,s)
+  #define throwStreamPrint(td,str,exp)
+  #define printline()
+#endif
+
+#ifdef cl_khr_fp64
+  #pragma OPENCL EXTENSION cl_khr_fp64 : enable
+  #define DOUBLE_PREC_AVAILABLE
+#endif
+
+#ifdef cl_amd_fp64
+  #pragma OPENCL EXTENSION cl_amd_fp64 : enable
+  #define DOUBLE_PREC_AVAILABLE
+#endif
+
+
+#define FILE_INFO modelica_integer
+#define threadData_t integer
+#define threadData NULL
+#define omc_dummyFileInfo __LINE__
+
+#define sin(v,m) (sin(v))
+#define cos(v,m) (cos(v))
+
+#ifdef DOUBLE_PREC_AVAILABLE
+typedef long  modelica_integer;
+typedef double modelica_real;
+#else
+typedef float modelica_real;
+typedef int  modelica_integer;
+#endif
+
+typedef bool modelica_boolean;
+typedef modelica_integer _index_t;
+
+
+#define state modelica_boolean
+
+modelica_boolean get_memory_state() {return true;}
+void restore_memory_state(modelica_boolean in_state) {}
+
+
+struct gr_array
+{
+    int ndims;
+    __global modelica_integer* dim_size;
+    __global modelica_real* data;
+};
+
+struct gi_array
+{
+    int ndims;
+    __global modelica_integer* dim_size;
+    __global modelica_integer* data;
+};
+typedef struct gr_array real_array;
+typedef struct gi_array integer_array;
+
+struct lr_array
+{
+    int ndims;
+    local modelica_integer* dim_size;
+    local modelica_real* data;
+};
+
+struct li_array
+{
+    int ndims;
+    local modelica_integer* dim_size;
+    local modelica_integer* data;
+};
+typedef struct lr_array local_real_array;
+typedef struct li_array local_integer_array;
+
+
+// ParModelica versions of OpenCL thread managment functions.
+// They start counting from 0. Parmodelica/Modelica starts from 1.
+modelica_integer  oclGetGlobalId(modelica_integer dim) {
+    return get_global_id(dim - 1) + 1;
+}
+
+modelica_integer  oclGetLocalId(modelica_integer dim) {
+    return get_local_id(dim - 1) + 1;
+}
+
+modelica_integer  oclGetLocalSize(modelica_integer dim) {
+    return get_local_size(dim - 1);
+}
+
+modelica_integer  oclGetGlobalSize(modelica_integer dim) {
+    return get_global_size(dim - 1);
+}
+
+modelica_integer  oclGetGroupId(modelica_integer dim) {
+    return get_group_id(dim - 1) + 1;
+}
+
+modelica_integer  oclGetNumGroups(modelica_integer dim) {
+    return get_num_groups(dim - 1);
+}
+
+#define oclGlobalBarrier() barrier(CLK_GLOBAL_MEM_FENCE)
+#define oclLocalBarrier() barrier(CLK_LOCAL_MEM_FENCE)
+
+
+
+inline int in_range_integer(modelica_integer i,
+         modelica_integer start,
+         modelica_integer stop)
+{
+  if (start <= stop) {
+      if ((i >= start) && (i <= stop)) {
+          return 1;
+      }
+  } else {
+      if ((i >= stop) && (i <= start)) {
+          return 1;
+      }
+  }
+  return 0;
+}
+
+inline int in_range_real(modelica_real i,
+      modelica_real start,
+      modelica_real stop)
+{
+  if (start <= stop) {
+      if ((i >= start) && (i <= stop)) {
+          return 1;
+      }
+  } else {
+      if ((i >= stop) && (i <= start)) {
+          return 1;
+      }
+  }
+  return 0;
+}
+
+
+size_t integer_array_nr_of_elements(integer_array *a)
+{
+    int i;
+    size_t nr_of_elements = 1;
+    for (i = 0; i < a->ndims; ++i) {
+       nr_of_elements *= a->dim_size[i];
+    }
+    return nr_of_elements;
+}
+
+size_t real_array_nr_of_elements(real_array *a)
+{
+    int i;
+    size_t nr_of_elements = 1;
+    for (i = 0; i < a->ndims; ++i) {
+       nr_of_elements *= a->dim_size[i];
+    }
+    return nr_of_elements;
+}
+
+void copy_integer_array_data(integer_array *source, integer_array *dest)
+{
+    size_t i, nr_of_elements;
+
+
+    nr_of_elements = integer_array_nr_of_elements(source);
+
+    for (i = 0; i < nr_of_elements; ++i) {
+        ((__global modelica_integer *) dest->data)[i] = ((__global modelica_integer *) source->data)[i];
+    }
+}
+
+void copy_real_array_data(real_array *source, real_array *dest)
+{
+    size_t i, nr_of_elements;
+
+
+    nr_of_elements = real_array_nr_of_elements(source);
+
+    for (i = 0; i < nr_of_elements; ++i) {
+        ((__global modelica_real *) dest->data)[i] = ((__global modelica_real *) source->data)[i];
+    }
+}
+
+
+
+#define integer_array_element_addr_c99_1(L, d, i) (((L)->data) + i - 1)
+#define integer_array_element_addr_c99_2(L, d, i, j) ((((L)->data)) + (i - 1)*((L)->dim_size[1]) + (j - 1))
+
+#define real_array_element_addr_c99_1(L, d, i) (((L)->data) + i - 1)
+#define real_array_element_addr_c99_2(L, d, i, j) ((((L)->data)) + (i - 1)*((L)->dim_size[1]) + (j - 1))
+
+
+
+// typedef modelica_real cos_rettype;
+// typedef modelica_real cosh_rettype;
+// typedef modelica_real acos_rettype;
+// typedef modelica_real sin_rettype;
+// typedef modelica_real sinh_rettype;
+// typedef modelica_real asin_rettype;
+// typedef modelica_real log_rettype;
+// typedef modelica_real log10_rettype;
+// typedef modelica_real tan_rettype;
+// typedef modelica_real tanh_rettype;
+// typedef modelica_real atan_rettype;
+// typedef modelica_real exp_rettype;
+// typedef modelica_real sqrt_rettype;
+// typedef modelica_real atan2_rettype;
+// typedef modelica_real div_rettype;
+// typedef modelica_real mod_rettype;
+
+
+// ///////////////////////////////////////////////////////////
+// //memory_pool
+
+// #define NR_REAL_ELEMENTS    1024
+// #define NR_INTEGER_ELEMENTS 1024
+// #define NR_BOOLEAN_ELEMENTS 1
+// #define NR_SIZE_ELEMENTS    100
+
+// #define PRECENTAGE_REAL_BUFFER       40
+// #define PRECENTAGE_INTEGER_BUFFER     40
+// #define PRECENTAGE_BOOLEAN_BUFFER    15
+// #define PRECENTAGE_SIZE_BUFFER        5
+
+
+// struct gr_array
+// {
+    // int ndims;
+    // __global modelica_integer* dim_size;
+    // __global modelica_real* data;
+// };
+
+// struct gi_array
+// {
+    // int ndims;
+    // __global modelica_integer* dim_size;
+    // __global modelica_integer* data;
+// };
+// typedef struct gr_array real_array;
+// typedef struct gi_array integer_array;
+
+// struct lr_array
+// {
+    // int ndims;
+    // __local modelica_integer* dim_size;
+    // __local modelica_real* data;
+// };
+
+// struct li_array
+// {
+    // int ndims;
+    // __local modelica_integer* dim_size;
+    // __local modelica_integer* data;
+// };
+// typedef __local struct lr_array local_real_array;
+// typedef __local struct li_array local_integer_array;
+
+
+
+// // HELL starts here. Enjoy!
+
+// struct local_state_s {
+  // _index_t real_count;
+  // _index_t integer_count;
+  // _index_t boolean_count;
+  // _index_t size_count;
+  // __local modelica_real* local_real_buffer_ptr;
+  // __local modelica_integer* local_integer_buffer_ptr;
+  // __local modelica_boolean* local_boolean_buffer_ptr;
+  // __local modelica_integer* local_size_buffer_ptr;
+// };
+// typedef __local struct local_state_s local_state;
+
+// struct global_state_s {
+  // __global modelica_real* global_real_buffer_ptr;
+  // __global modelica_integer* global_integer_buffer_ptr;
+  // __global modelica_boolean* global_boolean_buffer_ptr;
+  // __global modelica_integer* global_size_buffer_ptr;
+// };
+// typedef struct global_state_s global_state;
+
+
+// struct state_s{
+  // global_state saved_global_state;
+  // local_state saved_local_state;
+// };
+// typedef struct state_s state;
+
+// struct buffer_s{
+  // __global modelica_real* global_real_buffer;
+  // __global modelica_integer* global_integer_buffer;
+  // __global modelica_boolean* global_boolean_buffer;
+  // __global modelica_integer* global_size_buffer;
+  // __local modelica_real* local_real_buffer;
+  // __local modelica_integer* local_integer_buffer;
+  // __local modelica_boolean* local_boolean_buffer;
+  // __local modelica_integer* local_size_buffer;
+// };
+// typedef struct buffer_s buffer;
+
+
+// struct memory_s{
+    // global_state* current_global_state;
+    // local_state* current_local_state;
+    // buffer* data_buffer;
+// };
+// typedef struct memory_s memory;
+
+// /*
+// void print_memory_state(memory* m)
+// {
+  // printf("=== Current state ===\n");
+  // printf("real ptr at: %d\n",(int)m->current_global_state->global_real_buffer_ptr);
+  // printf("integer ptr at: %d\n",(int)m->current_global_state->global_integer_buffer_ptr);
+  // printf("boolean ptr at: %d\n",(int)m->current_global_state->global_boolean_buffer_ptr);
+  // printf("size ptr at: %d\n",(int)m->current_global_state->global_size_buffer_ptr);
+  // printf("real counter at: %d\n",(int)m->current_global_state->real_count);
+  // printf("integer counter at: %d\n",(int)m->current_global_state->integer_count);
+  // printf("boolean counter at: %d\n",(int)m->current_global_state->boolean_count);
+  // printf("size counter at: %d\n",(int)m->current_global_state->size_count);
+// }
+
+
+// void print_state(state* m)
+// {
+  // printf("=== Current state ===\n");
+  // printf("real ptr at: %d\n",(int)m->global_real_buffer_ptr);
+  // printf("integer ptr at: %d\n",(int)m->global_integer_buffer_ptr);
+  // printf("boolean ptr at: %d\n",(int)m->global_boolean_buffer_ptr);
+  // printf("size ptr at: %d\n",(int)m->global_size_buffer_ptr);
+  // printf("real counter at: %d\n",(int)m->real_count);
+  // printf("integer counter at: %d\n",(int)m->integer_count);
+  // printf("boolean counter at: %d\n",(int)m->boolean_count);
+  // printf("size counter at: %d\n",(int)m->size_count);
+// }
+
+
+// */
+// void initialize_global_buffer(__global void* exec_buffer, modelica_integer buffer_size, memory* current_memory){
+    // size_t num_threads = 1;
+    // size_t ndims = get_work_dim();
+    // for(int i = 0; i < ndims; i++)
+        // num_threads *= get_global_size(i);
+
+    // size_t universalId;
+    // if(ndims == 1)
+        // universalId = get_global_id(0);
+    // else if(ndims == 2)
+        // universalId = get_global_id(1)*get_global_size(0) + get_global_id(0);
+    // else if(ndims == 3)
+        // universalId = get_global_id(2)*get_global_size(1)*get_global_size(0) + get_global_id(1)*get_global_size(0) + get_global_id(0);
+
+
+// typedef __global void* global_void_ptr;
+
+    // global_void_ptr  thread_buff_start;
+    // size_t buffer_per_thread;
+    // size_t real_buffer_per_thread;
+    // size_t integer_buffer_per_thread;
+    // size_t boolean_buffer_per_thread;
+    // size_t size_buffer_per_thread;
+
+    // buffer_per_thread = (buffer_size/num_threads);
+    // thread_buff_start = exec_buffer + universalId*buffer_per_thread;
+
+    // global_void_ptr real_start = thread_buff_start;
+    // current_memory->data_buffer->global_real_buffer = (__global modelica_real*)real_start;
+    // real_buffer_per_thread = (buffer_per_thread*PRECENTAGE_REAL_BUFFER)/100;
+
+    // global_void_ptr integer_start = real_start + real_buffer_per_thread;
+    // current_memory->data_buffer->global_integer_buffer = (__global modelica_integer*)integer_start;
+    // integer_buffer_per_thread = (buffer_per_thread*PRECENTAGE_INTEGER_BUFFER)/100;
+
+    // global_void_ptr size_start = integer_start + integer_buffer_per_thread;
+    // current_memory->data_buffer->global_size_buffer = (__global modelica_integer*)size_start;
+    // size_buffer_per_thread = (buffer_per_thread*PRECENTAGE_SIZE_BUFFER)/100;
+
+    // global_void_ptr boolean_start = size_start + size_buffer_per_thread;
+    // current_memory->data_buffer->global_boolean_buffer = (__global modelica_boolean*)boolean_start;
+    // boolean_buffer_per_thread = (buffer_per_thread*PRECENTAGE_BOOLEAN_BUFFER)/100;
+
+
+    // current_memory->current_global_state->global_real_buffer_ptr = current_memory->data_buffer->global_real_buffer;
+    // current_memory->current_global_state->global_integer_buffer_ptr = current_memory->data_buffer->global_integer_buffer;
+    // current_memory->current_global_state->global_size_buffer_ptr = current_memory->data_buffer->global_size_buffer;
+    // current_memory->current_global_state->global_boolean_buffer_ptr = current_memory->data_buffer->global_boolean_buffer;
+
+    // /*
+    // if(get_global_id(0) == 0){
+        // printf("execution buffer starts from %d\n", exec_buffer);
+        // printf("execution buffer per thread %d KB\n", buffer_per_thread/1024);
+        // printf("thread %d starts from %d\n", get_global_id(0), thread_buff_start);
+        // //printf("REAL buffer SIZE  %d KB\n", (integer_start - real_start)/1024);
+        // printf("max nr of real elements  %d\n", (integer_start - real_start)/sizeof(modelica_real));
+        // //printf("INTEGER buffer SIZE  %d KB\n", (boolean_start - integer_start)/1024);
+        // printf("max nr of integer elements  %d\n", (boolean_start - integer_start)/sizeof(modelica_integer));
+        // //printf("BOOLEAN buffer SIZE  %d B\n", (size_start - boolean_start));
+        // printf("max nr of boolean elements  %d\n", sizeof(modelica_boolean));
+        // //printf("SIZE buffer SIZE  %d KB\n", (thread_buff_start + buffer_per_thread - size_start)/1024);
+        // printf("max nr of size elements  %d\n", (thread_buff_start + buffer_per_thread - size_start)/sizeof(modelica_integer));
+        // //printf("execution buffer for this thread ends at %d\n", current_memory->data_buffer->global_size_buffer + size_buffer_per_thread);
+        // //printf("thread %d starts from %d\n", get_global_id(0) + 1, thread_buff_start + buffer_per_thread);
+        // print_current_global_state(current_memory);
+    // }
+    // */
+
+// ///////////////////////////////Global Memory initialized!////////////////////////////////////////////////////////////////////////
+
+// }
+
+// // HELL ends here. You made it! yay!
+
+
+
+// /*
+// state get_memory_state(){
+  // return current_state;
+// }
+// */
+
+// #define get_memory_state() (state){*(memory_state->current_global_state), *(memory_state->current_local_state)}; barrier(CLK_LOCAL_MEM_FENCE);
+
+// /*
+// void restore_memory_state(state s){
+    // current_state = s;
+// }
+// */
+
+// #define restore_memory_state(s) *(memory_state->current_global_state) = s.saved_global_state; *(memory_state->current_local_state) = s.saved_local_state; barrier(CLK_LOCAL_MEM_FENCE);
+
+// //memory_pool ends here.
+// ///////////////////////////////////////////////////////////
+
+
+// ///////////////////////////////////////////////////////////
+// //utility + builtin functions
+
+// int in_range_integer(modelica_integer i,
+         // modelica_integer start,
+         // modelica_integer stop)
+// {
+  // if (start <= stop) if ((i >= start) && (i <= stop)) return 1;
+  // if (start > stop) if ((i >= stop) && (i <= start)) return 1;
+  // return 0;
+// }
+
+// int in_range_real(modelica_real i,
+      // modelica_real start,
+      // modelica_real stop)
+// {
+  // if (start <= stop) if ((i >= start) && (i <= stop)) return 1;
+  // if (start > stop) if ((i >= stop) && (i <= start)) return 1;
+  // return 0;
+// }
+
+// modelica_real modelica_div(modelica_real x, modelica_real y)
+// {
+  // return (modelica_real)((modelica_integer)(x/y));
+// }
+
+// modelica_real modelica_mod_real(modelica_real x, modelica_real y)
+// {
+  // return (x - floor(x/y) * y);
+// }
+
+// modelica_integer modelica_mod_integer(modelica_integer x, modelica_integer y)
+// {
+  // return x % y;
+// }
+
+// modelica_real modelica_rem_real(modelica_real x, modelica_real y)
+// {
+  // return x - y*(modelica_div(x,y));
+// }
+
+// modelica_integer modelica_rem_integer(modelica_integer x, modelica_integer y)
+// {
+  // return x - y*((x/y));
+// }
+
+
+// //utility + builtin functions ends here
+// ///////////////////////////////////////////////////////////
+
+
+
+
+
+
+
+// ///////////////////////////////////////////////////////////
+// //Array related utilities
+
+
+// void alloc_integer_array_c99_1(integer_array* dest, int ndims, modelica_integer size_1, memory* memory_state)
+// {
+    // size_t elements = 0;
+    // _index_t start;
+    // dest->ndims = 1;
+
+    // //assert(n>=0);
+    // //assert(n + current_global_state.global_size_buffer_ptr < NR_SIZE_ELEMENTS);
+    // if( memory_state->current_global_state->global_size_buffer_ptr + 2 >= memory_state->current_global_state->global_boolean_buffer_ptr){
+        // //printf("Size buffer pointer passed limit\n");
+    // }
+
+    // dest->dim_size = memory_state->current_global_state->global_size_buffer_ptr;
+    // memory_state->current_global_state->global_size_buffer_ptr += 1;
+    // dest->dim_size[0] = size_1;
+
+    // elements = integer_array_nr_of_elements(dest);
+    // //assert(n>=0);
+    // //assert(current_global_state.global_integer_buffer_ptr +n < NR_INTEGER_ELEMENTS);
+    // if( memory_state->current_global_state->global_integer_buffer_ptr + elements >= memory_state->current_global_state->global_size_buffer_ptr){
+        // //printf("Integer buffer pointer passed limit\n");
+    // }
+
+    // dest->data = memory_state->current_global_state->global_integer_buffer_ptr;
+    // memory_state->current_global_state->global_integer_buffer_ptr += elements;
+// }
+
+// void alloc_real_array_c99_1(real_array* dest, int ndims, modelica_integer size_1, memory* memory_state)
+// {
+    // size_t elements = 0;
+    // _index_t start;
+    // dest->ndims = 1;
+
+    // //assert(n>=0);
+    // //assert(n + current_global_state.global_size_buffer_ptr < NR_SIZE_ELEMENTS);
+    // if( memory_state->current_global_state->global_size_buffer_ptr + 2 >= memory_state->current_global_state->global_boolean_buffer_ptr){
+        // //printf("Size buffer pointer passed limit\n");
+    // }
+    // dest->dim_size = memory_state->current_global_state->global_size_buffer_ptr;
+    // memory_state->current_global_state->global_size_buffer_ptr += 1;
+    // dest->dim_size[0] = size_1;
+
+    // elements = real_array_nr_of_elements(dest);
+    // //assert(n>=0);
+    // //assert(current_global_state.global_integer_buffer_ptr +n < NR_INTEGER_ELEMENTS);
+    // if( memory_state->current_global_state->global_real_buffer_ptr + elements >= memory_state->current_global_state->global_integer_buffer_ptr){
+        // //printf("Real buffer pointer passed limit\n");
+    // }
+
+    // dest->data = memory_state->current_global_state->global_real_buffer_ptr;
+    // memory_state->current_global_state->global_real_buffer_ptr += elements;
+
+// }
+
+
+// void alloc_integer_array_c99_2(integer_array* dest, int ndims, modelica_integer size_1, modelica_integer size_2, memory* memory_state)
+// {
+    // size_t elements = 0;
+    // _index_t start;
+    // dest->ndims = 2;
+
+    // //assert(n>=0);
+    // //assert(n + current_global_state->global_size_buffer_ptr < NR_SIZE_ELEMENTS);
+    // if( memory_state->current_global_state->global_size_buffer_ptr + 2 >= memory_state->current_global_state->global_boolean_buffer_ptr){
+        // //printf("Size buffer pointer passed limit\n");
+    // }
+    // dest->dim_size = memory_state->current_global_state->global_size_buffer_ptr;
+    // memory_state->current_global_state->global_size_buffer_ptr += 2;
+    // dest->dim_size[0] = size_1;
+    // dest->dim_size[1] = size_2;
+
+    // elements = integer_array_nr_of_elements(dest);
+    // //assert(n>=0);
+    // //assert(current_global_state->global_integer_buffer_ptr +n < NR_INTEGER_ELEMENTS);
+
+    // if( memory_state->current_global_state->global_integer_buffer_ptr + elements >= memory_state->current_global_state->global_size_buffer_ptr){
+        // //printf("Integer buffer pointer passed limit\n");
+    // }
+    // dest->data = memory_state->current_global_state->global_integer_buffer_ptr;
+    // memory_state->current_global_state->global_integer_buffer_ptr += elements;
+// }
+
+// void alloc_real_array_c99_2(real_array* dest, int ndims, modelica_integer size_1, modelica_integer size_2, memory* memory_state)
+// {
+    // size_t elements = 0;
+    // _index_t start;
+    // dest->ndims = 2;
+
+    // //assert(n>=0);
+    // //assert(n + current_global_state->global_size_buffer_ptr < NR_SIZE_ELEMENTS);
+    // if( memory_state->current_global_state->global_size_buffer_ptr + 2 >= memory_state->current_global_state->global_boolean_buffer_ptr){
+        // //printf("Size buffer pointer passed limit\n");
+    // }
+    // dest->dim_size = memory_state->current_global_state->global_size_buffer_ptr;
+    // memory_state->current_global_state->global_size_buffer_ptr += 2;
+    // dest->dim_size[0] = size_1;
+    // dest->dim_size[1] = size_2;
+
+    // elements = real_array_nr_of_elements(dest);
+    // //assert(n>=0);
+    // //assert(current_global_state->global_integer_buffer_ptr +n < NR_INTEGER_ELEMENTS);
+
+    // if( memory_state->current_global_state->global_real_buffer_ptr + elements >= memory_state->current_global_state->global_integer_buffer_ptr){
+        // //printf("Real buffer pointer passed limit\n");
+    // }
+    // dest->data = memory_state->current_global_state->global_real_buffer_ptr;
+    // memory_state->current_global_state->global_real_buffer_ptr += elements;
+// }
+
+// void copy_integer_array_data(integer_array *source, integer_array *dest)
+// {
+    // size_t i, nr_of_elements;
+
+
+    // nr_of_elements = real_array_nr_of_elements(source);
+
+    // for (i = 0; i < nr_of_elements; ++i) {
+        // ((__global modelica_integer *) dest->data)[i] = ((__global modelica_integer *) source->data)[i];
+    // }
+// }
+
+// void copy_real_array_data(real_array *source, real_array *dest)
+// {
+    // size_t i, nr_of_elements;
+
+
+    // nr_of_elements = real_array_nr_of_elements(source);
+
+    // for (i = 0; i < nr_of_elements; ++i) {
+        // ((__global modelica_real *) dest->data)[i] = ((__global modelica_real *) source->data)[i];
+    // }
+// }
+
+// #define real_array_element_addr_c99_1(L, d, i) (((L)->data) + i - 1)
+// /*
+// __global modelica_real* real_array_element_addr_c99_1(real_array* L, int dim, modelica_integer i){
+    // return ((__global modelica_real*)(L->data)) + i - 1;
+// }
+
+// __local modelica_real* local_integer_array_element_addr_c99_1(local_real_array* L, int dim, modelica_integer i){
+    // return ((__local modelica_real*)(L->data)) + i - 1;
+// }
+// */
+
+// #define integer_array_element_addr_c99_1(L, d, i) (((L)->data) + i - 1)
+// /*
+// __global modelica_integer* integer_array_element_addr_c99_1(integer_array* L, int dim, modelica_integer i){
+    // return ((__global modelica_integer*)(L->data)) + i - 1;
+// }
+
+// __local modelica_integer* local_integer_array_element_addr_c99_1(local_integer_array* L, int dim, modelica_integer i){
+    // return ((__local modelica_integer*)(L->data)) + i - 1;
+// }
+// */
+
+// #define real_array_element_addr_c99_2(L, d, i, j) ((((L)->data)) + (i - 1)*((L)->dim_size[1]) + (j - 1))
+// /*
+// __global modelica_real* real_array_element_addr_c99_2(real_array* L, int dim, modelica_integer i, modelica_integer j){
+    // return ((__global modelica_real*)(L->data)) + (i - 1)*L->dim_size[1] + (j - 1);
+// }
+
+// __local modelica_real* real_array_element_addr_c99_2(local_real_array* L, int dim, modelica_integer i, modelica_integer j){
+    // return ((__local modelica_real*)(L->data)) + (i - 1)*L->dim_size[1] + (j - 1);
+// }
+// */
+
+// #define integer_array_element_addr_c99_2(L, d, i, j) ((((L)->data)) + (i - 1)*((L)->dim_size[1]) + (j - 1))
+// /*
+// __global modelica_integer* integer_array_element_addr_c99_2(integer_array* L, int dim, modelica_integer i, modelica_integer j){
+    // return ((__global modelica_integer*)(L->data)) + (i - 1)*L->dim_size[1] + (j - 1);
+// }
+
+// __local modelica_integer* integer_array_element_addr_c99_2(local_integer_array* L, int dim, modelica_integer i, modelica_integer j){
+    // return ((__local modelica_integer*)(L->data)) + (i - 1)*L->dim_size[1] + (j - 1);
+// }
+// */
+
+// #define real_array_element_addr_c99_3(L, d, i, j, k) ((((L)->data)) + (i - 1)*((L)->dim_size[1])*((L)->dim_size[2]) + (j - 1)*((L)->dim_size[2]) + (k - 1))
+// /*
+// __global modelica_real* real_array_element_addr_c99_3(real_array* L, int dim, modelica_integer i, modelica_integer j, modelica_integer k){
+    // return ((__global modelica_real*)(L->data)) + (i - 1)*L->dim_size[1]*L->dim_size[2] + (j - 1)*L->dim_size[2] + (k - 1);
+// }
+
+// __local modelica_real* real_array_element_addr_c99_3(local_real_array* L, int dim, modelica_integer i, modelica_integer j, modelica_integer k){
+    // return ((__local modelica_real*)(L->data)) + (i - 1)*L->dim_size[1]*L->dim_size[2] + (j - 1)*L->dim_size[2] + (k - 1);
+// }
+// */
+
+// #define integer_array_element_addr_c99_3(L, d, i, j, k) ((((L)->data)) + (i - 1)*((L)->dim_size[1])*((L)->dim_size[2]) + (j - 1)*((L)->dim_size[2]) + (k - 1))
+// /*
+// __global modelica_integer* integer_array_element_addr_c99_3(integer_array* L, int dim, modelica_integer i, modelica_integer j, modelica_integer k){
+    // return ((__global modelica_integer*)(L->data)) + (i - 1)*L->dim_size[1]*L->dim_size[2] + (j - 1)*L->dim_size[2] + (k - 1);
+// }
+
+// __local modelica_integer* integer_array_element_addr_c99_3(local_integer_array* L, int dim, modelica_integer i, modelica_integer j, modelica_integer k){
+    // return ((__local modelica_integer*)(L->data)) + (i - 1)*L->dim_size[1]*L->dim_size[2] + (j - 1)*L->dim_size[2] + (k - 1);
+// }
+// */
+
+// //uArray related utilities end here
+// ///////////////////////////////////////////////////////////
+
+
+
+
+// size_t local_integer_array_nr_of_elements(local_integer_array *a)
+// {
+    // int i;
+    // size_t nr_of_elements = 1;
+    // for (i = 0; i < a->ndims; ++i) {
+       // nr_of_elements *= a->dim_size[i];
+    // }
+    // return nr_of_elements;
+// }
+
+// size_t local_real_array_nr_of_elements(local_real_array *a)
+// {
+    // int i;
+    // size_t nr_of_elements = 1;
+    // for (i = 0; i < a->ndims; ++i) {
+       // nr_of_elements *= a->dim_size[i];
+    // }
+    // return nr_of_elements;
+// }
+
+
+// void alloc_local_integer_array_c99_1(local_integer_array* dest, int ndims, modelica_integer size_1, memory* memory_state)
+// {
+    // size_t elements = 0;
+    // dest->ndims = 1;
+
+    // //assert(n>=0);
+    // //assert(n + current_state.local_size_buffer_ptr < NR_SIZE_ELEMENTS);
+    // if( memory_state->current_local_state->size_count + 2 >= NR_SIZE_ELEMENTS){
+        // //printf("Size buffer pointer passed limit\n");
+    // }
+
+
+    // dest->dim_size = memory_state->current_local_state->local_size_buffer_ptr;
+
+    // memory_state->current_local_state->local_size_buffer_ptr += 1;
+    // memory_state->current_local_state->size_count += 1;
+    // dest->dim_size[0] = size_1;
+
+    // elements = local_integer_array_nr_of_elements(dest);
+
+    // //assert(n>=0);
+    // //assert(current_state.global_integer_buffer_ptr +n < NR_INTEGER_ELEMENTS);
+    // if( memory_state->current_local_state->integer_count + elements >= NR_INTEGER_ELEMENTS){
+        // //printf("Integer buffer pointer passed limit\n");
+    // }
+
+    // dest->data = memory_state->current_local_state->local_integer_buffer_ptr;
+    // memory_state->current_local_state->local_integer_buffer_ptr += elements;
+    // memory_state->current_local_state->integer_count += elements;
+// }
+
+// void alloc_local_integer_array_c99_2(local_integer_array* dest, int ndims, modelica_integer size_1, modelica_integer size_2, memory* memory_state)
+// {
+    // size_t elements = 0;
+    // dest->ndims = 2;
+
+    // //assert(n>=0);
+    // //assert(n + current_state.local_size_buffer_ptr < NR_SIZE_ELEMENTS);
+    // if( memory_state->current_local_state->size_count + 2 >= NR_SIZE_ELEMENTS){
+        // //printf("Size buffer pointer passed limit\n");
+    // }
+
+
+    // dest->dim_size = memory_state->current_local_state->local_size_buffer_ptr;
+
+    // memory_state->current_local_state->local_size_buffer_ptr += 2;
+    // memory_state->current_local_state->size_count += 2;
+    // dest->dim_size[0] = size_1;
+    // dest->dim_size[1] = size_2;
+
+    // elements = local_integer_array_nr_of_elements(dest);
+
+    // //assert(n>=0);
+    // //assert(current_state.global_integer_buffer_ptr +n < NR_INTEGER_ELEMENTS);
+    // if( memory_state->current_local_state->integer_count + elements >= NR_INTEGER_ELEMENTS){
+        // //printf("Integer buffer pointer passed limit\n");
+    // }
+
+    // dest->data = memory_state->current_local_state->local_integer_buffer_ptr;
+    // memory_state->current_local_state->local_integer_buffer_ptr += elements;
+    // memory_state->current_local_state->integer_count += elements;
+// }
+
+
+// void alloc_local_real_array_c99_1(local_real_array* dest, int ndims, modelica_integer size_1, memory* memory_state)
+// {
+    // size_t elements = 0;
+    // dest->ndims = 1;
+
+    // //assert(n>=0);
+    // //assert(n + current_state.local_size_buffer_ptr < NR_SIZE_ELEMENTS);
+    // if( memory_state->current_local_state->size_count + 2 >= NR_SIZE_ELEMENTS){
+        // //printf("Size buffer pointer passed limit\n");
+    // }
+
+
+    // dest->dim_size = memory_state->current_local_state->local_size_buffer_ptr;
+
+    // memory_state->current_local_state->local_size_buffer_ptr += 1;
+    // memory_state->current_local_state->size_count += 1;
+    // dest->dim_size[0] = size_1;
+
+    // elements = local_real_array_nr_of_elements(dest);
+
+    // //assert(n>=0);
+    // //assert(current_state.global_real_buffer_ptr +n < NR_REAL_ELEMENTS);
+    // if( memory_state->current_local_state->real_count + elements >= NR_REAL_ELEMENTS){
+        // //printf("Integer buffer pointer passed limit\n");
+    // }
+
+    // dest->data = memory_state->current_local_state->local_real_buffer_ptr;
+    // memory_state->current_local_state->local_real_buffer_ptr += elements;
+    // memory_state->current_local_state->integer_count += elements;
+// }
+
+// void alloc_local_real_array_c99_2(local_real_array* dest, int ndims, modelica_integer size_1, modelica_integer size_2, memory* memory_state)
+// {
+    // size_t elements = 0;
+    // dest->ndims = 2;
+
+    // //assert(n>=0);
+    // //assert(n + current_state.local_size_buffer_ptr < NR_SIZE_ELEMENTS);
+    // if( memory_state->current_local_state->size_count + 2 >= NR_SIZE_ELEMENTS){
+        // //printf("Size buffer pointer passed limit\n");
+    // }
+
+
+    // dest->dim_size = memory_state->current_local_state->local_size_buffer_ptr;
+
+    // memory_state->current_local_state->local_size_buffer_ptr += 2;
+    // memory_state->current_local_state->size_count += 2;
+    // dest->dim_size[0] = size_1;
+    // dest->dim_size[1] = size_2;
+
+    // elements = local_real_array_nr_of_elements(dest);
+
+    // //assert(n>=0);
+    // //assert(current_state.global_real_buffer_ptr +n < NR_REAL_ELEMENTS);
+    // if( memory_state->current_local_state->real_count + elements >= NR_REAL_ELEMENTS){
+        // //printf("Integer buffer pointer passed limit\n");
+    // }
+
+    // dest->data = memory_state->current_local_state->local_real_buffer_ptr;
+    // memory_state->current_local_state->local_real_buffer_ptr += elements;
+    // memory_state->current_local_state->integer_count += elements;
+// }

+ 116 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ParModelica/explicit/openclrt/omc_ocl_common_header.h

@@ -0,0 +1,116 @@
+/*
+ * This file is part of OpenModelica.
+ *
+ * Copyright (c) 1998-CurrentYear, Linköping University,
+ * Department of Computer and Information Science,
+ * SE-58183 Linköping, Sweden.
+ *
+ * All rights reserved.
+ *
+ * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
+ * AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
+ * ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
+ *
+ * The OpenModelica software and the Open Source Modelica
+ * Consortium (OSMC) Public License (OSMC-PL) are obtained
+ * from Linköping University, either from the above address,
+ * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
+ * http://www.openmodelica.org, and in the OpenModelica distribution.
+ * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This program is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of  MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
+ * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
+ * OF OSMC-PL.
+ *
+ * See the full OSMC Public License conditions for more details.
+ *
+ */
+
+
+/*
+
+ Common hader file included by other headers in the openCLRuntime
+
+ Mahder.Gebremedhin@liu.se  2012-03-31
+
+*/
+
+
+
+#ifndef _OMC_OCL_COMMON_HEADER
+#define _OMC_OCL_COMMON_HEADER
+
+#include <stdio.h>
+#ifdef __APPLE__
+#include <OpenCL/cl.h>
+#else
+#include <CL/cl.h>
+#endif
+#include <openmodelica.h>
+#include <stdarg.h>
+#include <sys/time.h>
+
+
+
+#define MAX_DEVICE 4
+#define SHOW_DEVICE_SELECTION
+// #define SHOW_ARG_SET_ERRORS
+#define DEFAULT_DEVICE 1
+#define OCL_BUFFER_SIZE_FRACTION 4
+
+
+// DEFINED IN: omc_ocl_util
+void ocl_initialize();
+void ocl_error_check(int operation, cl_int error_code);
+cl_program ocl_build_p_from_src(const char* source, int isfile);
+cl_kernel ocl_create_kernel(cl_program program, const char* kernel_name);
+
+
+//executes a kernel
+void ocl_execute_kernel(cl_kernel kernel);
+
+
+typedef cl_mem device_integer;
+typedef cl_mem device_real;
+
+
+struct dev_buff{
+ cl_mem buffer;
+ modelica_integer size;
+};
+
+typedef struct dev_buff device_buffer;
+
+
+typedef struct dev_arr{
+ cl_mem data;
+ cl_mem info_dev;
+ modelica_integer* info;
+} device_array;
+
+typedef device_array device_integer_array;
+typedef device_array device_real_array;
+
+// typedef struct dev_local_arr{
+ // cl_mem data;
+ // cl_mem info_dev;
+ // modelica_integer* info;
+// } device_local_array;
+
+typedef device_array device_local_real_array;
+typedef device_array device_local_integer_array;
+
+
+enum ocl_error {OCL_BUILD_PROGRAM, OCL_CREATE_KERNEL, OCL_CREATE_BUFFER, OCL_CREATE_CONTEXT,
+                OCL_CREATE_COMMAND_QUEUE, OCL_SET_KER_ARGS, OCL_ENQUE_ND_RANGE_KERNEL, OCL_COPY_DEV_TO_DEV,
+                OCL_COPY_HOST_TO_DEV, OCL_COPY_DEV_TO_HOST, OCL_REALEASE_MEM_OBJECT};
+
+
+
+// Defined in: omc_ocl_interface.cpp
+size_t device_array_nr_of_elements(device_array *a);
+
+#endif

+ 195 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ParModelica/explicit/openclrt/omc_ocl_interface.h

@@ -0,0 +1,195 @@
+/*
+ * This file is part of OpenModelica.
+ *
+ * Copyright (c) 1998-CurrentYear, Linköping University,
+ * Department of Computer and Information Science,
+ * SE-58183 Linköping, Sweden.
+ *
+ * All rights reserved.
+ *
+ * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
+ * AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
+ * ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
+ *
+ * The OpenModelica software and the Open Source Modelica
+ * Consortium (OSMC) Public License (OSMC-PL) are obtained
+ * from Linköping University, either from the above address,
+ * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
+ * http://www.openmodelica.org, and in the OpenModelica distribution.
+ * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This program is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of  MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
+ * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
+ * OF OSMC-PL.
+ *
+ * See the full OSMC Public License conditions for more details.
+ *
+ */
+
+
+/*
+
+ This file contains interfacing functions. Theses are the
+ actuall functions that are available for calling by the
+ code generated from Modelica source.
+ If a function is not called from the generated code please
+ don not add it here.
+ If the feature involves complex operations then define it
+ somewhere else and and just create interface for it here
+ (If it needs to be exported.)
+
+
+ Mahder.Gebremedhin@liu.se  2012-03-31
+
+*/
+
+
+
+#ifndef _OMC_OCL_INTERFACE_H
+#define _OMC_OCL_INTERFACE_H
+
+
+#include "omc_ocl_common_header.h"
+#include "omc_ocl_memory_ops.h"
+
+
+
+// Just to stick to  OpenModelica's function naming pattern
+#define oclSetNumThreadsOnlyGlobal(...) ocl_set_num_threads( __VA_ARGS__ )
+#define oclSetNumThreadsGlobalLocal(...) ocl_set_num_threads( __VA_ARGS__ )
+#define oclSetNumThreadsGlobalLocal1D(...) ocl_set_num_threads( __VA_ARGS__ )
+#define oclSetNumThreadsGlobalLocal2D(...) ocl_set_num_threads( __VA_ARGS__ )
+#define oclSetNumThreadsGlobalLocal3D(...) ocl_set_num_threads( __VA_ARGS__ )
+
+
+// sets the number of threads for subsequent parallel operations
+// arguments are arrays of work_dim size specifiying each workgroup dimension
+void ocl_set_num_threads(integer_array_t global_threads_in, integer_array_t local_threads_in);
+
+
+// sets the number of threads for subsequent parallel operations.
+// similar to the above function with arrays of size 1 only.
+void ocl_set_num_threads(modelica_integer global_threads_in, modelica_integer local_threads_in);
+
+//sets the number of threads for subsequent parallel operations.
+//This time only the total number of threads desired is given. OpenCL will
+//automatically distribute workitems/threads into work groups.
+//it ca also be used(by passing 0) to reset the number of total threads to the max value of one group (default).
+void ocl_set_num_threads(modelica_integer global_threads_in);
+
+//sets a single Kernel cl_mem (device pointer) argument.
+void ocl_set_kernel_arg(cl_kernel kernel, int arg_nr, cl_mem in_arg);
+//sets a single Kernel Real argument.
+void ocl_set_kernel_arg(cl_kernel kernel, int arg_nr, modelica_real in_arg);
+//sets a single Kernel Integer argument.
+void ocl_set_kernel_arg(cl_kernel kernel, int arg_nr, modelica_integer in_arg);
+
+// sets a __local Kernel argument. The size should be given.
+void ocl_set_local_kernel_arg(cl_kernel kernel, int arg_nr, size_t in_size);
+
+
+
+//overloaded functions from real/integer/boolean _array in the C_runtime library
+//for allocating and copying arrays to openCL device
+
+void alloc_integer_array(device_integer_array *dest, int ndims, ...);
+
+void alloc_real_array(device_integer_array *dest, int ndims, ...);
+
+void alloc_device_local_real_array(device_local_real_array *dest, int ndims, ...);
+
+void copy_real_array_data(device_real_array dev_array_ptr, real_array_t* host_array_ptr);
+
+void copy_real_array_data(real_array_t host_array_ptr, device_real_array* dev_array_ptr);
+
+void copy_real_array_data(device_real_array dev_array_ptr1, device_real_array* dev_array_ptr2);
+
+void copy_integer_array_data(device_integer_array dev_array_ptr, integer_array_t* host_array_ptr);
+
+void copy_integer_array_data(integer_array_t host_array_ptr, device_integer_array* dev_array_ptr);
+
+void copy_integer_array_data(device_integer_array dev_array_ptr1, device_integer_array* dev_array_ptr2);
+
+
+// //functions used for copying scalars. Scalars in the normal(serial C) code genertation
+// //of modelica are copied by assignment (a = b). However to be able to copy them b'n
+// //GPU and host CPU we need to change the assignments to copy functions.
+// void copy_assignment_helper_integer(modelica_integer* i1, modelica_integer* i2);
+
+// void copy_assignment_helper_integer(device_integer* i1, modelica_integer* i2);
+
+// void copy_assignment_helper_integer(modelica_integer* i1, device_integer* i2);
+
+// void copy_assignment_helper_integer(device_integer* i1, device_integer* i2);
+
+// void copy_assignment_helper_real(modelica_real* i1, modelica_real* i2);
+
+// void copy_assignment_helper_real(device_real* i1, modelica_real* i2);
+
+// void copy_assignment_helper_real(modelica_real* i1, device_real* i2);
+
+// void copy_assignment_helper_real(device_real* i1, device_real* i2);
+
+//these functions are added to solve a problem with a memory leak when returning arrays
+//from functions. Arrays used to be assigned just like normal scalar variables. Which causes the
+//allocated memory on the lhs to be lost when the pointer is replaced with the new one.
+//this fixes the problem for parallel arrays. for serial arrays the memory is restored when the
+//function returns(not dynamic allocation), So the only lose in serial case is visible just until
+//the function returns.
+void swap_and_release(device_array* lhs, device_array* rhs);
+
+void swap_and_release(base_array_t* lhs, base_array_t* rhs);
+
+//functions fallowing here are just the same function(the one in real/integer_array.c/h) declared with different names
+//this is done to be able to use the same generated code in normal c runtime and as well as in OpenCL kernels
+//which right now doesn't support overloading or the stdarg standard library.
+//even though the functions have the same body here they will have different body on the OpenCL counterparts
+
+modelica_real* real_array_element_addr_c99_1(real_array_t* source,int ndims,...);
+
+modelica_real* real_array_element_addr_c99_2(real_array_t* source,int ndims,...);
+
+modelica_real* real_array_element_addr_c99_3(real_array_t* source,int ndims,...);
+
+modelica_integer* integer_array_element_addr_c99_1(integer_array_t* source,int ndims,...);
+
+modelica_integer* integer_array_element_addr_c99_2(integer_array_t* source,int ndims,...);
+
+modelica_integer* integer_array_element_addr_c99_3(integer_array_t* source,int ndims,...);
+
+
+//array dimension size functions. returns the size of a given dimension for device real array
+modelica_integer size_of_dimension_real_array(device_real_array dev_arr, modelica_integer dim);
+
+//array dimension size functions. returns the size of a given dimension for device integer array
+modelica_integer size_of_dimension_integer_array(device_integer_array dev_arr, modelica_integer dim);
+
+//Free a device array memory.
+void free_device_array(device_array *dest);
+
+// This is just overloaded to allow the device arrays
+// be freed properly.
+void free_device_array(base_array_t* dest);
+
+//prints information about a device array. useful for debugging.
+void print_array_info(device_real_array* arr);
+
+//prints array. useful for debugging.
+void print_array(real_array_t* arr);
+
+//ATTENTION: printing a device array means copying back and then printing. Exprensive Operation.
+//void print_array(device_real_array* dev_arr);
+
+
+
+
+#endif
+
+
+
+
+
+

+ 106 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/ParModelica/explicit/openclrt/omc_ocl_memory_ops.h

@@ -0,0 +1,106 @@
+/*
+ * This file is part of OpenModelica.
+ *
+ * Copyright (c) 1998-CurrentYear, Linköping University,
+ * Department of Computer and Information Science,
+ * SE-58183 Linköping, Sweden.
+ *
+ * All rights reserved.
+ *
+ * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
+ * AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
+ * ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
+ *
+ * The OpenModelica software and the Open Source Modelica
+ * Consortium (OSMC) Public License (OSMC-PL) are obtained
+ * from Linköping University, either from the above address,
+ * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
+ * http://www.openmodelica.org, and in the OpenModelica distribution.
+ * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This program is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of  MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
+ * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
+ * OF OSMC-PL.
+ *
+ * See the full OSMC Public License conditions for more details.
+ *
+ */
+
+
+/*
+
+ This file contains functions for memory related operations.
+ Allocating, initializing, copying of memory on/from GPU/CPU
+ to GPU/CPU is handled by this functions.
+
+ Mahder.Gebremedhin@liu.se  2012-03-31
+
+*/
+
+
+#ifndef _OMC_OCL_MEMORY_OPS_H
+#define _OMC_OCL_MEMORY_OPS_H
+
+
+#include "omc_ocl_common_header.h"
+
+
+extern cl_command_queue device_comm_queue;
+extern cl_context  device_context;
+extern cl_device_id ocl_device;
+
+
+cl_mem ocl_device_alloc_init(modelica_integer* host_array, size_t size);
+
+cl_mem ocl_device_alloc_init(modelica_real* host_array, size_t size);
+
+cl_mem ocl_device_alloc(size_t size);
+
+
+//allocates memory space on device and returns the handle to the buffer object
+//also initializes if from host memory IF src_data is not NULL.
+//size is the actuall size in bytes.
+cl_mem ocl_alloc_init(void* src_data, size_t size);
+
+//ATTENTION: This function allocates a large amount of memory
+//to be used for creatinfg arrays inside parallel functions.
+//If this fails try reducing the amount by increasing the #define OCL_BUFFER_SIZE_FRACTION
+//which defines the freaction of memory from the availabel GLOBAL_MEM_SIZE to be used as buffer.
+void ocl_create_execution_memory_buffer(device_buffer* d_buff);
+
+//allocates a double array on device and returns the handle to the buffer object
+//also initializes if from host array IF host array is not NULL.
+//Use size 1 to allocate a Scalar.
+cl_mem ocl_alloc_init_real_arr(modelica_real* host_array, int a_size);
+
+//allocates an int array on device and returns the handle to the buffer object
+//also initializes if from host array IF host array is not NULL.
+//Use size 1 to allocate a Scalar.
+cl_mem ocl_alloc_init_integer_arr(modelica_integer* host_array, int a_size);
+
+
+
+//copies a double array to ALREADY allocated device buffer
+//Size is the number of elements in the src array
+void ocl_copy_to_device_real(cl_mem dev_dest_array, modelica_real* src_host_array, int a_size);
+
+//copies one buffer to another on the device
+//Size is the number of elements in the src array
+void ocl_copy_device_to_device_real(cl_mem dev_src_array, cl_mem device_dest_array, int a_size);
+
+//copies a double array back to host
+void ocl_copy_back_to_host_real(cl_mem dev_output_array, modelica_real* dest_host_array, int a_size);
+
+//copies an integer array to ALREADY allocated device buffer
+void ocl_copy_to_device_integer(cl_mem dev_dest_array, modelica_integer* src_host_array, int a_size);
+
+//Size is the number of elements in the src array
+void ocl_copy_device_to_device_integer(cl_mem dev_src_array, cl_mem device_dest_array, int a_size);
+
+//copies an int array back to host
+void ocl_copy_back_to_host_integer(cl_mem dev_output_array, modelica_integer* dest_host_array, int a_size);
+
+#endif

+ 158 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/blaswrap.h

@@ -0,0 +1,158 @@
+/* CLAPACK 3.0 BLAS wrapper macros
+ * Feb 5, 2000
+ */
+
+#ifndef __BLASWRAP_H
+#define __BLASWRAP_H
+
+#ifndef NO_BLAS_WRAP
+
+/* BLAS1 routines */
+#define srotg_ f2c_srotg
+#define drotg_ f2c_drotg
+#define srotmg_ f2c_srotmg
+#define drotmg_ f2c_drotmg
+#define srot_ f2c_srot
+#define drot_ f2c_drot
+#define srotm_ f2c_srotm
+#define drotm_ f2c_drotm
+#define sswap_ f2c_sswap
+#define dswap_ f2c_dswap
+#define cswap_ f2c_cswap
+#define zswap_ f2c_zswap
+#define sscal_ f2c_sscal
+#define dscal_ f2c_dscal
+#define cscal_ f2c_cscal
+#define zscal_ f2c_zscal
+#define csscal_ f2c_csscal
+#define zdscal_ f2c_zdscal
+#define scopy_ f2c_scopy
+#define dcopy_ f2c_dcopy
+#define ccopy_ f2c_ccopy
+#define zcopy_ f2c_zcopy
+#define saxpy_ f2c_saxpy
+#define daxpy_ f2c_daxpy
+#define caxpy_ f2c_caxpy
+#define zaxpy_ f2c_zaxpy
+#define sdot_ f2c_sdot
+#define ddot_ f2c_ddot
+#define cdotu_ f2c_cdotu
+#define zdotu_ f2c_zdotu
+#define cdotc_ f2c_cdotc
+#define zdotc_ f2c_zdotc
+#define snrm2_ f2c_snrm2
+#define dnrm2_ f2c_dnrm2
+#define scnrm2_ f2c_scnrm2
+#define dznrm2_ f2c_dznrm2
+#define sasum_ f2c_sasum
+#define dasum_ f2c_dasum
+#define scasum_ f2c_scasum
+#define dzasum_ f2c_dzasum
+#define isamax_ f2c_isamax
+#define idamax_ f2c_idamax
+#define icamax_ f2c_icamax
+#define izamax_ f2c_izamax
+
+/* BLAS2 routines */
+#define sgemv_ f2c_sgemv
+#define dgemv_ f2c_dgemv
+#define cgemv_ f2c_cgemv
+#define zgemv_ f2c_zgemv
+#define sgbmv_ f2c_sgbmv
+#define dgbmv_ f2c_dgbmv
+#define cgbmv_ f2c_cgbmv
+#define zgbmv_ f2c_zgbmv
+#define chemv_ f2c_chemv
+#define zhemv_ f2c_zhemv
+#define chbmv_ f2c_chbmv
+#define zhbmv_ f2c_zhbmv
+#define chpmv_ f2c_chpmv
+#define zhpmv_ f2c_zhpmv
+#define ssymv_ f2c_ssymv
+#define dsymv_ f2c_dsymv
+#define ssbmv_ f2c_ssbmv
+#define dsbmv_ f2c_dsbmv
+#define sspmv_ f2c_sspmv
+#define dspmv_ f2c_dspmv
+#define strmv_ f2c_strmv
+#define dtrmv_ f2c_dtrmv
+#define ctrmv_ f2c_ctrmv
+#define ztrmv_ f2c_ztrmv
+#define stbmv_ f2c_stbmv
+#define dtbmv_ f2c_dtbmv
+#define ctbmv_ f2c_ctbmv
+#define ztbmv_ f2c_ztbmv
+#define stpmv_ f2c_stpmv
+#define dtpmv_ f2c_dtpmv
+#define ctpmv_ f2c_ctpmv
+#define ztpmv_ f2c_ztpmv
+#define strsv_ f2c_strsv
+#define dtrsv_ f2c_dtrsv
+#define ctrsv_ f2c_ctrsv
+#define ztrsv_ f2c_ztrsv
+#define stbsv_ f2c_stbsv
+#define dtbsv_ f2c_dtbsv
+#define ctbsv_ f2c_ctbsv
+#define ztbsv_ f2c_ztbsv
+#define stpsv_ f2c_stpsv
+#define dtpsv_ f2c_dtpsv
+#define ctpsv_ f2c_ctpsv
+#define ztpsv_ f2c_ztpsv
+#define sger_ f2c_sger
+#define dger_ f2c_dger
+#define cgeru_ f2c_cgeru
+#define zgeru_ f2c_zgeru
+#define cgerc_ f2c_cgerc
+#define zgerc_ f2c_zgerc
+#define cher_ f2c_cher
+#define zher_ f2c_zher
+#define chpr_ f2c_chpr
+#define zhpr_ f2c_zhpr
+#define cher2_ f2c_cher2
+#define zher2_ f2c_zher2
+#define chpr2_ f2c_chpr2
+#define zhpr2_ f2c_zhpr2
+#define ssyr_ f2c_ssyr
+#define dsyr_ f2c_dsyr
+#define sspr_ f2c_sspr
+#define dspr_ f2c_dspr
+#define ssyr2_ f2c_ssyr2
+#define dsyr2_ f2c_dsyr2
+#define sspr2_ f2c_sspr2
+#define dspr2_ f2c_dspr2
+
+/* BLAS3 routines */
+#define sgemm_ f2c_sgemm
+#define dgemm_ f2c_dgemm
+#define cgemm_ f2c_cgemm
+#define zgemm_ f2c_zgemm
+#define ssymm_ f2c_ssymm
+#define dsymm_ f2c_dsymm
+#define csymm_ f2c_csymm
+#define zsymm_ f2c_zsymm
+#define chemm_ f2c_chemm
+#define zhemm_ f2c_zhemm
+#define ssyrk_ f2c_ssyrk
+#define dsyrk_ f2c_dsyrk
+#define csyrk_ f2c_csyrk
+#define zsyrk_ f2c_zsyrk
+#define cherk_ f2c_cherk
+#define zherk_ f2c_zherk
+#define ssyr2k_ f2c_ssyr2k
+#define dsyr2k_ f2c_dsyr2k
+#define csyr2k_ f2c_csyr2k
+#define zsyr2k_ f2c_zsyr2k
+#define cher2k_ f2c_cher2k
+#define zher2k_ f2c_zher2k
+#define strmm_ f2c_strmm
+#define dtrmm_ f2c_dtrmm
+#define ctrmm_ f2c_ctrmm
+#define ztrmm_ f2c_ztrmm
+#define strsm_ f2c_strsm
+#define dtrsm_ f2c_dtrsm
+#define ctrsm_ f2c_ctrsm
+#define ztrsm_ f2c_ztrsm
+
+#endif /* NO_BLAS_WRAP */
+
+#endif /* __BLASWRAP_H */

+ 160 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/blaswrap.h

@@ -0,0 +1,160 @@
+/* CLAPACK 3.0 BLAS wrapper macros
+ * Feb 5, 2000
+ */
+
+#ifndef __BLASWRAP_H
+#define __BLASWRAP_H
+
+#ifndef NO_BLAS_WRAP
+ 
+/* BLAS1 routines */
+#define srotg_ f2c_srotg
+#define crotg_ f2c_crotg
+#define drotg_ f2c_drotg
+#define zrotg_ f2c_zrotg
+#define srotmg_ f2c_srotmg
+#define drotmg_ f2c_drotmg
+#define srot_ f2c_srot
+#define drot_ f2c_drot
+#define srotm_ f2c_srotm
+#define drotm_ f2c_drotm
+#define sswap_ f2c_sswap
+#define dswap_ f2c_dswap
+#define cswap_ f2c_cswap
+#define zswap_ f2c_zswap
+#define sscal_ f2c_sscal
+#define dscal_ f2c_dscal
+#define cscal_ f2c_cscal
+#define zscal_ f2c_zscal
+#define csscal_ f2c_csscal
+#define zdscal_ f2c_zdscal
+#define scopy_ f2c_scopy
+#define dcopy_ f2c_dcopy
+#define ccopy_ f2c_ccopy
+#define zcopy_ f2c_zcopy
+#define saxpy_ f2c_saxpy
+#define daxpy_ f2c_daxpy
+#define caxpy_ f2c_caxpy
+#define zaxpy_ f2c_zaxpy
+#define sdot_ f2c_sdot
+#define ddot_ f2c_ddot
+#define cdotu_ f2c_cdotu
+#define zdotu_ f2c_zdotu
+#define cdotc_ f2c_cdotc
+#define zdotc_ f2c_zdotc
+#define snrm2_ f2c_snrm2
+#define dnrm2_ f2c_dnrm2
+#define scnrm2_ f2c_scnrm2
+#define dznrm2_ f2c_dznrm2
+#define sasum_ f2c_sasum
+#define dasum_ f2c_dasum
+#define scasum_ f2c_scasum
+#define dzasum_ f2c_dzasum
+#define isamax_ f2c_isamax
+#define idamax_ f2c_idamax
+#define icamax_ f2c_icamax
+#define izamax_ f2c_izamax
+ 
+/* BLAS2 routines */
+#define sgemv_ f2c_sgemv
+#define dgemv_ f2c_dgemv
+#define cgemv_ f2c_cgemv
+#define zgemv_ f2c_zgemv
+#define sgbmv_ f2c_sgbmv
+#define dgbmv_ f2c_dgbmv
+#define cgbmv_ f2c_cgbmv
+#define zgbmv_ f2c_zgbmv
+#define chemv_ f2c_chemv
+#define zhemv_ f2c_zhemv
+#define chbmv_ f2c_chbmv
+#define zhbmv_ f2c_zhbmv
+#define chpmv_ f2c_chpmv
+#define zhpmv_ f2c_zhpmv
+#define ssymv_ f2c_ssymv
+#define dsymv_ f2c_dsymv
+#define ssbmv_ f2c_ssbmv
+#define dsbmv_ f2c_dsbmv
+#define sspmv_ f2c_sspmv
+#define dspmv_ f2c_dspmv
+#define strmv_ f2c_strmv
+#define dtrmv_ f2c_dtrmv
+#define ctrmv_ f2c_ctrmv
+#define ztrmv_ f2c_ztrmv
+#define stbmv_ f2c_stbmv
+#define dtbmv_ f2c_dtbmv
+#define ctbmv_ f2c_ctbmv
+#define ztbmv_ f2c_ztbmv
+#define stpmv_ f2c_stpmv
+#define dtpmv_ f2c_dtpmv
+#define ctpmv_ f2c_ctpmv
+#define ztpmv_ f2c_ztpmv
+#define strsv_ f2c_strsv
+#define dtrsv_ f2c_dtrsv
+#define ctrsv_ f2c_ctrsv
+#define ztrsv_ f2c_ztrsv
+#define stbsv_ f2c_stbsv
+#define dtbsv_ f2c_dtbsv
+#define ctbsv_ f2c_ctbsv
+#define ztbsv_ f2c_ztbsv
+#define stpsv_ f2c_stpsv
+#define dtpsv_ f2c_dtpsv
+#define ctpsv_ f2c_ctpsv
+#define ztpsv_ f2c_ztpsv
+#define sger_ f2c_sger
+#define dger_ f2c_dger
+#define cgeru_ f2c_cgeru
+#define zgeru_ f2c_zgeru
+#define cgerc_ f2c_cgerc
+#define zgerc_ f2c_zgerc
+#define cher_ f2c_cher
+#define zher_ f2c_zher
+#define chpr_ f2c_chpr
+#define zhpr_ f2c_zhpr
+#define cher2_ f2c_cher2
+#define zher2_ f2c_zher2
+#define chpr2_ f2c_chpr2
+#define zhpr2_ f2c_zhpr2
+#define ssyr_ f2c_ssyr
+#define dsyr_ f2c_dsyr
+#define sspr_ f2c_sspr
+#define dspr_ f2c_dspr
+#define ssyr2_ f2c_ssyr2
+#define dsyr2_ f2c_dsyr2
+#define sspr2_ f2c_sspr2
+#define dspr2_ f2c_dspr2
+ 
+/* BLAS3 routines */
+#define sgemm_ f2c_sgemm
+#define dgemm_ f2c_dgemm
+#define cgemm_ f2c_cgemm
+#define zgemm_ f2c_zgemm
+#define ssymm_ f2c_ssymm
+#define dsymm_ f2c_dsymm
+#define csymm_ f2c_csymm
+#define zsymm_ f2c_zsymm
+#define chemm_ f2c_chemm
+#define zhemm_ f2c_zhemm
+#define ssyrk_ f2c_ssyrk
+#define dsyrk_ f2c_dsyrk
+#define csyrk_ f2c_csyrk
+#define zsyrk_ f2c_zsyrk
+#define cherk_ f2c_cherk
+#define zherk_ f2c_zherk
+#define ssyr2k_ f2c_ssyr2k
+#define dsyr2k_ f2c_dsyr2k
+#define csyr2k_ f2c_csyr2k
+#define zsyr2k_ f2c_zsyr2k
+#define cher2k_ f2c_cher2k
+#define zher2k_ f2c_zher2k
+#define strmm_ f2c_strmm
+#define dtrmm_ f2c_dtrmm
+#define ctrmm_ f2c_ctrmm
+#define ztrmm_ f2c_ztrmm
+#define strsm_ f2c_strsm
+#define dtrsm_ f2c_dtrsm
+#define ctrsm_ f2c_ctrsm
+#define ztrsm_ f2c_ztrsm
+
+#endif /* NO_BLAS_WRAP */
+
+#endif /* __BLASWRAP_H */

File diff suppressed because it is too large
+ 7262 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/clapack.h


+ 370 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/cminpack.h

@@ -0,0 +1,370 @@
+/* Header file for cminpack, by Frederic Devernay.
+   The documentation for all functions can be found in the file
+   minpack-documentation.txt from the distribution, or in the source
+   code of each function. */
+
+#ifndef __CMINPACK_H__
+#define __CMINPACK_H__
+
+/* The default floating-point type is "double" for C/C++ and "float" for CUDA,
+   but you can change this by defining one of the following symbols when
+   compiling the library, and before including cminpack.h when using it:
+   __cminpack_double__ for double
+   __cminpack_float__ for float
+   __cminpack_half__ for half from the OpenEXR library (in this case, you must
+                     compile cminpack with a C++ compiler)
+*/
+#ifdef __cminpack_double__
+#define __cminpack_real__ double
+#endif
+
+#ifdef __cminpack_float__
+#define __cminpack_real__ float
+#endif
+
+#ifdef __cminpack_half__
+#include <OpenEXR/half.h>
+#define __cminpack_real__ half
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Cmake will define cminpack_EXPORTS on Windows when it
+configures to build a shared library. If you are going to use
+another build system on windows or create the visual studio
+projects by hand you need to define cminpack_EXPORTS when
+building a DLL on windows.
+*/
+#if defined (__GNUC__)
+#define CMINPACK_DECLSPEC_EXPORT  __declspec(__dllexport__)
+#define CMINPACK_DECLSPEC_IMPORT  __declspec(__dllimport__)
+#endif
+#if defined (_MSC_VER) || defined (__BORLANDC__)
+#define CMINPACK_DECLSPEC_EXPORT  __declspec(dllexport)
+#define CMINPACK_DECLSPEC_IMPORT  __declspec(dllimport)
+#endif
+#ifdef __WATCOMC__
+#define CMINPACK_DECLSPEC_EXPORT  __export
+#define CMINPACK_DECLSPEC_IMPORT  __import
+#endif
+#ifdef __IBMC__
+#define CMINPACK_DECLSPEC_EXPORT  _Export
+#define CMINPACK_DECLSPEC_IMPORT  _Import
+#endif
+
+#if !defined(CMINPACK_NO_DLL) && (defined(__WIN32__) || defined(WIN32) || defined (_WIN32))
+#if defined(cminpack_EXPORTS) || defined(CMINPACK_EXPORTS) || defined(CMINPACK_DLL_EXPORTS)
+    #define  CMINPACK_EXPORT CMINPACK_DECLSPEC_EXPORT
+  #else
+    #define  CMINPACK_EXPORT CMINPACK_DECLSPEC_IMPORT
+  #endif /* cminpack_EXPORTS */
+#else /* defined (_WIN32) */
+ #define CMINPACK_EXPORT
+#endif
+
+#if defined(__CUDA_ARCH__) || defined(__CUDACC__)
+#define __cminpack_attr__ __device__
+#ifndef __cminpack_real__
+#define __cminpack_float__
+#define __cminpack_real__ float
+#endif
+#define __cminpack_type_fcn_nn__        __cminpack_attr__ int fcn_nn
+#define __cminpack_type_fcnder_nn__     __cminpack_attr__ int fcnder_nn
+#define __cminpack_type_fcn_mn__        __cminpack_attr__ int fcn_mn
+#define __cminpack_type_fcnder_mn__     __cminpack_attr__ int fcnder_mn
+#define __cminpack_type_fcnderstr_mn__  __cminpack_attr__ int fcnderstr_mn
+#define __cminpack_decl_fcn_nn__
+#define __cminpack_decl_fcnder_nn__
+#define __cminpack_decl_fcn_mn__
+#define __cminpack_decl_fcnder_mn__
+#define __cminpack_decl_fcnderstr_mn__
+#define __cminpack_param_fcn_nn__
+#define __cminpack_param_fcnder_nn__
+#define __cminpack_param_fcn_mn__
+#define __cminpack_param_fcnder_mn__
+#define __cminpack_param_fcnderstr_mn__
+#else
+#define __cminpack_attr__
+#ifndef __cminpack_real__
+#define __cminpack_double__
+#define __cminpack_real__ double
+#endif
+#define __cminpack_type_fcn_nn__        typedef int (*cminpack_func_nn)
+#define __cminpack_type_fcnder_nn__     typedef int (*cminpack_funcder_nn)
+#define __cminpack_type_fcn_mn__        typedef int (*cminpack_func_mn)
+#define __cminpack_type_fcnder_mn__     typedef int (*cminpack_funcder_mn)
+#define __cminpack_type_fcnderstr_mn__  typedef int (*cminpack_funcderstr_mn)
+#define __cminpack_decl_fcn_nn__        cminpack_func_nn fcn_nn,
+#define __cminpack_decl_fcnder_nn__     cminpack_funcder_nn fcnder_nn,
+#define __cminpack_decl_fcn_mn__        cminpack_func_mn fcn_mn,
+#define __cminpack_decl_fcnder_mn__     cminpack_funcder_mn fcnder_mn,
+#define __cminpack_decl_fcnderstr_mn__  cminpack_funcderstr_mn fcnderstr_mn,
+#define __cminpack_param_fcn_nn__       fcn_nn,
+#define __cminpack_param_fcnder_nn__    fcnder_nn,
+#define __cminpack_param_fcn_mn__       fcn_mn,
+#define __cminpack_param_fcnder_mn__    fcnder_mn,
+#define __cminpack_param_fcnderstr_mn__ fcnderstr_mn,
+#endif
+
+#ifdef __cminpack_double__
+#define __cminpack_func__(func) func
+#endif
+
+#ifdef __cminpack_float__
+#define __cminpack_func__(func) s ## func
+#endif
+
+#ifdef __cminpack_half__
+#define __cminpack_func__(func) h ## func
+#endif
+
+/* Declarations for minpack */
+
+/* Function types: */
+/* The first argument can be used to store extra function parameters, thus */
+/* avoiding the use of global variables. */
+/* the iflag parameter is input-only (with respect to the FORTRAN */
+/*  version), the output iflag value is the return value of the function. */
+/* If iflag=0, the function shoulkd just print the current values (see */
+/* the nprint parameters below). */
+  
+/* for hybrd1 and hybrd: */
+/*         calculate the functions at x and */
+/*         return this vector in fvec. */
+/* return a negative value to terminate hybrd1/hybrd */
+__cminpack_type_fcn_nn__(void *p, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec, int iflag );
+
+/* for hybrj1 and hybrj */
+/*         if iflag = 1 calculate the functions at x and */
+/*         return this vector in fvec. do not alter fjac. */
+/*         if iflag = 2 calculate the jacobian at x and */
+/*         return this matrix in fjac. do not alter fvec. */
+/* return a negative value to terminate hybrj1/hybrj */
+__cminpack_type_fcnder_nn__(void *p, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
+                                  int ldfjac, int iflag, void *user_data );
+
+/* for lmdif1 and lmdif */
+/*         calculate the functions at x and */
+/*         return this vector in fvec. */
+/*         if iflag = 1 the result is used to compute the residuals. */
+/*         if iflag = 2 the result is used to compute the Jacobian by finite differences. */
+/*         Jacobian computation requires exactly n function calls with iflag = 2. */
+/* return a negative value to terminate lmdif1/lmdif */
+__cminpack_type_fcn_mn__(void *p, int m, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec,
+                               int iflag );
+
+/* for lmder1 and lmder */
+/*         if iflag = 1 calculate the functions at x and */
+/*         return this vector in fvec. do not alter fjac. */
+/*         if iflag = 2 calculate the jacobian at x and */
+/*         return this matrix in fjac. do not alter fvec. */
+/* return a negative value to terminate lmder1/lmder */
+__cminpack_type_fcnder_mn__(void *p, int m, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec,
+                                  __cminpack_real__ *fjac, int ldfjac, int iflag );
+
+/* for lmstr1 and lmstr */
+/*         if iflag = 1 calculate the functions at x and */
+/*         return this vector in fvec. */
+/*         if iflag = i calculate the (i-1)-st row of the */
+/*         jacobian at x and return this vector in fjrow. */
+/* return a negative value to terminate lmstr1/lmstr */
+__cminpack_type_fcnderstr_mn__(void *p, int m, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec,
+                                     __cminpack_real__ *fjrow, int iflag );
+
+
+
+
+
+
+/* MINPACK functions: */
+/* the info parameter was removed from most functions: the return */
+/* value of the function is used instead. */
+/* The argument 'p' can be used to store extra function parameters, thus */
+/* avoiding the use of global variables. You can also think of it as a */
+/* 'this' pointer a la C++. */
+
+/* find a zero of a system of N nonlinear functions in N variables by
+   a modification of the Powell hybrid method (Jacobian calculated by
+   a forward-difference approximation) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(hybrd1)( __cminpack_decl_fcn_nn__ 
+	       void *p, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ tol,
+	       __cminpack_real__ *wa, int lwa );
+
+/* find a zero of a system of N nonlinear functions in N variables by
+   a modification of the Powell hybrid method (Jacobian calculated by
+   a forward-difference approximation, more general). */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(hybrd)( __cminpack_decl_fcn_nn__
+	      void *p, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ xtol, int maxfev,
+	      int ml, int mu, __cminpack_real__ epsfcn, __cminpack_real__ *diag, int mode,
+	      __cminpack_real__ factor, int nprint, int *nfev,
+	      __cminpack_real__ *fjac, int ldfjac, __cminpack_real__ *r, int lr, __cminpack_real__ *qtf,
+	      __cminpack_real__ *wa1, __cminpack_real__ *wa2, __cminpack_real__ *wa3, __cminpack_real__ *wa4);
+  
+/* find a zero of a system of N nonlinear functions in N variables by
+   a modification of the Powell hybrid method (user-supplied Jacobian) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(hybrj1)( __cminpack_decl_fcnder_nn__ void *p, int n, __cminpack_real__ *x,
+	       __cminpack_real__ *fvec, __cminpack_real__ *fjac, int ldfjac, __cminpack_real__ tol,
+	       __cminpack_real__ *wa, int lwa, void *user_data );
+          
+/* find a zero of a system of N nonlinear functions in N variables by
+   a modification of the Powell hybrid method (user-supplied Jacobian,
+   more general) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(hybrj)( __cminpack_decl_fcnder_nn__ void *p, int n, __cminpack_real__ *x,
+	      __cminpack_real__ *fvec, __cminpack_real__ *fjac, int ldfjac, __cminpack_real__ xtol,
+	      int maxfev, __cminpack_real__ *diag, int mode, __cminpack_real__ factor,
+	      int nprint, int *nfev, int *njev, __cminpack_real__ *r,
+	      int lr, __cminpack_real__ *qtf, __cminpack_real__ *wa1, __cminpack_real__ *wa2,
+	      __cminpack_real__ *wa3, __cminpack_real__ *wa4, void *user_data );
+
+/* minimize the sum of the squares of nonlinear functions in N
+   variables by a modification of the Levenberg-Marquardt algorithm
+   (Jacobian calculated by a forward-difference approximation) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(lmdif1)( __cminpack_decl_fcn_mn__
+	       void *p, int m, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ tol,
+	       int *iwa, __cminpack_real__ *wa, int lwa );
+
+/* minimize the sum of the squares of nonlinear functions in N
+   variables by a modification of the Levenberg-Marquardt algorithm
+   (Jacobian calculated by a forward-difference approximation, more
+   general) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(lmdif)( __cminpack_decl_fcn_mn__
+	      void *p, int m, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ ftol,
+	      __cminpack_real__ xtol, __cminpack_real__ gtol, int maxfev, __cminpack_real__ epsfcn,
+	      __cminpack_real__ *diag, int mode, __cminpack_real__ factor, int nprint,
+	      int *nfev, __cminpack_real__ *fjac, int ldfjac, int *ipvt,
+	      __cminpack_real__ *qtf, __cminpack_real__ *wa1, __cminpack_real__ *wa2, __cminpack_real__ *wa3,
+	      __cminpack_real__ *wa4 );
+
+/* minimize the sum of the squares of nonlinear functions in N
+   variables by a modification of the Levenberg-Marquardt algorithm
+   (user-supplied Jacobian) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(lmder1)( __cminpack_decl_fcnder_mn__
+	       void *p, int m, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
+	       int ldfjac, __cminpack_real__ tol, int *ipvt,
+	       __cminpack_real__ *wa, int lwa );
+
+/* minimize the sum of the squares of nonlinear functions in N
+   variables by a modification of the Levenberg-Marquardt algorithm
+   (user-supplied Jacobian, more general) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(lmder)( __cminpack_decl_fcnder_mn__
+	      void *p, int m, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
+	      int ldfjac, __cminpack_real__ ftol, __cminpack_real__ xtol, __cminpack_real__ gtol,
+	      int maxfev, __cminpack_real__ *diag, int mode, __cminpack_real__ factor,
+	      int nprint, int *nfev, int *njev, int *ipvt,
+	      __cminpack_real__ *qtf, __cminpack_real__ *wa1, __cminpack_real__ *wa2, __cminpack_real__ *wa3,
+	      __cminpack_real__ *wa4 );
+
+/* minimize the sum of the squares of nonlinear functions in N
+   variables by a modification of the Levenberg-Marquardt algorithm
+   (user-supplied Jacobian, minimal storage) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(lmstr1)( __cminpack_decl_fcnderstr_mn__ void *p, int m, int n,
+	       __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac, int ldfjac,
+	       __cminpack_real__ tol, int *ipvt, __cminpack_real__ *wa, int lwa );
+
+/* minimize the sum of the squares of nonlinear functions in N
+   variables by a modification of the Levenberg-Marquardt algorithm
+   (user-supplied Jacobian, minimal storage, more general) */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(lmstr)(  __cminpack_decl_fcnderstr_mn__ void *p, int m,
+	      int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
+	      int ldfjac, __cminpack_real__ ftol, __cminpack_real__ xtol, __cminpack_real__ gtol,
+	      int maxfev, __cminpack_real__ *diag, int mode, __cminpack_real__ factor,
+	      int nprint, int *nfev, int *njev, int *ipvt,
+	      __cminpack_real__ *qtf, __cminpack_real__ *wa1, __cminpack_real__ *wa2, __cminpack_real__ *wa3,
+	      __cminpack_real__ *wa4 );
+ 
+__cminpack_attr__
+void CMINPACK_EXPORT __cminpack_func__(chkder)( int m, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
+	       int ldfjac, __cminpack_real__ *xp, __cminpack_real__ *fvecp, int mode,
+	       __cminpack_real__ *err  );
+
+__cminpack_attr__
+__cminpack_real__ CMINPACK_EXPORT __cminpack_func__(dpmpar)( int i );
+
+__cminpack_attr__
+__cminpack_real__ CMINPACK_EXPORT __cminpack_func__(enorm)( int n, const __cminpack_real__ *x );
+
+/* compute a forward-difference approximation to the m by n jacobian
+   matrix associated with a specified problem of m functions in n
+   variables. */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(fdjac2)(__cminpack_decl_fcn_mn__
+	     void *p, int m, int n, __cminpack_real__ *x, const __cminpack_real__ *fvec, __cminpack_real__ *fjac,
+	     int ldfjac, __cminpack_real__ epsfcn, __cminpack_real__ *wa);
+
+/* compute a forward-difference approximation to the n by n jacobian
+   matrix associated with a specified problem of n functions in n
+   variables. if the jacobian has a banded form, then function
+   evaluations are saved by only approximating the nonzero terms. */
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(fdjac1)(__cminpack_decl_fcn_nn__
+	     void *p, int n, __cminpack_real__ *x, const __cminpack_real__ *fvec, __cminpack_real__ *fjac, int ldfjac,
+	     int ml, int mu, __cminpack_real__ epsfcn, __cminpack_real__ *wa1,
+	     __cminpack_real__ *wa2);
+
+/* compute inverse(JtJ) after a run of lmdif or lmder. The covariance matrix is obtained
+   by scaling the result by enorm(y)**2/(m-n). If JtJ is singular and k = rank(J), the
+   pseudo-inverse is computed, and the result has to be scaled by enorm(y)**2/(m-k). */
+__cminpack_attr__
+void CMINPACK_EXPORT __cminpack_func__(covar)(int n, __cminpack_real__ *r, int ldr, 
+           const int *ipvt, __cminpack_real__ tol, __cminpack_real__ *wa);
+
+/* covar1 estimates the variance-covariance matrix:
+   C = sigma**2 (JtJ)**+
+   where (JtJ)**+ is the inverse of JtJ or the pseudo-inverse of JtJ (in case J does not have full rank),
+   and sigma**2 = fsumsq / (m - k)
+   where fsumsq is the residual sum of squares and k is the rank of J.
+   The function returns 0 if J has full rank, else the rank of J.
+*/
+__cminpack_attr__
+int CMINPACK_EXPORT __cminpack_func__(covar1)(int m, int n, __cminpack_real__ fsumsq, __cminpack_real__ *r, int ldr, 
+                           const int *ipvt, __cminpack_real__ tol, __cminpack_real__ *wa);
+
+/* internal MINPACK subroutines */
+__cminpack_attr__
+void __cminpack_func__(dogleg)(int n, const __cminpack_real__ *r, int lr, 
+             const __cminpack_real__ *diag, const __cminpack_real__ *qtb, __cminpack_real__ delta, __cminpack_real__ *x, 
+             __cminpack_real__ *wa1, __cminpack_real__ *wa2);
+__cminpack_attr__
+void __cminpack_func__(qrfac)(int m, int n, __cminpack_real__ *a, int
+            lda, int pivot, int *ipvt, int lipvt, __cminpack_real__ *rdiag,
+            __cminpack_real__ *acnorm, __cminpack_real__ *wa);
+__cminpack_attr__
+void __cminpack_func__(qrsolv)(int n, __cminpack_real__ *r, int ldr, 
+             const int *ipvt, const __cminpack_real__ *diag, const __cminpack_real__ *qtb, __cminpack_real__ *x, 
+             __cminpack_real__ *sdiag, __cminpack_real__ *wa);
+__cminpack_attr__
+void __cminpack_func__(qform)(int m, int n, __cminpack_real__ *q, int
+            ldq, __cminpack_real__ *wa);
+__cminpack_attr__
+void __cminpack_func__(r1updt)(int m, int n, __cminpack_real__ *s, int
+             ls, const __cminpack_real__ *u, __cminpack_real__ *v, __cminpack_real__ *w, int *sing);
+__cminpack_attr__
+void __cminpack_func__(r1mpyq)(int m, int n, __cminpack_real__ *a, int
+             lda, const __cminpack_real__ *v, const __cminpack_real__ *w);
+__cminpack_attr__
+void __cminpack_func__(lmpar)(int n, __cminpack_real__ *r, int ldr, 
+            const int *ipvt, const __cminpack_real__ *diag, const __cminpack_real__ *qtb, __cminpack_real__ delta, 
+            __cminpack_real__ *par, __cminpack_real__ *x, __cminpack_real__ *sdiag, __cminpack_real__ *wa1, 
+            __cminpack_real__ *wa2);
+__cminpack_attr__
+void __cminpack_func__(rwupdt)(int n, __cminpack_real__ *r, int ldr, 
+             const __cminpack_real__ *w, __cminpack_real__ *b, __cminpack_real__ *alpha, __cminpack_real__ *cos, 
+             __cminpack_real__ *sin);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __CMINPACK_H__ */

+ 389 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/dgemm.c

@@ -0,0 +1,389 @@
+/* dgemm.f -- translated by f2c (version 20061008).
+   You must link the resulting object file with libf2c:
+	on Microsoft Windows system, link with libf2c.lib;
+	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
+	or, if you install libf2c.a in a standard place, with -lf2c -lm
+	-- in that order, at the end of the command line, as in
+		cc *.o -lf2c -lm
+	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
+
+		http://www.netlib.org/f2c/libf2c.zip
+*/
+
+#include "f2c.h"
+#include "blaswrap.h"
+
+/* Subroutine */ int dgemm_(char *transa, char *transb, integer *m, integer *
+	n, integer *k, doublereal *alpha, doublereal *a, integer *lda, 
+	doublereal *b, integer *ldb, doublereal *beta, doublereal *c__, 
+	integer *ldc)
+{
+    /* System generated locals */
+    integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2, 
+	    i__3;
+
+    /* Local variables */
+    integer i__, j, l, info;
+    logical nota, notb;
+    doublereal temp;
+    integer ncola;
+    extern logical lsame_(char *, char *);
+    integer nrowa, nrowb;
+    extern /* Subroutine */ int xerbla_(char *, integer *);
+
+/*     .. Scalar Arguments .. */
+/*     .. */
+/*     .. Array Arguments .. */
+/*     .. */
+
+/*  Purpose */
+/*  ======= */
+
+/*  DGEMM  performs one of the matrix-matrix operations */
+
+/*     C := alpha*op( A )*op( B ) + beta*C, */
+
+/*  where  op( X ) is one of */
+
+/*     op( X ) = X   or   op( X ) = X', */
+
+/*  alpha and beta are scalars, and A, B and C are matrices, with op( A ) */
+/*  an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix. */
+
+/*  Arguments */
+/*  ========== */
+
+/*  TRANSA - CHARACTER*1. */
+/*           On entry, TRANSA specifies the form of op( A ) to be used in */
+/*           the matrix multiplication as follows: */
+
+/*              TRANSA = 'N' or 'n',  op( A ) = A. */
+
+/*              TRANSA = 'T' or 't',  op( A ) = A'. */
+
+/*              TRANSA = 'C' or 'c',  op( A ) = A'. */
+
+/*           Unchanged on exit. */
+
+/*  TRANSB - CHARACTER*1. */
+/*           On entry, TRANSB specifies the form of op( B ) to be used in */
+/*           the matrix multiplication as follows: */
+
+/*              TRANSB = 'N' or 'n',  op( B ) = B. */
+
+/*              TRANSB = 'T' or 't',  op( B ) = B'. */
+
+/*              TRANSB = 'C' or 'c',  op( B ) = B'. */
+
+/*           Unchanged on exit. */
+
+/*  M      - INTEGER. */
+/*           On entry,  M  specifies  the number  of rows  of the  matrix */
+/*           op( A )  and of the  matrix  C.  M  must  be at least  zero. */
+/*           Unchanged on exit. */
+
+/*  N      - INTEGER. */
+/*           On entry,  N  specifies the number  of columns of the matrix */
+/*           op( B ) and the number of columns of the matrix C. N must be */
+/*           at least zero. */
+/*           Unchanged on exit. */
+
+/*  K      - INTEGER. */
+/*           On entry,  K  specifies  the number of columns of the matrix */
+/*           op( A ) and the number of rows of the matrix op( B ). K must */
+/*           be at least  zero. */
+/*           Unchanged on exit. */
+
+/*  ALPHA  - DOUBLE PRECISION. */
+/*           On entry, ALPHA specifies the scalar alpha. */
+/*           Unchanged on exit. */
+
+/*  A      - DOUBLE PRECISION array of DIMENSION ( LDA, ka ), where ka is */
+/*           k  when  TRANSA = 'N' or 'n',  and is  m  otherwise. */
+/*           Before entry with  TRANSA = 'N' or 'n',  the leading  m by k */
+/*           part of the array  A  must contain the matrix  A,  otherwise */
+/*           the leading  k by m  part of the array  A  must contain  the */
+/*           matrix A. */
+/*           Unchanged on exit. */
+
+/*  LDA    - INTEGER. */
+/*           On entry, LDA specifies the first dimension of A as declared */
+/*           in the calling (sub) program. When  TRANSA = 'N' or 'n' then */
+/*           LDA must be at least  lmax( 1, m ), otherwise  LDA must be at */
+/*           least  lmax( 1, k ). */
+/*           Unchanged on exit. */
+
+/*  B      - DOUBLE PRECISION array of DIMENSION ( LDB, kb ), where kb is */
+/*           n  when  TRANSB = 'N' or 'n',  and is  k  otherwise. */
+/*           Before entry with  TRANSB = 'N' or 'n',  the leading  k by n */
+/*           part of the array  B  must contain the matrix  B,  otherwise */
+/*           the leading  n by k  part of the array  B  must contain  the */
+/*           matrix B. */
+/*           Unchanged on exit. */
+
+/*  LDB    - INTEGER. */
+/*           On entry, LDB specifies the first dimension of B as declared */
+/*           in the calling (sub) program. When  TRANSB = 'N' or 'n' then */
+/*           LDB must be at least  lmax( 1, k ), otherwise  LDB must be at */
+/*           least  lmax( 1, n ). */
+/*           Unchanged on exit. */
+
+/*  BETA   - DOUBLE PRECISION. */
+/*           On entry,  BETA  specifies the scalar  beta.  When  BETA  is */
+/*           supplied as zero then C need not be set on input. */
+/*           Unchanged on exit. */
+
+/*  C      - DOUBLE PRECISION array of DIMENSION ( LDC, n ). */
+/*           Before entry, the leading  m by n  part of the array  C must */
+/*           contain the matrix  C,  except when  beta  is zero, in which */
+/*           case C need not be set on entry. */
+/*           On exit, the array  C  is overwritten by the  m by n  matrix */
+/*           ( alpha*op( A )*op( B ) + beta*C ). */
+
+/*  LDC    - INTEGER. */
+/*           On entry, LDC specifies the first dimension of C as declared */
+/*           in  the  calling  (sub)  program.   LDC  must  be  at  least */
+/*           lmax( 1, m ). */
+/*           Unchanged on exit. */
+
+
+/*  Level 3 Blas routine. */
+
+/*  -- Written on 8-February-1989. */
+/*     Jack Dongarra, Argonne National Laboratory. */
+/*     Iain Duff, AERE Harwell. */
+/*     Jeremy Du Croz, Numerical Algorithms Group Ltd. */
+/*     Sven Hammarling, Numerical Algorithms Group Ltd. */
+
+
+/*     .. External Functions .. */
+/*     .. */
+/*     .. External Subroutines .. */
+/*     .. */
+/*     .. Intrinsic Functions .. */
+/*     .. */
+/*     .. Local Scalars .. */
+/*     .. */
+/*     .. Parameters .. */
+/*     .. */
+
+/*     Set  NOTA  and  NOTB  as  true if  A  and  B  respectively are not */
+/*     transposed and set  NROWA, NCOLA and  NROWB  as the number of rows */
+/*     and  columns of  A  and the  number of  rows  of  B  respectively. */
+
+    /* Parameter adjustments */
+    a_dim1 = *lda;
+    a_offset = 1 + a_dim1;
+    a -= a_offset;
+    b_dim1 = *ldb;
+    b_offset = 1 + b_dim1;
+    b -= b_offset;
+    c_dim1 = *ldc;
+    c_offset = 1 + c_dim1;
+    c__ -= c_offset;
+
+    /* Function Body */
+    nota = lsame_(transa, "N");
+    notb = lsame_(transb, "N");
+    if (nota) {
+	nrowa = *m;
+	ncola = *k;
+    } else {
+	nrowa = *k;
+	ncola = *m;
+    }
+    if (notb) {
+	nrowb = *k;
+    } else {
+	nrowb = *n;
+    }
+
+/*     Test the input parameters. */
+
+    info = 0;
+    if (! nota && ! lsame_(transa, "C") && ! lsame_(
+	    transa, "T")) {
+	info = 1;
+    } else if (! notb && ! lsame_(transb, "C") && ! 
+	    lsame_(transb, "T")) {
+	info = 2;
+    } else if (*m < 0) {
+	info = 3;
+    } else if (*n < 0) {
+	info = 4;
+    } else if (*k < 0) {
+	info = 5;
+    } else if (*lda < lmax(1,nrowa)) {
+	info = 8;
+    } else if (*ldb < lmax(1,nrowb)) {
+	info = 10;
+    } else if (*ldc < lmax(1,*m)) {
+	info = 13;
+    }
+    if (info != 0) {
+	xerbla_("DGEMM ", &info);
+	return 0;
+    }
+
+/*     Quick return if possible. */
+
+    if (*m == 0 || *n == 0 || (*alpha == 0. || *k == 0) && *beta == 1.) {
+	return 0;
+    }
+
+/*     And if  alpha.eq.zero. */
+
+    if (*alpha == 0.) {
+	if (*beta == 0.) {
+	    i__1 = *n;
+	    for (j = 1; j <= i__1; ++j) {
+		i__2 = *m;
+		for (i__ = 1; i__ <= i__2; ++i__) {
+		    c__[i__ + j * c_dim1] = 0.;
+/* L10: */
+		}
+/* L20: */
+	    }
+	} else {
+	    i__1 = *n;
+	    for (j = 1; j <= i__1; ++j) {
+		i__2 = *m;
+		for (i__ = 1; i__ <= i__2; ++i__) {
+		    c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
+/* L30: */
+		}
+/* L40: */
+	    }
+	}
+	return 0;
+    }
+
+/*     Start the operations. */
+
+    if (notb) {
+	if (nota) {
+
+/*           Form  C := alpha*A*B + beta*C. */
+
+	    i__1 = *n;
+	    for (j = 1; j <= i__1; ++j) {
+		if (*beta == 0.) {
+		    i__2 = *m;
+		    for (i__ = 1; i__ <= i__2; ++i__) {
+			c__[i__ + j * c_dim1] = 0.;
+/* L50: */
+		    }
+		} else if (*beta != 1.) {
+		    i__2 = *m;
+		    for (i__ = 1; i__ <= i__2; ++i__) {
+			c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
+/* L60: */
+		    }
+		}
+		i__2 = *k;
+		for (l = 1; l <= i__2; ++l) {
+		    if (b[l + j * b_dim1] != 0.) {
+			temp = *alpha * b[l + j * b_dim1];
+			i__3 = *m;
+			for (i__ = 1; i__ <= i__3; ++i__) {
+			    c__[i__ + j * c_dim1] += temp * a[i__ + l * 
+				    a_dim1];
+/* L70: */
+			}
+		    }
+/* L80: */
+		}
+/* L90: */
+	    }
+	} else {
+
+/*           Form  C := alpha*A'*B + beta*C */
+
+	    i__1 = *n;
+	    for (j = 1; j <= i__1; ++j) {
+		i__2 = *m;
+		for (i__ = 1; i__ <= i__2; ++i__) {
+		    temp = 0.;
+		    i__3 = *k;
+		    for (l = 1; l <= i__3; ++l) {
+			temp += a[l + i__ * a_dim1] * b[l + j * b_dim1];
+/* L100: */
+		    }
+		    if (*beta == 0.) {
+			c__[i__ + j * c_dim1] = *alpha * temp;
+		    } else {
+			c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
+				i__ + j * c_dim1];
+		    }
+/* L110: */
+		}
+/* L120: */
+	    }
+	}
+    } else {
+	if (nota) {
+
+/*           Form  C := alpha*A*B' + beta*C */
+
+	    i__1 = *n;
+	    for (j = 1; j <= i__1; ++j) {
+		if (*beta == 0.) {
+		    i__2 = *m;
+		    for (i__ = 1; i__ <= i__2; ++i__) {
+			c__[i__ + j * c_dim1] = 0.;
+/* L130: */
+		    }
+		} else if (*beta != 1.) {
+		    i__2 = *m;
+		    for (i__ = 1; i__ <= i__2; ++i__) {
+			c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
+/* L140: */
+		    }
+		}
+		i__2 = *k;
+		for (l = 1; l <= i__2; ++l) {
+		    if (b[j + l * b_dim1] != 0.) {
+			temp = *alpha * b[j + l * b_dim1];
+			i__3 = *m;
+			for (i__ = 1; i__ <= i__3; ++i__) {
+			    c__[i__ + j * c_dim1] += temp * a[i__ + l * 
+				    a_dim1];
+/* L150: */
+			}
+		    }
+/* L160: */
+		}
+/* L170: */
+	    }
+	} else {
+
+/*           Form  C := alpha*A'*B' + beta*C */
+
+	    i__1 = *n;
+	    for (j = 1; j <= i__1; ++j) {
+		i__2 = *m;
+		for (i__ = 1; i__ <= i__2; ++i__) {
+		    temp = 0.;
+		    i__3 = *k;
+		    for (l = 1; l <= i__3; ++l) {
+			temp += a[l + i__ * a_dim1] * b[j + l * b_dim1];
+/* L180: */
+		    }
+		    if (*beta == 0.) {
+			c__[i__ + j * c_dim1] = *alpha * temp;
+		    } else {
+			c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
+				i__ + j * c_dim1];
+		    }
+/* L190: */
+		}
+/* L200: */
+	    }
+	}
+    }
+
+    return 0;
+
+/*     End of DGEMM . */
+
+} /* dgemm_ */

+ 0 - 0
SemanticAdaptationForFMI/Experiments/power_window_case_study/fmu20/fmu/cs/PW_PowerSystem/sources/include/external_solvers/dger.c


Some files were not shown because too many files changed in this diff