-
Notifications
You must be signed in to change notification settings - Fork 6
Make interpolation code accessible to automatic differentiation #53
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
Make interpolation code accessible to automatic differentiation #53
Conversation
|
Concerning the HCURLN1 interpolation, I found that if one increases the quadrature order in the normal interpolation tests (test_interpolators.jl:112) by one, then already there the HCURLN1 interpolation fails (and not other FE). That is interesting and indicates that the element itself is buggy. It is not caused by your interpolation matrix code. |
|
I think I have found the problem, please change the following in hcurl_n1.jl:
|
|
This doesn't seem to do anything on my end. Incorporating those changes fails the tests for me before and after with the same errors and numerical values. EDIT: worked after all, was just doing it wrong :) |
|
Great work, I am happy with this |
|
Final thoughts from @chmerdon? |
|
Yes, let's merge. Thanks! |
Here are the proposed changes we've coordinated so far, @chmerdon, @pjaap.
The gist of it:
PointEvaluatorgets an additional type parameterTCoefffor the entry type of the solutionevaluate!functions do an a priori check for theeltypeof the target to match the result'seltypeso the sparsity detection types etc. from the AD evals can run throughcompute_interpolation_jacobiannow computes the jacobian for alazy_interpolate!call between asource_spaceand atarget_spaceinit_interpolator!calls from the element codes to theNodalInterpolator,MomentInterpolator,FunctionalInterpolatorbecause this would necessitate a change to theFESpace.interpolatorsdictionary: now theAssemblyTypewouldn't uniquely identify an interpolator anymore and it seemed weird making interpolators depend on the type of their evaluation (though I'm personally agnostic to that)FETypes on the same gridHCurlinterpolations, @chmerdonThings left to do:
HCurlelements; still needs a fixH1P1intoRT0one contains zero entries innzval)use_cellparents = trueactually has the effect of slowing down the jacobian computation which we should probably look into