Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Init file format

Init file format

In previous realeses, OpenModelica used XXX_init.txt files that now have been replaced by XXX_init.xml files.

¿is there any simulation option to choice the input format? I mean, something similar to outputFormat="plt"

Thanks in advance for your help.

Oscar Duarte

Re: Init file format

No, there is not

Re: Init file format

Thanks for the answer!

Do you know where can I find the specifications of the xml init file?

Re: Init file format

Code:

$ svn log -r9222

------------------------------------------------------------------------
r9222 | adrpo | 2011-06-01 00:42:19 +0200 (Wed, 01 Jun 2011) | 20 lines

- BIG CHANGE!
- generate Model_init.xml instead of Model_init.txt
- clean objects in Model.makefile before compiling (Make doesn't seem to get that
  Model.c is newer than Model.o if we issue two simulate commands for the same model,
  even if the model changed via loadFile.)
- check the result of fflush in systemimpl.c and printimpl.c
- fflush in c_runtime/linearize.cpp
- added c_runtime/simulation_input_xml.h and cpp to read the Model_init.xml file.
- link the generated code with the XML parser library -lexpat as libc_runtime needs it now
- Model.c and Model_init.xml will now contain a GUID which is used in c_runtime/simulation_input_xml.cpp
  to check if the Model_init.xml is matched with Model.c (Model.exe)
- The Model_init.xml is based on FMI but with much more information that we need for OMC.
- The Model_init.xml file it has no schema yet as it may change in the near future to include
  more things that are now static in the generated code (Model.c). This will make compilation
  of generated code faster.
- disabled testsuite/interactive-simulation/runInteractiveSimulation.mos and added only a
  compilation test (more work is needed to make the run test more robust).
- updated tests and compiler files with the name change from _init.txt to _init.xml.


------------------------------------------------------------------------

As far as I know more static data was moved into the xml-file, but it's basically an FMI description with some extensions.

Re: Init file format

Hi,


The XML format is based on FMI with some OpenModelica additions.
http://functional-mockup-interface.org/fmi.html

Yes, we should provide some documentation on what everything
represents, but we had no time to do that yet.
Crash course here (on the additions from FMI):

classType = [r|i|b|s][Sta|Der|Par|Alg|Ali]
r=Real
i=Integer
b=Boolean
s=String
Sta=state
Der=state derivative
Par=Parameter
Alg=Algebraic
Ali=Alias
classIndex - differentiate between classType using a number
valueReference = index in the arrays generated in the C code by OMC
file position information is straightforward
The numberOf* at the begining you can see which ones are OMC and FMI
from the cmt_*

Cheers,
Adrian Pop/

Re: Init file format

Thanks for the answer. They are very useful to me!

There are 0 guests and 0 other users also viewing this topic