Skip to content

WIP: Sc/p4est view coupled hanging nodes#2598

Draft
SimonCan wants to merge 96 commits intosc/p4est-view-coupled-enhancedfrom
sc/p4est-view-coupled-hanging-nodes
Draft

WIP: Sc/p4est view coupled hanging nodes#2598
SimonCan wants to merge 96 commits intosc/p4est-view-coupled-enhancedfrom
sc/p4est-view-coupled-hanging-nodes

Conversation

@SimonCan
Copy link
Copy Markdown
Contributor

@SimonCan SimonCan commented Oct 9, 2025

Added capability of coupling pest mesh views with hanging/non-conforming nodes.

@SimonCan SimonCan added enhancement New feature or request low-priority labels Oct 9, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 9, 2025

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
Copy Markdown

codecov Bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 23.28358% with 514 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (sc/p4est-view-coupled-enhanced@cdd1181). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/solvers/dgsem_p4est/dg_2d_coupled.jl 0.00% 257 Missing ⚠️
src/meshes/p4est_mesh_view.jl 0.00% 140 Missing ⚠️
src/solvers/dgsem_p4est/containers_coupled.jl 0.00% 44 Missing ⚠️
...discretization/semidiscretization_coupled_p4est.jl 0.00% 43 Missing ⚠️
...dgsem/elixir_advection_coupled_with_amr_mortars.jl 0.00% 20 Missing ⚠️
src/solvers/dgsem_p4est/dg.jl 0.00% 4 Missing ⚠️
src/solvers/dgsem/basis_lobatto_legendre.jl 91.67% 2 Missing ⚠️
src/solvers/dgsem_p4est/dg_2d.jl 0.00% 2 Missing ⚠️
src/solvers/dgsem_p4est/dg_3d_parallel.jl 0.00% 1 Missing ⚠️
src/solvers/dgsem_tree/subcell_finite_volume_O2.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##             sc/p4est-view-coupled-enhanced    #2598   +/-   ##
=================================================================
  Coverage                                  ?   91.87%           
=================================================================
  Files                                     ?      570           
  Lines                                     ?    44734           
  Branches                                  ?        0           
=================================================================
  Hits                                      ?    41095           
  Misses                                    ?     3639           
  Partials                                  ?        0           
Flag Coverage Δ
unittests 91.87% <23.28%> (?)

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.

SimonCan and others added 22 commits October 17, 2025 09:42
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 SimonCan changed the base branch from main to sc/p4est-view-coupled-enhanced February 9, 2026 17:18
SimonCan and others added 10 commits April 20, 2026 18:43
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>
Add coupled AMR elixir to test suit.
Comment thread test/test_p4est_2d.jl
Copy link
Copy Markdown
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 🐶

# Load the mesh file for code coverage.
loaded_mesh = Trixi.load_mesh_serial(joinpath("out", "mesh_1_000000000.h5");
n_cells_max = 0,
RealT = typeof(parent_mesh).parameters[3])
end

SimonCan and others added 9 commits April 27, 2026 12:41
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>

# Iterator for coupled mortars
@inline eachcoupledmortar(dg, cache) = Base.OneTo(ncoupledmortars(cache.coupled_mortars))

Copy link
Copy Markdown
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

Comment thread test/test_p4est_2d.jl
Comment on lines +127 to +133
@trixi_testset "elixir_advection_coupled_with_amr_mortars.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_advection_coupled_with_amr_mortars.jl"),
tspan=(0.0, 1.0),
l2=[0.0007319835742861697, 0.001985235435356559],
linf=[0.008310493861112489, 0.009003928823673624])
end
Copy link
Copy Markdown
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_testset "elixir_advection_coupled_with_amr_mortars.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_advection_coupled_with_amr_mortars.jl"),
tspan=(0.0, 1.0),
l2=[0.0007319835742861697, 0.001985235435356559],
linf=[0.008310493861112489, 0.009003928823673624])
end
@trixi_testset "elixir_advection_restart_amr.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"),
l2=[2.869137983727866e-6],
linf=[3.8353423270964804e-5])
end

Comment thread test/test_p4est_2d.jl
Comment on lines +135 to +141
@trixi_testset "elixir_advection_coupled_checkerboard_views.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_advection_coupled_checkerboard_views.jl"),
tspan=(0.0, 1.0),
l2=[0.0015361594792012185, 0.001455051112944291],
linf=[0.00900392882367318, 0.008196871838623832])
end
Copy link
Copy Markdown
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_testset "elixir_advection_coupled_checkerboard_views.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_advection_coupled_checkerboard_views.jl"),
tspan=(0.0, 1.0),
l2=[0.0015361594792012185, 0.001455051112944291],
linf=[0.00900392882367318, 0.008196871838623832])
end
@trixi_testset "elixir_advection_coupled.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_coupled.jl"),
l2=[0.00013318279010712176, 0.00013318279010712014],
linf=[0.000960578229013187, 0.0009605782290140752])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
@test_broken (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
# Test show methods for code coverage.
@test_nowarn show(stdout, semi)
# Load the mesh file for code coverage.
loaded_mesh = Trixi.load_mesh_serial(joinpath("out", "mesh_1_000000000.h5");
n_cells_max = 0,
RealT = typeof(parent_mesh).parameters[3])
end

Comment on lines +61 to +64
u[3], 0.0,
u[4], 0.0,
0.0, 0.0,
0.0)
Copy link
Copy Markdown
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
u[3], 0.0,
u[4], 0.0,
0.0, 0.0,
0.0)
u[3], 0.0,
u[4], 0.0,
0.0, 0.0,
0.0)

0.0)
coupling_functions[2, 1] = (x, u, equations_other, equations_own) -> SVector(u[1], u[2],
u[3], u[5])
u[3], u[5])
Copy link
Copy Markdown
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
u[3], u[5])
u[3], u[5])

Comment thread test/test_p4est_2d.jl
Copy link
Copy Markdown
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 🐶

@trixi_testset "elixir_advection_basic.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"),
# Expected errors are exactly the same as with P4estMeshView!
l2=[0.00013773915040249946],
linf=[0.0010140184322192658],
initial_refinement_level=0)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
@test_allocations(Trixi.rhs!, semi, sol, 1000)
end

Comment thread test/test_p4est_2d.jl
Copy link
Copy Markdown
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 🐶

@trixi_testset "elixir_euler_mhd_coupled.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_mhd_coupled.jl"),
l2=[
0.0009209778282789782, 0.0014756088960704886,
2.6739154420876842e-5, 0.0, 0.002302285074638671,
0.0, 0.0, 0.0, 0.0,
0.00092795792971463, 0.001486604885621148,
1.94903864271771e-7, 0.0023209501264139848
],
linf=[
0.0016212187495835417, 0.0026481875873929084,
0.00028267046396916696, 0.0, 0.004053956838104833,
0.0, 0.0, 0.0, 0.0,
0.0016010194777924536, 0.0026102809747779302,
2.539799766164192e-6, 0.004014367354669757
],
tspan=(0.0, 0.02))
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
@test_broken (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request low-priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants