-
-
Notifications
You must be signed in to change notification settings - Fork 4
Installation instructions for Code_Aster
This guide is meant as a brief overview for those who are not yet familiar with Code_Aster. Please consult the official documentation of Code_Aster for any issues.
There are two possible ways to install the Code_Aster solver on your system:
- The easiest and most intuitive way, is to install Salome-Meca. This is a user-friendly Code_Aster implementation, that also provides pre- and post-processing software. It can be used to create the mesh and model, and it also provides the post-processing software ParaVis.
- The second method to install Code_Aster on your system is to download a package containing the Code_Aster source code. This grants the possibility to run the Code_Aster solver from a script, but brings about some additional complexities during installation. This implementation of Code_Aster is supported for coupling with preCICE.
To install Code_Aster, download the full package on code-aster.org, under download. It is recommended to install a stable version of Code_Aster (here 14.4).
Make sure to have the code_aster dependencies installed before building code_aster.
For Ubuntu, you may install the following packages:
bison cmake make flex g++ gcc gfortran\
grace liblapack-dev libblas-dev\
libboost-numpy-dev libboost-python-dev\
python3 python3-dev python3-numpy\
tk zlib1g-devExtract the package. Inside it you will find a folder SRC/ which contains the source code for Code_Aster, and all the tools that it calls.
In the setup.cfg file you can set the root directory of the Code_Aster installation (the path where you extracted Code_Aster), the preferred compiler, and some paths to dependencies. The latter can be a good first thing to check if the installation of Code_Aster fails due to unresolved dependencies. For this guide, we only set the ASTER_ROOT and leave the rest of the setup.cfg unchanged.
To initiate the installation of Code_Aster, redirect the terminal to the location of the setup.py file, and run the following command.
python3 setup.py install --prefix=$ASTER_ROOT
The installation will ask you to confirm the automatically-set environment soon after it starts. Make sure that none of the dependencies listed are missing, and that there are no unexpected messages. It can happen that some optional dependencies (such as nedit, geany or gvim) are not found, this is not a problem. Once confirmed that everything is correct, you can go ahead and tell the terminal to continue the installation.

Code_Aster and the bundled dependencies will now be built. This can take a while.
After the installation is done, check that all tools have been installed correctly. If a tool was not installed correctly, one should go through the log file, and try to run the installation again. Alternatively, a tool can be installed manually, and its home directory can be set in setup.cfg. In this case, make sure that the required version of the tool is installed. For Code_Aster 14.4 the bundled dependency versions are:
- hdf5 1.10.3
- med 4.0.0
- gmsh 3.0.6
- scotch 6.0.4
- astk 2019.0
- metis 5.1.0
- tfel 3.2.1
- mumps 5.1.2
- homard 11.12

Once the solver has been installed successfully, add the following line to the bashrc (run gedit ~/.bashrc) and start a new session:
source $ASTER_ROOT/etc/codeaster/profile.sh
where $ASTER_ROOT you should replace with the actual path where you build Code_Aster. This line will make sure that once the user runs the just built Code_Aster version with the as_run command. If your package manager suggests to install a binary package of Code_Aster (do not install it), you may have not set the $ASTER_ROOT path correctly.
We can test the installation of Code_Aster with the following command:
as_run --vers=14.4 --test forma01a
If everything is as expected, the output should be --- DIAGNOSTIC JOB : OK.

You can then continue with installing the Code_Aster adapter for preCICE.
If anything fails, please have a look at the Code_Aster documentation, and feel free to contact us.
More information on precice.org. Subscribe to the preCICE mailing list.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Please use "precice.org" for the attribution.
We moved these pages to the preCICE website: https://www.precice.org/adapter-code_aster.html
