-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
User defined schemes - FunctionalScheme #247
Merged
Merged
Conversation
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
Codecov Report
@@ Coverage Diff @@
## master #247 +/- ##
==========================================
- Coverage 77.24% 72.85% -4.40%
==========================================
Files 39 40 +1
Lines 1991 2037 +46
==========================================
- Hits 1538 1484 -54
- Misses 453 553 +100
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
User Defined Schemes
Allows
advection_scheme
to be defined at the top level, and fed in to the package. Defines the typeFunctionalScheme
with a predefined application method to allow this. The docstring for this is reproduced below.Redefines WENO in terms of this new scheme type as an example.
This will allow for experiments with optimized schemes, as well as making schemes conform to a standard interface.
FunctionalScheme
A user definable scheme that takes a set of functions as input. The functions define the derivative at the interior, lower boundary, and upper boundary.
lower
andupper
should be vectors of functions. In general,upper
andlower
must be at leastfloor(interior_points/2)
long. Where you have no good approximation for a derivative at the boundary, you can usenothing
as a placeholder. MethodOfLines will then attempt to use an extrapolation here where nessesary. Be warned that this can lead to instability.The boundary functions define the derivative at their index in the function vector, numbering from the boundary. For example, if
boundary_points = 3
, the first function in the vector will define the derivative at the boundary, the second at the boundary plus one step, and the third at the boundary plus two steps.The functions making up the scheme take the following inputs:
Functions must be of the form
f(u, p, t, deriv_iv, d_iv)
.For the interior,
u
takes a vector of dependent variable values in the direction of the derivativeof length
interior_points
.interior_points
must be odd, as this function defines the derivative at the center of the input points.For the lower and upper boundaries,
u
takes a vector of dependent variable values of lengthboundary_points
. This will be theboundary_points
number of points closest to the lower and upper boundary respectively.p
will take all parameter values in the order specified in the PDESystem, with the scheme's parameters prepended to the list.deriv_iv
takes a vector of independent variable values of the same support as foru
, for the independent variable in the direction of the derivative.If
is_nonuniform
is false,d_iv
will take a scalar value of the stepsize between the points used to call the function inu
andderiv_iv
.If
is_nonuniform
is true, the scheme must be able to acceptd_iv
as a vector of stepsizes between the points used to call the function inu
andderiv_iv
, therefore of lengthlength(u)-1
. A method should also be defined for the case whered_iv
is a scalar, in which case the stepsizes are assumed to be uniform.