简体   繁体   English

在Abaqus ODB中处理张量数据

[英]manipulating tensorial data in Abaqus ODB

I want to sum all the Strain Energy Density (ELSE) values of every mode (Frames from modal analysis) of my odb and save it in a new Frame. 我想对odb的每个模式(模态分析的框架)的所有应变能密度(ELSE)值求和,并将其保存在新框架中。

My code works fine with the displacements 'U' and type=VECTOR But when I change it to 'ELSE' and type=TENSOR_3D_FULL I got the following error: 我的代码在位移'U'和type = VECTOR上工作正常,但是当我将其更改为'ELSE'在type = TENSOR_3D_FULL时,出现以下错误:

Traceback (most recent call last):    File "..\Python\modaldata.py", line 62, in <module> 
    newField.addData(field=strechtMode1)  OdbError: Fields are not compatible. They are either associated with different structural models or have incompatible attributes.

Do I have to use another method to manipulate tensorial data? 我是否必须使用另一种方法来处理张量数据? I found something with position=ELEMENT_NODAL but with a total differen approach by getting certain scalar stress values of certain nodesets. 我找到了一些具有position = ELEMENT_NODAL的东西,但通过获取某些节点集的某些标量应力值而采用了完全不同的方法。 I want the whole ELSE Tensor for every Integrationpoint of every Element as a new Frame. 我希望将每个元素的每个集成点的整个ELSE张量作为一个新框架。

Here is my code: 这是我的代码:

#-ODB OEFFNEN------------------------------------------------------------------------#    
odb = openOdb(odbName) 
#-DIE MODEN EINZELN ABSPEICHERN UM SIE VERRECHNEN ZU KOENNEN-------------------------#
nmoden=len(odb.steps['Modalanalyse'].frames)

#------------------------------------------------------------------------------------#
#-FIELD VARIABLE ZIEHEN UND VERRECHNEN-----------------------------------------------#
#------------------------------------------------------------------------------------#

field='U' # ''ELSE' # U oder E oder ELSE oder whatever...
type=VECTOR #TENSOR_3D_FULL  # muss an das field angepasst werden. 

Modes_field=[]
for i in range(nmoden):
    Modes_field.insert(i,odb.steps['Modalanalyse'].frames[i].fieldOutputs[field])  
#-FIELD VARIABLE ALLER MODEN UEBERLAGERN---------------------------------------------#
sumAllModes_field = Modes_field[0]
for i in range(nmoden):
    sumAllModes_field = sumAllModes_field + Modes_field[i] 
#-NEUE FIELD VARIABLE MODE ABSPEICHERN-----------------------------------------------#
newFrame = odb.steps['Modalanalyse'].Frame(incrementNumber=0, frameValue=0.0)
newField = newFrame.FieldOutput(name=field, description='sum of ELSE of all modes', type=type)
newField.addData(field=sumAllModes_field)
#-ODB ABSPEICHERN--------------------------------------------------------------------#
odb.save()

ELSE is a total energy. ELSE是一种总能量。
Thus, its field output type is SCALAR. 因此,其字段输出类型为SCALAR。 And that is why you get your error, you are trying to populate a TENSOR_3D_FULL field with SCALAR field values. 这就是为什么出现错误的原因,您试图用SCALAR字段值填充TENSOR_3D_FULL字段。

I strongly recommend using prettyPrint from the textRepr library in order to access a field and get a better idea of its properties. 我强烈建议使用textRepr库中的prettyPrint来访问字段并更好地了解其属性。

from textRepr import prettyPrint as pp  

pp(odb.steps['Modalanalyse'].frames[-1].fieldOutputs['ELSE'])
pp(sumAllModes_field)
pp(newField)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM