Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export counter-warped geometry 1

Status
Not open for further replies.

Sivergo

New member
Sep 26, 2018
2
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.

Thanks for your help.

Regards
 
Replies continue below

Recommended for you

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.data to defNodePos = curNode.coordinates - dispField.values.data .


Good luck
 
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.
Python:
from abaqus import * 
from abaqusConstants import * 
# create odb object from odb file 
outputDatabase = session.openOdb(name= 'Platedefromed'+'.odb') 

# get access to the nodal displacement data 
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' ) 

# write inp header 

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()
 
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
 
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.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor