Help Forums

Running with Matlab an Abaqus python script involving a subroutine  


totofr
Posts: 4
(@totofr)
New Member
Joined: 10 years ago

Hello,

I have succeeded in executing, with the classical abaqus command line window, a python script which makes use of a subroutine. No problem, calculations went fine.

But when I want to do the same from matlab, this does not work and results into an error.

system(['abaqus cae noGUI=script.py']);

-> error from matlab: WindowsError: [Error 2] The system cannot find the file specified

Does someone know how to solve this problem or is it possible to do this under matlab in the first place ?

thanks

Topic Tags
5 Replies
Jorgen
Posts: 3835
Moderator
(@jorgen)
Member
Joined: 2 months ago

I have stopped using Matlab, I now prefer the language Julia. Julia is free, and developed by a team from MIT. (My minor while I studied for my Ph.D. at MIT was in numerical math, and I took classes from the same team that later developed Julia.)

It should certainly be possible to do what you are trying to do using Matlab. It you are using a Windows computer, then you may have to specify the complete path to "abaqus.bat" for it to work. Since I prefer Linux, I don't need to worry so much about bat-files any more 😎 

-Jorgen

Reply
3 Replies
totofr
(@totofr)
Joined: 10 years ago

New Member
Posts: 4

@jorgen

Hello Jorgen,

thanks for your reply and the introduction to Julia.

I have checked in matlab with getenv('PATH') and the path for "abaqus.bat" is correctly specified: C:\SIMULIA\Abaqus\Commands

(the paths for the fortran compiler are also present).

By the way, when I use the same command in Matlab with a python script not using a fortran subroutine, it works well. It can execute the job without problem.

I am really confused.

best

 

Reply
David Nolan
(@davidn)
Joined: 6 years ago

New Member
Posts: 2

@totofr

Hi, this is a problem I came across before. I have the hacky solution below. The problem is that the command line needs to access ifort, which it won't do unless environment is setup to do this. The code below should work once you change the paths to the IFortVars.bat to what it is on your machine. There is probably a little trial and error to getting the path correct on your machine.

string = ['C:\Windows\SysWOW64\cmd.exe /K' ...
'""C:\Program Files (x86)\Intel\Composer XE 2013\bin\IFortVars.bat" intel64 vs2010 & abaqus '
'j=jobName '...
'inp=inpName.inp '...
'user=umatName.for '...
'int & exit"'];

job1 = system(string);
Reply
totofr
(@totofr)
Joined: 10 years ago

New Member
Posts: 4

@davidn

Hello David,

thank you for your answer. I will try this and keep you informed.

Reply
totofr
Posts: 4
(@totofr)
New Member
Joined: 10 years ago

Dear David,

I just return from a workshop and have tested your solution by adapting it to my folders.

It works fine !

Thank you so much !

Reply
Share:

Please Login or Register