×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Export counter-warped geometry

## Export counter-warped geometry

(OP)
Good morning,

I am a new user of Abaqus and I am having some difficulties when trying to export the inverse deformed shape of a part after an analysis. I am using Abaqus CAE to apply a temperature field in a part, generating the correspondent deflections. I know that I can invert the deflections using a negative scale factor, but I would like to know, if possible, how could I export this counter-warped geometry, so I could import it as an original part for following studies. I know that I can import the deformed part from the ODB file, but I would like to import the deflections with a scale factor of -1. I have been looking in the manual and different tutorials but I cannot find what I am exactly looking for.

Regards

### RE: Export counter-warped geometry

Not sure because when you import the ODB file (in Part/Instance), then it is the true deformed mesh. Not sure how you can scale it with -1.

In another post there is a python script for exporting deformed mesh (Link)

Not good with that so I can not tell how it works. I believe though that one main line that needs to be changed at least is: defNodePos = curNode.coordinates + dispField.values[i].data to defNodePos = curNode.coordinates - dispField.values[i].data .

Good luck

### RE: Export counter-warped geometry

I have modified slightly the script from the above link and made a reference example to export an input file (for shells only). The file needs to be in the same folder as the .odb files, and the scale factor (called scalefactor in the script) needs to be set in order to scale the deformed mesh. Obviously this is just a reference example only, but feel free to have a go and see if you can tailor it to your needs.

#### CODE --> Python

from abaqus import *
from abaqusConstants import *
# create odb object from odb file
outputDatabase = session.openOdb(name= 'Platedefromed'+'.odb')

frame = outputDatabase.steps[ 'Step-1' ].frames[-1]

dispField = frame.fieldOutputs['U']

# get access to the part instance -- thru which u can access the undeformed nodal position coordinates
my_part_instance = outputDatabase.rootAssembly.instances['PART-1-1']

# Write deformed shape to inp file
# NOTE: if you want to export to a different file format, you should appropriate code for that file format here

outFile = open( 'deformed_shape.inp' , 'w' )

outFile.write( '\n*Part, name=PART-1-1' )
scalefactor= 1.00
# write nodes

numNodesTotal = len( my_part_instance.nodes )

#outFile.write( '\n\nPOINTS ' + str( numNodesTotal ) + ' floathiiii' )
outFile.write( '\n*Node\n' )
for i in range( numNodesTotal ):
#outFile.write('Hi\n')
curNode = my_part_instance.nodes[i]

defNodePos = curNode.coordinates + scalefactor*dispField.values[i].data

#for j in range( 3 ):

outFile.write( str(i+1)+','+str( defNodePos[0] ) + ',' + str( defNodePos[1] )+ ',' +str( defNodePos[2] )+'\n' )

# write shell elements

numElementsTotal = len( my_part_instance.elements )

#outFile.write( '\n\nCELLS ' + str( numElementsTotal ) + ' ' + str( numElementsTotal * 5 ) )

for i in range( numElementsTotal ):

curElement = list( [i+1] + list( my_part_instance.elements[i].connectivity ) )
numbernodes=len(curElement)
outFile.write( '\n*ELEMENT,' + 'type='+'S' + str(numbernodes-1))
outFile.write( '\n' )
for j in range( numbernodes ):

outFile.write( str( curElement[j] ) + ',' )

outFile.close()

outputDatabase.close() 

### RE: Export counter-warped geometry

(OP)
Good morning Erik, thanks a lot for your help.

Unfortunately, I had never worked with Python files so I am not able to change it as I want. I have tried the script but I don´t get the values for the nodes. The principal problem is that my part is a solid, not a shell, but I don´t know how can I modify the script to get the nodes for the solid and if it would be far different from this one.

Thanks again

### RE: Export counter-warped geometry

Hi I am not an expert in Python either :).

For 3D elements you should just need to change line 54 from outFile.write( '\n*ELEMENT,' + 'type='+'S' + str(numbernodes-1)) to outFile.write( '\n*ELEMENT,' + 'type='+'C3D' + str(numbernodes-1)).

If you have some reduced integration 3D elements then you might also add +'R' in the end that is: outFile.write( '\n*ELEMENT,' + 'type='+'C3D' + str(numbernodes-1) + 'R').

The file needs to be in the same folder as the .odb files, and the scale factor (called scalefactor in the script) needs to be set in order to scale the deformed mesh. The input file generated is in this folder also and is called, deformed shape.inp.

To run the script, go to your model (not output and visualisation module), and go to File/Run script... and select the .py script. That works.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!