Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 3.46 KB

user_guide.md

File metadata and controls

32 lines (23 loc) · 3.46 KB

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) 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 cannot be imported inside of Salome. Hence a Python version of the Kratos-ModelPart 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: This function takes a ModelPart as input and writes an mdpa file from it. This is basically what the ModelPartIO does. It was kept a bit more modular to be easier to extend in the future.
  • GeometriesIO: 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 ModelParts from Geometries inside of the solvers in Kratos
  • MeshInterface: 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
  2. MeshInterfaces are created for the Salome meshes that are to be used
  3. The created ModelPart and the MeshInterfaces are given to the GeometriesIO in order to create Nodes, Elements and Conditions. A separate dictionary is used to specify which entities to create.
  4. After the ModelPart is filled with entities, it is being passed to write_mdpa for creating the mdpa file.

GUI mode

The GUI is currently under development. This section will be added once the GUI of the plugin fully developed.

TUI mode

The plugin offers a wide range of usecases:

  • The most basic and straight forward way of creating mdpa files from salome meshes is to use CreateMdpaFile of create_kratos_input_tui.py. Several examples demonstrate this.
  • In case the user wants to modify the ModelPart before creating an mdpa file, then the function CreateModelPart is suitable. After modifying the ModelPart the function write_mdpa can be called separately.
  • For a more customized usage the main components introduced above can of course also be used individually. It is recommended to take a look at the workflow inside of create_kratos_input_tui.py as a starting point.

Logging

The plugin uses the Python logging module, 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.