Skip to content

Commit

Permalink
More comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Sep 5, 2024
1 parent 84f1352 commit 3c952f7
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/callbacks_step/analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@ function analyze(quantity, du, u, t, semi::AbstractSemidiscretization)
mesh, equations, solver, cache = mesh_equations_solver_cache(semi)
analyze(quantity, du, u, t, mesh, equations, solver, cache)
end
# `analyze` function that passes also the iteration number `iter`along.
# Required for callbacks that handle the write-off of results to disk themselves,
# such as `AnalysisSurfacePointwise`.
function analyze(quantity, du, u, t, semi::AbstractSemidiscretization, iter)
mesh, equations, solver, cache = mesh_equations_solver_cache(semi)
analyze(quantity, du, u, t, mesh, equations, solver, cache, iter)
Expand Down Expand Up @@ -712,16 +715,19 @@ include("analysis_dg3d_parallel.jl")
# This version of `analyze` is used for [`AnalysisSurfaceIntegral`](@ref) which requires
# `semi` to be passed along to retrieve the current boundary indices, which are non-static
# in the case of AMR.
function analyze(quantity::AnalysisSurfaceIntegral{Variable}, du, u, t,
function analyze(quantity::AnalysisSurfaceIntegral{Variable},
du, u, t,
semi::AbstractSemidiscretization) where {Variable}
mesh, equations, solver, cache = mesh_equations_solver_cache(semi)
analyze(quantity, du, u, t, mesh, equations, solver, cache, semi)
end

# Special analyze for `SemidiscretizationHyperbolicParabolic` such that
# precomputed gradients are available. Required for `enstrophy` (see above) and viscous forces.
# Note that this needs to be included after `analysis_surface_integral_2d.jl` to
# have `VariableViscous` available.
# Note that this needs to be defined after `analysis_surface_integral_2d.jl` is included
# to have `VariableViscous` available.
# We require `semi` to be passed along to retrieve the current boundary indices, which are non-static
# in the case of AMR.
function analyze(quantity::AnalysisSurfaceIntegral{Variable},
du, u, t,
semi::SemidiscretizationHyperbolicParabolic) where {
Expand All @@ -734,13 +740,21 @@ function analyze(quantity::AnalysisSurfaceIntegral{Variable},
cache_parabolic)
end

# This version of `analyze` is used for `AnalysisSurfacePointwise` such as `SurfacePressureCoefficient`.
# We need the iteration number `iter` to be passed in here
# as for `AnalysisSurfacePointwise` the writing to disk is handled by the callback itself.
function analyze(quantity::AnalysisSurfacePointwise{Variable},
du, u, t,
semi::AbstractSemidiscretization,
iter) where {Variable}
mesh, equations, solver, cache = mesh_equations_solver_cache(semi)
analyze(quantity, du, u, t, mesh, equations, solver, cache, semi, iter)
end
# Special analyze for `SemidiscretizationHyperbolicParabolic` such that
# precomputed gradients are available. Required for `AnalysisSurfacePointwise` equipped
# with `VariableViscous` such as `SurfaceFrictionCoefficient`.
# As for the inviscid version, we need to pass in the iteration number `iter` as
# for `AnalysisSurfacePointwise` the writing to disk is handled by the callback itself.
function analyze(quantity::AnalysisSurfacePointwise{Variable},
du, u, t,
semi::SemidiscretizationHyperbolicParabolic,
Expand Down

0 comments on commit 3c952f7

Please sign in to comment.