Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ __pycache__
.idea/
*.fmu
*.zip
*_out.csv
/venv/
tests/work/
302 changes: 302 additions & 0 deletions BouncingBall/BouncingBall_out.csv

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions BouncingBall/fmi-ls-ref.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<fmiReferences
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fmi-ls="http://fmi-standard.org/fmi-ls-manifest"
fmi-ls:fmi-ls-name="org.fmi-standard.fmi-ls-ref"
fmi-ls:fmi-ls-version="1.0.0-alpha.1">
<Related type="text/csv" source="BouncingBall_out.csv" role="result" description="Output of the default experiment"/>
</fmiReferences>
48 changes: 35 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,20 @@ SET(SOURCES
${MODEL_NAME}/model.c
src/fmi${FMI_VERSION}Functions.c
src/cosimulation.c
)

add_library(${TARGET_NAME} SHARED
${HEADERS}
${SOURCES}
${MODEL_NAME}/buildDescription.xml
${MODEL_NAME}/FMI${FMI_VERSION}.xml
)

if("${MODEL_NAME}" STREQUAL "Resource")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/y.txt")
endif()

if(NOT "${MODEL_NAME}" STREQUAL "Clocks")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/fmi-ls-ref.xml")
endif()

add_library(${TARGET_NAME} SHARED ${HEADERS} ${SOURCES})

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fmus)

target_compile_definitions(${TARGET_NAME} PRIVATE
Expand Down Expand Up @@ -185,10 +190,28 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)

# modelDescription.xml
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/FMI${FMI_VERSION}.xml
"${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/FMI${FMI_VERSION}.xml"
"${FMU_BUILD_DIR}/modelDescription.xml"
)

set(ARCHIVE_FILES "modelDescription.xml" "binaries" "sources")

if(NOT "${MODEL_NAME}" STREQUAL "Clocks")
# fmi-ls-ref.xml
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/fmi-ls-ref.xml"
"${FMU_BUILD_DIR}/extras/org.fmi-standard.fmi-ls-ref/fmi-ls-manifest.xml"
)

# {model_name}_out.csv
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/${MODEL_NAME}_out.csv"
"${FMU_BUILD_DIR}/extras/org.fmi-standard.fmi-ls-ref/${MODEL_NAME}_out.csv"
)

list(APPEND ARCHIVE_FILES "extras")
endif()

# model specific header and source
foreach (SOURCE_FILE config.h model.c)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
Expand Down Expand Up @@ -226,14 +249,13 @@ else()
)
endif()

set(ARCHIVE_FILES "modelDescription.xml" "binaries" "sources")

if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/resources")
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/resources"
"${FMU_BUILD_DIR}/resources/"
# resources/y.txt
if("${MODEL_NAME}" STREQUAL "Resource")
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/${MODEL_NAME}/y.txt"
"${FMU_BUILD_DIR}/resources/y.txt"
)
set(ARCHIVE_FILES ${ARCHIVE_FILES} "resources")
list(APPEND ARCHIVE_FILES "resources")
endif()

# delete unintended files from binaries (Release configuration only)
Expand Down
102 changes: 102 additions & 0 deletions Dahlquist/Dahlquist_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
time,x
0,1
0.1,0.9
0.2,0.81
0.30000000000000004,0.7290000000000001
0.4,0.6561000000000001
0.5,0.5904900000000001
0.6000000000000001,0.531441
0.7000000000000001,0.4782969
0.8,0.43046721
0.9,0.387420489
1,0.3486784401
1.1,0.31381059609
1.2000000000000002,0.282429536481
1.3,0.2541865828329
1.4000000000000001,0.22876792454961
1.5,0.20589113209464902
1.6,0.1853020188851841
1.7000000000000002,0.16677181699666568
1.8,0.15009463529699912
1.9000000000000001,0.1350851717672992
2,0.12157665459056928
2.1,0.10941898913151235
2.2,0.09847709021836111
2.3000000000000003,0.088629381196525
2.4000000000000004,0.0797664430768725
2.5,0.07178979876918525
2.6,0.06461081889226672
2.7,0.05814973700304005
2.8000000000000003,0.052334763302736044
2.9000000000000004,0.047101286972462436
3,0.042391158275216195
3.1,0.03815204244769457
3.2,0.034336838202925116
3.3000000000000003,0.030903154382632605
3.4000000000000004,0.027812838944369346
3.5,0.02503155504993241
3.6,0.022528399544939168
3.7,0.02027555959044525
3.8000000000000003,0.018248003631400726
3.9000000000000004,0.016423203268260654
4,0.014780882941434589
4.1000000000000005,0.01330279464729113
4.2,0.011972515182562017
4.3,0.010775263664305815
4.4,0.009697737297875235
4.5,0.00872796356808771
4.6000000000000005,0.00785516721127894
4.7,0.007069650490151046
4.800000000000001,0.006362685441135941
4.9,0.005726416897022347
5,0.005153775207320112
5.1000000000000005,0.0046383976865881004
5.2,0.0041745579179292905
5.300000000000001,0.0037571021261363613
5.4,0.0033813919135227254
5.5,0.003043252722170453
5.6000000000000005,0.002738927449953408
5.7,0.0024650347049580672
5.800000000000001,0.0022185312344622605
5.9,0.0019966781110160345
6,0.0017970102999144309
6.1000000000000005,0.0016173092699229878
6.2,0.001455578342930689
6.300000000000001,0.0013100205086376202
6.4,0.001179018457773858
6.5,0.0010611166119964723
6.6000000000000005,0.0009550049507968251
6.7,0.0008595044557171426
6.800000000000001,0.0007735540101454283
6.9,0.0006961986091308855
7,0.0006265787482177969
7.1000000000000005,0.0005639208733960172
7.2,0.0005075287860564154
7.300000000000001,0.0004567759074507739
7.4,0.0004110983167056965
7.5,0.00036998848503512683
7.6000000000000005,0.00033298963653161415
7.7,0.00029969067287845274
7.800000000000001,0.00026972160559060745
7.9,0.0002427494450315467
8,0.00021847450052839203
8.1,0.00019662705047555283
8.200000000000001,0.00017696434542799753
8.3,0.00015926791088519777
8.4,0.00014334111979667798
8.5,0.0001290070078170102
8.6,0.00011610630703530917
8.700000000000001,0.00010449567633177826
8.8,0.00009404610869860043
8.9,0.00008464149782874038
9,0.00007617734804586634
9.1,0.0000685596132412797
9.200000000000001,0.00006170365191715173
9.3,0.00005553328672543656
9.4,0.0000499799580528929
9.5,0.000044981962247603614
9.600000000000001,0.00004048376602284325
9.700000000000001,0.00003643538942055893
9.8,0.00003279185047850304
9.9,0.000029512665430652733
10,0.00002656139888758746
8 changes: 8 additions & 0 deletions Dahlquist/fmi-ls-ref.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<fmiReferences
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fmi-ls="http://fmi-standard.org/fmi-ls-manifest"
fmi-ls:fmi-ls-name="org.fmi-standard.fmi-ls-ref"
fmi-ls:fmi-ls-version="1.0.0-alpha.1">
<Related type="text/csv" source="Dahlquist_out.csv" role="result" description="Output of the default experiment"/>
</fmiReferences>
22 changes: 22 additions & 0 deletions Feedthrough/Feedthrough_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
time,Float32_continuous_output,Float32_discrete_output,Float64_continuous_output,Float64_discrete_output,Int8_output,UInt8_output,Int16_output,UInt16_output,Int32_output,UInt32_output,Int64_output,UInt64_output,Boolean_output,String_output,Binary_output,Enumeration_output
0,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.1,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.2,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.30000000000000004,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.4,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.5,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.6000000000000001,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.7000000000000001,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.8,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
0.9,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.1,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.2000000000000002,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.3,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.4000000000000001,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.5,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.6,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.7000000000000002,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.8,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
1.9000000000000001,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
2,0,0,0,0,0,0,0,0,0,0,0,0,false,Set me!,666f6f,1
8 changes: 8 additions & 0 deletions Feedthrough/fmi-ls-ref.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<fmiReferences
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fmi-ls="http://fmi-standard.org/fmi-ls-manifest"
fmi-ls:fmi-ls-name="org.fmi-standard.fmi-ls-ref"
fmi-ls:fmi-ls-version="1.0.0-alpha.1">
<Related type="text/csv" source="Feedthrough_out.csv" role="result" description="Output of the default experiment"/>
</fmiReferences>
3 changes: 3 additions & 0 deletions Resource/Resource_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
time,y
0,97
1,97
8 changes: 8 additions & 0 deletions Resource/fmi-ls-ref.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<fmiReferences
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fmi-ls="http://fmi-standard.org/fmi-ls-manifest"
fmi-ls:fmi-ls-name="org.fmi-standard.fmi-ls-ref"
fmi-ls:fmi-ls-version="1.0.0-alpha.1">
<Related type="text/csv" source="Resource_out.csv" role="result" description="Output of the default experiment"/>
</fmiReferences>
File renamed without changes.
47 changes: 47 additions & 0 deletions Stair/Stair_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
time,counter
0,1
0.2,1
0.4,1
0.6000000000000001,1
0.8,1
1,2
1.2000000000000002,2
1.4000000000000001,2
1.6,2
1.8,2
2,3
2.2,3
2.4000000000000004,3
2.6,3
2.8000000000000003,3
3,4
3.2,4
3.4000000000000004,4
3.6,4
3.8000000000000003,4
4,5
4.2,5
4.4,5
4.6000000000000005,5
4.800000000000001,5
5,6
5.2,6
5.4,6
5.6000000000000005,6
5.800000000000001,6
6,7
6.2,7
6.4,7
6.6000000000000005,7
6.800000000000001,7
7,8
7.2,8
7.4,8
7.6000000000000005,8
7.800000000000001,8
8,9
8.200000000000001,9
8.4,9
8.6,9
8.8,9
9,10
8 changes: 8 additions & 0 deletions Stair/fmi-ls-ref.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<fmiReferences
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fmi-ls="http://fmi-standard.org/fmi-ls-manifest"
fmi-ls:fmi-ls-name="org.fmi-standard.fmi-ls-ref"
fmi-ls:fmi-ls-version="1.0.0-alpha.1">
<Related type="text/csv" source="Stair_out.csv" role="result" description="Output of the default experiment"/>
</fmiReferences>
12 changes: 12 additions & 0 deletions StateSpace/StateSpace_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
time,y
0,1 2 3
1,2.7169239322358925 5.433847864471785 8.150771796707678
2,7.381675653556159 14.763351307112318 22.145026960668407
3,20.055451243149793 40.11090248629959 60.16635372944905
4,54.489135454303685 108.97827090860737 163.4674063629103
5,148.04283616264095 296.0856723252819 444.12850848792027
6,402.2211245663556 804.4422491327113 1206.6633736990636
7,1092.8041993851652 2185.6083987703305 3278.4125981554794
8,2969.0658825574433 5938.131765114887 8907.197647672285
9,8066.726152705384 16133.452305410769 24200.1784581161
10,21916.681339078466 43833.36267815693 65750.0440172352
8 changes: 8 additions & 0 deletions StateSpace/fmi-ls-ref.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<fmiReferences
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fmi-ls="http://fmi-standard.org/fmi-ls-manifest"
fmi-ls:fmi-ls-name="org.fmi-standard.fmi-ls-ref"
fmi-ls:fmi-ls-version="1.0.0-alpha.1">
<Related type="text/csv" source="StateSpace_out.csv" role="result" description="Output of the default experiment"/>
</fmiReferences>
Loading