|
FhSim
3.1.0
Marine systems simulation
|
A FhSim simulation scenario is defined in an XML input file. This file describes which SimObjects to use, how they are connected, their initial conditions, how the integrator should run, and what output to produce.
The input file must have a <Contents> root element containing the following sections:
<Contents> does not matter.Each section is documented on its own page:
| Section | Purpose | Page |
|---|---|---|
<VARIABLES> | Define reusable variables for $Variable substitution. | VARIABLES section |
<OBJECTS> | Declare which SimObjects to load and their parameters. | OBJECTS section |
<INTERCONNECTIONS> | Connect SimObject input ports to output ports or constants. | INTERCONNECTIONS section |
<INITIALIZATION> | Set initial states for the SimObjects. | INITIALIZATION section |
<SIMULATION> | Configure the integrator, timing, and simulation provider. | SIMULATION section |
<OBSERVERS> | Configure output: file, console, network, visualisation, plugins. | OBSERVERS section |
FhSim input files support W3C XInclude via libxml2. This allows you to split a large input file into smaller, reusable fragments.
Declare the xi namespace on the root element and use <xi:include> to include other files:
Included file paths are resolved relative to the parent file's directory. The included file must be a valid XML fragment whose root element matches the expected child type at the insertion point.
**shared/simulation_settings.xml:**
This fragment can be included by any scenario that needs the same integrator configuration, making it easy to maintain consistent settings across multiple input files.