Skip to content

Commit

Permalink
Preparing release (#75)
Browse files Browse the repository at this point in the history
* initial improvements

* more minor fixes
  • Loading branch information
philbucher authored May 23, 2020
1 parent d378e42 commit 5e8b0ca
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The plugin can be used in both modes.
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**\
Besides 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).\
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:
- The Salome GUI offers to load TUI-scripts directly with `File/Load Script ...`. This will execute the script while loading it. It is recommended to use this only for small models, since the output cannot be controlled as good as with the second option.
Expand All @@ -39,7 +39,7 @@ Also the [tests](tests) contain usage examples.
The documentation can be found in [Documentation](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](documentation/install_salome).
- Get Salome from <https://www.salome-platform.org/>. 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.

Expand All @@ -65,7 +65,7 @@ The documentation can be found in [Documentation](documentation).
- 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 [developers guide](documentation/developers_guide.md#minimum-supported-version) for details.
- **Salome**: The minimum supported version is Salome **9.3**. Check the [developer guide](documentation/developer_guide.md#minimum-supported-version) for details.
- **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.

<!-- ## Quick start
Expand Down
4 changes: 1 addition & 3 deletions documentation/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Reasons to drop support for versions < 9
Mesh identifier of Salome is used. This is supposed to be unique. Note that the mesh names can be duplicated!

## Using Salome functionalities
Useful: [PrintObjectInfo](../development/utilities.py#L16)
Useful: [PrintObjectInfo](../development/dev_utilities.py)

## Debugging
- Increase the logger level
Expand All @@ -34,8 +34,6 @@ The CI tests with and without Salome. It runs the tests with every supported ver
The documentation of functions & modules follows [PEP 257 -- Docstring Conventions](https://www.python.org/dev/peps/pep-0257/).


### This folder contains files and other things that are helpful for the development.

**Github Actions:**
- Version 8.3 and 8.4 do NOT return failure (i.e. `sys.exit(1)`) even if they fail in TUI-mode! => hence have to be checked manually!

Expand Down
9 changes: 7 additions & 2 deletions documentation/install_salome.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Installing Salome

Usually it is enough to [download](https://www.salome-platform.org/downloads/current-version) and unpack Salome. In some cases it can be necessary to do additional things like installing some missing libraries. Here is a list of know issues.
For required libraries and how to install them it is recommended to check the [DockerFiles](../.github).
Usually it is enough to [download](https://www.salome-platform.org/downloads/current-version) and unpack Salome.

In some cases it can be necessary to do additional things like installing some missing libraries. For required libraries and how to install them it is recommended to check the [DockerFiles](../.github).

#

Here is a list of know issues:

- Cannot save files on Windows:
add `@SET SALOME_TMP_DIR=%TEMP%` at the end of `SALOME-8.2.0-WIN64\WORK\set_env.bat`. More information can be found [here](https://www.salome-platform.org/forum/forum_10/541818275).
Expand Down
6 changes: 3 additions & 3 deletions documentation/user_guide.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# User Guide
This guide explains how the plugin works in the background and how it can be used.

The workflow for creating Kratos input files (currently supported format: [`mdpa`](https://github.com/KratosMultiphysics/Kratos/wiki/Input-data)) follows the workflow of Kratos itself. The implementation is very modular, such that it can easily be extended (or even adapted to other preprocessors) in the future.
The workflow for creating Kratos input files (currently supported format: [`mdpa`](https://github.com/KratosMultiphysics/Kratos/wiki/Input-data#mdpa-file-structure-format)) follows the workflow of Kratos itself. The implementation is very modular, such that it can easily be extended (or even adapted to other preprocessors) in the future.

The main components are:
- [`ModelPart`](../kratos_salome_plugin/model_part.py): Kratos cannot be imported inside of Salome. Hence a Python version of the [Kratos-ModelPart](https://github.com/KratosMultiphysics/Kratos/blob/master/kratos/includes/model_part.h) was developed, which has a matching interface for the most part. I.e. it is possible to add Nodes, Elements, Properties etc, just like with the Kratos-ModelPart. For users familiar with Kratos using it is straight forward.
- [`write_mdpa`](../kratos_salome_plugin/write_mdpa.py): This function takes a `ModelPart` as input and writes an `mdpa` file from it. This is basically what the [ModelPartIO](https://github.com/KratosMultiphysics/Kratos/blob/master/kratos/includes/model_part_io.h) does. It was kept a bit more modular to be easier to extend in the future.
- [`GeometriesIO`](../kratos_salome_plugin/geometries_io.py): This class takes (Salome) meshes as input and creates `Nodes`, `Elements` and `Conditions` from it. It works purely based on connectivities and could therefore serve as a prototype for creating `ModelPart`s from `Geometries` inside of the solvers in Kratos
- [`MeshInterface`](../kratos_salome_plugin/mesh_interface.py): The interface for accessing the Salome Mesh. It directly accesses the database of Salome and extracts the mesh information the user requested.
- [`MeshInterface`](../kratos_salome_plugin/mesh_interface.py): The interface for accessing the Salome Mesh (created with the `Mesh` module). It directly accesses the database of Salome and extracts the mesh information the user requested.

Those components are combined in the following way:
1. An empty `ModelPart` is created
Expand All @@ -28,5 +28,5 @@ The plugin offers a wide range of usecases:


## Logging
The plugin uses the [Python loggin module](https://docs.python.org/3/library/logging.html), the logs are placed in important parts of the code. Logging is done to the console as well as to a file (`kratos_salome_plugin.log`). Beside the regular logs also exceptions are being logged.\
The plugin uses the [Python logging module](https://docs.python.org/3/library/logging.html), the logs are placed in important parts of the code. Logging is done to the console as well as to a file (`kratos_salome_plugin.log`). Beside the regular logs also exceptions are being logged.\
In case problems with the plugin occur it is very helpful to provide the this log-file.
1 change: 1 addition & 0 deletions kratos_salome_plugin/applications/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![](https://media.giphy.com/media/3o7btQ0NH6Kl8CxCfK/giphy.gif)

0 comments on commit 5e8b0ca

Please sign in to comment.