Skip to content

Latest commit

 

History

History
118 lines (80 loc) · 6.94 KB

README.md

File metadata and controls

118 lines (80 loc) · 6.94 KB

Kratos Salome Plugin

Release License Github CI

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.

Note:

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.

Overview

How does it work?

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:

GUI mode

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.

TUI mode

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.

CAD-modelling and meshing in GUI, export with 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

Standalone mode

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

Examples for the GUI are under development.

The TUI examples can be found here

Also the tests contain usage examples.

Documentation

The documentation can be found in Documentation.

Setup

  • 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 namedSALOME_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"
        Use echo SALOME_PLUGINS_PATH="${HOME}/KratosSalomePlugin" >> ~/.bashrc to directly add it to your bashrc

    • 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, check View/Toolbars/Plugins

  • For using the plugin in the TUI mode:

    • use sys.path.append("path/to/plugin/KratosSalomePlugin") before importing anything from the plugin

Minimum supported version

  • 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.