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

doublemach_physical_av: lazy fixes #758

Merged
merged 1 commit into from
Sep 20, 2022
Merged
Changes from all 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
22 changes: 10 additions & 12 deletions examples/doublemach_physical_av-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,17 +550,15 @@ def my_pre_step(step, t, dt, state):
smoothness=no_smoothness)

# recompute the dv to have the correct smoothness
# this is forcing a recompile, only do it at dump time
# not sure why the compiled version of grad_cv doesn't work
if do_viz:
# use the divergence to compute the smoothness field
force_evaluation(actx, t)
grad_cv = grad_cv_operator(
dcoll, gas_model, boundaries, fluid_state,
time=t, quadrature_tag=quadrature_tag)
# grad_cv = grad_cv_operator_compiled(fluid_state,
# time=t)
smoothness = compute_smoothness(state, grad_cv)
# grad_cv = grad_cv_operator(
# dcoll, gas_model, boundaries, fluid_state,
# time=t, quadrature_tag=quadrature_tag)
grad_cv = grad_cv_operator_compiled(fluid_state,
t)
smoothness = compute_smoothness_compiled(state, grad_cv)

# this works, but seems a lot of work,
# not sure if it's really faster
Expand Down Expand Up @@ -716,10 +714,10 @@ def _my_rhs_phys_visc_div_av(t, state):
smoothness=no_smoothness)

# use the divergence to compute the smoothness field
current_grad_cv = grad_cv_operator(
dcoll, gas_model, boundaries, current_state, time=current_t,
quadrature_tag=quadrature_tag)
# smoothness = compute_smoothness_compiled(current_cv, grad_cv)
# current_grad_cv = grad_cv_operator(
# dcoll, gas_model, boundaries, current_state, time=current_t,
# quadrature_tag=quadrature_tag)
current_grad_cv = grad_cv_operator_compiled(current_state, current_t)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't call compiled functions down inside the RHS.

smoothness = compute_smoothness(current_cv, current_grad_cv)

from dataclasses import replace
Expand Down