-
Couldn't load subscription status.
- Fork 131
WIP: Sc/p4est view coupled hanging nodes #2598
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
Draft
SimonCan
wants to merge
421
commits into
main
Choose a base branch
from
sc/p4est-view-coupled-hanging-nodes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 250 commits
Commits
Show all changes
421 commits
Select commit
Hold shift + click to select a range
f2e00bf
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan 2032066
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan edbdf13
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan 0c1d0d0
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan c5940d0
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 0d07fb3
Ucommented functions that would only make sense for a structured mesh.
SimonCan b3fca1a
Removed Taal comment.
SimonCan 5584c02
Corrected order of parameters in function rhs!.
SimonCan 764b614
Formatting.
SimonCan dd7dc64
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan 18d40e8
Added routine to construct the boundaries for the p4est mesh views.
SimonCan db6653e
Now returning the local (mesh view) boundaries.
SimonCan eacc997
Transform global mesh ids into local ones.
SimonCan 2b76768
Added option to save mesh files for multiple mesh views.
SimonCan 36b2c7a
Added global index informatoin to semiiscretization.
SimonCan c4f3f1d
Update src/semidiscretization/semidiscretization_hyperbolic.jl
SimonCan 35b6706
Reinstated boundary fluxes.
SimonCan 23ed41c
Added calc_boundary_flux! function for coupled p4est meshes.
SimonCan 2920610
Implemented coupled p4est boundary fluxes.
SimonCan 2781b21
Added functions speicif for boundary numericalfluxes
SimonCan fd49e25
Added copy of coupled boundary for p4est mesh views.
SimonCan 05ca758
Corrected indices for coupled fluxes.
SimonCan 24359ac
Corrected shape of global u-vector.
SimonCan 6126788
Resintated analysis callback for p4est mesh view.
SimonCan 643dc66
Update src/meshes/p4est_mesh_view.jl
SimonCan b789104
Update src/meshes/p4est_mesh_view.jl
SimonCan 6cb10a3
Update src/meshes/p4est_mesh_view.jl
SimonCan 40e99b8
Update src/meshes/p4est_mesh_view.jl
SimonCan cca68ff
Update src/meshes/p4est_mesh_view.jl
SimonCan ae232fe
Update src/meshes/p4est_mesh_view.jl
SimonCan 96ac772
Update src/solvers/dgsem_p4est/dg_2d.jl
SimonCan b6818c3
Update src/meshes/p4est_mesh_view.jl
SimonCan cd5fda7
Update src/meshes/p4est_mesh_view.jl
SimonCan 3eb0e3b
Update src/meshes/p4est_mesh_view.jl
SimonCan 31d0391
Update src/meshes/p4est_mesh_view.jl
SimonCan 8a01a6c
Update src/meshes/p4est_mesh_view.jl
SimonCan 3bfa483
Removed swap file.
SimonCan 9b02fa6
Return -1 if element id is not part of this p4est mesh view.
SimonCan c8a9270
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan f0dc832
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 939a1a0
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan f067b98
Update src/solvers/dgsem_p4est/dg_2d.jl
SimonCan 6e04e18
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 2ce754d
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 4de4fda
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 676829a
Cleaned up some of the coupling code for p4est mesh views.
SimonCan eee5388
Started to get the roight p4esh mesh view boundaries.
SimonCan fb335c7
Corrected calculation of periodic boundary neighbors.
SimonCan b580bd0
Generalized the p4eest mesh view coupling so that it works for
SimonCan d6ecc94
Movde routine for finding global neighbor ids.
SimonCan c1523f8
Changed funciton signature.
SimonCan 96244b6
Generalized for arbitrary number of nodes.
SimonCan 87e0cf2
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 213d7e2
Update src/meshes/p4est_mesh_view.jl
SimonCan 0b1f8e3
Update src/meshes/p4est_mesh_view.jl
SimonCan 4431260
Update src/meshes/p4est_mesh_view.jl
SimonCan 211faab
Update src/meshes/p4est_mesh_view.jl
SimonCan a4cdf7b
Update src/meshes/p4est_mesh_view.jl
SimonCan 626c3f1
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan a14ac96
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 7b01b1e
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan d039315
Update src/meshes/p4est_mesh_view.jl
SimonCan e17e7eb
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 65b4765
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan b1e958d
Added elixir to show case p4est mesh view coupling.
SimonCan 1547f60
Added test for coupled p4est mesh views.
SimonCan 1705a7b
Fixed ambiguitiy for calc_boundary_flux! for p4est meshes.
SimonCan 34b7852
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 06d0f41
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan ae810f2
Update src/meshes/p4est_mesh_view.jl
SimonCan b8f5108
Update src/meshes/p4est_mesh_view.jl
SimonCan f628004
Update src/meshes/p4est_mesh_view.jl
SimonCan 0c2f2ae
Update src/meshes/p4est_mesh_view.jl
SimonCan f906d36
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan f9d1620
Update src/meshes/p4est_mesh_view.jl
SimonCan 3f9f827
Update src/meshes/p4est_mesh_view.jl
SimonCan 3208217
Update src/meshes/p4est_mesh_view.jl
SimonCan 9a24d27
Update src/meshes/p4est_mesh_view.jl
SimonCan 2f73f48
Update src/meshes/p4est_mesh_view.jl
SimonCan fc1fd71
Temporarily removed tests for meshview example.
SimonCan dd7591a
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan eeec423
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 8298476
Removed redundant definition of foreach_enumerate function.
SimonCan 2333191
Corrected prolong2interfaces! call.
SimonCan e073051
Removed update of GLM cleaning speed, as we don't have a test yet tha…
SimonCan abedff4
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan afa88ce
Removed another redundant foreach_enumerate funciton definition.
SimonCan ecee86a
Removed further redundant definitions.
SimonCan 586ae5d
Removed unused ncells definition.
SimonCan b550f63
Merge branch 'main' into sc/p4est-view-coupled
DanielDoehring cfef1b7
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 90ff72a
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan e8064ec
Added integer to string conversion for sving mesh files for coupled s…
SimonCan 9c00d81
Added P4estMeshView to max_dt.
SimonCan d6ff92c
Added ability to couple systems with more than one variable.
SimonCan 9178818
Added ncells for P4estMeshViews needed for the conversion to vtk.
SimonCan aa30aa6
Merge branch 'main' into sc/p4est-view-coupled
DanielDoehring 6ba8e6d
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 34181c0
Correcte comment fo rglobal cell id converion funciton when input is …
SimonCan 3bd7911
Error arrays for coupled simulations are now pre-allocated.
SimonCan b2c69bb
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 21a4291
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 1cda279
Added comment on p4est coupled boundary conditions and that they only…
SimonCan 5af5ebe
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan 3862abb
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 76cbb4f
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan aa8943d
Added usage of coupling converter function for p4est mesh view coupling.
SimonCan ac3a3f9
Started with generalization of p4est coupling so that we can couple
SimonCan 50a1e2a
Added semi as argument for computing coupled boundary condition in p4…
SimonCan 7f3b63a
Fixed bug with copying values over to the global array.
SimonCan b1b7c3f
Added P4estMeshView to rhs! functions.
SimonCan 0613f96
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 126e947
Corrected non-conservative flux calls using p4est coupled systems.
SimonCan 1251830
Corrected issue with glm speed updates for coupled p4est simulations.
SimonCan 5d02184
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 011f094
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan e3b3897
Change parent mesh boundary condition to trigger more code for the test.
SimonCan 9037cf3
Corrected argument for P4estMesh.
SimonCan bfdc3df
Fixed issue with AnalysisCallbackCoupled.
SimonCan 74843ac
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 98bf870
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 2c9bf4d
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan b396227
Removed code for structured meshes.
SimonCan 5ce2067
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 69bab29
Merge branch 'sc/p4est-view-coupled' of https://github.com/trixi-fram…
SimonCan cd0a019
Addedcomments on the mesh views
SimonCan 7bee9aa
Added ncelss for p4est mesh views.
SimonCan fef8913
Added comment about the boundary conditions.
SimonCan 1561815
Added comment about boundary u-array.
SimonCan 63b5499
Corrected calculation of linf_error for p4est coupled systems.
SimonCan 3c53935
Merge branch 'main' into sc/p4est-view-coupled
SimonCan ca5a0bc
Merge branch 'sc/p4est-view-coupled' into sc/p4est-view-coupled-enhanced
SimonCan 3bbc298
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan 2486d1d
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 85e7494
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 8e5f08f
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 4d3433e
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan a70a242
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan 17e8a12
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan 6fa73a2
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan d266677
Added update_cleaning_speed for SemidiscretizationCoupledP4est.
SimonCan 3831b3b
Introduced iteration offset for saving mesh files when running couple…
SimonCan 2e18b03
Changed boundary coupling functions to array.
SimonCan f9c4a2b
Removed commented code.
SimonCan 71646bc
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 4b0cde0
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 937eb2a
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 81bf410
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan a8278ed
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 1d488cd
Removed debugging line.
SimonCan 9cfa77c
Merge branch 'sc/p4est-view-coupled-enhanced' of https://github.com/t…
SimonCan 735b6aa
Removed further debugging lines.
SimonCan ea2354e
Update src/solvers/dgsem_p4est/dg_2d.jl
SimonCan 9774cb6
Update src/solvers/dgsem_p4est/dg_2d.jl
SimonCan 8e7c069
Update src/solvers/dgsem_tree/dg_2d.jl
SimonCan 3a26e20
Update src/solvers/dgsem_unstructured/dg_2d.jl
SimonCan ce142b8
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan 146d5b4
Update src/callbacks_step/save_solution.jl
SimonCan 5d35dc2
Update src/callbacks_step/save_solution.jl
SimonCan 5eb56f2
Update src/callbacks_step/save_solution.jl
SimonCan 71ab7e1
Update src/callbacks_step/save_solution.jl
SimonCan 6661aed
Added path to examples directory when checking for hdf5 file.
SimonCan 3319aed
Merge branch 'sc/p4est-view-coupled-enhanced' of https://github.com/t…
SimonCan 3e89289
Removed analysis callback.
SimonCan 9e77bea
Removed definition of analysis callback for coupled p4est systems.
SimonCan 6884760
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan 7817847
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan 8ef4bef
Update test/test_p4est_2d.jl
SimonCan 621f54e
Added analysis callback.
SimonCan 574e33e
Removed redefinition of allocate_coupled_boundary_condition function.
SimonCan b74c55d
Added dummy calc_boundary_flux! for P4estMeshView to be used for the …
SimonCan bcfc2e4
Removed analysis callbacks for the semis for a coupled system.
SimonCan bee6ded
Merge branch 'main' into sc/p4est-view-coupled-enhanced
SimonCan 801d3a5
Removed rtoublesome debugging output.
SimonCan b9c8da8
Removed redundant Union with P4estMeshView.
SimonCan 573b39a
Removed mesh view example. This is redundant with examples with actua…
SimonCan 9ed255e
Added test of couple Euler with MHD system.
SimonCan 07df706
Uncommented previous tests.
SimonCan d4877a3
Corrected typos.
SimonCan e4a9389
Update src/callbacks_step/analysis_dg2d.jl
SimonCan ad50853
Update examples/p4est_2d_dgsem/elixir_advection_coupled.jl
SimonCan 9239c9b
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 30fc17d
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan ed16a3e
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 33f670a
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 067d230
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan a5fe9a2
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 518af7f
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 259f4bf
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 357e461
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan b9e200e
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 50c585f
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 2dddaad
Update src/solvers/dgsem_unstructured/dg_2d.jl
SimonCan 0464eaf
Update test/test_p4est_2d.jl
SimonCan 51a03a6
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 99d0834
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 4246b87
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 58bc1a6
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 61fef7c
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan f06626c
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan dbee6ba
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan a1160f5
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan b79bf9f
Update examples/p4est_2d_dgsem/elixir_euler_mhd_coupled.jl
SimonCan 6521fb7
Merge branch 'main' into sc/p4est-view-coupled
SimonCan fc79fe4
Added parameter cfl_diffusive to calculate_dt for SemidiscretizationC…
SimonCan b233381
Removed analysis callback.
SimonCan a4661db
Reinstated analysis callback for coupled p4est simulations.
SimonCan 6657ceb
First steps for coupled analysis callback.
SimonCan 399dd8e
Added more infrastructure for coupled analysis callback.
SimonCan f787fc6
Removed debugging code.
SimonCan 11a9602
Merge remote-tracking branch 'origin/main' into sc/p4est-view-coupled
SimonCan ca34af9
Added comments about coupled analysis callbacks.
SimonCan a2726db
Merge remote-tracking branch 'origin/main' into sc/p4est-view-coupled
SimonCan 93903c3
Merge remote-tracking branch 'origin/main' into sc/p4est-view-coupled
SimonCan 8cb9cfa
Removed unused callback functions.
SimonCan 3c1c853
Removed unused references to u_ode_coupled.
SimonCan 763a842
Merge branch 'main' into sc/p4est-view-coupled
SimonCan b369fbb
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 74ab2e1
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 7b29c24
Removed unused call of 'show' for analysis callback for p4est mesh vi…
SimonCan d1db4b4
Applied autoformatter.
SimonCan 2217b09
Merge branch 'sc/p4est-view-coupled' of github.com:trixi-framework/Tr…
SimonCan cb4c96a
Update src/callbacks_step/analysis.jl
SimonCan d523377
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 2a94fd2
Update test/test_p4est_2d.jl
SimonCan 8f54ca2
git pushMerge branch 'sc/p4est-view-coupled' of github.com:trixi-fram…
SimonCan e2596f2
Update test/test_p4est_2d.jl
SimonCan c9377b2
Update src/semidiscretization/semidiscretization_coupled_p4est.jl
SimonCan 52a5b6c
Update src/callbacks_step/analysis_dg2d.jl
SimonCan 0ad3b72
Update src/callbacks_step/analysis_dg2d.jl
SimonCan f3a2025
Update src/callbacks_step/analysis_dg2d.jl
SimonCan e6be6b2
Update src/callbacks_step/analysis_dg2d.jl
SimonCan db2a2fc
Update src/callbacks_step/analysis_dg2d.jl
SimonCan 02ecbbb
Update src/callbacks_step/analysis_dg2d.jl
SimonCan ebf7d66
Update src/callbacks_step/analysis.jl
SimonCan 5540a80
Update src/callbacks_step/analysis.jl
SimonCan 775e9cd
Update src/callbacks_step/analysis_dg2d.jl
SimonCan d4f257f
Merge branch 'main' into sc/p4est-view-coupled
SimonCan 3741953
Removed redundant and conflicting redefinition of the function alloca…
SimonCan 9df2941
Merge branch 'sc/p4est-view-coupled' of github.com:trixi-framework/Tr…
SimonCan 898b24a
Merge branch 'sc/p4est-view-coupled' into sc/p4est-view-coupled-enhanced
SimonCan a8dbe47
Merge branch 'main' into sc/p4est-view-coupled-hanging-nodes
SimonCan 250a7ef
Update examples/structured_2d_dgsem/test.jl
SimonCan bb4198a
Update examples/structured_2d_dgsem/test.jl
SimonCan 592e298
Update examples/structured_2d_dgsem/test.jl
SimonCan d3a36de
Update examples/structured_2d_dgsem/test.jl
SimonCan ca9eb6d
Update examples/structured_2d_dgsem/test.jl
SimonCan 67efa85
Merge branch 'main' into sc/p4est-view-coupled-hanging-nodes
SimonCan 4cbe837
Merge branch 'main' into sc/p4est-view-coupled-hanging-nodes
SimonCan 2b94b79
Merge branch 'main' into sc/p4est-view-coupled-hanging-nodes
SimonCan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||||
|
|
||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [JuliaFormatter] reported by reviewdog 🐶
Suggested change
|
||||
| # 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); | ||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶