diff --git a/examples/dgmulti_2d/elixir_advection_diffusion.jl b/examples/dgmulti_2d/elixir_advection_diffusion.jl index ce7b0e745a4..35e048b6b54 100644 --- a/examples/dgmulti_2d/elixir_advection_diffusion.jl +++ b/examples/dgmulti_2d/elixir_advection_diffusion.jl @@ -51,7 +51,7 @@ summary_callback = SummaryCallback() alive_callback = AliveCallback(alive_interval = 10) analysis_interval = 100 analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg)) -callbacks = CallbackSet(summary_callback, alive_callback) +callbacks = CallbackSet(summary_callback, alive_callback, analysis_callback) ############################################################################### # run the simulation diff --git a/examples/dgmulti_2d/elixir_advection_diffusion_nonperiodic.jl b/examples/dgmulti_2d/elixir_advection_diffusion_nonperiodic.jl index d2f11f18507..f66bc965a8c 100644 --- a/examples/dgmulti_2d/elixir_advection_diffusion_nonperiodic.jl +++ b/examples/dgmulti_2d/elixir_advection_diffusion_nonperiodic.jl @@ -67,7 +67,7 @@ summary_callback = SummaryCallback() alive_callback = AliveCallback(alive_interval = 10) analysis_interval = 100 analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg)) -callbacks = CallbackSet(summary_callback, alive_callback) +callbacks = CallbackSet(summary_callback, alive_callback, analysis_callback) ############################################################################### # run the simulation diff --git a/examples/dgmulti_2d/elixir_navierstokes_convergence.jl b/examples/dgmulti_2d/elixir_navierstokes_convergence.jl index 38cf3d7984b..b529b43a41d 100644 --- a/examples/dgmulti_2d/elixir_navierstokes_convergence.jl +++ b/examples/dgmulti_2d/elixir_navierstokes_convergence.jl @@ -208,7 +208,7 @@ summary_callback = SummaryCallback() alive_callback = AliveCallback(alive_interval = 10) analysis_interval = 100 analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg)) -callbacks = CallbackSet(summary_callback, alive_callback) +callbacks = CallbackSet(summary_callback, alive_callback, analysis_callback) ############################################################################### # run the simulation diff --git a/examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl b/examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl index 87ffd0e0995..92216bf6c29 100644 --- a/examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl +++ b/examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl @@ -216,7 +216,7 @@ summary_callback = SummaryCallback() alive_callback = AliveCallback(alive_interval = 10) analysis_interval = 100 analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg)) -callbacks = CallbackSet(summary_callback, alive_callback) +callbacks = CallbackSet(summary_callback, alive_callback, analysis_callback) ############################################################################### # run the simulation diff --git a/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl b/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl index a612dd0e0d5..4c7d96d9305 100644 --- a/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl +++ b/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl @@ -63,7 +63,7 @@ summary_callback = SummaryCallback() alive_callback = AliveCallback(alive_interval = 10) analysis_interval = 100 analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg)) -callbacks = CallbackSet(summary_callback, alive_callback) +callbacks = CallbackSet(summary_callback, alive_callback, analysis_callback) ############################################################################### # run the simulation diff --git a/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl b/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl index 9ae90ac47b6..5b844fbe3d2 100644 --- a/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl +++ b/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl @@ -62,9 +62,8 @@ alive_callback = AliveCallback(alive_interval = 10) analysis_interval = 100 analysis_callback = AnalysisCallback(semi, interval = analysis_interval, uEltype = real(dg), extra_analysis_integrals = (energy_kinetic, - energy_internal, - enstrophy)) -callbacks = CallbackSet(summary_callback, alive_callback) + energy_internal)) +callbacks = CallbackSet(summary_callback, alive_callback, analysis_callback) ############################################################################### # run the simulation diff --git a/src/callbacks_step/analysis.jl b/src/callbacks_step/analysis.jl index b6c80f47867..0a26bbdbebe 100644 --- a/src/callbacks_step/analysis.jl +++ b/src/callbacks_step/analysis.jl @@ -629,6 +629,8 @@ function analyze(quantity::typeof(enstrophy), du, u, t, mesh, equations, solver, cache = mesh_equations_solver_cache(semi) equations_parabolic = semi.equations_parabolic cache_parabolic = semi.cache_parabolic + # We do not apply `enstrophy` directly here because we might later have different `quantity`s + # that we wish to integrate, which can share this routine. analyze(quantity, du, u, t, mesh, equations, equations_parabolic, solver, cache, cache_parabolic) end diff --git a/src/callbacks_step/analysis_dgmulti.jl b/src/callbacks_step/analysis_dgmulti.jl index 1f0eec2de34..8d43bfa90ea 100644 --- a/src/callbacks_step/analysis_dgmulti.jl +++ b/src/callbacks_step/analysis_dgmulti.jl @@ -135,46 +135,6 @@ function analyze(::Val{:linf_divb}, du, u, t, return linf_divB end -function integrate(func::typeof(enstrophy), u, - mesh::DGMultiMesh, - equations, equations_parabolic::CompressibleNavierStokesDiffusion3D, - dg::DGMulti, - cache, cache_parabolic; normalize = true) - gradients_x, gradients_y, gradients_z = cache_parabolic.gradients - - # allocate local storage for gradients. - # TODO: can we avoid allocating here? - local_gradient_quadrature_values = ntuple(_ -> similar(cache_parabolic.local_u_values_threaded), - 3) - - integral = zero(eltype(u)) - for e in eachelement(mesh, dg) - u_quadrature_values = cache_parabolic.local_u_values_threaded[Threads.threadid()] - gradient_x_quadrature_values = local_gradient_quadrature_values[1][Threads.threadid()] - gradient_y_quadrature_values = local_gradient_quadrature_values[2][Threads.threadid()] - gradient_z_quadrature_values = local_gradient_quadrature_values[3][Threads.threadid()] - - # interpolate to quadrature on each element - apply_to_each_field(mul_by!(dg.basis.Vq), u_quadrature_values, view(u, :, e)) - apply_to_each_field(mul_by!(dg.basis.Vq), gradient_x_quadrature_values, - view(gradients_x, :, e)) - apply_to_each_field(mul_by!(dg.basis.Vq), gradient_y_quadrature_values, - view(gradients_y, :, e)) - apply_to_each_field(mul_by!(dg.basis.Vq), gradient_z_quadrature_values, - view(gradients_z, :, e)) - - # integrate over the element - for i in eachindex(u_quadrature_values) - gradients_i = SVector(gradient_x_quadrature_values[i], - gradient_y_quadrature_values[i], - gradient_z_quadrature_values[i]) - integral += mesh.md.wJq[i, e] * - func(u_quadrature_values[i], gradients_i, equations) - end - end - return integral -end - function create_cache_analysis(analyzer, mesh::DGMultiMesh, equations, dg::DGMulti, cache, RealT, uEltype)