XML Format for 2D Simulation Files
    • 29 Jul 2022
    • 1 Minute to read
    • Dark
      Light

    XML Format for 2D Simulation Files

    • Dark
      Light

    Article Summary

    Overview

    A control file referencing all data and simulation parameters must be specified when running 2D Solver. This control file is written in XML (Extensible Mark-up Language) and is automatically generated by the 2D Solver User Interface but can also be manually created using a Text Editor by the user.

    The XML file can be opened in any text editor and consists of an organised collection of tags and attributes.

    XML tags are enclosed in angled brackets. Each tag is either an opening tag, closing tag, or self closing tag.Tags must always close, by either using a self closing tag. Here are some examples:

    Opening tag:                  <ExampleTag>

    Closing tag:                   </ExampleTag> ( notice the forward slash )

    Self closing tag: <ExampleTag/> ( equivalent of <ExampleTag></ExampleTag> )

    Tags can contain other tags and so on. The XML file then is able to group together related run parameters, for example:

    <computational_area>

    <xll/>

    <yll/>

    <dx/>

    <nrows/>

    <ncols/>

    <rotation/>

    </computational_area>

    Tags may also have attributes. The following TimeStep tag has a time units attribute:

    <TimeStep units="second"> 5 </TimeStep>

    Comment tags are also allowed, in this example, the rotation tag has been commented out and will therefore be ignored by 2D Solver:

    <computational_area>

    <xll> 100.0 </xll>

    <yll> 100.0 </yll>

    <dx> 10.0 </dx>

    <nrows> 1000 </nrows>

    <ncols> 200 </ncols>

    <!-- <rotation> 45 </rotation> -->

    </computational_area>

    When the XML file is read into 2D Solver, it is validated against a template, or schema, which describes which tags are mandatory, which tags are optional etc. The schema is a file with an XSD extension which describes all possible tags which can be used in an 2D Solver control file. By reading the schema, a user can write XML input files entirely by hand. If a manually created XML file fails to validate correctly, 2D Solver will output some error messages describing on which lines problems were found and give some indications of why the file failed to validate, allowing the user to fix these problems. All 2D Solver control XML files generated by the 2D Solver user interface are valid.

    This section of the help file describes the tags used in the 2D Solver Control XML file in more detail.


    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.