-
-
Notifications
You must be signed in to change notification settings - Fork 74
Adding NonLinearDiffusion operator to derivate_operator.jl returning discretized function #327
Conversation
The test issue should be fixed SciML/SciMLBase.jl#15. This needs tests. |
examples/Fast_Diffusion.jl
Outdated
bc = DirichletBC(exp(-t),(1.0 + exp(2*t))^(-0.5)) | ||
l = bc*u | ||
k = l.^(-2) # Diffusion Coefficient | ||
NonLinearDiffusion(n,m,approx_ord,k,l,h,nknots) |
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.
Can it be represented as an operator?
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.
end | ||
|
||
discretization += (CenteredDifference(first_differential_order + second_differential_order,approx_order,dx,nknots)*q).*p[2:(nknots + 1)]; | ||
return discretization |
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.
There only seems to be an out of place operation? It would be good to have a mul!
definition and then an allocating version that uses the non-allocating one. Refer to https://www.youtube.com/watch?v=M2i7sSRcSIw or https://mitmath.github.io/18337/lecture2/optimizing on non-allocating operators.
https://diffeq.sciml.ai/stable/features/diffeq_operator/ defines our operator format which is an extension of the simple examples posted above. I think this is all mathematically correct but needs a little bit of work to match the standard operator API. |
@@ -26,6 +26,29 @@ struct DerivativeOperator{T<:Real,N,Wind,T2,S1,S2<:SArray,T3,F} <: AbstractDeriv | |||
coeff_func :: F | |||
end | |||
|
|||
struct NonLinearDiffusion! end |
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.
if it's a function then it shouldn't be capitalized like a struct, or need the struct at all.
Just the caps issue and the lack of an out of place dispatch to fix. |
Great thanks! |
Could you follow up with adding this to the documentation? |
Modifications should be done in derivate_operators.md or a new file needs to be created? |
I think a nonlinear derivative operators page would be good |
This addition tries addressing #276.
It will return the required discretization as output given k (the diffusion coefficent) and u (the desired function) along with inner and outer differential orders.