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

HLL MHD Breaking changes for Consistency #1708

Merged
merged 24 commits into from
Nov 10, 2023

Conversation

DanielDoehring
Copy link
Contributor

@DanielDoehring DanielDoehring commented Nov 6, 2023

This closes #1545, closes #1561 and closes #1525 .

This contains now the breaking changes for MHD to have a consistent implementation of the wave speed estimates across SWE, CEE, MHD.

Copy link
Contributor

github-actions bot commented Nov 6, 2023

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.

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.

@ranocha
Copy link
Member

ranocha commented Nov 6, 2023

Does this close the issues/PRs you linked above? If so, you can use any of the key words such as closes #123 or fixes #123 to let GitHub close them automatically when this is merged.

Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Could you please add a section "Changes when updating to v0.6 from v0.5.x" similar to https://github.com/trixi-framework/Trixi.jl/blob/main/NEWS.md#changes-when-updating-to-v05-from-v04x describing the breaking change made in this PR?

Could you also please add some simple tests of the new code (maybe just unit tests)?

A review from @andrewwinters5000 would be nice 🙂

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Attention: 67 lines in your changes are missing coverage. Please review.

Comparison is base (61c80ba) 83.12% compared to head (29bb3d8) 77.68%.

Additional details and impacted files
@@             Coverage Diff              @@
##           v0.6-dev    #1708      +/-   ##
============================================
- Coverage     83.12%   77.68%   -5.43%     
============================================
  Files           424      424              
  Lines         34234    34296      +62     
============================================
- Hits          28454    26642    -1812     
- Misses         5780     7654    +1874     
Flag Coverage Δ
unittests 77.68% <6.94%> (-5.43%) ⬇️

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

Files Coverage Δ
...t_3d_dgsem/elixir_mhd_alfven_wave_nonconforming.jl 100.00% <ø> (ø)
...ples/structured_3d_dgsem/elixir_mhd_alfven_wave.jl 100.00% <ø> (ø)
...ples/tree_1d_dgsem/elixir_mhd_briowu_shock_tube.jl 100.00% <ø> (ø)
...es/tree_1d_dgsem/elixir_mhd_ryujones_shock_tube.jl 100.00% <ø> (ø)
...s/tree_1d_dgsem/elixir_mhd_shu_osher_shock_tube.jl 100.00% <ø> (ø)
src/equations/ideal_glm_mhd_1d.jl 93.50% <11.11%> (-6.50%) ⬇️
src/equations/ideal_glm_mhd_2d.jl 88.01% <6.90%> (-10.78%) ⬇️
src/equations/ideal_glm_mhd_3d.jl 87.70% <5.88%> (-12.30%) ⬇️

... and 49 files with indirect coverage changes

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

@ranocha ranocha changed the base branch from main to v0.6-dev November 6, 2023 15:49
Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Thanks! I changed the base branch to the development branch @sloede has created for v0.6. When @andrewwinters5000 agrees, we can merge this PR.

Copy link
Member

@andrewwinters5000 andrewwinters5000 left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this! I think some comments need updated that I marked in my review comments. Once these are changed this should be good to go.

src/equations/ideal_glm_mhd_1d.jl Show resolved Hide resolved
src/equations/ideal_glm_mhd_1d.jl Show resolved Hide resolved
src/equations/ideal_glm_mhd_2d.jl Show resolved Hide resolved
src/equations/ideal_glm_mhd_2d.jl Show resolved Hide resolved
src/equations/ideal_glm_mhd_3d.jl Show resolved Hide resolved
src/equations/ideal_glm_mhd_3d.jl Show resolved Hide resolved
sloede and others added 2 commits November 7, 2023 07:22
…ework#1701)

* Remove all neural network indicator stuff from `src/`

* Migrate neural network tests

* Migrate neural network examples

* Migrate test dependencies

* Update NEWS.md

* Fix typo

* Remove Requires.jl-based use of Flux.jl

* Fix formatting

* Add migration of indicators to section with breaking changes

---------

Co-authored-by: Hendrik Ranocha <[email protected]>
@ranocha
Copy link
Member

ranocha commented Nov 8, 2023

The unit test failures at https://github.com/trixi-framework/Trixi.jl/actions/runs/6784509254/job/18440947485?pr=1708#step:7:1220 look like they should be further investigated?

@DanielDoehring
Copy link
Contributor Author

DanielDoehring commented Nov 8, 2023

The unit test failures at https://github.com/trixi-framework/Trixi.jl/actions/runs/6784509254/job/18440947485?pr=1708#step:7:1220 look like they should be further investigated?

Yes, there was a bug in the 2D version of the hlle flux which must somehow slipped through - for 3D, the correct version was already implemented:

v_roe_mag = (v1_roe * normal_direction[1])^2 + (v2_roe * normal_direction[2])^2

vs

v_roe_mag = v1_roe^2 + v2_roe^2 + v3_roe^2

I will open a seperate PR for this.

@ranocha
Copy link
Member

ranocha commented Nov 8, 2023

Thanks!

DanielDoehring and others added 4 commits November 8, 2023 10:12
* Make parabolic terms non-experimental

* Make NSE a separate item

* Add MPI to supported features

* Mention that parabolic terms are now officially supported in NEWS.md

Co-authored-by: Hendrik Ranocha <[email protected]>
* remove previously deprecated functions

* fix typo in NEWS.md about deprecation vs removal

* fix literate tutorial

* removing other deprecation

* format

* Revert "fix typo in NEWS.md about deprecation vs removal"

This reverts commit 6b03020.
…rixi-framework#1409)

* add gradient variable type parameter

* fix parabolic literate test

* remove trailing comment

* remove unnecessary abstract type

* move gradient variable structs

* formatting

* fix dropped changes

* try to fix doc tests

* fixing navier stokes 1D

* formatting

* remove duplicate GradientVariablesPrimitive/Entropy definition

* update news
@sloede
Copy link
Member

sloede commented Nov 9, 2023

@DanielDoehring it would be great if you can resolve the conflicts here and then get another review from @andrewwinters5000. Afterwards, I believe, we can merge this to the staging branch

@DanielDoehring
Copy link
Contributor Author

Maybe before doing so merge #1720 and #1719 into main, then main into this to have some more tests pass

@sloede
Copy link
Member

sloede commented Nov 9, 2023

Maybe before doing so merge #1720 and #1719 into main, then main into this to have some more tests pass

Ah, I'll leave this up to @ranocha who has the magic touch re git merging :-) But from where I stand, I believe it might be easier to merge #1720 and #1719 into here and then this PR into the staging branch, but I might be mistaken...

@ranocha
Copy link
Member

ranocha commented Nov 10, 2023

Maybe before doing so merge #1720 and #1719 into main, then main into this to have some more tests pass

@DanielDoehring I have updated the v0.6 development branch with your PRs merged into main. Please resolve the conflicts.

@sloede sloede mentioned this pull request Nov 10, 2023
2 tasks
@DanielDoehring
Copy link
Contributor Author

Maybe before doing so merge #1720 and #1719 into main, then main into this to have some more tests pass

@DanielDoehring I have updated the v0.6 development branch with your PRs merged into main. Please resolve the conflicts.

Thanks a lot!

test/Project.toml Outdated Show resolved Hide resolved
@ranocha
Copy link
Member

ranocha commented Nov 10, 2023

The test failure looks real to me:

1D non-periodic DGMultiMesh: Error During Test at /home/runner/work/Trixi.jl/Trixi.jl/test/test_unit.jl:1318
  Got exception outside of a @test
  MethodError: no method matching Trixi.DGMultiMesh(::Trixi.DGMulti{1, NodesAndModes.Line, StartUpDG.Polynomial{StartUpDG.DefaultPolynomialType}, Trixi.SurfaceIntegralWeakForm{typeof(Trixi.flux_central)}, Trixi.VolumeIntegralFluxDifferencing{typeof(Trixi.flux_central)}, Nothing, StartUpDG.RefElemData{1, NodesAndModes.Line, StartUpDG.Polynomial{StartUpDG.DefaultPolynomialType}, Int64, Tuple{Int64, Int64}, Tuple{Vector{Float64}}, Tuple{Vector{Float64}}, Tuple{Vector{Float64}}, Tuple{Vector{Float64}}, Tuple{Vector{Float64}}, Vector{Int64}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Tuple{Matrix{Float64}}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Vector{Float64}, Vector{Float64}}}; cells_per_dimension::Tuple{Int64}, periodicity::Bool)
  
  Closest candidates are:
    Trixi.DGMultiMesh(::Trixi.DGMulti{NDIMS, ElemType, ApproxType, SurfaceIntegral, VolumeIntegral, Mortar, <:StartUpDG.RefElemData{NDIMS, ElemType, ApproxType}} where {ElemType, ApproxType, SurfaceIntegral, VolumeIntegral, Mortar}, ::String; periodicity) where NDIMS got unsupported keyword argument "cells_per_dimension"
     @ Trixi ~/work/Trixi.jl/Trixi.jl/src/solvers/dgmulti/types.jl:302
    Trixi.DGMultiMesh(::Trixi.DGMulti{NDIMS, ElemType, ApproxType, SurfaceIntegral, VolumeIntegral, Mortar, <:StartUpDG.RefElemData{NDIMS, ElemType, ApproxType}} where {ElemType, ApproxType, SurfaceIntegral, VolumeIntegral, Mortar}, ::Any; coordinates_min, coordinates_max, is_on_boundary, periodicity, kwargs...) where NDIMS
     @ Trixi ~/work/Trixi.jl/Trixi.jl/src/solvers/dgmulti/types.jl:239
    Trixi.DGMultiMesh(::Trixi.DGMulti{NDIMS, ElemType, ApproxType, SurfaceIntegral, VolumeIntegral, Mortar, <:StartUpDG.RefElemData{NDIMS, ElemType, ApproxType}} where {ElemType, ApproxType, SurfaceIntegral, VolumeIntegral, Mortar}, ::Any, ::AbstractArray; is_on_boundary, periodicity, kwargs...) where NDIMS
     @ Trixi ~/work/Trixi.jl/Trixi.jl/src/solvers/dgmulti/types.jl:195
    ...

see https://github.com/trixi-framework/Trixi.jl/actions/runs/6822105630/job/18553580689?pr=1708#step:7:1241

Did some merging go wrong? CC @jlchan

@ranocha
Copy link
Member

ranocha commented Nov 10, 2023

Aha, these CI failures occurred already in #1709. Could you please have a look at it, @jlchan?

Copy link
Member

@andrewwinters5000 andrewwinters5000 left a comment

Choose a reason for hiding this comment

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

LGTM! This can merge into the staging branch.

@jlchan
Copy link
Contributor

jlchan commented Nov 10, 2023

Aha, these CI failures occurred already in #1709. Could you please have a look at it, @jlchan?

Yep. @DanielDoehring can I fix it in dev and have you merge the change in here?

@jlchan
Copy link
Contributor

jlchan commented Nov 10, 2023

@ranocha @DanielDoehring CI should be fixed in #1728

@DanielDoehring
Copy link
Contributor Author

I merged your branch directly into this, hope that this works

@ranocha
Copy link
Member

ranocha commented Nov 10, 2023

I'll merge this now. Please do not merge commits from other PRs into PRs, that's just causing trouble in the long run.

@ranocha ranocha merged commit 5fd33f5 into trixi-framework:v0.6-dev Nov 10, 2023
28 of 30 checks passed
@DanielDoehring DanielDoehring deleted the HLL_MHD_Breaking branch November 10, 2023 15:06
ranocha added a commit that referenced this pull request Nov 11, 2023
* Breaking changes HLL MHD

* format

* format examples

* hlle

* fix

* news, tests, example changes

* fmt

* remove left-right-biased flux from test

* Set version to v0.6.0

* Migrate neural network-based indicators to new repository (#1701)

* Remove all neural network indicator stuff from `src/`

* Migrate neural network tests

* Migrate neural network examples

* Migrate test dependencies

* Update NEWS.md

* Fix typo

* Remove Requires.jl-based use of Flux.jl

* Fix formatting

* Add migration of indicators to section with breaking changes

---------

Co-authored-by: Hendrik Ranocha <[email protected]>

* fix hlle noncartesian 2d

* remove parantheses

* correct test vals

* Make parabolic terms nonexperimental (#1714)

* Make parabolic terms non-experimental

* Make NSE a separate item

* Add MPI to supported features

* Mention that parabolic terms are now officially supported in NEWS.md

Co-authored-by: Hendrik Ranocha <[email protected]>

* Deprecate some `DGMultiMesh` constructors  (#1709)

* remove previously deprecated functions

* fix typo in NEWS.md about deprecation vs removal

* fix literate tutorial

* removing other deprecation

* format

* Revert "fix typo in NEWS.md about deprecation vs removal"

This reverts commit 6b03020.

* add gradient variable type parameter to `AbstractEquationsParabolic` (#1409)

* add gradient variable type parameter

* fix parabolic literate test

* remove trailing comment

* remove unnecessary abstract type

* move gradient variable structs

* formatting

* fix dropped changes

* try to fix doc tests

* fixing navier stokes 1D

* formatting

* remove duplicate GradientVariablesPrimitive/Entropy definition

* update news

* bring downloads back

* fix failing test

* fmt

---------

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking consistency Make Michael happy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent implementation of min_max_speed_naive in different equations
5 participants