2.2.1. General Architecture of SW2D¶
General Architecture of SW2D
The purpose of this page is to present the global architecture followed in the SW2D project.
The project is subdivided in three main libraries:
This librairy contains all the needed files to do a hydraulic simulation. There is a swSettings class containing all the parameters of the simulation. These parameters can be read from a .in file (old input format) or a .json file . They can also be exported in both these formats.
Then, with these settings, you can create a swPipeline. When calling the init method on this pipeline, it will use the settings to create a mesh, choose a model (DIP, .. ) and initialized a timeloop.
Finally, to launch the simulation, you can call the run method of the pipeline.
This library contains the code to do a biological simulation. It’s architecture is a copy of what’s in swCore. A biological simulation may be launched on it’s own if a hydraulic result is already present or it may need to do a hydraulic simulation before.
As it name implies the library is to be used by the GUI sw2dModeler. It contains code for the modeler part and two types of view for the simulation:
sw2dSimulationView to visualize the simulation mesh and it’s fields
sw2dProbeView to see probes data as 2D plots.
Add a new simulation algorithm
Add a new model