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

You are not logged in.

#1 Code_Aster usage » Trouble seeing values from tables using IMPR_TABLE » 2019-11-17 17:37:58

Giamma1997
Replies: 1

I am using the post releve T in order to have a table showing the strain values of my model. Then I am printing them using IMPR_TABLE. The problem is when opening the file, some of the columns are over others and not one after anther one, so is a little hard to see the values of strain for each node. This is are the two commands on my command file and I have attached the table for the strain. Thank you for the help!


table2 = POST_RELEVE_T(ACTION=(_F(GROUP_NO=('N1', ),
                                  INTITULE='node1',
                                  NOM_CHAM='EPSI_ELNO',
                                  OPERATION=('EXTRACTION', ),
                                  RESULTAT=finalmoy,
                                  TOUT_CMP='OUI',
                                  TOUT_ORDRE='OUI'),
                               _F(GROUP_NO=('N2', ),
                                  INTITULE='node2',
                                  NOM_CHAM='EPSI_ELNO',
                                  OPERATION=('EXTRACTION', ),
                                  RESULTAT=finalmoy,
                                  TOUT_CMP='OUI',
                                  TOUT_ORDRE='OUI'),
                               _F(GROUP_NO=('N3', ),
                                  INTITULE='node3',
                                  NOM_CHAM='EPSI_ELNO',
                                  OPERATION=('EXTRACTION', ),
                                  RESULTAT=finalmoy,
                                  TOUT_CMP='OUI',
                                  TOUT_ORDRE='OUI'),
                               _F(GROUP_NO=('N4', ),
                                  INTITULE='node4',

IMPR_TABLE(FORMAT='TABLEAU',
           TABLE=table2,
           UNITE=4)

#3 Re: Code_Aster usage » Problems while reading med file with as_run » 2019-11-14 09:45:36

konyaro wrote:

Hello,
You read your mesh in logical unit 2:

mesh0 = LIRE_MAILLAGE(FORMAT='MED',
                      UNITE=2)

But your logical unit in your export file is 20:

F libr /home/students/gbroilo/Desktop/Script/Template_1_4/Mesh_1.med D  20

That's why your MED file is not found.

Konyaro

Thank you for your reply! This time I tried to change the logical unit to 2 in the export file but I get the following error message when trying to run the file with as_run:    (I have attached the new export file)

<A>_COPY_DATA      '/home/students/gbroilo/Desktop/Script/Template_1_4/Scriptstudy.comm' overwrites 'fort.1.1'

copying .../Template_1_4/Scriptstudy.comm...                            [  OK  ]
copying .../Template_1_4/Mesh_1.med...                                  [FAILED]
Exit code : 256
cp: cannot stat '/home/students/gbroilo/Desktop/Script/Template_1_4/Mesh_1.med': No such file or directory

#4 Code_Aster usage » Problems while reading med file with as_run » 2019-11-13 20:10:27

Giamma1997
Replies: 4

I am trying to run a simulation using as_run, I have created the med file, command file and export file. When I try to run the simulation with as_run I get the following message:


   !-------------------------------------------------------------------------------!
   ! <EXCEPTION> <PREPOST3_10>                                                     !
   !                                                                               !
   !  either the file does not exist, or it is a bad version of HDF (uses by MED). !
   !-------------------------------------------------------------------------------!
   


I have attached med comm mess and .py files

#5 Code_Aster usage » Command to export MED file » 2019-11-04 19:03:54

Giamma1997
Replies: 1

Hello community,

I am automating the simulation process of Code Aster using a bash script. Right now I can export multiple dump studies and change automatically some values of the geometry. I just have one question, how can I automatically export the MED file in the specific folder?
Right now with my bash script, I am using the echo command to add to the dump study the "command" and path to export the med file:

try:
Mesh_1.ExportMED( r\047/'${path}'/'Template_${step_x}_${step_y}'/Mesh_1.med\047, 0, SMESH.MED_V2_2, 1, None ,1)
pass
except:
print \047ExportToMEDX() failed.
Invalid file name?

This does not automatically export me the med file but If I open the dump study with Salome and compute the mesh, it automatically export the med file to the right folder.

How can I fix this?

Thank you very much, I have attached the dump.py file

#6 Re: Code_Aster usage » Automation with Python » 2019-10-23 17:22:17

Thank you very much my friend!!! You really helped me a lot with that.

#7 Code_Aster usage » Automation with Python » 2019-10-22 14:05:23

Giamma1997
Replies: 2

Hello everyone

I am currently working on automating simulations using a python script.
My goal is to simulate a 2D plate with a hole in it. Each simulation provides results of stress and strain with the hole in a specific location. The python script should be able to:
1. take a template file (for example I'm using the dump study) and edit some coordinates
2. export this new file in a new folder (for example TEST1)
3. Run a simulation on that fie with a already created command file and export the results in the TEST1 folder
4. repeat this process for a desire amount of time.

As I'm not very good with python scripting and I couldn't find much on automating the simulation process I wrote the basic template of the python script that would translate the coordinates of the input file. I have attached here the template file. Any help would be greatly appreciated!!!

here is the code that I started to write:

#!bin/bash

x=20;    #fix value of x
NewValue = x+i;    #new value of x to replace fix value

for i in {1..60}
do
    $sed         ’s/x/NewValue/g‘    prova.py > prova1.py

    #command to run simulation
    #export in folder

done

#8 Code_Aster usage » Parametric study in Code Aster » 2019-10-21 13:35:13

Giamma1997
Replies: 0

Hello community, I am currently working on a study in which I need to complete a couple hundreds simulations of a static mechanical analysis and I would like to know if it is possible to automate the simulation process using a python script. The simulations are done on a 2D plate with a crack on it. This crack has to translate on the X and Y coordinate in order to simulate different crack locations on the plate. Is there a way to create a python script that automatically modify the text file of the geometry (the dump study) and translate the crack coordinates and export it in a folder? This crack would have to translate by small increments. I have attached the example of the geometry of the plate if that could help.

Thank you very much for your help !!!