Skip to content
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

Add gradient calculation for surfaces #15

Open
egiovan opened this issue Jan 8, 2025 · 3 comments
Open

Add gradient calculation for surfaces #15

egiovan opened this issue Jan 8, 2025 · 3 comments

Comments

@egiovan
Copy link

egiovan commented Jan 8, 2025

First. It is a very nice and useful project the modernization of the Dierckx routines, so, thanks.
A useful addition will be the calculation of the gradients for a gridded surface. The Dierckx parder function is already in fitpack_core, so it shouldn't be difficult. One has only to decide if one wants a different function or wants to add some optional arguments to the gridded_eval_ functions.
I may easily do it if you like.

@egiovan
Copy link
Author

egiovan commented Jan 8, 2025

There could be a problem with the length of the work array as it may be bigger in parder. But I have seen that you have written pardtc that can return the derivative of a surface. That is very nice. One can add a method that return a derivative of a spline as another spline.

@perazz
Copy link
Owner

perazz commented Jan 8, 2025

Thanks for the interest @egiovan. Do you have a simple sample case where this could be evaluated?
Currently, we only have a parder test from the original testsuite that consider a square cartesian grid

@perazz
Copy link
Owner

perazz commented Jan 8, 2025

@egiovan I've implemented the derivative evaluation for both cartesian bivariate types:

!> Evaluate derivatives at given coordinates
procedure, private :: surface_derivatives_gridded
procedure, private :: surface_derivatives_many
procedure, private :: surface_derivatives_one
generic :: dfdx => surface_derivatives_one,surface_derivatives_many
generic :: dfdx_ongrid => surface_derivatives_gridded

I don't have a quick test to run on them, so if you do, please let me know, happy to add a test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants