×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*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.

Students Click Here

Jobs

Assign materials to elements without remeshing in Python

Assign materials to elements without remeshing in Python

Assign materials to elements without remeshing in Python

(OP)
Hi All !
I didn't find anything on the forum unfortunetly.

Here is my situation :
- I have a 2D domain meshed (by instance).
- I'd like to assign 2 different materials to 2 different groups of elements.
- I want to keep my mesh.

For the moment I just splitted my domain into 2 groups of elements (elRegion1 and elRegion2).

elRegion1 = regionToolset.Region(elements=elData[0:nb_el_demi+1])
elRegion2 = regionToolset.Region(elements=elData[nb_el_demi+1:nb_el])

And then I have for instance :

elRegion1.elements[1]=({'connectivity': (14, 15, 21, 20), 'instanceName': 'plaque_ref_instance', 'label': 13, 'type': CPS4R})

1st question : How can I divide my domain into 2 groups and then assign 2 materials without remeshing.
2nd question : Can I assign the mesh to another instance without meshing directly the other instance (having : elRegion1.elements[1]=({'connectivity': (14, 15, 21, 20), 'instanceName': 'new_instance', 'label': 13, 'type': CPS4R}).)

Thank you so much for our answer !
 

RE: Assign materials to elements without remeshing in Python

If you have a native part you should partition the domain then assign a different section to each region created by partioning and then mesh the regions.

RE: Assign materials to elements without remeshing in Python

(OP)
Actually I defined different element sets from my mesh and different sections(with different materials). Then I assigned properties with this type of syntax :

myPart.SectionAssignment(region = elSet[i-1],sectionName = tab_nomSection[i-1])

Thank you for your answer !
 

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.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources