Abaqus Script學(xué)習(xí)筆記
2017-03-03 by:CAE仿真在線 來(lái)源:互聯(lián)網(wǎng)
Abaqus Script學(xué)習(xí)筆記
1 abaqus中的對(duì)象分為兩類,一類是容器對(duì)象(repository),例如steps(包含所有分析步)、frames(包含一個(gè)分析步中所有的frame)、fieldOutputs(包含一個(gè)frame中所有的場(chǎng)變量輸出)等等,它們本身是一個(gè)list,用len函數(shù)可以得到其所包含對(duì)象的數(shù)量(例如len(steps1)),還可以用keys函數(shù)列出所有的成員,詳見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
另一類是單一對(duì)象(singular).例如steps中所包含的一個(gè)step對(duì)象,這類對(duì)象可以用“step1.__members__”這樣的方法查詢它所有的成員;
2 下面的例子演示了用elementSets得到一個(gè)特定的set,配合getSubset輸出指定set的計(jì)算結(jié)果,關(guān)于getSubset函數(shù)中region參數(shù)的用法參見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自動(dòng)補(bǔ)全功能,詳見Abaqus Scripting User's Manual->6.1.2。
相關(guān)標(biāo)簽搜索:Abaqus Script學(xué)習(xí)筆記 abaqus分析培訓(xùn) abaqus技術(shù)教程 abaqus巖土分析 鋼筋混凝土仿真 abaqus分析理論 abaqus軟件下載 abaqus umat用戶子程序編程 Abaqus代做 Abaqus基礎(chǔ)知識(shí) Fluent、CFX流體分析 HFSS電磁分析 Ansys培訓(xùn)