From 38cfe8d65c6542e9c25bd849d3d197be3ab132ab Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:41:04 +0100 Subject: [PATCH 1/4] Fix averaging example plots The first example of the averaging section lost its calls to plot methods at some point, not fitting the description anymore. This PR adds them back to fix the example. --- examples/09-averaging/00-compute_and_average.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/09-averaging/00-compute_and_average.py b/examples/09-averaging/00-compute_and_average.py index 45491e0d45..b4474ccf75 100644 --- a/examples/09-averaging/00-compute_and_average.py +++ b/examples/09-averaging/00-compute_and_average.py @@ -98,7 +98,6 @@ def compute_von_mises_then_average(analysis): # Create a model from the results of the simulation and retrieve its mesh model = dpf.Model(analysis) - mesh = model.metadata.meshed_region # Apply the stress operator to obtain the stresses in the body stress_op = dpf.operators.result.stress() @@ -120,6 +119,8 @@ def compute_von_mises_then_average(analysis): min_max.inputs.field.connect(avg_von_mises) max_val = min_max.outputs.field_max() + avg_von_mises.plot() + return max_val.data[0] @@ -157,6 +158,8 @@ def average_then_compute_von_mises(analysis): min_max.inputs.field.connect(avg_von_mises) max_val = min_max.outputs.field_max() + avg_von_mises.plot() + return max_val.data[0] From 2738d7318cb7e164e4bb07d3624c6f35c0d76df6 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:43:40 +0100 Subject: [PATCH 2/4] Update examples/09-averaging/00-compute_and_average.py --- examples/09-averaging/00-compute_and_average.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/09-averaging/00-compute_and_average.py b/examples/09-averaging/00-compute_and_average.py index b4474ccf75..1763469ddb 100644 --- a/examples/09-averaging/00-compute_and_average.py +++ b/examples/09-averaging/00-compute_and_average.py @@ -120,7 +120,6 @@ def compute_von_mises_then_average(analysis): max_val = min_max.outputs.field_max() avg_von_mises.plot() - return max_val.data[0] From 018188211036bcf0dbd7b2b40cbba92612d78691 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:43:59 +0100 Subject: [PATCH 3/4] Update examples/09-averaging/00-compute_and_average.py --- examples/09-averaging/00-compute_and_average.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/09-averaging/00-compute_and_average.py b/examples/09-averaging/00-compute_and_average.py index 1763469ddb..a6915447e9 100644 --- a/examples/09-averaging/00-compute_and_average.py +++ b/examples/09-averaging/00-compute_and_average.py @@ -158,7 +158,6 @@ def average_then_compute_von_mises(analysis): max_val = min_max.outputs.field_max() avg_von_mises.plot() - return max_val.data[0] From 984aef909216f83dc429658ae3ec7adbad52350f Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:44:52 +0100 Subject: [PATCH 4/4] Update 00-compute_and_average.py --- examples/09-averaging/00-compute_and_average.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/09-averaging/00-compute_and_average.py b/examples/09-averaging/00-compute_and_average.py index a6915447e9..2000b96cf4 100644 --- a/examples/09-averaging/00-compute_and_average.py +++ b/examples/09-averaging/00-compute_and_average.py @@ -135,7 +135,6 @@ def compute_von_mises_then_average(analysis): def average_then_compute_von_mises(analysis): # Creating the model from the results of the simulation model = dpf.Model(analysis) - mesh = model.metadata.meshed_region # Retrieving the stresses stress_op = dpf.operators.result.stress()