Sergiano
Mechanical
- Apr 26, 2019
- 1
I'm modelling high speed water impact in a structure. The water jet is modeled with an Eulerain Eulements (the part is named 'Water') while the structure is modeled with a Lagrangian element (the part is named 'Structure').I'm currently writing a script Abaqus python to collect [highlight #F57900]separately[/highlight] every element position (X, Y, Z) in space from the Water and the Structure part . The element position should be extracted in the last frame from the first step. Once it is done the coordinate are saved in excel file. Can you help me to write the script.
# odb reading and writing acces
odbPath='E:/Temp/A1.odb'
Odb = session.openOdb(odbPath)
# create a variable that refers to the last frame of the first steps
lastFrame=Odb.steps['Step-1'].frames[-1]
#Part instance in the model
print Odb.rootAssembly.instances.keys()
# abaqus visualise ['Water-1', 'Structure-1']
myInstance1=Odb.rootAssembly.instances ['Water-1']
myInstance2=Odb.rootAssembly.instances ['Structure-1']
numElements1=len(yInstance1.elements)
numElements2=len(yInstance2.elements)
for el in range(0,numElements1):
# What commande to use to extract
for el in range(0,numElements1): # this commande does'nt work. What commande to use to extract coordinate position
print'Position=',el.position
Odb.close()
# odb reading and writing acces
odbPath='E:/Temp/A1.odb'
Odb = session.openOdb(odbPath)
# create a variable that refers to the last frame of the first steps
lastFrame=Odb.steps['Step-1'].frames[-1]
#Part instance in the model
print Odb.rootAssembly.instances.keys()
# abaqus visualise ['Water-1', 'Structure-1']
myInstance1=Odb.rootAssembly.instances ['Water-1']
myInstance2=Odb.rootAssembly.instances ['Structure-1']
numElements1=len(yInstance1.elements)
numElements2=len(yInstance2.elements)
for el in range(0,numElements1):
# What commande to use to extract
for el in range(0,numElements1): # this commande does'nt work. What commande to use to extract coordinate position
print'Position=',el.position
Odb.close()