Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2021-04-19 19:24:10

aep93
Member
Registered: 2020-02-21
Posts: 97

Run code_aster file with Matlab

Hello all,
Are there any ways to run a comm file with MATLAB?
Any ideas are appreciated.

Offline

#2 2021-04-23 05:56:50

konyaro
Member
From: Genève
Registered: 2016-04-02
Posts: 262

Re: Run code_aster file with Matlab

Hello,
if you search for "run aster with python" on the forum you will get many results you can convert to Matlab. I use the following python script:

if os.name == 'nt':
    print('Lancement du calcul sous Windows')
    command = '{!s} {!s}'.format(os.path.join(repAsRun, 'as_run.bat'), export_file)
else:
    print('Lancement du calcul sous Linux')
    command = '{!s} shell -- as_run "{!s}"'.format(os.path.join(repAsRun, 'salome'), export_file)
process = subprocess.Popen(command, shell=True)
process.wait()

- repAsRun : path to your CA installation
- export_file : your export file

Konyaro

Last edited by konyaro (2021-04-23 05:57:19)


失敗は成功のもと (L'échec est la base de la réussite)

Offline

#3 2021-04-23 07:37:11

aep93
Member
Registered: 2020-02-21
Posts: 97

Re: Run code_aster file with Matlab

Thank you very much for your response konyaro. I will try it.
I think maybe one easier way is to somehow run the commands that we use to run aster run inside the terminal, inside MATLAB. I mean, somehow using the MATLAB as a terminal for running the as_run command. I am still not sure whether this method works. Any ideas in this regard are also greatly appreciated.

Offline