KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.04k stars 245 forks source link

create mdpa file without GiD GUI #11779

Open megaprimatus opened 1 year ago

megaprimatus commented 1 year ago

Basically the question is how to read .mdpa file data? I’m not planning to install GiD and just want to make programmable input files where I change geometry/nodes coordinates run solver and generate result plots using for instance matplotlib or bokeh libraries. In addition it would be useful to generate a paraview file as well. Example: I need to check von Mises of different beam dimensions every day where I only change the load magnitude on top of the beam, length and height of the beam inside input files (json and mdpa). Solve each case independently using kratos python library and generate von Mises plots using matplotlib. For this example I use only Kratos and don’t need to install GiD, do I?

RiccardoRossi commented 1 year ago

it is definitely possible to output to vtk format, either in ascii or in binary mode.

per regards the generation of the input file, there is a function called ModelPartIO that does the reading. There is a python test showing how that should be used.

megaprimatus commented 1 year ago

@RiccardoRossi thanks for clarification. Is there any example of a simple 2D beam structure showing the whole python code writen from scratch without GiD GUI where ends of the beam are fixed and distributed load is applied on top of the beam? It would really helped me to understand the code flow.