Search code examples
pythonabaqus

How to get the volume of elements with certain type of material in Abaqus ODB by means of Python


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


Solution

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