Changeset 22a8249 in OpenModelica
- Timestamp:
- 2023-03-22T15:21:34+01:00 (14 months ago)
- Children:
- d6fb23cd
- Parents:
- e8d53f78
- Location:
- testsuite/openmodelica/fmi/CoSimulation/2.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuite/openmodelica/fmi/CoSimulation/2.0/ExportCvodeFmu_cmake.mos
re8d53f78 r22a8249 2 2 // keywords: fmu export simulation flags 3 3 // status: correct 4 // teardown_command: rm -rf *.fmu Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum* Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum* Pendulum-dynamic* Pendulum_dynamic* Pendulum_cs_systemCall* Pendulum_flags_dynamic.json4 // teardown_command: rm -rf Pendulum* Pendulum-dynamic* Pendulum_dynamic* Pendulum_cs_systemCall* Pendulum_flags_dynamic.json 5 5 // cflags: -d=-newInst 6 6 // 7 // Export Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum as 2.0 CS FMU with CVODE solver7 // Export Pendulum as 2.0 CS FMU with CVODE solver 8 8 9 9 // Generate FMU 10 10 loadModel(Modelica, {"3.2.3"}); getErrorString(); 11 loadString("model Pendulum 12 extends Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum; 13 end Pendulum;"); getErrorString(); 14 11 15 setCommandLineOptions("--fmiFlags=s:cvode --fmuCMakeBuild=true"); getErrorString(); 12 buildModelFMU( Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum, version = "2.0", fmuType="cs", platforms={"dynamic"}); getErrorString();16 buildModelFMU(Pendulum, version = "2.0", fmuType="cs", platforms={"dynamic"}); getErrorString(); 13 17 14 18 // Check _flags.json for simulation flags 15 system("unzip -cqq Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu resources/Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum_flags.json > Pendulum_flags_dynamic.json"); getErrorString();19 system("unzip -cqq Pendulum.fmu resources/Pendulum_flags.json > Pendulum_flags_dynamic.json"); getErrorString(); 16 20 readFile("Pendulum_flags_dynamic.json"); getErrorString(); 17 21 18 22 // Simulate with OMSimulator 19 system(getInstallationDirectoryPath() + "/bin/OMSimulator Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu --mode=cs --tolerance=1e-6 --resultFile=\"Pendulum_dynamic_res.mat\" --stopTime=1.0 --suppressPath=true --tempDir=\"Pendulum-dynamic-tmp\"", "Pendulum_cs_systemCall.log"); getErrorString();23 system(getInstallationDirectoryPath() + "/bin/OMSimulator Pendulum.fmu --mode=cs --tolerance=1e-6 --resultFile=\"Pendulum_dynamic_res.mat\" --stopTime=1.0 --suppressPath=true --tempDir=\"Pendulum-dynamic-tmp\"", "Pendulum_cs_systemCall.log"); getErrorString(); 20 24 readFile("Pendulum_cs_systemCall.log"); 21 25 … … 33 37 // true 34 38 // "" 35 // "Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu" 39 // true 40 // "" 41 // "Pendulum.fmu" 36 42 // "" 37 43 // 0 -
testsuite/openmodelica/fmi/CoSimulation/2.0/ExportCvodeFmu_dynamic.mos
re8d53f78 r22a8249 2 2 // keywords: fmu export simulation flags 3 3 // status: correct 4 // teardown_command: rm -rf *.fmu Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum* Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum* Pendulum-dynamic* Pendulum_dynamic* Pendulum_cs_systemCall* Pendulum_flags_dynamic.json4 // teardown_command: rm -rf *.fmu Pendulum* Pendulum* Pendulum-dynamic* Pendulum_dynamic* Pendulum_cs_systemCall* Pendulum_flags_dynamic.json 5 5 // cflags: -d=-newInst 6 6 // 7 // Export Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum as 2.0 CS FMU with CVODE solver7 // Export Pendulum as 2.0 CS FMU with CVODE solver 8 8 9 9 // Generate FMU 10 10 loadModel(Modelica, {"3.2.3"}); getErrorString(); 11 loadString("model Pendulum 12 extends Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum; 13 end Pendulum;"); getErrorString(); 11 14 setCommandLineOptions("--fmiFlags=s:cvode"); getErrorString(); 12 buildModelFMU( Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum, version = "2.0", fmuType="cs", platforms={"dynamic"}); getErrorString();15 buildModelFMU(Pendulum, version = "2.0", fmuType="cs", platforms={"dynamic"}); getErrorString(); 13 16 14 17 // Check _flags.json for simulation flags 15 system("unzip -cqq Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu resources/Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum_flags.json > Pendulum_flags_dynamic.json"); getErrorString();18 system("unzip -cqq Pendulum.fmu resources/Pendulum_flags.json > Pendulum_flags_dynamic.json"); getErrorString(); 16 19 readFile("Pendulum_flags_dynamic.json"); getErrorString(); 17 20 18 21 // Simulate with OMSimulator 19 system(getInstallationDirectoryPath() + "/bin/OMSimulator Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu --mode=cs --tolerance=1e-6 --resultFile=\"Pendulum_dynamic_res.mat\" --stopTime=1.0 --suppressPath=true --tempDir=\"Pendulum-dynamic-tmp\"", "Pendulum_cs_systemCall.log"); getErrorString();22 system(getInstallationDirectoryPath() + "/bin/OMSimulator Pendulum.fmu --mode=cs --tolerance=1e-6 --resultFile=\"Pendulum_dynamic_res.mat\" --stopTime=1.0 --suppressPath=true --tempDir=\"Pendulum-dynamic-tmp\"", "Pendulum_cs_systemCall.log"); getErrorString(); 20 23 readFile("Pendulum_cs_systemCall.log"); 21 24 … … 33 36 // true 34 37 // "" 35 // " Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu"38 // "Pendulum.fmu" 36 39 // "" 37 40 // 0 -
testsuite/openmodelica/fmi/CoSimulation/2.0/ExportCvodeFmu_static.mos
re8d53f78 r22a8249 2 2 // keywords: fmu export simulation flags 3 3 // status: correct 4 // teardown_command: rm -rf *.fmu Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum* Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum* Pendulum-static* Pendulum_static* Pendulum_me_cs_systemCall.log Pendulum_flags_static.json4 // teardown_command: rm -rf *.fmu Pendulum* Pendulum-static* Pendulum_static* Pendulum_me_cs_systemCall.log Pendulum_flags_static.json 5 5 // cflags: -d=-newInst 6 6 // 7 // Export Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum as 2.0 CS FMU with CVODE solver7 // Export Pendulum as 2.0 CS FMU with CVODE solver 8 8 9 9 // Generate FMU 10 10 loadModel(Modelica, {"3.2.3"}); getErrorString(); 11 loadString("model Pendulum 12 extends Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum; 13 end Pendulum;"); getErrorString(); 11 14 setCommandLineOptions("--fmiFlags=s:cvode"); getErrorString(); 12 translateModelFMU( Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum, version = "2.0", fmuType="me_cs"); getErrorString();15 translateModelFMU(Pendulum, version = "2.0", fmuType="me_cs"); getErrorString(); 13 16 14 17 // Check _flags.json for simulation flags 15 system("unzip -cqq Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu resources/Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum_flags.json > Pendulum_flags_static.json"); getErrorString();18 system("unzip -cqq Pendulum.fmu resources/Pendulum_flags.json > Pendulum_flags_static.json"); getErrorString(); 16 19 readFile("Pendulum_flags_static.json"); getErrorString(); 17 20 18 21 // Simulate with OMSimulator 19 system(getInstallationDirectoryPath() + "/bin/OMSimulator Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu --mode=cs --tolerance=1e-6 --stopTime=1.0 --resultFile=\"Pendulum_static_res.mat\" --suppressPath=true --tempDir=\"Pendulum-static-tmp\"", "Pendulum_me_cs_systemCall.log"); getErrorString();22 system(getInstallationDirectoryPath() + "/bin/OMSimulator Pendulum.fmu --mode=cs --tolerance=1e-6 --stopTime=1.0 --resultFile=\"Pendulum_static_res.mat\" --suppressPath=true --tempDir=\"Pendulum-static-tmp\"", "Pendulum_me_cs_systemCall.log"); getErrorString(); 20 23 readFile("Pendulum_me_cs_systemCall.log"); getErrorString(); 21 24 … … 33 36 // true 34 37 // "" 35 // "Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu" 38 // true 39 // "" 40 // "Pendulum.fmu" 36 41 // "" 37 42 // 0
Note: See TracChangeset
for help on using the changeset viewer.