Skip to content

New AMR indicator IndicatorNodalFunction#2881

Merged
ranocha merged 46 commits intotrixi-framework:mainfrom
TJP-Karpowski:IndicatorPositional
Apr 3, 2026
Merged

New AMR indicator IndicatorNodalFunction#2881
ranocha merged 46 commits intotrixi-framework:mainfrom
TJP-Karpowski:IndicatorPositional

Conversation

@TJP-Karpowski
Copy link
Copy Markdown
Contributor

Positional Indicator and Testcases

The PR adds a Positional Indicator which allows us to define a function rule(x,t) and use it to drive AMR.
As mentioned in #2880 this is targeted for testing purposes to create highly dynamic AMR grids to test refinement, unrefinement, and mortars, especially with MPI.
As an example, I have attached a video of the examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity_amr_mortarTestcase.jl case showcasing the capability by pulsing the refinement zone with a sin function.

IndicatorPositional

The testcases are envisioned to test MPI mortars for the hyperbolic parabolic system as mentioned in #2880 .

Open question

  • Is the weighted average of the nodes a valid proxy for the element centers? It seemed reasonable to me.
  • I did not add a 1D testcase for the IndicatorPositional as the use case is again for MPI treatments in 3D or 2D

@DanielDoehring, I hope this clarifies the feature's use case.

Disclaimer

LLMs have been used to aid in the PR, though sparingly.

Funding Statement

This work has been funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project Number 237267381 – TRR 150.

@github-actions
Copy link
Copy Markdown
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.

@TJP-Karpowski TJP-Karpowski changed the title Indicator positional Indicator positional (AMR) Mar 24, 2026
Copy link
Copy Markdown
Member

@DanielDoehring DanielDoehring 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 getting this started! I added a first review, which is mostly about namings and the evaluation of the indicator at the cell center.

Furthermore, I am not sure if Positional is good naming, as this somewhat drops that you can also add time as an argument.

TJP-Karpowski and others added 7 commits March 25, 2026 12:46
Included suggested style improvments

Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
update Naming to indicator_function

Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
changed naming

Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
changed naming

Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
changed naming

Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
TJP-Karpowski and others added 3 commits March 26, 2026 12:55
Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 93.84615% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.07%. Comparing base (ce719f3) to head (7db5065).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/solvers/dgsem/indicators.jl 94.74% 1 Missing ⚠️
src/solvers/dgsem_tree/indicators_1d.jl 93.33% 1 Missing ⚠️
src/solvers/dgsem_tree/indicators_2d.jl 93.33% 1 Missing ⚠️
src/solvers/dgsem_tree/indicators_3d.jl 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2881      +/-   ##
==========================================
+ Coverage   96.76%   97.07%   +0.31%     
==========================================
  Files         610      611       +1     
  Lines       47500    47565      +65     
==========================================
+ Hits        45960    46171     +211     
+ Misses       1540     1394     -146     
Flag Coverage Δ
unittests 97.07% <93.85%> (+0.31%) ⬆️

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.

Copy link
Copy Markdown
Member

@DanielDoehring DanielDoehring left a comment

Choose a reason for hiding this comment

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

Implementationwise, this is already looking very good to me! Now we only need to cover the code & set up tests.

Copy link
Copy Markdown
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 for your contribution!

@ranocha ranocha changed the title Indicator positional (AMR) New AMR indicator IndicatorNodalFunction Apr 2, 2026
ranocha
ranocha previously approved these changes Apr 2, 2026
Copy link
Copy Markdown
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, this looks good to me.

@ranocha ranocha requested a review from DanielDoehring April 2, 2026 14:46
@ranocha
Copy link
Copy Markdown
Member

ranocha commented Apr 2, 2026

The CI failure seems to come from the recent SciML updates (OrdinaryDiffEq.jl and supporting ecosystem). Running the failing test locally passes with older versions of the SciML packages, but fails after updating them.

Xref SciML/OrdinaryDiffEq.jl#3331

Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
@ranocha ranocha enabled auto-merge (squash) April 3, 2026 16:31
@ranocha ranocha disabled auto-merge April 3, 2026 17:23
@ranocha ranocha merged commit 86fbdbb into trixi-framework:main Apr 3, 2026
39 of 40 checks passed
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.

4 participants