许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  abaqus python提取楼层剪力及从变形测试对象中提取节点坐标

abaqus python提取楼层剪力及从变形测试对象中提取节点坐标

阅读数 6
点赞 0
article_banner

I am trying to make a python script to extract the nodal coordinates from the ODB file (from abaqus).

So far i have come up with the code attached below (don't mind the extra information i put behind the #, sometimes it's just so i can keep track of what i'm doing)

The problem is that the coordinates i extract are those from the undeformed test subject. and i need the coordinates of the nodes from the deformed test subject.

Can somebody help me with how i reach this information using python code?

from abaqus import *

from abaqusConstants import *

import __main__

import section

import regionToolset

import displayGroupMdbToolset as dgm

import part

import material

import assembly

import step

import interaction

import load

import mesh

import optimization

import job

import sketch

import visualization

import xyPlot

import displayGroupOdbToolset as dgo

import connectorBehavior

import shutil

import os

import sys

from odbAccess import openOdb

for ODBname in os.listdir("https://www.gofarlic.com/r0333338/Documents/MP/nodal_files_genereren/OBD"): # this is where all your ODB files are located #t hier wordt ook de odb file gekozen die geopend zal worden

SUBname = ODBname[1:3] # My subject ID is saved in the ODB name - this helps me create the file #woerdt er hier de 3e tot6e letter van de ODBname gepakt ?

print 'Current File: '+ODBname #voor check welke file er gebruikt wordt #t (ZIT '.odb' hier bij in ?)

ODBnamefull = 'https://www.gofarlic.com/r0333338/Documents/MP/nodal_files_genereren/OBD/'+ODBname # Full path to the ODB file, otherwise abaqus tries to find it in default work directory

odb = openOdb(path=ODBnamefull) #open the ODB file

assembly = odb.rootAssembly #t declareren van assembly?

session.viewports['Viewport: 1'].odbDisplay.setFrame(step=0, frame=1)

numNodes = 0 #t num nodes op nul zetten

f = open("https://www.gofarlic.com/r0333338/Documents/MP/nodal_files_genereren/ODBoutput/nodal.txt", "w") #indien het bestand al bestaat moet er "a" staan ipv "w"

for name, instance in assembly.instances.items(): #t 'name' is naam van elke part van in de assembly ?

n = len(instance.nodes) #t tellen van hoeveelheid nodes

print 'Number of nodes of instance %s: %d' % (name, n) #moet niet in de file staan, kan eigenlijk weggelaten worden. (maar is een goede check?)

numNodes = numNodes + n #tellen van totaal aantal nodes (globaal over alle parts) maar is eigenlijk niet nodig?

f.write( "*Part, name=Part-1" + "\n")#moet erin staan volgens de MatchId regels

f.write( "*Nodes" + "\n") #moet erin staan volgens de MatchId regels

if instance.embeddedSpace == THREE_https://www.gofarlic.com #indien het 3D is

print ' X Y Z' #moet niet in de file staan, maar is een goede check om te zien waar we zitten

for node in instance.nodes:

#print node #printen van node

f.write( str(node.label) + ";" ) #schrijven van nodenummer

f.write(str(node.coordinates[0]) + ";" + str(node.coordinates[1]) + ";" + str(node.coordinates[2]) + "\n") #schrijven van coordinaten [X;Y;Z] en enter

else: #indien het 2D is

print ' X Y' ';0' #moet niet in de file staan, maar is een goede check om te zien waar we zitten

for node in instance.nodes:

#print node #printen van node

f.write( str(node.label) + ";" )

f.write(str(node.coordinates[0]) + ";" + str(node.coordinates[1]) + ";" + str(node.coordinates[2]) + "\n") #schrijven van coordinaten [X;Y;Z] en enter

f.write( "*End Part" ) #moet erin staan volgens de MatchId regels

f.close()

解决方案

get the displacement field:

u=odb.steps['Step-1'].frames[-1].fieldOutputs['U']

then u.values is a list of all nodal values:

u.values[i].data -> array of (ux,uy,uz)

u.values[i].nodeLabel -> node label

then you grab the original position like this:

instance.getNodeFromLabel(u.values[i].nodeLabel).coordinates

You can also directly get the deformed coordinate as a field output, but you need to request COORD output when you run the analysis.


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删

相关文章
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空