Introduction
Code-Aster is a powerful open-source software for numerical simulations in mechanics and thermodynamics. It is widely used for structural and thermal analysis in various fields. This guide will walk you through running Code_Aster simulations on the Qarnot platform.
Versions
The test case uses Code-aster 14.6
If you are interested in another version, please email us at qlab@qarnot.com.
Test case
Please ensure that you have created a Qarnot account here.
This test case is a based on BEAM 2D study. You can download the case folder here, which contains the mesh and case setup files. You should put it at the same folder level as the script to launch the calculation. Please note that it needs to be unzipped before it can be used on Qarnot.
Launching the case
Before starting a calculation with the Python SDK, a few steps are required:
Once everything is set up, the following script needs to be used to start the calculation.
To launch this script, simply copy the following code in a Python script, put at the same level as the input folder and execute python3 SampleCodeaster.py
in your terminal.
Your tree should look like :
sample_codeaster.py
input/
allruncodeaster.sh
sample_case/
etudepoutre2D.comm
- …
Be sure you have copied your authentication token in the script (instead of <<<MY_SECRET_TOKEN>>>
) to be able to launch the task on Qarnot.
sample_codeaster.py
#!/usr/bin/env python3
import qarnot
# Create a connection
conn=qarnot.connection.Connection(client_token='<<<MY_SECRET_TOKEN>>>')
# Create a task
task = conn.create_task("codeaster", "docker-batch", 1)
# Create a resource bucket and add input files
input_bucket = conn.retrieve_or_create_bucket("codeaster-input")
input_bucket.sync_directory("input")
# Attach the bucket to the task
task.resources.append(input_bucket)
# Create a result bucket and attach it to the task .
output_bucket = conn.retrieve_or_create_bucket("codeaster-output")
task.results = output_bucket
task.constants["DOCKER_REPO"] = "qarnotlab/code_aster"
task.constants["DOCKER_TAG"] = "latest"
task.constants["DOCKER_CMD"] = "/job/allruncodeaster.sh"
# Submit the task to the Api, that will launch it on the cluster
task.run(output_dir="codeasterout")
Results
At any given time, you can monitor the status of your task on the general web interface Tasq. The following figure shows a successful Code-aster demo simulation on Tasq.
You should also now have a result folder in the output bucket (Med file) and on your computer containing all the numerical results. You can open the output file to view the results in Gmsh or any other viewer.
Wrapping up
That’s it! If you have any questions, please contact qlab@qarnot.com and we will help you with pleasure!