-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First step towards FD methods and surface integrals/terms (#617)
* introduce surface integrals This could be considered to be breaking since it changes a documented constructor of our `DG` type. On the other hand, the documentation of this constructor was just wrong (since it contained the basis twice but not the mortar). Hence, this is more like a bug fix, I think ;). * do not restrict volume_integral to AbstractVolumeIntegral for DGSEM constructor * use the central flux as default flux for surface integral/terms * remove temporary code * WIP: prepare 2D tree mesh for FD * update note on open issues * update compat bounds for SummationByPartsOperators * fix unit test * revisions based on code review * no need to use the SafeMode anymore * add NEWS * add tests * adapt comment on computation of reference_length [skip ci] * allow other surface terms/integral types for DGSEM * add additional TODO notes [skip ci] * adapt 1D/3D containers consistently * fix deinition of real * fix tests * add surface_integral to p4est methods * ignore warning importing deprecated binding Colors.RGB1 into PlotUtils
- Loading branch information
Showing
33 changed files
with
989 additions
and
505 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,57 @@ | ||
# TODO: FD | ||
# !!! warning "Experimental feature" | ||
# This is an experimental feature and may change in any future releases. | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# semidiscretization of the linear advection equation | ||
|
||
advectionvelocity = (0.2, -0.3) | ||
equations = LinearScalarAdvectionEquation2D(advectionvelocity) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
|
||
D_SBP = derivative_operator(SummationByPartsOperators.MattssonNordström2004(), | ||
derivative_order=1, accuracy_order=4, | ||
xmin=0.0, xmax=1.0, N=100) | ||
solver = DG(D_SBP, nothing #= mortar =#, | ||
SurfaceIntegralStrongForm(flux_lax_friedrichs), | ||
VolumeIntegralStrongForm()) | ||
|
||
coordinates_min = (-1.0, -1.0) | ||
coordinates_max = ( 1.0, 1.0) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level=1, | ||
n_cells_max=30_000, | ||
periodicity=true) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
|
||
############################################################################### | ||
# ODE solvers, callbacks etc. | ||
|
||
tspan = (0.0, 1.0) | ||
ode = semidiscretize(semi, tspan); | ||
|
||
summary_callback = SummaryCallback() | ||
|
||
analysis_interval = 100 | ||
analysis_callback = AnalysisCallback(semi, interval=analysis_interval, | ||
extra_analysis_integrals=(energy_total,)) | ||
|
||
alive_callback = AliveCallback(analysis_interval=analysis_interval) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, | ||
alive_callback) | ||
|
||
|
||
############################################################################### | ||
# run the simulation | ||
|
||
sol = solve(ode, RDPK3SpFSAL49(), abstol=1.0e-8, reltol=1.0e-8, | ||
save_everystep=false, callback=callbacks, maxiters=1e5) | ||
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
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
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
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.