-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from czha/mortar-flux
Add mortar flux kernel with `nonconservative_terms::False` to 2D and 3D
- Loading branch information
Showing
13 changed files
with
693 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using Trixi, TrixiGPU | ||
using OrdinaryDiffEq | ||
|
||
# The example is taken from the Trixi.jl | ||
|
||
############################################################################### | ||
# semidiscretization of the linear advection equation | ||
|
||
advection_velocity = (0.2, -0.7) | ||
equations = LinearScalarAdvectionEquation2D(advection_velocity) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs) | ||
|
||
coordinates_min = (-1.0, -1.0) | ||
coordinates_max = (1.0, 1.0) | ||
refinement_patches = ((type = "box", coordinates_min = (0.0, -1.0), | ||
coordinates_max = (1.0, 1.0)),) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level = 2, | ||
refinement_patches = refinement_patches, | ||
n_cells_max = 10_000) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0, 1.0) | ||
ode = semidiscretize_gpu(semi, tspan) # from TrixiGPU.jl | ||
|
||
summary_callback = SummaryCallback() | ||
|
||
analysis_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval = analysis_interval, | ||
extra_analysis_integrals = (entropy,)) | ||
|
||
alive_callback = AliveCallback(analysis_interval = analysis_interval) | ||
|
||
save_solution = SaveSolutionCallback(interval = 100, | ||
save_initial_solution = true, | ||
save_final_solution = true, | ||
solution_variables = cons2prim) | ||
|
||
stepsize_callback = StepsizeCallback(cfl = 1.6) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
save_solution, | ||
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 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
using Trixi, TrixiGPU | ||
using OrdinaryDiffEq | ||
|
||
# The example is taken from the Trixi.jl | ||
|
||
############################################################################### | ||
# semidiscretization of the linear advection equation | ||
|
||
advection_velocity = (0.2, -0.7, 0.5) | ||
equations = LinearScalarAdvectionEquation3D(advection_velocity) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs) | ||
|
||
coordinates_min = (-1.0, -1.0, -1.0) | ||
coordinates_max = (1.0, 1.0, 1.0) | ||
refinement_patches = ((type = "box", coordinates_min = (0.0, -1.0, -1.0), | ||
coordinates_max = (1.0, 1.0, 1.0)), | ||
(type = "box", coordinates_min = (0.0, -0.5, -0.5), | ||
coordinates_max = (0.5, 0.5, 0.5))) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level = 2, | ||
refinement_patches = refinement_patches, | ||
n_cells_max = 10_000) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0, 5.0) | ||
ode = semidiscretize_gpu(semi, tspan) # from TrixiGPU.jl | ||
|
||
summary_callback = SummaryCallback() | ||
|
||
analysis_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval = analysis_interval, | ||
extra_analysis_integrals = (entropy,)) | ||
|
||
alive_callback = AliveCallback(analysis_interval = analysis_interval) | ||
|
||
save_solution = SaveSolutionCallback(interval = 100, | ||
save_initial_solution = true, | ||
save_final_solution = true, | ||
solution_variables = cons2prim) | ||
|
||
stepsize_callback = StepsizeCallback(cfl = 1.2) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, | ||
alive_callback, | ||
save_solution, | ||
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 | ||
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
Oops, something went wrong.