Isight联合Abaqus优化流程本质是通过脚本自动化执行每次手动修改模型参数、创建提交计算任务的工作。每执行一次abaqus计算,即通过内置脚本自动修改abaqus输入文件中要优化的参数,并将所有文件树中的文件临时复制一份,自动调用abaqus程序提交任务计算,并将计算结果传回到Isight。

其每次执行过程会自动生成一个名为execInp.py的python脚本,其在打开Cae文件之后,会自动检测当前工作文件夹是否有用户自定义前处理和后处理脚本,并调用。其调用过程的代码如下:
try:
if os.path.exists('userscript_cae_pre.py'):
import userscript_cae_pre
userscript_cae_pre.runUserScript(mdb, values)
except Exception, ex:
# write the error to an error file
errFile = open('errors.txt','a')
errFile.write(str(ex))
errFile.close()
前处理脚本是在isight修改模型参数之前调用的,可以用来自动建模等等。后处理脚本是修改模型参数之后调用的,可以用于模型参数更新之后的接触行为、边界行为的定义等等。
if os.path.exists('userscript_cae_post.py'):
import userscript_cae_post
userscript_cae_post.runUserScript(mdb, values)
# Write the updated input file
使用之前先在abaqus组件编辑板块,勾选use custom scripts.

同样结果后处理也可以用同样的方法编写自定义脚本进行。

免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删