Workflow for a Code-Aster simulation

There are many ways to perform the sequence of a simulation: preparing the geometry, creating the mesh, analysing the model, postprocessing. And perhaps you wish also to fill in software-driven a template for a report with your analysis results.

We describe here briefly only one of these ways. Thereby we seek to keep as much as possible seperated and independent the several tasks. So we start them all from the Linux Shell and do not use SalomeMeca's Aster module to setup and run an analysis.

Read more…

This means that you do not need to have installed the SalomeMeca package. It is sufficient to have a Code-Aster and a Salome installation.

Moreover if you use a different mesher and postprocessing tool then you even do not need Salome. But you must procure translators for the mesh conversion and/or for reading Code-Aster's output files or you must insert suitable code in the Code-Aster command file to procure for the translation.

1. Start SalomeMeca (or Salome):


The path where runSalomeMeca and the other programs reside may be different in your installation.

2. In Salome (or SalomeMeca) open the Geometry module

Then import an existing geometry in .step or .brep-format (Menu: File - import) or create your geometry step-by-step starting with Menu: New Entity. When ready explore your geometry with Menu: Measures - What is?. This informs you about the "SubShapes" contained in your geometry object. Example: for a cube solid you will find the follwing SubShapes: 1 shell (closed hull composed of 8 faces), 8 faces, 6 wires (closed sequence of lines enclosing a face), 12 lines, 8 vertices.

3. Change in Salome (or SalomeMeca) to the Mesh module

Create the mesh based on your geometry (Menu: Mesh - Create Mesh). The mesh knows only the element topology (SEG2, QUAD8, TETRA4, HEXA8-elements and many others,..) but does not contain any information about materials, properties (plate thicknesses, beam cross section etc.) or loads. Therefore it is necessary to create groups (of nodes and/or elements) to be included in the mesh definition.

Read more…

You will later assign materials, properties, boundary conditions etc. to these groups. A group is most basically created with Menu: Mesh - Create Group. You may select to create a Standalone-Group or a Group on geometry or a Group on filter. With the first mentioned method the group is defined by a set of IDs of elements (or nodes). The geometry-based group is defined by a SubShape of that geometry object on which your mesh is defined. This SubShape must be exploded in order to be referenced. It can be exploded "on-the-fly" meanwhile creating the group, or turning back to Salome's Geometry module and doing there Menu: New Entity - Explode. For example: if you want to fix a cube-shaped solid mesh on it's base surface, you need to explode this face as a SubShape of your solid geometry object in order to create a proper geometry-based group of nodes. When your mesh with all groups is ready explore it with Menu: Mesh - Mesh information. Visualize your mesh or groups of your mesh by highlighting in Salome's object browser your mesh object or a group and then right Mouse click - Show (or Show only). Export your mesh File - Export in .med format. The mesh is now on your hard disk.

4. Beside the Mesh you need a second input file: the command-file (.comm)

This is a file in ASCI-format containing a sequence of Code-Aster commands. During the Code-Aster run these commands will be processed successively in order to perform the desired analysis steps. The commands perform tasks such as reading the mesh file from the hard disk (LIRE_MAILLAGE), assigning materials to groups of elements or to the whole mesh (AFFE_MATERIAU), assigning loads and boundary conditions to groups of nodes or elements (AFFE_CHAR_MECA), starting the solver for a linear mechanical analysis (MECA_STATIQUE), and so on. A novice in Code-Aster, but also an experienced user will never know the vast quantity of Code-Aster commands and all their options. That's why the developpers of Code-Aster have created a very nice tool: eficas, the Code-Aster command editor:

/opt/SALOME-MECA-2014.1/appli_V7_3_0/runSession eficasQt

When using eficas to create your command file you are protected from writing wrong syntax or from arranging commands in a wrong sequence.

Read more…

eficas helps you to find out all the options belonging to the Code-Aster commands by making them graphically selectable or hiding them. 

Beside eficas there are several other methods to create a command file:

  • Change in SalomeMeca to the Aster module. Use the Wizards (templates) Linear Elastic, Modal Analysis or others which you find in Aster - Wizards. Sadly these templates are very limited.
  • Use an existing command file which you (or a collegue) developped earlier
  • Use a text editor and copy and paste commands from an existing command-file

Creating a command-file is the most challanging task when you plan to use advanced features of Code-Aster for the first time. Then you might contact us as a service provider to help you.

5. Next you need an export-file (.export)

Basically the .export-file contains a list of the names of all files - input and output files - participating at the Code-Aster run. The tool to create the export-file is astk:

/opt/SALOME-MECA-2014.1/appli_V7_3_0/runSession astk

It is common and practical - but of course not exhaustive - to include at least two input files: .med (mesh in med-format) and .comm, and three output-files: .resu(lt), .mess(age) and .rmed(results in .med-format)

Read more…

Beside astk there are several other methods to create an .export file:
Change in SalomeMeca to the Aster module. Create a "study case": Aster - Add study case. Then run the study case: Aster - current study case - run. You are doing now an analysis with the input files (.med, .comm) which you have determined for the study case. An .export file has been written to your hard disk. Use an existing .export file and adapt paths, file names and parameters, e.g. memory and time limit, to your needs.

The use of astk and the creation of your first .export file is the most troublesome, unpleasant, tedious and painful task which you have to survive. Please do not swear, do not blaspheme. There is no one who has got it easier. Find consolation in the future benefits when working with Code-Aster.

6. Now start the analysis:

/opt/SALOME-MECA-2014.1/appli_V7_3_0/runSession as_run yourfile.export

If the analysis runs well (generally it does not at the beginning!) you will find all output files on your hard disk.

Read more…

There are also ways to start the Code-Aster run from astk and from the Aster module of SalomeMeca.

7. Postprocessing

Let's hope that you have inserted the command IMPR_RESU (print result to output file) in your command file after the solver command. Depending on the format specification (FORMAT='MED' or FORMAT='RESULTAT') given in IMPR_RESU the results will be printed to the .rmed-file or in ASCI-Format to the .resu-File. The .rmed-file can be opened in a graphical postprocessor such as

  • the ParaViS module of SalomeMeca, or
  • gmsh

where you can create the usual plots of the deformed structure, vanMises stresses and so on.

Read more…
  • gmsh is very handy for small and medium sized models. With larger models gmsh becomes slow, use better ParaViS
  • gmsh is also a versatile and scriptable meshing tool
  • gmsh is able to read meshes in Nastran format and export them in .med-format. So it is a means to transfer a Nastran mesh to Code-Aster. But caution: not all element topologies are transfered, and no groups are contained in the .med file after the transfer.
  • ParaViS is nothing different than ParaView, plugged in SalomeMeca and provided with a .med-format reader to read Code-Aster's result files.