Formal specification of Elmer file formats

Discussion about coding and new developments
Post Reply
putanowr
Posts: 7
Joined: 14 Dec 2020, 19:53
Antispam: Yes
Location: Cracow, Poland

Formal specification of Elmer file formats

Post by putanowr »

Hi All,

I would like to ask for directions - are Elmer specific file formats (like SIF) formally described somewhere ?
What I mean by formal description is a such specification that would allow to build parser for such file.

If Elmer SIF format has grown lets say "organically", could you please point me to the parts of the source
code that are responsible for input parsing?

If you wonder why I need this - I am just trying to "storm Elmer castle, and looking for the least fortified gate" :)
but seriously - closer look at Elmer formats would hopefully give me some ideas about interfacing it with
external tools.

Best regards,

Roman
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Formal specification of Elmer file formats

Post by raback »

Hi Roman,

Unfortunately there is no formal description, just a practical one. You can find it in ElmerSolver Manual and also in a recent slide show:

http://elmerfem.org/elmerice/wiki/lib/e ... mersif.pdf

As you rightly assume it has grown organically but there is still some syntax with sections and keywords. We have recognized that deducing the correctness of a SIF file is maybe not easily done. The most serious trial for jumping between different formats is here for YAML -> SIF.

https://github.com/juhanikataja/yml2sif

Related things to this is the list of most common keywords used, for which the type need not be cast.

https://github.com/ElmerCSC/elmerfem/bl ... R.KEYWORDS

Basically major part of the syntax may be described in XML files. Using this as the starting point ElmerGUI uses XML files to define the menus that then are used to write the SIF. The XML files are here under edf and edf-extra directories,

https://github.com/ElmerCSC/elmerfem/tr ... pplication

The keywords reflect quite closely a Model_t type in the code where each section has a list structure and keywords are fecthed by their name. This means that the keyword list is never complete since people may create a new module with new keywords etc. So whereas it is feasible to list all keywords for educational level it is not at the development level.

I hope this made some sense. What we have been happy about the SIF file is that it is easy to read for humans and long keywords easily convey the purpose. However, this makes things you try to achieve more complicated.

-Peter
Post Reply