Skip to content

Conversation

@SimonCan
Copy link
Contributor

This adds analysis options, like enstrophy for the multicomponent Euler scheme.

@github-actions
Copy link
Contributor

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

  • The PR has a single goal that is clear from the PR title and/or description.
  • All code changes represent a single set of modifications that logically belong together.
  • No more than 500 lines of code are changed or there is no obvious way to split the PR into multiple PRs.

Code quality

  • The code can be understood easily.
  • Newly introduced names for variables etc. are self-descriptive and consistent with existing naming conventions.
  • There are no redundancies that can be removed by simple modularization/refactoring.
  • There are no leftover debug statements or commented code sections.
  • The code adheres to our conventions and style guide, and to the Julia guidelines.

Documentation

  • New functions and types are documented with a docstring or top-level comment.
  • Relevant publications are referenced in docstrings (see example for formatting).
  • Inline comments are used to document longer or unusual code sections.
  • Comments describe intent ("why?") and not just functionality ("what?").
  • If the PR introduces a significant change or new feature, it is documented in NEWS.md with its PR number.

Testing

  • The PR passes all tests.
  • New or modified lines of code are covered by tests.
  • New or modified tests run in less then 10 seconds.

Performance

  • There are no type instabilities or memory allocations in performance-critical parts.
  • If the PR intent is to improve performance, before/after time measurements are posted in the PR.

Verification

  • The correctness of the code was verified using appropriate tests.
  • If new equations/methods are added, a convergence test has been run and the results
    are posted in the PR.

Created with ❤️ by the Trixi.jl community.

@codecov
Copy link

codecov bot commented May 22, 2025

Codecov Report

❌ Patch coverage is 8.43373% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.08%. Comparing base (96c7aef) to head (df58d7f).

Files with missing lines Patch % Lines
src/callbacks_step/analysis_dg2d.jl 9.21% 69 Missing ⚠️
.../equations/compressible_euler_multicomponent_2d.jl 0.00% 7 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (96c7aef) and HEAD (df58d7f). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (96c7aef) HEAD (df58d7f)
unittests 25 23
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2414      +/-   ##
==========================================
- Coverage   96.36%   87.08%   -9.27%     
==========================================
  Files         527      527              
  Lines       42559    42629      +70     
==========================================
- Hits        41008    37123    -3885     
- Misses       1551     5506    +3955     
Flag Coverage Δ
unittests 87.08% <8.43%> (-9.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 291 to 298
@inline function enstrophy(u, equations::CompressibleNavierStokesDiffusion2D; gradients)
# Enstrophy is 0.5 rho ω⋅ω where ω = ∇ × v

omega = vorticity(u, gradients, equations)
return 0.5f0 * u[1] * omega^2
end

@inline function vorticity(u, gradients, equations::CompressibleNavierStokesDiffusion2D)
@inline function vorticity(u, equations::CompressibleNavierStokesDiffusion2D; gradients)
Copy link
Member

Choose a reason for hiding this comment

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

Why different signature compared to old and added functions?

u_local = get_node_vars(u, equations, dg, i, j, element)
return func(u_local, equations)
end
@autoinfiltrate
Copy link
Member

Choose a reason for hiding this comment

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

What does that do/why is this needed?

return func(u_local, equations)
end
@autoinfiltrate
if length(m.sig.parameters) == 2
Copy link
Member

Choose a reason for hiding this comment

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

What is this if-clause?

SimonCan and others added 23 commits May 27, 2025 15:51
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Attempt of using existing infrastructure for parabolic terms to compute derivatives.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SimonCan and others added 12 commits July 3, 2025 15:45
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
normalize = normalize) do u, i, j, element,
equations, dg
u_local = get_node_vars(u, equations, dg, i, j, element)
gradients_local = Vector([gradients_x[:, i, j, element], gradients_y[:, i, j, element]])
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
gradients_local = Vector([gradients_x[:, i, j, element], gradients_y[:, i, j, element]])
gradients_local = Vector([
gradients_x[:, i, j, element],
gradients_y[:, i, j, element]
])


# Compute the surface flux terms.
surface_flux_values = similar(u)
Trixi.calc_surface_integral!(surface_flux_values, u, mesh, equations, dg.surface_integral, dg, cache)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
Trixi.calc_surface_integral!(surface_flux_values, u, mesh, equations, dg.surface_integral, dg, cache)
Trixi.calc_surface_integral!(surface_flux_values, u, mesh, equations,
dg.surface_integral, dg, cache)

Comment on lines +336 to +338
# # Contract D in the ξ̂ (first spatial) direction
# gradients[v, :, :, elem] .= D * u[v, :, :, elem]
# # Average over element.
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
# # Contract D in the ξ̂ (first spatial) direction
# gradients[v, :, :, elem] .= D * u[v, :, :, elem]
# # Average over element.
# # Contract D in the ξ̂ (first spatial) direction
# gradients[v, :, :, elem] .= D * u[v, :, :, elem]
# # Average over element.

# gradients[v, :, :, elem] .= D * u[v, :, :, elem]
# # Average over element.

average = sum(gradients[v, :, :, elem]/Np^2)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
average = sum(gradients[v, :, :, elem]/Np^2)
average = sum(gradients[v, :, :, elem] / Np^2)

Comment on lines +361 to +362
# # Contract D in the ξ̂ (first spatial) direction
# gradients[v, :, :, elem] .= u[v, :, :, elem] * D'
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
# # Contract D in the ξ̂ (first spatial) direction
# gradients[v, :, :, elem] .= u[v, :, :, elem] * D'
# # Contract D in the ξ̂ (first spatial) direction
# gradients[v, :, :, elem] .= u[v, :, :, elem] * D'

# gradients[v, :, :, elem] .= u[v, :, :, elem] * D'

# Average over element.
average = sum(gradients[v, :, :, elem]/Np^2)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
average = sum(gradients[v, :, :, elem]/Np^2)
average = sum(gradients[v, :, :, elem] / Np^2)

enstrophy, vorticity
export entropy, energy_total, energy_kinetic, energy_internal, energy_magnetic,
cross_helicity,
enstrophy, magnetic_field, divergence_cleaning_field, enstrophy_multi_euler, vorticity
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
enstrophy, magnetic_field, divergence_cleaning_field, enstrophy_multi_euler, vorticity
enstrophy, magnetic_field, divergence_cleaning_field, enstrophy_multi_euler,
vorticity

end

@inline function enstrophy_multi_euler(u, gradients,
equations::CompressibleEulerMulticomponentEquations2D)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
equations::CompressibleEulerMulticomponentEquations2D)
equations::CompressibleEulerMulticomponentEquations2D)

@DanielDoehring DanielDoehring added the enhancement New feature or request label Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants