Atom topic feed | site map | contact | login | Protection des données personnelles | Powered by FluxBB | réalisation artaban
You are not logged in.
hello,
how can Code-Aster be used in the "pythonic way"?
The new pythonic way (since v 15) is shown in this training document:
https: //code-aster.org/UPLOAD/DOC/Formations/20-asterxx-inanutshell.pdf
The problem is when starting from the bash:
singularity run --bind /home:/home /opt/SaloMec2021/salome_meca-lgpl-2021.0.0-1-20210811-scibian-9.sif shell
(details see at https: //code-aster.org/forum2/viewtopic.php?id=26013)
the salome shell appears. What to do next? I would instead need a python shell in order to do
export PREFIX=/home/myNNI/dev/codeaster/install/
. $PREFIX/share/aster/profile.sh
import code_aster
from code_aster.Commands import *
code_aster.init()
monMaillage = code_aster.Mesh()
and so on and so on . . .
Many thanks and regards
Johannes_ACKVA
*** NEW: all Code-Aster courses now as Video and Webinar courses ***
Ingenieurbüro für Mechanik
D 91717 Wassertrüdingen / Germany
www.code-aster.de Training & Support for NASTRAN and CODE-ASTER
Offline
hi,
looks like there is a path missing so python can look it up:
What i tried in python and it seems to work
import sys
sys.path.append('/opt/salome_meca/Salome-V2021-s9/tools/Code_aster_stable-1540/lib/aster/')
import code_aster
else you could add this in bash
export $PYTHONPATH=/opt/salome_meca/Salome-V2021-s9/tools/Code_aster_stable-1540/lib/aster/:$PYTHONPATH
but i have no idea on how to fix this in the container, or if there is another way which would work.
best regards
Offline
Hello,
The container embeds a convenient starter script. See `singularity run-help NAME.sif`
It tells you to run: `singularity run --app install NAME.sif`
Then just use the created script, named as `NAME` (without .sif)
See `./NAME --help` for options.
Next steps:
$ ./NAME shell
Singularity> /opt/salome_meca/Salome-V2021-s9/tools/Code_aster_stable-1540/bin/run_aster FILENAME.export
See `run_aster --help`
Example: for interactive executions (it will stop before executing FIN):
$ ./NAME shell
Singularity> /opt/salome_meca/Salome-V2021-s9/tools/Code_aster_stable-1540/bin/run_aster -i FILENAME.export
The next version (>16.1) will allow to directly use `run_aster FILENAME.py`...
MC
Code_Aster release : last unstable on Ubuntu 16.04 64 bits - GNU Compilers
Please do not forget to tag your first post as *SOLVED* when it is!
Offline
Hello,
I tried to launch code_aster from Python, but without success.
When loading the necessary environment (share/aster/profile.sh) the Python environment seems to be misconfigured (see attachment).
Moreover, using Celdor's method I can execute the
import code_aster
command, but the command below crashes, which is not surprising because the profile.sh contains more path definitions than lib/aster:
from code_aster.Commands import *
Offline