Reputation: 133
I created a model in Abaqus using Python and I want to use the node nearest to the centroid volume in my Python code. However I can never find how to use this, only how to manually find the volume centroid in Abaqus (Tools --> Query --> Mass properties and select instance). And then I can use this point to find the nearest node. Is there code available to script the tools-->query-->mass properties part?
Thank you in advance.
Upvotes: 0
Views: 559
Reputation: 924
You can get query related commands for the assembly in Chapter 6.1 Assembly Object
of Abaqus Scripting Reference Guide. Unfortunately, the query commands are not recorded in .rpy
file. However, one should always check Reference Guide for the related object.
For getting mass properties, you can use the following command:
# Accessing the instance object
inst = mdb.models['Model-1'].rootAssembly.instances['Part-1-1']
# Getting the mass properties of the part instance
mp = mdb.models['Model-1'].rootAssembly.getMassProperties(regions=[inst,])
print(mp)
The mass property variable, mp
, is dictionary object. When you print it:
{'volume': 74912600.0, 'massFromMassPerUnitSurfaceArea': None, 'area': None, 'volumeCentroid': (63.5161468164234, 500.0, 2578.95903759848), 'warnings': (MISSING_DENSITY,), 'momentOfInertia': (None, None, None, None, None, None), 'centerOfMass': (None, None, None), 'mass': None, 'areaCentroid': (None, None, None)}
Then you can use the getClosest
command to find the nearest node.
inst.nodes.getClosest(mp['volumeCentroid'])
Upvotes: 2