-
Notifications
You must be signed in to change notification settings - Fork 4
Added IMEX for KdV eq. #207
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
Draft
cwittens
wants to merge
10
commits into
NumericalMathematics:main
Choose a base branch
from
cwittens:IMEX
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
65979bd
added IMEX
cwittens 62f42fe
deleted rhs using split
cwittens d9806af
added tests
cwittens a3c1c50
Apply suggestions from code review
cwittens 8ec469f
changed alle rhs_split names
cwittens a33f088
quite a few changes
cwittens bc57c2b
formatting
cwittens 062f4d9
added missing "," in export list
cwittens f1c24e9
Apply suggestions from code review
cwittens b61e48d
Merge branch 'main' into IMEX
JoshuaLampert 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| using OrdinaryDiffEqSDIRK | ||
| using DispersiveShallowWater | ||
| using SummationByPartsOperators: upwind_operators, periodic_derivative_operator | ||
|
|
||
| ############################################################################### | ||
| # Semidiscretization of the KdV equation | ||
|
|
||
| equations = KdVEquation1D(gravity = 9.81, D = 1.0) | ||
| initial_condition = initial_condition_convergence_test | ||
| boundary_conditions = boundary_condition_periodic | ||
|
|
||
| # create homogeneous mesh | ||
| coordinates_min = -50.0 | ||
| coordinates_max = 50.0 | ||
| N = 512 | ||
| mesh = Mesh1D(coordinates_min, coordinates_max, N) | ||
|
|
||
| # Create solver with periodic SBP operators of accuracy order 3, | ||
| # which results in a 4th order accurate semi discretizations. | ||
| # We can set the accuracy order of the upwind operators to 3 since | ||
| # we only use central versions/combinations of the upwind operators. | ||
| D1_upwind = upwind_operators(periodic_derivative_operator; | ||
| derivative_order = 1, accuracy_order = 3, | ||
| xmin = xmin(mesh), xmax = xmax(mesh), | ||
| N = nnodes(mesh)) | ||
| solver = Solver(D1_upwind) | ||
|
|
||
| semi = Semidiscretization(mesh, equations, initial_condition, solver, | ||
| boundary_conditions = boundary_conditions) | ||
|
|
||
| tspan = (0.0, 5.0) | ||
| ode = semidiscretize(semi, tspan) | ||
|
|
||
| summary_callback = SummaryCallback() | ||
| analysis_callback = AnalysisCallback(semi; interval = 100, | ||
| extra_analysis_errors = (:conservation_error,), | ||
| extra_analysis_integrals = (waterheight_total, | ||
| waterheight)) | ||
| callbacks = CallbackSet(analysis_callback, summary_callback) | ||
| saveat = range(tspan..., length = 100) | ||
|
|
||
| alg = KenCarp4() # use an IMEX method | ||
| sol = solve(ode, alg, abstol = 1e-7, reltol = 1e-7, | ||
| save_everystep = false, callback = callbacks, saveat = saveat) |
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
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also check the performance for a physically relevant setup, i.e., not a manufactured solution? Manufactured setups can be unusual and behave differently from what we observe in physically relevant setups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some benchmarks using
initial_condition_convergence_testandalg = KenCarp4()andalg = Tsit5().