Abaqus Script学习笔记
2017-03-03 by:CAE仿真在线 来源:互联网
Abaqus Script学习笔记
1 abaqus中的对象分为两类,一类是容器对象(repository),例如steps(包含所有分析步)、frames(包含一个分析步中所有的frame)、fieldOutputs(包含一个frame中所有的场变量输出)等等,它们本身是一个list,用len函数可以得到其所包含对象的数量(例如len(steps1)),还可以用keys函数列出所有的成员,详见Abaqus Scripting User's Manual->8.5.5。例如:
for stepName in odb.steps.keys():
print stepName
输出为:
Step-1
Step-2
Step-3
##################
for fieldName in lastFrame.fieldOutputs.keys():
print fieldName
输出为:
COPEN TARGET/IMPACTOR
CPRESS TARGET/IMPACTOR
CSHEAR1 TARGET/IMPACTOR
CSLIP1 TARGET/IMPACTOR
LE
RF
RM3
S
U
另一类是单一对象(singular).例如steps中所包含的一个step对象,这类对象可以用“step1.__members__”这样的方法查询它所有的成员;
2 下面的例子演示了用elementSets得到一个特定的set,配合getSubset输出指定set的计算结果,关于getSubset函数中region参数的用法参见Abaqus Scripting User's Manual->8.5.7。
topCenter = odb.rootAssembly.instances['PART-1-1'].elementSets['CENT']
stressField = odb.steps['Step-2'].frames[3].fieldOutputs['S']
# The following variable represents the stress at
# integration points for CAX4 elements from the
# element set "CENT."
field = stressField.getSubset(region=topCenter,
position=INTEGRATION_POINT, elementType = 'CAX4')
fieldValues = field.values
for v in fieldValues:
print 'Element label = ', v.elementLabel,
if v.integrationPoint:
print 'Integration Point = ', v.integrationPoint
else:
# For each tensor component.
for component in v.data:
# Print using a format. The comma at the end of the
# print statement suppresses the carriage return.
print '%-10.5f' % component,
# After each tuple has printed, print a carriage return.
输出为:
Element label = 1 Integration Point = 1
S : 0.01230 -0.05658 0.00892 -0.00015
Element label = 1 Integration Point = 2
S : 0.01313 -0.05659 0.00892 -0.00106
Element label = 1 Integration Point = 3
S : 0.00619 -0.05642 0.00892 -0.00023
Element label = 1 Integration Point = 4
S : 0.00697 -0.05642 0.00892 -0.00108
Element label = 11 Integration Point = 1
S : 0.01281 -0.05660 0.00897 -0.00146
Element label = 11 Integration Point = 2
S : 0.01183 -0.05651 0.00897 -0.00257
Element label = 11 Integration Point = 3 ...
3 Abaqus python输入行的tab自动补全功能,详见Abaqus Scripting User's Manual->6.1.2。
相关标签搜索:Abaqus Script学习笔记 abaqus分析培训 abaqus技术教程 abaqus岩土分析 钢筋混凝土仿真 abaqus分析理论 abaqus软件下载 abaqus umat用户子程序编程 Abaqus代做 Abaqus基础知识 Fluent、CFX流体分析 HFSS电磁分析 Ansys培训