https://github.com/kratosmultiphysics/kratossalomeplugin
Plugin for the SALOME platform to integrate the open source finite element framework KratosMultiphysics
https://github.com/kratosmultiphysics/kratossalomeplugin
kratos-multiphysics plugin python salome-platform
Last synced: 9 months ago
JSON representation
Plugin for the SALOME platform to integrate the open source finite element framework KratosMultiphysics
- Host: GitHub
- URL: https://github.com/kratosmultiphysics/kratossalomeplugin
- Owner: KratosMultiphysics
- License: bsd-3-clause
- Created: 2019-12-20T18:35:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-10T17:22:36.000Z (over 4 years ago)
- Last Synced: 2025-04-08T16:55:10.184Z (about 1 year ago)
- Topics: kratos-multiphysics, plugin, python, salome-platform
- Language: Python
- Homepage:
- Size: 3.33 MB
- Stars: 11
- Watchers: 5
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Kratos Salome Plugin
[![Release][release-image]][releases] [![License][license-image]][license] [![Github CI][CI-image]][CI-link]
[release-image]: https://img.shields.io/badge/release-1.0.0-green.svg?style=flat
[releases]: https://github.com/KratosMultiphysics/KratosSalomePlugin/releases
[license-image]: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
[license]: https://github.com/KratosMultiphysics/KratosSalomePlugin/blob/master/LICENSE
[CI-image]: https://github.com/KratosMultiphysics/KratosSalomePlugin/workflows/Plugin%20CI/badge.svg
[CI-link]: https://github.com/KratosMultiphysics/KratosSalomePlugin/actions?query=workflow%3A%22Plugin+CI%22
Plugin for the [SALOME platform](https://www.salome-platform.org/) with which it can be used as preprocessor for the finite element programm [KratosMultiphysics](https://github.com/KratosMultiphysics/Kratos).
It writes mesh files in Kratos format that can then be read and used by the generic problemtype [Flowgraph](https://github.com/KratosMultiphysics/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](https://github.com/KratosMultiphysics/GiDInterface).
## Overview
- [How does it work?](#how-does-it-work)
- [GUI mode](#gui-mode)
- [TUI mode](#tui-mode)
- [Examples](#examples)
- [Documentation](#documentation)
- [Setup](#setup)
- [Minimum supported version](#minimum-supported-version)
## 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](https://www.salome-platform.org/user-section/faq/faq#_faq_003_07) for an explanation of the TUI mode and [here](https://www.salome-platform.org/user-section/faq/faq#_faq_003_08) 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](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](https://docs.salome-platform.org/9/gui/GUI/using_pluginsmanager.html#) 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](documentation/install_salome.md) and set up the plugin by following the instructions in the [Setup section](#Setup).
### 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](https://www.salome-platform.org/user-section/tui-examples).\
It is very suitable e.g. for creating models with different levels mesh refinements, see [this example](tui_examples/flow_cylinder).
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](https://stackoverflow.com/questions/13266480/running-salome-script-without-graphics). The script [execute_in_salome.py](execute_in_salome.py) can be used for this purpose.
For large models and meshes the [following procedure](#cad-modelling-and-meshing-in-gui-export-with-script) 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](#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](tui_examples/shell_using_salome_GUI_model)
### 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](tui_examples)
Also the [tests](tests) contain usage examples.
## Documentation
The documentation can be found in [Documentation](documentation).
## Setup
- Get Salome from . Usually it is enough to download and unpack it. For more information check the [installation guide](documentation/install_salome.md).
- 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](https://www.computerhope.com/issues/ch000549.htm) named`SALOME_PLUGINS_PATH` pointing to the directory where the code was cloned to.
E.g. `C:\Users\\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](documentation/developer_guide.md#minimum-supported-version) for details. The versions of Salome that are tested to work can be found [here](kratos_salome_plugin/version.py), 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.