2

I have written a UMAT subroutine in which I call a Python code of ABAQUS simulation.

st1=SYSTEM('abaqus cae noGUI="c:\temp\pycode.py"')

I need to pass some variables from Fortran to my Python code and bring back some other values from Python to Fortran. Now, I write those variables in text files and load them in Python and Fortran. By this way, I cannot parallelize my code since all the cores wants to write in a file at the same time.

0

1 Answer 1

3

Arguments can be passed into the script by entering -- on the command line, followed by the arguments separated by one or more spaces. These arguments will be ignored by the Abaqus/CAE execution procedure, but they will be accessible within the script. Example: abaqus cae noGUI=pythonScript -- -passedToPythonScript.

For more information, see “Abaqus/CAE execution,” Section 3.2.6 of the Abaqus Analysis User's Guide

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for your response. I have seen it in the manual. However, I do not know how to get back the results of my python code to my UMAT.
Passing back to Fortran is always a challenge. I don't think cae scripts are able to return anything. Using a file is the simplest way. Alternatively, you can create an always running server that responds to requests directly and that would solve your parallelism since once request gets one answer.
Would you please elaborate the second way more? Since it is parallel, creating a file and reading it is not possible
Maybe check out this
Daniel F's answer is exactly what I meant.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.