Changeset 84a90a33 in OpenModelica


Ignore:
Timestamp:
2019-01-18T10:06:13+01:00 (5 years ago)
Author:
hudson <openmodelica@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
6307dbc
Parents:
d663c40
git-author:
Lennart Ochel <lennart.ochel@…> (01/18/19 10:06:13)
git-committer:
hudson <openmodelica@…> (01/18/19 10:06:13)
Message:

Update tests

Belonging to [master]:

  • OpenModelica/OpenModelica-testsuite#1106
Location:
omsimulator
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • omsimulator/DualMassOscillator_me.mos

    r7df27713 r84a90a33  
    99
    1010writeFile("DualMassOscillator_me.lua", "
    11 oms3_setCommandLineOption(\"--suppressPath=true\")
    12 oms3_setTempDirectory(\"./temp-DualMassOscillator_me/\")
     11oms_setCommandLineOption(\"--suppressPath=true\")
     12oms_setTempDirectory(\"./temp-DualMassOscillator_me/\")
    1313
    14 oms3_newModel(\"DualMassOscillator\")
    15 oms3_addSystem(\"DualMassOscillator.root\", oms_system_sc)
    16 oms3_addSubModel(\"DualMassOscillator.root.system1\", \"DualMassOscillator.System1.fmu\")
    17 oms3_addSubModel(\"DualMassOscillator.root.system2\", \"DualMassOscillator.System2.fmu\")
     14oms_newModel(\"DualMassOscillator\")
     15oms_addSystem(\"DualMassOscillator.root\", oms_system_sc)
     16oms_addSubModel(\"DualMassOscillator.root.system1\", \"DualMassOscillator.System1.fmu\")
     17oms_addSubModel(\"DualMassOscillator.root.system2\", \"DualMassOscillator.System2.fmu\")
    1818
    19 oms3_addConnection(\"DualMassOscillator.root.system1.F\", \"DualMassOscillator.root.system2.F\")
    20 oms3_addConnection(\"DualMassOscillator.root.system1.s1\", \"DualMassOscillator.root.system2.s1\")
    21 oms3_addConnection(\"DualMassOscillator.root.system1.v1\", \"DualMassOscillator.root.system2.v1\")
    22 oms3_addConnection(\"DualMassOscillator.root.system1.a1\", \"DualMassOscillator.root.system2.a1\")
     19oms_addConnection(\"DualMassOscillator.root.system1.F\", \"DualMassOscillator.root.system2.F\")
     20oms_addConnection(\"DualMassOscillator.root.system1.s1\", \"DualMassOscillator.root.system2.s1\")
     21oms_addConnection(\"DualMassOscillator.root.system1.v1\", \"DualMassOscillator.root.system2.v1\")
     22oms_addConnection(\"DualMassOscillator.root.system1.a1\", \"DualMassOscillator.root.system2.a1\")
    2323
    24 oms3_setResultFile(\"DualMassOscillator\", \"\")
    25 oms3_setStopTime(\"DualMassOscillator\", 0.1)
    26 oms3_setFixedStepSize(\"DualMassOscillator.root\", 1e-4)
    27 oms3_setTolerance(\"DualMassOscillator.root\", 1e-6)
     24oms_setResultFile(\"DualMassOscillator\", \"\")
     25oms_setStopTime(\"DualMassOscillator\", 0.1)
     26oms_setFixedStepSize(\"DualMassOscillator.root\", 1e-4)
     27oms_setTolerance(\"DualMassOscillator.root\", 1e-6)
    2828
    29 oms3_instantiate(\"DualMassOscillator\")
    30 oms3_setReal(\"DualMassOscillator.root.system2.s2_start\", 2.5)
     29oms_instantiate(\"DualMassOscillator\")
     30oms_setReal(\"DualMassOscillator.root.system2.s2_start\", 2.5)
    3131
    32 oms3_initialize(\"DualMassOscillator\")
     32oms_initialize(\"DualMassOscillator\")
    3333print(\"info:    Initialization\")
    34 print(\"info:      system1.s1: \" .. oms3_getReal(\"DualMassOscillator.root.system1.s1\"))
    35 print(\"info:      system2.s2: \" .. oms3_getReal(\"DualMassOscillator.root.system2.s2\"))
     34print(\"info:      system1.s1: \" .. oms_getReal(\"DualMassOscillator.root.system1.s1\"))
     35print(\"info:      system2.s2: \" .. oms_getReal(\"DualMassOscillator.root.system2.s2\"))
    3636
    37 oms3_simulate(\"DualMassOscillator\")
     37oms_simulate(\"DualMassOscillator\")
    3838print(\"info:    Simulation\")
    39 print(\"info:      system1.s1: \" .. oms3_getReal(\"DualMassOscillator.root.system1.s1\"))
    40 print(\"info:      system2.s2: \" .. oms3_getReal(\"DualMassOscillator.root.system2.s2\"))
     39print(\"info:      system1.s1: \" .. oms_getReal(\"DualMassOscillator.root.system1.s1\"))
     40print(\"info:      system2.s2: \" .. oms_getReal(\"DualMassOscillator.root.system2.s2\"))
    4141
    42 oms3_terminate(\"DualMassOscillator\")
    43 oms3_delete(\"DualMassOscillator\")
     42oms_terminate(\"DualMassOscillator\")
     43oms_delete(\"DualMassOscillator\")
    4444"); getErrorString();
    4545
  • omsimulator/initialization.mos

    r539eebd r84a90a33  
    2020
    2121writeFile("initialization.lua", "
    22 oms3_setCommandLineOption(\"--suppressPath=true\")
    23 oms3_setTempDirectory(\"./temp-initialization/\")
     22oms_setCommandLineOption(\"--suppressPath=true\")
     23oms_setTempDirectory(\"./temp-initialization/\")
    2424
    25 oms3_newModel(\"test\")
    26 oms3_addSystem(\"test.root\", oms_system_sc)
    27 oms3_addSubModel(\"test.root.A\", \"initialization.fmu\")
    28 oms3_setResultFile(\"test\", \"\")
     25oms_newModel(\"test\")
     26oms_addSystem(\"test.root\", oms_system_sc)
     27oms_addSubModel(\"test.root.A\", \"initialization.fmu\")
     28oms_setResultFile(\"test\", \"\")
    2929
    30 oms3_instantiate(\"test\")
    31 oms3_setReal(\"test.root.A.x_start\", 1.5)
     30oms_instantiate(\"test\")
     31oms_setReal(\"test.root.A.x_start\", 1.5)
    3232
    33 oms3_initialize(\"test\")
     33oms_initialize(\"test\")
    3434print(\"info:    Initialization\")
    35 print(\"info:      A.x_start: \" .. oms3_getReal(\"test.root.A.x_start\"))
    36 print(\"info:      A.x:       \" .. oms3_getReal(\"test.root.A.x\"))
    37 print(\"info:      A.w:       \" .. oms3_getReal(\"test.root.A.w\"))
     35print(\"info:      A.x_start: \" .. oms_getReal(\"test.root.A.x_start\"))
     36print(\"info:      A.x:       \" .. oms_getReal(\"test.root.A.x\"))
     37print(\"info:      A.w:       \" .. oms_getReal(\"test.root.A.w\"))
    3838
    39 oms3_simulate(\"test\")
     39oms_simulate(\"test\")
    4040print(\"info:    Simulation\")
    41 print(\"info:      A.x_start: \" .. oms3_getReal(\"test.root.A.x_start\"))
    42 print(\"info:      A.x:       \" .. oms3_getReal(\"test.root.A.x\"))
    43 print(\"info:      A.w:       \" .. oms3_getReal(\"test.root.A.w\"))
     41print(\"info:      A.x_start: \" .. oms_getReal(\"test.root.A.x_start\"))
     42print(\"info:      A.x:       \" .. oms_getReal(\"test.root.A.x\"))
     43print(\"info:      A.w:       \" .. oms_getReal(\"test.root.A.w\"))
    4444
    45 oms3_terminate(\"test\")
    46 oms3_delete(\"test\")
     45oms_terminate(\"test\")
     46oms_delete(\"test\")
    4747"); getErrorString();
    4848
  • omsimulator/initialization2.mos

    r539eebd r84a90a33  
    2222
    2323writeFile("initialization2.lua", "
    24 oms3_setCommandLineOption(\"--suppressPath=true\")
    25 oms3_setTempDirectory(\"./temp-initialization2/\")
     24oms_setCommandLineOption(\"--suppressPath=true\")
     25oms_setTempDirectory(\"./temp-initialization2/\")
    2626
    27 oms3_newModel(\"test\")
    28 oms3_addSystem(\"test.root\", oms_system_sc)
    29 oms3_addSubModel(\"test.root.A\", \"input.csv\")
    30 oms3_addSubModel(\"test.root.B\", \"initialization2.fmu\")
    31 oms3_addConnection(\"test.root.A.y\", \"test.root.B.u\")
    32 oms3_setResultFile(\"test\", \"\")
     27oms_newModel(\"test\")
     28oms_addSystem(\"test.root\", oms_system_sc)
     29oms_addSubModel(\"test.root.A\", \"input.csv\")
     30oms_addSubModel(\"test.root.B\", \"initialization2.fmu\")
     31oms_addConnection(\"test.root.A.y\", \"test.root.B.u\")
     32oms_setResultFile(\"test\", \"\")
    3333
    34 oms3_instantiate(\"test\")
    35 oms3_initialize(\"test\")
     34oms_instantiate(\"test\")
     35oms_initialize(\"test\")
    3636print(\"info:    Initialization\")
    37 print(\"info:      A.y: \" .. oms3_getReal(\"test.root.A.y\"))
    38 print(\"info:      B.x: \" .. oms3_getReal(\"test.root.B.x\"))
    39 print(\"info:      B.y: \" .. oms3_getReal(\"test.root.B.y\"))
    40 print(\"info:      B.u: \" .. oms3_getReal(\"test.root.B.u\"))
     37print(\"info:      A.y: \" .. oms_getReal(\"test.root.A.y\"))
     38print(\"info:      B.x: \" .. oms_getReal(\"test.root.B.x\"))
     39print(\"info:      B.y: \" .. oms_getReal(\"test.root.B.y\"))
     40print(\"info:      B.u: \" .. oms_getReal(\"test.root.B.u\"))
    4141
    42 oms3_terminate(\"test\")
    43 oms3_delete(\"test\")
     42oms_terminate(\"test\")
     43oms_delete(\"test\")
    4444"); getErrorString();
    4545
Note: See TracChangeset for help on using the changeset viewer.