Plugin for the SALOME platform with which it can be used as preprocessor for the finite element programm KratosMultiphysics. It writes mesh files in Kratos format that can then be read and used by the generic problemtype Flowgraph.
This plugin is currently work in progress. Furthermore it is more research oriented, which means that the user has to have more knowledge of Kratos itself. For a more consolidated solution please check the GiD interface.
Salome offers two ways of creating models; with and without graphical user interface, the GUI (graphical user interface) mode and the TUI (text user interface, batch) mode respectively. See here for an explanation of the TUI mode and here for an explanation of the differences between GUI and TUI.
Internally the plugin works with meshes created in the Mesh module of Salome. For more information check the Documentation.
The plugin can be used in the following modes:
UNDER DEVELOPMENT
In this mode the plugin extends the Salome GUI by using the python plugin functionalities that Salome provides. It is purely Python based, which means that Salome does not have to be compiled. It is sufficient to install Salome as explained here and set up the plugin by following the instructions in the Setup section.
In addition to creating models through the GUI, Salome also provides a way of creating models through scripting in Python, by exposing the C++ API to Python (Kratos works the same way). Salome examples can be found here.
It is very suitable e.g. for creating models with different levels mesh refinements, see this example.
Two ways of executing the TUI-scripts exist:
-
Load script in GUI: The Salome GUI offers to load TUI-scripts directly with
File/Load Script ...
. This will execute the script while loading it. -
Batch mode: Running Salome in batch mode without launching the GUI is the recommended way for executing TUI-scripts. Some information can be found here. The script execute_in_salome.py can be used for this purpose.
For large models and meshes the following procedure is recommended to avoid repeating expensive operations (like e.g. meshing) when executing the script.
The geometry and mesh can be created a priori in the Salome GUI and saved as a salome project file. Instead of the GUI mode, the export can be done by loading a script that contains only the Plugin related export settings. This is advantageous if e.g. the meshing process is expensive and should only be done once. For this workflow, the input for the plugin are the "Entry" values in the object browser (e.g. "0:1:2:3").
An example can be found here
A fourth option is to use this plugin without Salome and creating the mesh manually. This can be done for simple problems like beam-structures.
Examples for the GUI are under development.
The TUI examples can be found here
Also the tests contain usage examples.
The documentation can be found in Documentation.
-
Get Salome from https://www.salome-platform.org/. Usually it is enough to download and unpack it. For more information check the installation guide.
-
Get the plugin by cloning this repo.
-
For using the plugin in the GUI mode:
-
Set the environment variables for using the plugin:
-
Windows
Add an environment variable named
SALOME_PLUGINS_PATH
pointing to the directory where the code was cloned to. E.g.C:\Users\<Username>\KratosSalomePlugin
-
Linux
Add an environment variable named
SALOME_PLUGINS_PATH
pointing to the directory where the code was cloned to. E.g.export SALOME_PLUGINS_PATH="${HOME}/KratosSalomePlugin"
Useecho SALOME_PLUGINS_PATH="${HOME}/KratosSalomePlugin" >> ~/.bashrc
to directly add it to yourbashrc
-
-
In Salome: Click
Tools/Plugin/Kratos Multiphysics
in order to load the plugin.
Also a small icon with which the plugin can be loaded appears in the menu list:
In case the icon does not appear, checkView/Toolbars/Plugins
-
-
For using the plugin in the TUI mode:
- use
sys.path.append("path/to/plugin/KratosSalomePlugin")
before importing anything from the plugin
- use
- Salome: The minimum supported version is Salome 9.3. Check the developer guide for details. The versions of Salome that are tested to work can be found here, but this doesn't mean that other/newer versions don't work.
- Python: Salome 9 uses Python 3.6, this is the officially minimum supported version. Currently also Python 3.5 is supported, but this will be dropped in the future.