I teach finite elements with application to solid mechanics using the Code_Aster software and Simscale.
Quick tutorial for your first simulation with Code_Aster (after instalation)
We will run the use case sdld02a from the examples/benchmarks provided with code_aster. The examples can accessed in the directory : aster-full-src-xx.x.x/SRC/aster-xx.x.x/astest, where xx.x.x is your downloaded Code_Aster version.
STEP 1 : Copy the following files to your working directory
- sdld02a.comm : command file
- sdld02a.mail : meshing file
- sdld02a.export : parameters file. this post explains how to create a basic export file.
STEP 2 : RUN the model with the command
as_run sdld02a.export
You may add a line with :
P mode interactif
to the .export file. If your get an error “file not found : config.txt“, then you should check your export file. Make sure to not mix up different kind of new-lines otherwise the export file parser may have difficulty to load your export file. Finally adding the line (XX.X is your Code_Aster version)
P version XX.X
may help locate the right config.txt.
Documentation about this use case is available here. It solves a two-dimensional problem consisting of finding the frequencies and modes of vibration of a mechanical structure composed of 8 masses and 7 springs. This benchmark corresponds to a dynamic analysis of a discrete model with linear behavior.
STEP 3 : View your model
In order to view your model with a software like Paraview you need first to export a 'med' file during your simulation. For this add to your 'comm' file the following command and re-run the simulation.
# Impression au format MED du fichier de maillage après modification
unit2=DEFI_FICHIER(ACTION='ASSOCIER', ACCES='NEW',TYPE='LIBRE', FICHIER='/home/user/test.med',)
IMPR_RESU(UNITE=unit2,FORMAT='MED',RESU=_F(MAILLAGE=MA, RESULTAT= FREQ ,),)
DEFI_FICHIER(ACTION='LIBERER',UNITE=unit2,)
DETRUIRE(CONCEPT=_F(NOM=unit2),INFO=1,)
If you build your own mesh, using gmesh, then make sure to use the 2.2 version of gmesh. Example :
gmsh -3 geometry_file.geo -format msh2
then you can use, the PRE_GMSH command in Code_Aster to load the gmsh mesh.
in the course, we use simscale to view the model. simscale is a cloud basis CFD and FEM suite based on OpenFoam and Code_Aster. You need top create a free account to use it. Once you have your account go to your Dashboad, create a new folder and then a new project. Once you created a new project you drag and drop the med file from your simulation to view it.