python - 如何在没有图形用户界面和数据库模型的情况下使用 abaqus cae?
问题描述
如何在没有图形用户界面的情况下运行 Abaqus cae,但使用模型数据库(cae 文件)和命令行中的 python 脚本?
我试过这个命令:
abaqus cae database=test.cae script=test2.py,它工作得很好,但有图形用户界面,但是我正在尝试这两个命令:
- abaqus cae 数据库=test.cae noGUI=test2.py
- abaqus cae noGUI=test2.py -- test.cae
他们不工作,有人可以帮助我吗?
解决方案
第二个命令应该提供您正在寻找的行为。您没有描述运行它时会发生什么,但我假设您的脚本失败了,因为它可能依赖于已经加载的 CAE 文件。在第二种情况下,您需要自己加载 CAE 文件。这来自 Abaqus 脚本参考手册 - Python 命令,在以下Mdb
部分:
您的脚本可以使用它的一种方式:
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']
推荐阅读
- javascript - 如何在触发 toggleClass 语句后修复不可见元素(burgermenu)
- javascript - 移动导航栏显示选项彼此相邻而不是彼此下方
- google-bigquery - Big Query 对于简单查询来说耗时太长
- odoo - 以多公司模式搜索产品 Odoo
- csv - 如何使用 Spark 从本地驱动程序节点读取 csv 文件?
- r - How to fill a column based on a condition using sum() for matches in r
- gradle - Gradle exec task fails with "execCommand == null!"
- powerapps - 来自 powerapps 的 ms 流中的文件系统错误
- firebase - Flutter Firebase Android/ios Google 登录错误
- codeigniter - 如何在 codeigniter 中进行 128 位/32 字符加密?