Skip to content

Commit 38cfe8d

Browse files
authored
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.
1 parent b7f89f7 commit 38cfe8d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/09-averaging/00-compute_and_average.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
def compute_von_mises_then_average(analysis):
9999
# Create a model from the results of the simulation and retrieve its mesh
100100
model = dpf.Model(analysis)
101-
mesh = model.metadata.meshed_region
102101

103102
# Apply the stress operator to obtain the stresses in the body
104103
stress_op = dpf.operators.result.stress()
@@ -120,6 +119,8 @@ def compute_von_mises_then_average(analysis):
120119
min_max.inputs.field.connect(avg_von_mises)
121120
max_val = min_max.outputs.field_max()
122121

122+
avg_von_mises.plot()
123+
123124
return max_val.data[0]
124125

125126

@@ -157,6 +158,8 @@ def average_then_compute_von_mises(analysis):
157158
min_max.inputs.field.connect(avg_von_mises)
158159
max_val = min_max.outputs.field_max()
159160

161+
avg_von_mises.plot()
162+
160163
return max_val.data[0]
161164

162165

0 commit comments

Comments
 (0)