问题
I need to calculate the total volume of elements with a certain type of material, then calculate that part of them in which some UVARM variable is greater than 1, and then define the ratio between these volumes.
The problem is that I cannot find how to filter out the elements exactly by name of material, not by section, part instance or element set, since the elements of interest are evenly distributed among these sections, sets etc.
Thank you
回答1:
It seems you need to loop over every element and look at the sectionCategory for each:
element.sectionCategory.name
'solid < materialname >'
so you build a full list something like:
steelels = [ el.label for el in instance.elements if el.sectionCategory.name == 'solid < steel >']
Really the preferred approach here is to create the appropriate element sets as you build the model.
回答2:
If you edit the model attributes before writing the .inp file to 'do not use parts and assemblies in input files' and run the simulation with this input you probably won't get any issues when accessing the odb.
part_instance = odb.rootAssembly.instances['PART-1-1']
elLabels = [ v.label for v in part_instance.elements if v.sectionCategory.name == 'solid < DUMMY_MATERIAL >']
来源:https://stackoverflow.com/questions/49250071/how-to-get-the-volume-of-elements-with-certain-type-of-material-in-abaqus-odb-by