-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into sg/wet-dry-swe-2d
- Loading branch information
Showing
89 changed files
with
1,516 additions
and
718 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ jobs: | |
- name: Checkout Actions Repository | ||
uses: actions/checkout@v3 | ||
- name: Check spelling | ||
uses: crate-ci/[email protected].0 | ||
uses: crate-ci/[email protected].6 |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Trixi" | ||
uuid = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" | ||
authors = ["Michael Schlottke-Lakemper <[email protected]>", "Gregor Gassner <[email protected]>", "Hendrik Ranocha <[email protected]>", "Andrew R. Winters <[email protected]>", "Jesse Chan <[email protected]>"] | ||
version = "0.5.29-pre" | ||
version = "0.5.31-pre" | ||
|
||
[deps] | ||
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" | ||
|
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
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,56 @@ | ||
using OrdinaryDiffEq | ||
using Trixi | ||
using LinearAlgebra | ||
|
||
############################################################################### | ||
equations = LinearScalarAdvectionEquation3D(1.0, 1.0, 1.0) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
|
||
# Define the polynomial degrees for the polynoms of the triangular base and the line | ||
# of the tensor-prism | ||
tensor_polydeg = (3, 4) | ||
|
||
dg = DGMulti(element_type = Wedge(), | ||
approximation_type = Polynomial(), | ||
surface_flux = flux_lax_friedrichs, | ||
polydeg = tensor_polydeg) | ||
|
||
|
||
cells_per_dimension = (8, 8, 8) | ||
mesh = DGMultiMesh(dg, | ||
cells_per_dimension, | ||
coordinates_min = (-1.0, -1.0, -1.0), | ||
coordinates_max = (1.0, 1.0, 1.0), | ||
periodicity = true) | ||
|
||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, dg, | ||
boundary_conditions=boundary_condition_periodic) | ||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0, 5.0) | ||
ode = semidiscretize(semi, tspan) | ||
|
||
summary_callback = SummaryCallback() | ||
|
||
analysis_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval=analysis_interval, uEltype=real(dg)) | ||
|
||
alive_callback = AliveCallback(analysis_interval=analysis_interval) | ||
|
||
# The StepsizeCallback handles the re-calculation of the maximum Δt after each time step | ||
stepsize_callback = StepsizeCallback(cfl=1.0) | ||
|
||
callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, stepsize_callback) | ||
|
||
|
||
############################################################################### | ||
# run the simulation | ||
|
||
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 1.0, | ||
save_everystep=false, callback=callbacks); | ||
|
||
summary_callback() # print the timer summary |
96 changes: 96 additions & 0 deletions
96
examples/p4est_2d_dgsem/elixir_advection_diffusion_nonperiodic_curved.jl
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,96 @@ | ||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the linear advection-diffusion equation | ||
|
||
diffusivity() = 5.0e-2 | ||
advection_velocity = (1.0, 0.0) | ||
equations = LinearScalarAdvectionEquation2D(advection_velocity) | ||
equations_parabolic = LaplaceDiffusion2D(diffusivity(), equations) | ||
|
||
# Example setup taken from | ||
# - Truman Ellis, Jesse Chan, and Leszek Demkowicz (2016). | ||
# Robust DPG methods for transient convection-diffusion. | ||
# In: Building bridges: connections and challenges in modern approaches | ||
# to numerical partial differential equations. | ||
# [DOI](https://doi.org/10.1007/978-3-319-41640-3_6). | ||
function initial_condition_eriksson_johnson(x, t, equations) | ||
l = 4 | ||
epsilon = diffusivity() # TODO: this requires epsilon < .6 due to sqrt | ||
lambda_1 = (-1 + sqrt(1 - 4 * epsilon * l)) / (-2 * epsilon) | ||
lambda_2 = (-1 - sqrt(1 - 4 * epsilon * l)) / (-2 * epsilon) | ||
r1 = (1 + sqrt(1 + 4 * pi^2 * epsilon^2)) / (2 * epsilon) | ||
s1 = (1 - sqrt(1 + 4 * pi^2 * epsilon^2)) / (2 * epsilon) | ||
u = exp(-l * t) * (exp(lambda_1 * x[1]) - exp(lambda_2 * x[1])) + | ||
cos(pi * x[2]) * (exp(s1 * x[1]) - exp(r1 * x[1])) / (exp(-s1) - exp(-r1)) | ||
return SVector{1}(u) | ||
end | ||
initial_condition = initial_condition_eriksson_johnson | ||
|
||
boundary_conditions = Dict(:x_neg => BoundaryConditionDirichlet(initial_condition), | ||
:y_neg => BoundaryConditionDirichlet(initial_condition), | ||
:y_pos => BoundaryConditionDirichlet(initial_condition), | ||
:x_pos => boundary_condition_do_nothing) | ||
|
||
boundary_conditions_parabolic = Dict(:x_neg => BoundaryConditionDirichlet(initial_condition), | ||
:x_pos => BoundaryConditionDirichlet(initial_condition), | ||
:y_neg => BoundaryConditionDirichlet(initial_condition), | ||
:y_pos => BoundaryConditionDirichlet(initial_condition)) | ||
|
||
# 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, -0.5) | ||
coordinates_max = ( 0.0, 0.5) | ||
|
||
# This maps the domain [-1, 1]^2 to [-1, 0] x [-0.5, 0.5] while also | ||
# introducing a curved warping to interior nodes. | ||
function mapping(xi, eta) | ||
x = xi + 0.1 * sin(pi * xi) * sin(pi * eta) | ||
y = eta + 0.1 * sin(pi * xi) * sin(pi * eta) | ||
return SVector(0.5 * (1 + x) - 1, 0.5 * y) | ||
end | ||
|
||
trees_per_dimension = (4, 4) | ||
mesh = P4estMesh(trees_per_dimension, | ||
polydeg=3, initial_refinement_level=2, | ||
mapping=mapping, periodicity=(false, false)) | ||
|
||
# A semidiscretization collects data structures and functions for the spatial discretization | ||
semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabolic), initial_condition, solver, | ||
boundary_conditions = (boundary_conditions, boundary_conditions_parabolic)) | ||
|
||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
# Create ODE problem with time span `tspan` | ||
tspan = (0.0, 1.0) | ||
ode = semidiscretize(semi, tspan); | ||
|
||
# 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_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval=analysis_interval) | ||
|
||
# The AliveCallback prints short status information in regular intervals | ||
alive_callback = AliveCallback(analysis_interval=analysis_interval) | ||
|
||
# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver | ||
callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback) | ||
|
||
|
||
############################################################################### | ||
# run the simulation | ||
|
||
# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks | ||
time_int_tol = 1.0e-11 | ||
sol = solve(ode, RDPK3SpFSAL49(); abstol=time_int_tol, reltol=time_int_tol, | ||
ode_default_options()..., callback=callbacks) | ||
|
||
# Print the timer summary | ||
summary_callback() |
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.