Open GuillemBarroso opened 1 year ago
I have found a workaround by doing
from ansys.dpf import core as dpf
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples
model = dpf.Model(examples.download_all_kinds_of_complexity())
scoping_op = ops.scoping.on_named_selection()
scoping_op.inputs.requested_location.connect("nodal")
scoping_op.inputs.named_selection_name.connect("_CM82")
scoping_op.inputs.data_sources.connect(
dpf.DataSources(examples.download_all_kinds_of_complexity())
)
mesh_scoping = scoping_op.outputs.mesh_scoping()
disp_selection_fc = model.results.displacement.on_mesh_scoping(mesh_scoping).eval()
print(disp_selection_fc[0].location)
Still, I think it would be nice to add the extra argument requested_location
in on_named_selection
as initially described in this issue so we don't have to explicitly use the scoping operator.
Description of the feature
The
Result.on_named_selection()
method, see docs could have an additional argumentrequested_location
, similar to thescoping.on_named_selection()
, see docs.This would fix the behavior I am having: I am requesting the displacements on a named selection and I end up with a displacement field that has elemental location. See code below.
Again, this could be fix by adding an extra argument as:
Steps for implementing the feature
N/A
Useful links and references
N/A