简体   繁体   English

如何将参数传递给ABAQUS python代码?

[英]How can I pass arguments to an ABAQUS python code?

I have written a UMAT subroutine in which I call a Python code of ABAQUS simulation. 我编写了一个UMAT子例程,在其中调用了ABAQUS模拟的Python代码。

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. 我需要将一些变量从Fortran传递到我的Python代码,并将其他一些值从Python传递回Fortran。 Now, I write those variables in text files and load them in Python and Fortran. 现在,我将这些变量写入文本文件,然后将其加载到Python和Fortran中。 By this way, I cannot parallelize my code since all the cores wants to write in a file at the same time. 这样,由于所有内核都希望同时写入文件,因此我无法并行处理代码。

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. 这些参数将被Abaqus / CAE执行过程忽略,但是可以在脚本中访问。 Example: abaqus cae noGUI=pythonScript -- -passedToPythonScript . 示例: abaqus cae noGUI=pythonScript -- -passedToPythonScript

For more information, see “Abaqus/CAE execution,” Section 3.2.6 of the Abaqus Analysis User's Guide 有关更多信息,请参见《 Abaqus Analysis用户指南》第3.2.6节中的“ Abaqus / CAE执行”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM