forked from DanielDoehring/Trixi.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
TreeMesh
type general (trixi-framework#2129)
* Make TreeMesh type general * fmt * get mesh read * work * parallel read in * tests * get things workin before commit tests * Avoid irrational type * Update examples/tree_1d_dgsem/elixir_advection_diffusion.jl * remove unused * try bounding type parameter * another try aqua test pass * Be less breaking * example * restore comments * test vals * demand same type for refinement patches * change vals * avoid breaking changes * warning if non-agreeing coordinates * make examples warning-free * avoid warning * fmt * type general NaN * typo * Consistent constructors * hard-code realT * tests for consistency constructors --------- Co-authored-by: Hendrik Ranocha <[email protected]>
- Loading branch information
1 parent
dcf1b58
commit 9fa4e27
Showing
11 changed files
with
283 additions
and
127 deletions.
There are no files selected for viewing
This file contains 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 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 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,62 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the compressible ideal GLM-MHD equations | ||
|
||
equations = IdealGlmMhdEquations2D(1.4f0) | ||
|
||
initial_condition = initial_condition_weak_blast_wave | ||
|
||
volume_flux = (flux_hindenlang_gassner, flux_nonconservative_powell) | ||
solver = DGSEM(polydeg = 3, RealT = Float32, | ||
surface_flux = (flux_hindenlang_gassner, flux_nonconservative_powell), | ||
volume_integral = VolumeIntegralFluxDifferencing(volume_flux)) | ||
|
||
coordinates_min = (-2.0f0, -2.0f0) | ||
coordinates_max = (2.0f0, 2.0f0) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level = 4, | ||
n_cells_max = 10_000, | ||
RealT = Float32) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0f0, 0.4f0) | ||
ode = semidiscretize(semi, tspan) | ||
|
||
summary_callback = SummaryCallback() | ||
|
||
analysis_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval = analysis_interval) | ||
|
||
alive_callback = AliveCallback(analysis_interval = analysis_interval) | ||
|
||
save_solution = SaveSolutionCallback(interval = 10, | ||
save_initial_solution = true, | ||
save_final_solution = true, | ||
solution_variables = cons2prim) | ||
|
||
cfl = 1.0f0 | ||
stepsize_callback = StepsizeCallback(cfl = cfl) | ||
|
||
glm_speed_callback = GlmSpeedCallback(glm_scale = 0.5f0, cfl = cfl) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, | ||
alive_callback, | ||
save_solution, | ||
stepsize_callback, | ||
glm_speed_callback) | ||
|
||
############################################################################### | ||
# run the simulation | ||
|
||
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), | ||
dt = 1.0f0, # solve needs some value here but it will be overwritten by the stepsize_callback | ||
save_everystep = false, callback = callbacks); | ||
summary_callback() # print the timer summary |
This file contains 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 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 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.