PyDPF - Differences in 'named_selection_scoping' and 'operators.scoping.on_named_selection()'

Options

Hy guys,

What is the difference between the different codes?

1 ) op = dpf.operators.scoping.on_named_selection() # operator instantiation

op.inputs.requested_location.connect(my_requested_location)

op.inputs.named_selection_name.connect(my_named_selection_name)

op.inputs.int_inclusive.connect(my_int_inclusive)# optional

op.inputs.streams_container.connect(my_streams_container)# optional

op.inputs.data_sources.connect(my_data_sources)”


2 ) q = dpf.mesh_scoping_factory.named_selection_scoping(comp_element_s, r)


Please analyzed also the followings outputs from the codes:

1) Total nodes rst file: 5347

time needed for the operetors, comp BODY 0.0999 s

nodes in comp BODY: 5347


 2) Total nodes rst file: 5347

time needed for the operetors, comp BODY 0.0515 s

nodes in comp BODY: 1714


The second code extracts less nodes in the component and it seems that the nodes id are totally wrong.


Thanks,

Tommaso

Tagged:

Best Answer

  • Pierre Thieffry
    Pierre Thieffry Member, Moderator, Employee Posts: 103
    First Anniversary Ansys Employee Solution Developer Community of Practice Member Photogenic
    Answer ✓
    Options

    hi @TommasoMarella , the difference has to do with the fact your named selection refers to elements or nodes. From the 'BODY' name, I suspect your named selection is on a geometric body, which means that the named selection contains elements.

    The second operator will retrieve the named selection and give you the list of ids corresponding to the selection's type. In this case, I think your mesh contains 1714 elements.

    With the first one, you can ask dpf to retrieve either nodes or elements by specifying requested_location='Nodal' or 'Elemental' and this whether your selection contains nodes or elements. DPF will convert for you.

    Hope this helps