Add support for WENO4 interpolation#470
Open
tiagopereira wants to merge 2 commits intoJuliaMath:masterfrom
Open
Add support for WENO4 interpolation#470tiagopereira wants to merge 2 commits intoJuliaMath:masterfrom
tiagopereira wants to merge 2 commits intoJuliaMath:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #470 +/- ##
==========================================
- Coverage 86.75% 81.42% -5.33%
==========================================
Files 27 28 +1
Lines 1819 1938 +119
==========================================
Hits 1578 1578
- Misses 241 360 +119 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
julia> struct Greeting
salutation::String
end # define a struct
julia> hello = Greeting("Hello") # construct a Greeting instance with salutation == "Hello"
Greeting("Hello")
julia> (g::Greeting)(name) = println(g.salutation * ", " * name) # using an instance
julia> hello("Tiago") # Use the instance as a function (e.g. a Functor)
Hello, Tiago
julia> hola = Greeting("Hola") # construct another Greeting instance with salutation == "Hola"
Greeting("Hola")
julia> hola("Marcos")
Hola, Marcos
julia> Greeting() = Greeting("Hi") # define a constructor for Greeting that takes no arguments... and defaults salutation to "Hi"
Greeting
julia> default = Greeting() # use the new constructor
Greeting("Hi")
julia> default("Mark")
Hi, Mark |
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
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.
This PR is not currently working. I would like to add support for interpolation with a 4th order Weighted Essentially Non-Oscillatory (WENO) scheme, following Janett et al (2019). I wrote the standalone package WENO4.jl (not yet registered) that has been tested to work as it should. This PR is an attempt at bringing the same functionality into Interpolations.jl.
My experience with Julia is limited, and I don't fully understand the abstractions and architecture of Interpolations.jl, so I apologise for the many mistakes in the current PR and would appreciate some help at getting this code working and sufficiently general. This implementation follows closely what I saw in
monotonic.jl, but I couldn't get my head around all the abstractions. This is the type of usage I was hoping it would get when working:The idea is to follow existing practice of getting a way to generate an interpolant for all input data values and nodes, and then a separate function to evaluate this interpolant at a required point. I have tested and the functions inside, in particular
interpolate(to build the interpolant) and the function to evaluate the interpolant, currentlyworks if I rewrite it as the standalone function
However, it is not working in the present formulation because I don't really understand the relation between the
interpolatefunction and the function with the same name as thestruct, here calledWENO4Interpolation.Currently the functions used perform about twice as slow as in the standalone package, which I attribute to the need of generating intermediate arrays. This could also be improved.