From ec056433445b21fd88c61924d0d3478d1c9969be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Roos?= Date: Thu, 14 Sep 2023 16:23:01 +0200 Subject: [PATCH 1/6] Fix broken link, and port changes from 0.3.1 back to develop --- README.rst | 16 ++++++++-------- doc/source/index.rst | 6 ++++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 6776ffedc..d7b45fbca 100644 --- a/README.rst +++ b/README.rst @@ -34,13 +34,13 @@ PyDPF Composites PyDPF Composites enables the post-processing of composite structures based on -`Ansys DPF`_ and the DPF Composites plugin. It implements classes on top of -DPF Composites operators and data accessors for short fiber and layered -composites (layered shell and solid elements). This module can be used to -postprocess fiber reinforced plastics and layered composites, and to implement -custom failure criteria and computation. For information demonstrating -the behavior and usage of PyDPF Composites, see `Examples`_ in the DPF Composite -documentation. +`Ansys DPF`_ and the DPF Composites plugin. So it is a Python wrapper which +implements classes on top of DPF Composites operators and data accessors for +short fiber and layered composites (layered shell and solid elements). This +module can be used to postprocess fiber reinforced plastics and layered +composites, and to implement custom failure criteria and computation. For +information demonstrating the behavior and usage of PyDPF Composites, +see `Examples`_ in the DPF Composite documentation. .. START_MARKER_FOR_SPHINX_DOCS @@ -195,6 +195,6 @@ released versions. .. _pytest: https://docs.pytest.org/en/stable/ .. _Sphinx: https://www.sphinx-doc.org/en/master/ .. _tox: https://tox.wiki/ -.. _Examples: https://composites.dpf.docs.pyansys.com/dev/examples/index.html +.. _Examples: https://composites.dpf.docs.pyansys.com/version/stable/examples/index.html .. _Getting The DPF Server Docker Image: https://composites.dpf.docs.pyansys.com/version/stable/intro.html#getting-the-dpf-server-docker-image .. _Ansys DPF: https://dpf.docs.pyansys.com/version/stable/ \ No newline at end of file diff --git a/doc/source/index.rst b/doc/source/index.rst index d499f9862..15620cdb2 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -11,10 +11,11 @@ PyDPF Composites ---------------- -PyDPF Composites is a Python wrapper for Ansys DPF composites. It implements +PyDPF Composites enables the post-processing of composite structures based on +`Ansys DPF`_ and the DPF Composites plugin. It implements classes on top of DPF Composites operators and data accessors for short fiber and layered composites (layered shell and solid elements). This module -can be used to postprocess fiber reinforced plastics and layered composites and +can be used to postprocess fiber reinforced plastics and layered composites, and to implement custom failure criteria and computation. .. grid:: 1 1 2 2 @@ -73,3 +74,4 @@ Limitations .. _Ansys Workbench: https://download.ansys.com/Current%20Release .. _Import of Legacy Mechanical APDL Composite Models: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v231/en/acp_ug/acp_import_legacy_APDL_comp.html .. _Compatibility: https://dpf.docs.pyansys.com/version/stable/getting_started/compatibility.html +.. _Ansys DPF: https://dpf.docs.pyansys.com/version/stable/ From b9429166f4b115e1570ce1822702889bab4afa65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Roos?= Date: Fri, 13 Oct 2023 11:58:50 +0200 Subject: [PATCH 2/6] Add note that the critical layer indices are 1-based. --- examples/010_harmonic_example.py | 2 ++ src/ansys/dpf/composites/_composite_model_impl.py | 2 ++ tests/basic_workflow_test.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/examples/010_harmonic_example.py b/examples/010_harmonic_example.py index 6d1b6c3b7..49c89ba53 100644 --- a/examples/010_harmonic_example.py +++ b/examples/010_harmonic_example.py @@ -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 since + # WB 2024 R1 (server version 7 and above) 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 6a0876b76..998bd9595 100644 --- a/src/ansys/dpf/composites/_composite_model_impl.py +++ b/src/ansys/dpf/composites/_composite_model_impl.py @@ -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 since + # WB 2024 R1 (server version 7 and above) 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/tests/basic_workflow_test.py b/tests/basic_workflow_test.py index c9b92922a..b5dea77ed 100644 --- a/tests/basic_workflow_test.py +++ b/tests/basic_workflow_test.py @@ -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 since + # WB 2024 R1 (server version 7 and above) 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) From dad47a4da46ebd4aee26a84b91acc6ce2e516fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Roos?= Date: Fri, 13 Oct 2023 13:36:10 +0200 Subject: [PATCH 3/6] add note when using get_selected_indices --- src/ansys/dpf/composites/select_indices.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ansys/dpf/composites/select_indices.py b/src/ansys/dpf/composites/select_indices.py index 288da7fab..329420aea 100644 --- a/src/ansys/dpf/composites/select_indices.py +++ b/src/ansys/dpf/composites/select_indices.py @@ -56,6 +56,10 @@ 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" where the + min/max layer indices are 1-based. """ if layers is None: layer_indices: Collection[int] = range(element_info.n_layers) 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 4/6] 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) From 98251bd546d845ea21661346f5c8716d21bd1f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Roos?= Date: Sun, 15 Oct 2023 22:38:11 +0200 Subject: [PATCH 5/6] implement remark from the code review. --- src/ansys/dpf/composites/select_indices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/dpf/composites/select_indices.py b/src/ansys/dpf/composites/select_indices.py index dc7e5d315..39ba90d41 100644 --- a/src/ansys/dpf/composites/select_indices.py +++ b/src/ansys/dpf/composites/select_indices.py @@ -57,7 +57,7 @@ def get_selected_indices( ----- Returns an empty selection if any of the collections is empty. - The indices (nodes, layers and spots) are 0-based. Pay attention to this + 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 starting with Workbench 2024 R1 (DPF server 7.1). From 1cf6637ad7b1e19f4deefdb16a1423bbeadaf82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Roos?= Date: Sun, 15 Oct 2023 22:44:19 +0200 Subject: [PATCH 6/6] improve documentation --- src/ansys/dpf/composites/select_indices.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ansys/dpf/composites/select_indices.py b/src/ansys/dpf/composites/select_indices.py index 39ba90d41..230d7519f 100644 --- a/src/ansys/dpf/composites/select_indices.py +++ b/src/ansys/dpf/composites/select_indices.py @@ -58,9 +58,9 @@ def get_selected_indices( 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" where the - min/max layer indices are 1-based starting with Workbench 2024 R1 - (DPF server 7.1). + 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)