Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2021-06-25 10:39:06

Registered: 2021-06-03
Posts: 3

Create a geometry from .txt file

Hello, I am not very good at programming on Python and also on the Salome-méca software. However I must create a structure on Salome meca. And to do that, I create a point list using a Python code (send as attachment) which gives me a text file.
I would like to know if it is possible to open a text file that reads the different values of the file to create points automatically.
Although having searched on different forums I have not found a way to do this, I have come to ask for your help to be able to achieve this. Because writing a hundred points by hand is quite boring.
Thank you for your help.

ploteur_profil_NACA.gnuplot, Size: 477 B, Downloads: 53


#2 2021-07-06 15:00:39

Registered: 2015-03-16
Posts: 209

Re: Create a geometry from .txt file


You can use the Salome-Geom or Salome-Shaper Module to create your geometry in the Salome-Meca itself and then use Mesh module to create the mesh. There are very good tutorials in the YouTube for beginners as well. Some of them I recommend are "feaforall", "Digvijay Patankar" and "FEA with FLOSS". Alternatively you can use gmsh which is another free and light weight but powerful meshining program (W__gmsh/info) where you can also generate the geometry and then mesh it. Again there are many video tutorials on gmsh in YouTube including in the last channel mentioned above. For using gmsh you may also refer to the only Book on Code-aster by J. P. Aubry which is an excellent book, freely available at  H__PS://framabook.org/beginning-with-code_aster/ (Please correct the urls appropriately as I am not allowed to enter url here).

If you are interested to write your mesh file manually, that is also possible, by following the ASTER format. I am enclosing an ASTER mesh of a homogeneous slope, having 3-noded Triangular Elements (TRIA3). You may refer to Code-Aster Documentation U3.01.00 for details of the file format. But for realistic projects, that won't be convenient and may be error prone, I suppose.

Best wishes in your journey with this wonderful and powerful but absolutely free software Salome-Meca/Code-Aster.


Slope01WithNodeGroups.dat, Size: 479.04 KiB, Downloads: 50