Skip to content
Draft
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
427 commits
Select commit Hold shift + click to select a range
b3fca1a
Removed Taal comment.
SimonCan Apr 30, 2025
5584c02
Corrected order of parameters in function rhs!.
SimonCan Apr 30, 2025
764b614
Formatting.
SimonCan Apr 30, 2025
dd7dc64
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan Apr 30, 2025
18d40e8
Added routine to construct the boundaries for the p4est mesh views.
SimonCan May 2, 2025
db6653e
Now returning the local (mesh view) boundaries.
SimonCan May 2, 2025
eacc997
Transform global mesh ids into local ones.
SimonCan May 6, 2025
2b76768
Added option to save mesh files for multiple mesh views.
SimonCan May 8, 2025
36b2c7a
Added global index informatoin to semiiscretization.
SimonCan May 8, 2025
c4f3f1d
Update src/semidiscretization/semidiscretization_hyperbolic.jl
SimonCan May 9, 2025
35b6706
Reinstated boundary fluxes.
SimonCan May 12, 2025
23ed41c
Added calc_boundary_flux! function for coupled p4est meshes.
SimonCan May 13, 2025
2920610
Implemented coupled p4est boundary fluxes.
SimonCan May 19, 2025
2781b21
Added functions speicif for boundary numericalfluxes
SimonCan May 20, 2025
fd49e25
Added copy of coupled boundary for p4est mesh views.
SimonCan May 22, 2025
05ca758
Corrected indices for coupled fluxes.
SimonCan May 22, 2025
24359ac
Corrected shape of global u-vector.
SimonCan May 28, 2025
6126788
Resintated analysis callback for p4est mesh view.
SimonCan May 30, 2025
643dc66
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
b789104
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
6cb10a3
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
40e99b8
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
cca68ff
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
ae232fe
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
96ac772
Update src/solvers/dgsem_p4est/dg_2d.jl
SimonCan May 30, 2025
b6818c3
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
cd5fda7
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
3eb0e3b
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
31d0391
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
8a01a6c
Update src/meshes/p4est_mesh_view.jl
SimonCan May 30, 2025
3bfa483
Removed swap file.
SimonCan May 30, 2025
9b02fa6
Return -1 if element id is not part of this p4est mesh view.
SimonCan May 30, 2025
c8a9270
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan May 30, 2025
f0dc832
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan May 30, 2025
939a1a0
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan May 30, 2025
f067b98
Update src/solvers/dgsem_p4est/dg_2d.jl
SimonCan May 30, 2025
6e04e18
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan May 30, 2025
2ce754d
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan May 30, 2025
4de4fda
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan May 30, 2025
676829a
Cleaned up some of the coupling code for p4est mesh views.
SimonCan May 30, 2025
eee5388
Started to get the roight p4esh mesh view boundaries.
SimonCan Jun 3, 2025
fb335c7
Corrected calculation of periodic boundary neighbors.
SimonCan Jun 5, 2025
b580bd0
Generalized the p4eest mesh view coupling so that it works for
SimonCan Jun 6, 2025
d6ecc94
Movde routine for finding global neighbor ids.
SimonCan Jun 10, 2025
c1523f8
Changed funciton signature.
SimonCan Jun 10, 2025
96244b6
Generalized for arbitrary number of nodes.
SimonCan Jun 10, 2025
87e0cf2
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jun 10, 2025
213d7e2
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 10, 2025
0b1f8e3
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 10, 2025
4431260
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 10, 2025
211faab
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 10, 2025
a4cdf7b
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 10, 2025
626c3f1
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 10, 2025
a14ac96
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 10, 2025
7b01b1e
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 10, 2025
d039315
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 10, 2025
e17e7eb
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 10, 2025
65b4765
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 10, 2025
b1e958d
Added elixir to show case p4est mesh view coupling.
SimonCan Jun 11, 2025
1547f60
Added test for coupled p4est mesh views.
SimonCan Jun 11, 2025
1705a7b
Fixed ambiguitiy for calc_boundary_flux! for p4est meshes.
SimonCan Jun 12, 2025
34b7852
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jun 12, 2025
06d0f41
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan Jun 12, 2025
ae810f2
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
b8f5108
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
f628004
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
0c2f2ae
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
f906d36
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 12, 2025
f9d1620
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
3f9f827
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
3208217
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
9a24d27
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
2f73f48
Update src/meshes/p4est_mesh_view.jl
SimonCan Jun 12, 2025
fc1fd71
Temporarily removed tests for meshview example.
SimonCan Jun 13, 2025
dd7591a
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan Jun 13, 2025
eeec423
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jun 16, 2025
8298476
Removed redundant definition of foreach_enumerate function.
SimonCan Jun 16, 2025
2333191
Corrected prolong2interfaces! call.
SimonCan Jun 16, 2025
e073051
Removed update of GLM cleaning speed, as we don't have a test yet tha…
SimonCan Jun 16, 2025
abedff4
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan Jun 16, 2025
afa88ce
Removed another redundant foreach_enumerate funciton definition.
SimonCan Jun 16, 2025
ecee86a
Removed further redundant definitions.
SimonCan Jun 16, 2025
586ae5d
Removed unused ncells definition.
SimonCan Jun 16, 2025
b550f63
Merge branch 'main' into sc/p4est-view-coupled
DanielDoehring Jun 17, 2025
cfef1b7
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jun 20, 2025
90ff72a
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 23, 2025
e8064ec
Added integer to string conversion for sving mesh files for coupled s…
SimonCan Jun 23, 2025
9c00d81
Added P4estMeshView to max_dt.
SimonCan Jun 23, 2025
d6ff92c
Added ability to couple systems with more than one variable.
SimonCan Jun 24, 2025
9178818
Added ncells for P4estMeshViews needed for the conversion to vtk.
SimonCan Jun 25, 2025
aa30aa6
Merge branch 'main' into sc/p4est-view-coupled
DanielDoehring Jun 28, 2025
6ba8e6d
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 30, 2025
34181c0
Correcte comment fo rglobal cell id converion funciton when input is …
SimonCan Jun 30, 2025
3bd7911
Error arrays for coupled simulations are now pre-allocated.
SimonCan Jun 30, 2025
b2c69bb
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 30, 2025
21a4291
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 30, 2025
1cda279
Added comment on p4est coupled boundary conditions and that they only…
SimonCan Jun 30, 2025
5af5ebe
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan Jun 30, 2025
3862abb
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 30, 2025
76cbb4f
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jun 30, 2025
aa8943d
Added usage of coupling converter function for p4est mesh view coupling.
SimonCan Jun 30, 2025
ac3a3f9
Started with generalization of p4est coupling so that we can couple
SimonCan Jul 1, 2025
50a1e2a
Added semi as argument for computing coupled boundary condition in p4…
SimonCan Jul 3, 2025
7f3b63a
Fixed bug with copying values over to the global array.
SimonCan Jul 3, 2025
b1b7c3f
Added P4estMeshView to rhs! functions.
SimonCan Jul 7, 2025
0613f96
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jul 8, 2025
126e947
Corrected non-conservative flux calls using p4est coupled systems.
SimonCan Jul 8, 2025
1251830
Corrected issue with glm speed updates for coupled p4est simulations.
SimonCan Jul 11, 2025
5d02184
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jul 14, 2025
011f094
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Jul 14, 2025
e3b3897
Change parent mesh boundary condition to trigger more code for the test.
SimonCan Jul 14, 2025
9037cf3
Corrected argument for P4estMesh.
SimonCan Jul 15, 2025
bfdc3df
Fixed issue with AnalysisCallbackCoupled.
SimonCan Jul 15, 2025
74843ac
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jul 15, 2025
98bf870
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jul 15, 2025
2c9bf4d
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan Jul 15, 2025
b396227
Removed code for structured meshes.
SimonCan Jul 16, 2025
5ce2067
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jul 16, 2025
69bab29
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan Jul 16, 2025
cd0a019
Addedcomments on the mesh views
SimonCan Jul 16, 2025
7bee9aa
Added ncelss for p4est mesh views.
SimonCan Jul 16, 2025
fef8913
Added comment about the boundary conditions.
SimonCan Jul 16, 2025
1561815
Added comment about boundary u-array.
SimonCan Jul 16, 2025
63b5499
Corrected calculation of linf_error for p4est coupled systems.
SimonCan Jul 17, 2025
3c53935
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jul 18, 2025
ca5a0bc
Merge branch 'sc/p4est-view-coupled' into sc/p4est-view-coupled-enhanced
SimonCan Jul 23, 2025
3bbc298
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan Jul 23, 2025
2486d1d
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Jul 23, 2025
85e7494
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jul 23, 2025
8e5f08f
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Jul 23, 2025
4d3433e
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan Jul 23, 2025
a70a242
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan Jul 23, 2025
17e8a12
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan Jul 23, 2025
6fa73a2
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Jul 24, 2025
d266677
Added update_cleaning_speed for SemidiscretizationCoupledP4est.
SimonCan Aug 4, 2025
3831b3b
Introduced iteration offset for saving mesh files when running couple…
SimonCan Aug 19, 2025
2e18b03
Changed boundary coupling functions to array.
SimonCan Sep 8, 2025
f9c4a2b
Removed commented code.
SimonCan Sep 8, 2025
71646bc
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 8, 2025
4b0cde0
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 8, 2025
937eb2a
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 8, 2025
81bf410
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 8, 2025
a8278ed
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 8, 2025
1d488cd
Removed debugging line.
SimonCan Sep 8, 2025
9cfa77c
Merge branch 'sc/p4est-view-coupled-enhanced' of https://github.com/t…
SimonCan Sep 8, 2025
735b6aa
Removed further debugging lines.
SimonCan Sep 8, 2025
ea2354e
Update src/solvers/dgsem_p4est/dg_2d.jl
SimonCan Sep 8, 2025
9774cb6
Update src/solvers/dgsem_p4est/dg_2d.jl
SimonCan Sep 8, 2025
8e7c069
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan Sep 8, 2025
3a26e20
Update src/solvers/dgsem_unstructured/dg_2d.jl
SimonCan Sep 8, 2025
ce142b8
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Sep 8, 2025
146d5b4
Update src/callbacks_step/save_solution.jl
SimonCan Sep 8, 2025
5d35dc2
Update src/callbacks_step/save_solution.jl
SimonCan Sep 8, 2025
5eb56f2
Update src/callbacks_step/save_solution.jl
SimonCan Sep 8, 2025
71ab7e1
Update src/callbacks_step/save_solution.jl
SimonCan Sep 8, 2025
6661aed
Added path to examples directory when checking for hdf5 file.
SimonCan Sep 9, 2025
3319aed
Merge branch 'sc/p4est-view-coupled-enhanced' of https://github.com/t…
SimonCan Sep 10, 2025
3e89289
Removed analysis callback.
SimonCan Sep 10, 2025
9e77bea
Removed definition of analysis callback for coupled p4est systems.
SimonCan Sep 10, 2025
6884760
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Sep 10, 2025
7817847
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Sep 11, 2025
8ef4bef
Update test/test_p4est_2d.jl
SimonCan Sep 11, 2025
621f54e
Added analysis callback.
SimonCan Sep 11, 2025
574e33e
Removed redefinition of allocate_coupled_boundary_condition function.
SimonCan Sep 11, 2025
b74c55d
Added dummy calc_boundary_flux! for P4estMeshView to be used for the …
SimonCan Sep 12, 2025
bcfc2e4
Removed analysis callbacks for the semis for a coupled system.
SimonCan Sep 17, 2025
bee6ded
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Sep 17, 2025
801d3a5
Removed rtoublesome debugging output.
SimonCan Sep 18, 2025
b9c8da8
Removed redundant Union with P4estMeshView.
SimonCan Sep 18, 2025
573b39a
Removed mesh view example. This is redundant with examples with actua…
SimonCan Sep 18, 2025
9ed255e
Added test of couple Euler with MHD system.
SimonCan Sep 18, 2025
07df706
Uncommented previous tests.
SimonCan Sep 18, 2025
d4877a3
Corrected typos.
SimonCan Sep 20, 2025
e4a9389
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Sep 20, 2025
ad50853
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan Sep 20, 2025
9239c9b
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 20, 2025
30fc17d
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 20, 2025
ed16a3e
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 20, 2025
33f670a
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
067d230
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Sep 20, 2025
a5fe9a2
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
518af7f
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
259f4bf
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
357e461
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
b9e200e
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
50c585f
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
2dddaad
Update src/solvers/dgsem_unstructured/dg_2d.jl
SimonCan Sep 20, 2025
0464eaf
Update test/test_p4est_2d.jl
SimonCan Sep 20, 2025
51a03a6
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
99d0834
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
4246b87
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
58bc1a6
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
61fef7c
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
f06626c
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
dbee6ba
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
a1160f5
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
b79bf9f
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan Sep 20, 2025
6521fb7
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Sep 25, 2025
fc79fe4
Added parameter cfl_diffusive to calculate_dt for SemidiscretizationC…
SimonCan Sep 25, 2025
b233381
Removed analysis callback.
SimonCan Sep 25, 2025
a4661db
Reinstated analysis callback for coupled p4est simulations.
SimonCan Sep 27, 2025
6657ceb
First steps for coupled analysis callback.
SimonCan Sep 29, 2025
399dd8e
Added more infrastructure for coupled analysis callback.
SimonCan Sep 30, 2025
f787fc6
Removed debugging code.
SimonCan Sep 30, 2025
11a9602
Merge remote-tracking branch 'origin/main' into sc/p4est-view-coupled
SimonCan Sep 30, 2025
ca34af9
Added comments about coupled analysis callbacks.
SimonCan Sep 30, 2025
a2726db
Merge remote-tracking branch 'origin/main' into sc/p4est-view-coupled
SimonCan Oct 1, 2025
93903c3
Merge remote-tracking branch 'origin/main' into sc/p4est-view-coupled
SimonCan Oct 1, 2025
8cb9cfa
Removed unused callback functions.
SimonCan Oct 1, 2025
3c1c853
Removed unused references to u_ode_coupled.
SimonCan Oct 1, 2025
763a842
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Oct 2, 2025
b369fbb
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Oct 2, 2025
74ab2e1
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Oct 6, 2025
7b29c24
Removed unused call of 'show' for analysis callback for p4est mesh vi…
SimonCan Oct 6, 2025
d1db4b4
Applied autoformatter.
SimonCan Oct 6, 2025
2217b09
Merge branch 'sc/p4est-view-coupled' of github.com:trixi-framework/Tr…
SimonCan Oct 6, 2025
cb4c96a
Update src/callbacks_step/analysis.jl
SimonCan Oct 6, 2025
d523377
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Oct 6, 2025
2a94fd2
Update test/test_p4est_2d.jl
SimonCan Oct 6, 2025
8f54ca2
git pushMerge branch 'sc/p4est-view-coupled' of github.com:trixi-fram…
SimonCan Oct 9, 2025
e2596f2
Update test/test_p4est_2d.jl
SimonCan Oct 9, 2025
c9377b2
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan Oct 9, 2025
52a5b6c
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Oct 9, 2025
0ad3b72
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Oct 9, 2025
f3a2025
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Oct 9, 2025
e6be6b2
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Oct 9, 2025
db2a2fc
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Oct 9, 2025
02ecbbb
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Oct 9, 2025
ebf7d66
Update src/callbacks_step/analysis.jl
SimonCan Oct 9, 2025
5540a80
Update src/callbacks_step/analysis.jl
SimonCan Oct 9, 2025
775e9cd
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Oct 9, 2025
d4f257f
Merge branch 'main' into sc/p4est-view-coupled
SimonCan Oct 9, 2025
3741953
Removed redundant and conflicting redefinition of the function alloca…
SimonCan Oct 10, 2025
9df2941
Merge branch 'sc/p4est-view-coupled' of github.com:trixi-framework/Tr…
SimonCan Oct 10, 2025
898b24a
Merge branch 'sc/p4est-view-coupled' into sc/p4est-view-coupled-enhanced
SimonCan Oct 16, 2025
7e8090c
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Oct 16, 2025
24e615d
Update examples/structured_2d_dgsem/test.jl
SimonCan Oct 17, 2025
374e23a
Update examples/structured_2d_dgsem/test.jl
SimonCan Oct 17, 2025
3b8d6af
Update examples/structured_2d_dgsem/test.jl
SimonCan Oct 17, 2025
9de98c3
Update examples/structured_2d_dgsem/test.jl
SimonCan Oct 17, 2025
4a61508
Update examples/structured_2d_dgsem/test.jl
SimonCan Oct 17, 2025
28960ae
Update examples/structured_2d_dgsem/test.jl
SimonCan Oct 17, 2025
e2d695c
Update examples/structured_2d_dgsem/test.jl
SimonCan Oct 17, 2025
f1b1b9c
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Oct 17, 2025
3a1a156
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Oct 21, 2025
711921a
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Oct 21, 2025
a6350a1
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Oct 22, 2025
716ca60
Fixed parsing error in 2d p4est test file.
SimonCan Oct 23, 2025
026c25b
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Oct 23, 2025
1061839
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan Oct 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
OrdinaryDiffEqLowStorageRK = "b0944070-b475-4768-8dec-fb6eb410534d"
OrdinaryDiffEqSSPRK = "669c94d9-1f4b-4b64-b377-1aa079aa2388"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
9 changes: 9 additions & 0 deletions examples/p4est_2d_dgsem/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[deps]
AbbreviatedStackTraces = "ac637c84-cc71-43bf-9c33-c1b4316be3d4"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
Trixi2Vtk = "bc1476a1-1ca6-4cc3-950b-c312b255ff95"
94 changes: 94 additions & 0 deletions examples/p4est_2d_dgsem/elixir_advection_coupled.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
using OrdinaryDiffEqSSPRK, OrdinaryDiffEqLowStorageRK
using Trixi

###############################################################################
# Simplest coupled setup consisting of two non-trivial mesh views.

advection_velocity = (0.2, -0.7)
equations = LinearScalarAdvectionEquation2D(advection_velocity)

# Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux
solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs)

coordinates_min = (-1.0, -1.0) # minimum coordinates (min(x), min(y))
coordinates_max = (1.0, 1.0) # maximum coordinates (max(x), max(y))

trees_per_dimension = (8, 8)

# Create parent P4estMesh with 8 x 8 trees and 8 x 8 elements
# Since we couple through the boundaries, the periodicity does not matter here,
# but it is to trigger parts of the code for the test.
parent_mesh = P4estMesh(trees_per_dimension, polydeg = 3,
coordinates_min = coordinates_min,
coordinates_max = coordinates_max,
initial_refinement_level = 0,
periodicity = false)

# Define the mesh views consisting of a small square in the center
# and a square ring around it.
cell_ids1 = vcat((1:18), (23:26), (31:34), (39:42), (47:64))
mesh1 = P4estMeshView(parent_mesh, cell_ids1)
cell_ids2 = vcat((19:22), (27:30), (35:38), (43:46))
mesh2 = P4estMeshView(parent_mesh, cell_ids2)

# Define a trivial coupling function.
coupling_function = (x, u, equations_other, equations_own) -> u

# Define a coupling function for each combination of interfaces.
coupling_functions = Array{Function}(undef, 2, 2)
coupling_functions[1, 1] = (x, u, equations_other, equations_own) -> u
coupling_functions[1, 2] = (x, u, equations_other, equations_own) -> u
coupling_functions[2, 1] = (x, u, equations_other, equations_own) -> u
coupling_functions[2, 2] = (x, u, equations_other, equations_own) -> u

# The mesh is coupled across the physical boundaries, which makes this setup
# effectively double periodic.
boundary_conditions = Dict(:x_neg => BoundaryConditionCoupledP4est(coupling_functions),
:y_neg => BoundaryConditionCoupledP4est(coupling_functions),
:y_pos => BoundaryConditionCoupledP4est(coupling_functions),
:x_pos => BoundaryConditionCoupledP4est(coupling_functions))

semi1 = SemidiscretizationHyperbolic(mesh1, equations, initial_condition_convergence_test,
solver,
boundary_conditions = boundary_conditions)
semi2 = SemidiscretizationHyperbolic(mesh2, equations, initial_condition_convergence_test,
solver,
boundary_conditions = boundary_conditions)

# Create a semidiscretization that bundles semi1 and semi2
semi = SemidiscretizationCoupledP4est(semi1, semi2)

###############################################################################
# ODE solvers, callbacks etc.

# Create ODE problem with time span from 0.0 to 2.0
ode = semidiscretize(semi, (0.0, 2.0))

# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation setup
# and resets the timers
summary_callback = SummaryCallback()

# The AnalysisCallback allows to analyse the solution in regular intervals and prints the results
analysis_callback1 = AnalysisCallback(semi1, interval = 100)
analysis_callback2 = AnalysisCallback(semi2, interval = 100)
analysis_callback = AnalysisCallbackCoupledP4est(semi, analysis_callback1,
analysis_callback2)

# The SaveSolutionCallback allows to save the solution to a file in regular intervals
save_solution = SaveSolutionCallback(interval = 100,
solution_variables = cons2prim)

# The StepsizeCallback handles the re-calculation of the maximum Δt after each time step
stepsize_callback = StepsizeCallback(cfl = 1.6)

# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution,
stepsize_callback)

###############################################################################
# run the simulation

# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
ode_default_options()..., callback = callbacks);
126 changes: 126 additions & 0 deletions examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
using OrdinaryDiffEqSSPRK, OrdinaryDiffEqLowStorageRK
using Trixi

###############################################################################
# One Euler system is coupled to one MHD system.

# Pressure wave, same for the Euler system.
function initial_condition_mhd(x, t, equations::IdealGlmMhdEquations2D)
rho = ((1.0 + 0.01 * sin(x[1] * 2 * pi)))
v1 = ((0.01 * sin((x[1] - 1 / 2) * 2 * pi)))
v2 = 0.0
v3 = 0.0
p = rho^equations.gamma
B1 = 0.0
B2 = 0.0
B3 = 0.0
psi = 0.0

return prim2cons(SVector(rho, v1, v2, v3, p, B1, B2, B3, psi), equations)
end

# Pressure wave, same as for the MHD system.
function initial_condition_euler(x, t, equations::CompressibleEulerEquations2D)
rho = ((1.0 + 0.01 * sin(x[1] * 2 * pi)))
v1 = ((0.01 * sin((x[1] - 1 / 2) * 2 * pi)))
v2 = 0.0
p = rho .^ equations.gamma

return prim2cons(SVector(rho, v1, v2, p), equations)
end

# Define the parent mesh.
coordinates_min = (-2.0, -2.0) # minimum coordinates (min(x), min(y))
coordinates_max = (2.0, 2.0) # maximum coordinates (max(x), max(y))
trees_per_dimension = (8, 8)
# Here we set the priodicity to false for the coupling.
# Since we couple through the physical boundaries the system is effectively periodic.
parent_mesh = P4estMesh(trees_per_dimension, polydeg = 3,
coordinates_min = coordinates_min,
coordinates_max = coordinates_max,
initial_refinement_level = 0, periodicity = (false, false))

equations1 = IdealGlmMhdEquations2D(5 / 3)
equations2 = CompressibleEulerEquations2D(5 / 3)

# Define the coupling function between every possible pair of systems.
coupling_functions = Array{Function}(undef, 2, 2)
coupling_functions[1, 1] = (x, u, equations_other, equations_own) -> u
coupling_functions[1, 2] = (x, u, equations_other, equations_own) -> SVector(u[1], u[2],
u[3], 0.0,
u[4], 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])
coupling_functions[2, 2] = (x, u, equations_other, equations_own) -> u

# semi 1 MHD.
cell_ids1 = vcat(Vector(1:8), Vector(32:64))
mesh1 = P4estMeshView(parent_mesh, cell_ids1)
volume_flux = (flux_hindenlang_gassner, flux_nonconservative_powell)
solver1 = DGSEM(polydeg = 3,
surface_flux = (flux_lax_friedrichs, flux_nonconservative_powell),
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))
boundary_conditions1 = Dict(:x_neg => BoundaryConditionCoupledP4est(coupling_functions),
:y_neg => BoundaryConditionCoupledP4est(coupling_functions),
:y_pos => BoundaryConditionCoupledP4est(coupling_functions),
:x_pos => BoundaryConditionCoupledP4est(coupling_functions))
semi1 = SemidiscretizationHyperbolic(mesh1, equations1, initial_condition_mhd, solver1,
boundary_conditions = boundary_conditions1)

# semi 2 Euler
cell_ids2 = Vector(9:31)
mesh2 = P4estMeshView(parent_mesh, cell_ids2)
solver2 = DGSEM(polydeg = 3, surface_flux = flux_hll,
volume_integral = VolumeIntegralWeakForm())
boundary_conditions2 = Dict(:x_neg => BoundaryConditionCoupledP4est(coupling_functions),
:y_neg => BoundaryConditionCoupledP4est(coupling_functions),
:y_pos => BoundaryConditionCoupledP4est(coupling_functions),
:x_pos => BoundaryConditionCoupledP4est(coupling_functions))
semi2 = SemidiscretizationHyperbolic(mesh2, equations2, initial_condition_euler, solver2,
boundary_conditions = boundary_conditions2)

# Create a semidiscretization that bundles semi1 and semi2
semi = SemidiscretizationCoupledP4est(semi1, semi2)

###############################################################################
# ODE solvers, callbacks etc.

ode = semidiscretize(semi, (0.0, 1.0));

# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation setup
# and resets the timers
summary_callback = SummaryCallback()

# The AnalysisCallback allows to analyse the solution in regular intervals and prints the results
analysis_callback1 = AnalysisCallback(semi1, interval = 100)
analysis_callback2 = AnalysisCallback(semi2, interval = 100)
analysis_callback = AnalysisCallbackCoupled(semi, analysis_callback1, analysis_callback2)

# The SaveSolutionCallback allows to save the solution to a file in regular intervals
save_solution = SaveSolutionCallback(interval = 100,
solution_variables = cons2prim)

# The StepsizeCallback handles the re-calculation of the maximum Δt after each time step
stepsize_callback = StepsizeCallback(cfl = 0.8)

glm_speed_callback = GlmSpeedCallback(glm_scale = 0.5, cfl = 0.8,
semi_indices = Vector([1]))

# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback,
# analysis_callback,
save_solution,
stepsize_callback,
glm_speed_callback)

###############################################################################
# run the simulation

# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 0.0001, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep = false, callback = callbacks);

# Print the timer summary
summary_callback()
11 changes: 11 additions & 0 deletions examples/structured_2d_dgsem/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[deps]
AbbreviatedStackTraces = "ac637c84-cc71-43bf-9c33-c1b4316be3d4"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
OrdinaryDiffEqLowStorageRK = "b0944070-b475-4768-8dec-fb6eb410534d"
OrdinaryDiffEqSSPRK = "669c94d9-1f4b-4b64-b377-1aa079aa2388"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
Trixi2Vtk = "bc1476a1-1ca6-4cc3-950b-c312b255ff95"
80 changes: 80 additions & 0 deletions examples/structured_2d_dgsem/test.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# #Ignore this
# using Pkg
# Pkg.activate("..")

using Trixi
using OrdinaryDiffEqSSPRK, OrdinaryDiffEqLowStorageRK
using Plots

equations = ShallowWaterEquations2D(gravity_constant = 9.81)
# Define the initial condition

function initial_condition_test(x, t, equations::ShallowWaterEquations2D)
x1, x2 = x
v1 = 0.0
v2 = 0.0
b = 0.0
H = 1.0
return prim2cons(SVector(H, v1, v2, b), equations)
end

initial_condition = initial_condition_test
# Define the dirichlet boundary condition
boundary_conditions = BoundaryConditionDirichlet(initial_condition_test)

# Define the problem solver

volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal)
solver = DGSEM(polydeg = 3,
surface_flux = (flux_lax_friedrichs, flux_nonconservative_fjordholm_etal),
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))

xl = 0.0;
yl = 0.0;
xr = 3.0;
yr = 3.0;
coordinates_min = (xl, yl)
coordinates_max = (xr, yr)
cells_per_dimension = (30, 30)

# Define the mesh

# If we use tree mesh, it is good.
#mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 5, n_cells_max = 10_000, periodicity = false)

# If we use a structured mesh is wrong.
mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max,
periodicity = false)

# Create the semi discretization object
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_conditions)

###############################################################################
# ODE solver

tspan = (0.0, 2.0)
ode = semidiscretize(semi, tspan)

###############################################################################
# Callbacks

summary_callback = SummaryCallback()

analysis_interval = 1000
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
extra_analysis_integrals = (lake_at_rest_error,))

alive_callback = AliveCallback(analysis_interval = analysis_interval)

stepsize_callback = StepsizeCallback(cfl = 0.5)

callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback,
stepsize_callback)

###############################################################################
# run the simulation

sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
ode_default_options()..., callback = callbacks);
10 changes: 10 additions & 0 deletions examples/structured_3d_dgsem/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[deps]
AbbreviatedStackTraces = "ac637c84-cc71-43bf-9c33-c1b4316be3d4"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
OrdinaryDiffEqLowStorageRK = "b0944070-b475-4768-8dec-fb6eb410534d"
OrdinaryDiffEqSSPRK = "669c94d9-1f4b-4b64-b377-1aa079aa2388"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
Trixi2Vtk = "bc1476a1-1ca6-4cc3-950b-c312b255ff95"
9 changes: 9 additions & 0 deletions examples/t8code_2d_dgsem/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[deps]
AbbreviatedStackTraces = "ac637c84-cc71-43bf-9c33-c1b4316be3d4"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
Trixi2Vtk = "bc1476a1-1ca6-4cc3-950b-c312b255ff95"
7 changes: 4 additions & 3 deletions src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ include("semidiscretization/semidiscretization_hyperbolic.jl")
include("semidiscretization/semidiscretization_hyperbolic_parabolic.jl")
include("semidiscretization/semidiscretization_euler_acoustics.jl")
include("semidiscretization/semidiscretization_coupled.jl")
include("semidiscretization/semidiscretization_coupled_p4est.jl")
include("time_integration/time_integration.jl")
include("callbacks_step/callbacks_step.jl")
include("callbacks_stage/callbacks_stage.jl")
Expand Down Expand Up @@ -229,7 +230,7 @@ export boundary_condition_do_nothing,
BoundaryConditionNavierStokesWall,
NoSlip, Slip,
Adiabatic, Isothermal,
BoundaryConditionCoupled
BoundaryConditionCoupled, BoundaryConditionCoupledP4est

export initial_condition_convergence_test, source_terms_convergence_test,
source_terms_lorentz, source_terms_collision_ion_electron,
Expand Down Expand Up @@ -291,14 +292,14 @@ export SemidiscretizationEulerGravity, ParametersEulerGravity,
timestep_gravity_erk53_3Sstar!,
timestep_gravity_carpenter_kennedy_erk54_2N!

export SemidiscretizationCoupled
export SemidiscretizationCoupled, SemidiscretizationCoupledP4est

export SummaryCallback, SteadyStateCallback, AnalysisCallback, AliveCallback,
SaveRestartCallback, SaveSolutionCallback, TimeSeriesCallback, VisualizationCallback,
AveragingCallback,
AMRCallback, StepsizeCallback,
GlmSpeedCallback, LBMCollisionCallback, EulerAcousticsCouplingCallback,
TrivialCallback, AnalysisCallbackCoupled,
TrivialCallback, AnalysisCallbackCoupled, AnalysisCallbackCoupledP4est,
AnalysisSurfaceIntegral, DragCoefficientPressure2D, LiftCoefficientPressure2D,
DragCoefficientShearStress2D, LiftCoefficientShearStress2D,
DragCoefficientPressure3D, LiftCoefficientPressure3D
Expand Down
Loading
Loading