如何在 ABAQUS 中请求能量场输出 Python
How to request energy field output in ABAQUS Python
我正在尝试提取 Abaqus 中每个积分点的能量。我可以为压力或应变做,但我不能为能量量做。获得的错误是:“KeyError: 'ELEN'”,但在 Abaqus 中它是 good keyword...下面是我提取它的代码:
from odbAccess import *
import numpy as np
odb = openOdb(path='C:/Desktop/Fish1.odb')
# lastFrame = odb.steps['Step-2'].frames[-1]
lastFrame = odb.steps['Step-1'].frames[-1]
topCenter = \
odb.rootAssembly.instances['PART-1-1']
stressField = lastFrame.fieldOutputs['ELEN']
field = stressField.getSubset(region=topCenter,
position=INTEGRATION_POINT, elementType = 'CPS3')
fieldValues = field.values
sortie = open('C:/Users/tests.txt', 'w')
sortie.write('Eleme \t Integ \t\t PE11 \t\t\t PE22 \t\t\t PE12 \n')
for v in fieldValues:
sortie.write('%-10.2f'% ( v.elementLabel))
if v.integrationPoint:
sortie.write('%-10.2f'% (v.integrationPoint))
sortie.write('%-10.3f\t\t %-10.3f\t\t %-10.3f\t\t %-10.3f\t\t \n'% (v.data[0], v.data[1], v.data[2], v.data[3]))
sortie.close()
我想您已经在 Abaqus Viewer 中检查过 FieldOutput ELEN 是否可用。
ELEN 是一个整体元素变量,所以你不能在积分点提取它,因为它在那里不可用。
from odbAccess import *
import numpy as np
odb = openOdb(path='C:/Desktop/Fish1.odb')
lastFrame = odb.steps['Step-1'].frames[-1]
topCenter = odb.rootAssembly.instances['PART-1-1']
stressField = lastFrame.fieldOutputs['ELEN']
field = stressField.getSubset(region=topCenter, elementType = 'CPS3')
fieldValues = field.values
尽管这不是您真正要求的解决方案,但我希望这会有所帮助。
我正在尝试提取 Abaqus 中每个积分点的能量。我可以为压力或应变做,但我不能为能量量做。获得的错误是:“KeyError: 'ELEN'”,但在 Abaqus 中它是 good keyword...下面是我提取它的代码:
from odbAccess import *
import numpy as np
odb = openOdb(path='C:/Desktop/Fish1.odb')
# lastFrame = odb.steps['Step-2'].frames[-1]
lastFrame = odb.steps['Step-1'].frames[-1]
topCenter = \
odb.rootAssembly.instances['PART-1-1']
stressField = lastFrame.fieldOutputs['ELEN']
field = stressField.getSubset(region=topCenter,
position=INTEGRATION_POINT, elementType = 'CPS3')
fieldValues = field.values
sortie = open('C:/Users/tests.txt', 'w')
sortie.write('Eleme \t Integ \t\t PE11 \t\t\t PE22 \t\t\t PE12 \n')
for v in fieldValues:
sortie.write('%-10.2f'% ( v.elementLabel))
if v.integrationPoint:
sortie.write('%-10.2f'% (v.integrationPoint))
sortie.write('%-10.3f\t\t %-10.3f\t\t %-10.3f\t\t %-10.3f\t\t \n'% (v.data[0], v.data[1], v.data[2], v.data[3]))
sortie.close()
我想您已经在 Abaqus Viewer 中检查过 FieldOutput ELEN 是否可用。
ELEN 是一个整体元素变量,所以你不能在积分点提取它,因为它在那里不可用。
from odbAccess import *
import numpy as np
odb = openOdb(path='C:/Desktop/Fish1.odb')
lastFrame = odb.steps['Step-1'].frames[-1]
topCenter = odb.rootAssembly.instances['PART-1-1']
stressField = lastFrame.fieldOutputs['ELEN']
field = stressField.getSubset(region=topCenter, elementType = 'CPS3')
fieldValues = field.values
尽管这不是您真正要求的解决方案,但我希望这会有所帮助。