You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix scoping if force_elemental_nodal is true. (#739)
When manual averaging is needed we request the data as ElementalNodal and perform the nodal averaging manually (force_elemental_nodal=True). If the mesh_scoping for a source operator (such as S) is nodal, and the requested location is ElementalNodal it returns the inclusive data (all elements that have at least one node in the scoping). This leads to one extra layer of data if
the initial scope is nodal (see Nodal named selection with force_elemental_nodal yield too large selection #731)
The initial scope is elemental but the requested data is nodal. This happens because _build_selection converts the elemental scoping into a nodal scoping when the requested result is nodal.
In build selection, there was already a call to _requires_manual_averaging, based on which the location was modified. However, _requires_manual_averaging was always called with selection = None, which basically meant it always returns false and the location is not adapted.
This PR adresses the problem by making the has_skin, and has_external_layer inputs explicit in the call to _requires_manual_averaging and passing the correct values in _build_selection. It also moves the call to _requires_manual_averaging outside of all the if statements so is called in the same way as in _get_results.
The selection is now inclusive for nodes (from a nodal named selections or a node id array), to support the case of nodal selections that don't select all the nodes of an element. Depending on the selection this results in an additional "layer" of nodes in the result. This is solved by returning the original selection from _build_selection and applying it in the end of the results workflow. Please have another look.
Notes:
This problem was not often visible because manual averaging is mostly needed in the skin case, where the final result is rescoped to the skin. It is more apparent with the new average per solid feature
I removed the requires_manual_averaging method from selection and spatial selection, because it is incomplete. Some decisions depend on the result type (is it a strain result?). If these methods are needed for backward compatibility I can add calls to the new generic method with dummy arguments for the result types.
Also #fixes#731
0 commit comments