Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Assign materials to elements without remeshing in Python

Status
Not open for further replies.

alexemse

Mechanical
Joined
Feb 24, 2009
Messages
12
Location
FR
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 !
 
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.
 
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 !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top