首页 > 解决方案 > 如何在没有图形用户界面和数据库模型的情况下使用 abaqus cae?

问题描述

如何在没有图形用户界面的情况下运行 Abaqus cae,但使用模型数据库(cae 文件)和命令行中的 python 脚本?
我试过这个命令:
abaqus cae database=test.cae script=test2.py,它工作得很好,但有图形用户界面,但是我正在尝试这两个命令:

  1. abaqus cae 数据库=test.cae noGUI=test2.py
  2. abaqus cae noGUI=test2.py -- test.cae

他们不工作,有人可以帮助我吗?

标签: pythonabaqus

解决方案


第二个命令应该提供您正在寻找的行为。您没有描述运行它时会发生什么,但我假设您的脚本失败了,因为它可能依赖于已经加载的 CAE 文件。在第二种情况下,您需要自己加载 CAE 文件。这来自 Abaqus 脚本参考手册 - Python 命令,在以下Mdb部分:

Abaqus mdb.openMdb 文档

您的脚本可以使用它的一种方式:

import sys
from abaqus import *

# Get the cae file path and name from the last command line argument
cae_file_path = sys.argv[-1]

openMdb(cae_file_path)

# And then find the appropriate model in mdb.models, your key may be different
# and may need to be also supplied from the command line if it changes between
# CAE files
model = mdb.models['Model-1']

推荐阅读