-
Notifications
You must be signed in to change notification settings - Fork 151
More robust LDG Switch for P4estMesh
#2871
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
Merged
ranocha
merged 12 commits into
trixi-framework:main
from
DanielDoehring:LDG_SwitchP4est
Mar 26, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
558909d
More robust LDG Switch for `P4estMesh`
DanielDoehring 548d2ac
fmt
DanielDoehring 5e6e5fb
Merge branch 'main' into LDG_SwitchP4est
DanielDoehring fcbb593
tv
DanielDoehring b342d91
Merge branch 'LDG_SwitchP4est' of github.com:DanielDoehring/Trixi.jl …
DanielDoehring 9a344ed
tv
DanielDoehring c1a0804
Merge branch 'main' into LDG_SwitchP4est
ranocha 5fcd7a4
readme and docstring
DanielDoehring 41afb33
bf
DanielDoehring e28aff8
Update NEWS.md
DanielDoehring d4b1b79
Merge branch 'main' into LDG_SwitchP4est
DanielDoehring f881b68
Merge branch 'main' into LDG_SwitchP4est
ranocha 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
60 changes: 60 additions & 0 deletions
60
examples/p4est_2d_dgsem/elixir_advection_diffusion_rotated.jl
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,60 @@ | ||
| using OrdinaryDiffEqLowStorageRK | ||
| using Trixi | ||
|
|
||
| ############################################################################### | ||
| # semidiscretization of the linear advection-diffusion equation | ||
|
|
||
| diffusivity() = 1.0e-2 | ||
| advection_velocity = (-1.0, 1.0) | ||
| equations = LinearScalarAdvectionEquation2D(advection_velocity) | ||
| equations_parabolic = LaplaceDiffusion2D(diffusivity(), equations) | ||
|
|
||
| function initial_condition_gauss_damped(x, t, equations) | ||
| damping_factor = 1 + 4 * diffusivity() * t | ||
| return SVector(exp(-(x[1]^2 + x[2]^2) / damping_factor) / damping_factor) | ||
| end | ||
| initial_condition = initial_condition_gauss_damped | ||
|
|
||
| solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs) | ||
|
|
||
| # This maps the domain [-1, 1]^2 to a 45-degree rotated increased square | ||
| square_size() = 5.0 | ||
| function mapping(xi, eta) | ||
| x = square_size() * xi | ||
| y = square_size() * eta | ||
| return SVector((x - y) / sqrt(2), (x + y) / sqrt(2)) | ||
| end | ||
|
|
||
| trees_per_dimension = (23, 23) | ||
| mesh = P4estMesh(trees_per_dimension, | ||
| polydeg = 3, initial_refinement_level = 0, | ||
| mapping = mapping, periodicity = true) | ||
|
|
||
| semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabolic), | ||
| initial_condition, solver; | ||
| solver_parabolic = ViscousFormulationLocalDG(), | ||
| boundary_conditions = (boundary_condition_periodic, | ||
| boundary_condition_periodic)) | ||
|
|
||
| ############################################################################### | ||
| # ODE solvers, callbacks etc. | ||
|
|
||
| n_passes = 2 | ||
| tspan = (0.0, n_passes * square_size() * sqrt(2)) | ||
| ode = semidiscretize(semi, tspan) | ||
|
|
||
| summary_callback = SummaryCallback() | ||
|
|
||
| analysis_interval = 100 | ||
| analysis_callback = AnalysisCallback(semi, interval = analysis_interval) | ||
|
|
||
| alive_callback = AliveCallback(analysis_interval = analysis_interval) | ||
|
|
||
| callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback) | ||
|
|
||
| ############################################################################### | ||
| # run the simulation | ||
|
|
||
| time_int_tol = 1.0e-6 | ||
| sol = solve(ode, RDPK3SpFSAL49(); abstol = time_int_tol, reltol = time_int_tol, | ||
| 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
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.