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

Fix averaging example plots #1988

Merged
merged 4 commits into from
Jan 6, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/09-averaging/00-compute_and_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -120,6 +119,7 @@ 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]


Expand Down Expand Up @@ -157,6 +157,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()

PProfizi marked this conversation as resolved.
Show resolved Hide resolved
return max_val.data[0]


Expand Down