Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

sectionCategory vs Material 2

Status
Not open for further replies.

pogoGo

Mechanical
Jul 24, 2015
16
0
0
US
I'm trying to extract the material assigned to a particular element (i.e. label # 100). It seems like a very simple command:

elementMaterial = odb.rootAssembly.instances['Part-1'].elements[99].sectionCategory.name

This works flawlessly when the instance has a single section assignment. However, when the instance has two section assignments (i.e. a part with weld overlay), the "section category name" extracted is incorrect (it grabs the other section's material). There are more ways to get to ".elements[#].sectionCategory.name" but they all yield the same result.

In this example, Section-1's elements are from 1 - 75 and Section-2's elements are from 76 - 125 so I can't see how it is grabbing the Section-1 material. The only thing i can think of is that there is a distinct difference between a material and a section category.

Is there a better way to get the material used by an element?

 
Replies continue below

Recommended for you

I made a simple test block with two materials and it worked fine. Both were solid section but with different materials. This is then shown in the name when I check two elements.

You can access the section assignments and get the regions (elements) used for them:
print session.odbs['Job-1.odb'].rootAssembly.instances['PART-1-1'].sectionAssignments[0].region.elements
In this case the 0 indicates the first section assignment and you can check if there are other.


You can check all existing section in the odb with these and ongoing commands:
print session.odbs['Job-1.odb'].sections
print session.odbs['Job-1.odb'].sectionCategories
 
If I manually check the section assignments using:

print session.odbs['Job-1.odb'].rootAssembly.instances['PART-1-1'].sectionAssignments[0].region.elements[0].sectionCategory
print session.odbs['Job-1.odb'].rootAssembly.instances['PART-1-1'].sectionAssignments[1].region.elements[0].sectionCategory

it shows the same section category name for both sections. However, the CAE assembly/part and ODB show two different material names in the color coding.

I made the file in 6.11 and have been using it as a template. Could it just be something that got messed up in the conversion to 6.13?
 
Nevermind on the version thing. I made a test block from scratch and I get the same issue. This block has two solid sections with two materials. Abaqus shows one material when I use:

print session.odbs['Job-1.odb'].sectionCategories

I've attached this simple block in case anyone wants to figure out what I'm doing wrong.
 
 http://files.engineering.com/getfile.aspx?folder=ba34304b-fe38-4fc7-9605-6664e0b80145&file=test.cae
Ahh, now I see the issue. I've run your model and made a test with:

Code:
elems = session.odbs['Job-1.odb'].rootAssembly.instances['PART-1-1'].elements
for a in elems:
	print a.sectionCategory.name

You are correct, the output is wrong. It always shows only the first section with the first material.

I had a look into the support database and found an old service request of a colleague. It seems that the 'wrong' behavior is made on purpose to reduce the size of the odb. Identical section categories are merged automatically to one when storing this information in the odb, even when the material within is different.
It is possible to deactivate that behavior with an environment setting in the abaqus_v6.env.
Code:
import os
os.environ['SECTION_DEF_MERGE'] = 'no'
 
I couldn't find the abaqus_v6.env file in my 2016 installation (it exists in my older installations though) so I made a new one in the current directory with only the code you mentioned. Works perfectly now!
 
Status
Not open for further replies.
Back
Top