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

Add support for P4estMesh to subcell-limiting #121

Merged
merged 32 commits into from
Dec 5, 2023

Conversation

bennibolm
Copy link
Owner

@bennibolm bennibolm commented Nov 22, 2023

Adding support for subcell limiting with P4estMesh.

TODOs:

  • Check if StructuredMesh and P4estMesh give the same results
    -> Different order in calculating of the boundary fluxes yields slightly different (machine precision) results

Copy link

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.

@bennibolm
Copy link
Owner Author

bennibolm commented Nov 23, 2023

I'm thinking about whether it's useful to keep this default implementation of get_boundary_outer_state that only returns the inner value. When keeping it, the user doesn't really get an information if the used boundary condition has an influence to the bounds calculation or not.

# Default implementation of `get_boundary_outer_state` returns inner value.
@inline function get_boundary_outer_state(u_inner, cache, t, boundary_condition,
orientation_or_normal, direction, equations,
dg, indices...)
return u_inner
end

What do you think about that @amrueda ?

EDIT: On the other hand, it is useful for boundary conditions like boundary_condition_outflow.

@amrueda
Copy link
Collaborator

amrueda commented Nov 23, 2023

I'm thinking about whether it's useful to keep this default implementation of get_boundary_outer_state that only returns the inner value. When keeping it, the user doesn't really get an information if the used boundary condition has an influence to the bounds calculation or not.

# Default implementation of `get_boundary_outer_state` returns inner value.
@inline function get_boundary_outer_state(u_inner, cache, t, boundary_condition,
orientation_or_normal, direction, equations,
dg, indices...)
return u_inner
end

What do you think about that @amrueda ?

True, I was also thinking recently about this routine. I think it is better to remove it because it can lead a user to think that the bound computation takes into account their BCs. However, sometimes it makes sense to just use the inner solution. Is it possible to activate this computation with an input argument and keep it inactive as default?

@bennibolm
Copy link
Owner Author

True, I was also thinking recently about this routine. I think it is better to remove it because it can lead a user to think that the bound computation takes into account their BCs. However, sometimes it makes sense to just use the inner solution. Is it possible to activate this computation with an input argument and keep it inactive as default?

Yesterday, I revised the implementation of this routine. It is much more flexible and cleaner now.
Yes, it would be possible to add a boolean variable like use_inner_value_as_boundary_value_as_default (or something longer 😉 ) and throwing an error when the default routine is clled but the variable is false. But actually I think this is not very nice and we would have another stupid parameter 😣
So, I think I will just delete the default routine. If someone still wants to just use the inner value it is about 4 lines of code to add to the elixir.

Copy link
Collaborator

@amrueda amrueda left a comment

Choose a reason for hiding this comment

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

LGTM!
Just a minor comment:

src/equations/compressible_euler_2d.jl Outdated Show resolved Hide resolved
bennibolm and others added 2 commits December 4, 2023 15:55
Co-authored-by: Andrés Rueda-Ramírez <aruedara@uni-koeln.de>
@bennibolm bennibolm marked this pull request as ready for review December 4, 2023 14:58
@bennibolm bennibolm merged commit 1a09eaa into subcell-limiting Dec 5, 2023
29 of 31 checks passed
@bennibolm bennibolm deleted the subcell-limiting-p4est-all branch December 5, 2023 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants