Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document composite:minmax_per_element_operator #366

Merged
merged 9 commits into from
Oct 15, 2023
2 changes: 2 additions & 0 deletions examples/010_harmonic_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@
failure_evaluator.inputs.strains_container(strain_at_phase)
failure_evaluator.inputs.mesh(composite_model.get_mesh())

# Note: the min/max layer indices are 1-based starting with
# Workbench 2024 R1 (DPF server 7.1)
minmax_per_element = dpf.Operator("composite::minmax_per_element_operator")
minmax_per_element.inputs.fields_container(failure_evaluator)
minmax_per_element.inputs.mesh(composite_model.get_mesh())
Expand Down
2 changes: 2 additions & 0 deletions src/ansys/dpf/composites/_composite_model_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ def evaluate_failure_criteria(
# Ensure that sandwich criteria are evaluated
evaluate_failure_criterion_per_scope_op.inputs.request_sandwich_results(True)

# Note: the min/max layer indices are 1-based starting with
# Workbench 2024 R1 (DPF server 7.1)
minmax_el_op = dpf.Operator("composite::minmax_per_element_operator")
minmax_el_op.inputs.fields_container(
evaluate_failure_criterion_per_scope_op.outputs.failure_container
Expand Down
5 changes: 5 additions & 0 deletions src/ansys/dpf/composites/select_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def get_selected_indices(
Notes
-----
Returns an empty selection if any of the collections is empty.

The indices (nodes, layers, and spots) are 0-based. Pay attention to this
when using the "composite::minmax_per_element_operator" or
func:`~evaluate_failure_criteria` where the min/max layer indices
are 1-based starting with Workbench 2024 R1 (DPF server 7.1).
"""
if layers is None:
layer_indices: Collection[int] = range(element_info.n_layers)
Expand Down
2 changes: 2 additions & 0 deletions tests/basic_workflow_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def test_basic_workflow(dpf_server, distributed_rst):
failure_evaluator.inputs.stresses_container(stress_operator.outputs.fields_container)
failure_evaluator.inputs.mesh(mesh_provider.outputs.mesh)

# Note: the min/max layer indices are 1-based starting with
# Workbench 2024 R1 (DPF server 7.1)
minmax_per_element = dpf.Operator("composite::minmax_per_element_operator")
minmax_per_element.inputs.fields_container(failure_evaluator.outputs.fields_container)
minmax_per_element.inputs.mesh(mesh_provider.outputs.mesh)
Expand Down