From 440be8335a48beb81f89e43e5810e0bf92059440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Roos?= Date: Sun, 15 Oct 2023 22:32:40 +0200 Subject: [PATCH] update comments and note about 1-based indices --- examples/010_harmonic_example.py | 4 ++-- src/ansys/dpf/composites/_composite_model_impl.py | 4 ++-- src/ansys/dpf/composites/select_indices.py | 3 ++- tests/basic_workflow_test.py | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/010_harmonic_example.py b/examples/010_harmonic_example.py index 49c89ba53..9918e1c18 100644 --- a/examples/010_harmonic_example.py +++ b/examples/010_harmonic_example.py @@ -131,8 +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 since - # WB 2024 R1 (server version 7 and above) + # 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()) diff --git a/src/ansys/dpf/composites/_composite_model_impl.py b/src/ansys/dpf/composites/_composite_model_impl.py index 998bd9595..dc6c0acb0 100644 --- a/src/ansys/dpf/composites/_composite_model_impl.py +++ b/src/ansys/dpf/composites/_composite_model_impl.py @@ -331,8 +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 since - # WB 2024 R1 (server version 7 and above) + # 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 diff --git a/src/ansys/dpf/composites/select_indices.py b/src/ansys/dpf/composites/select_indices.py index 329420aea..dc7e5d315 100644 --- a/src/ansys/dpf/composites/select_indices.py +++ b/src/ansys/dpf/composites/select_indices.py @@ -59,7 +59,8 @@ def get_selected_indices( The indices (nodes, layers and spots) are 0-based. Pay attention to this when using the "composite::minmax_per_element_operator" where the - min/max layer indices are 1-based. + 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) diff --git a/tests/basic_workflow_test.py b/tests/basic_workflow_test.py index b5dea77ed..a92d67dd1 100644 --- a/tests/basic_workflow_test.py +++ b/tests/basic_workflow_test.py @@ -87,8 +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 since - # WB 2024 R1 (server version 7 and above) + # 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)