PHS+poly approximation procedures
Project description
phs_poly
Finite difference coefficients using the RBF-FD method.
Only PHS + poly of limited order are supported.
Fortran examples
Example of gradient and Hessian calculation using RBF-FD.
To compile use,
gfortran -Wall -Og -o test_phs_poly phs_poly_approx.f90 test_phs_poly.f90 -llapack
Here's what the output should look like:
$ ./test_phs_poly
Testing 1
Grad (approx) -0.000000 -0.000000
Grad (exact) 0.000000 0.000000
Hess (approx) -0.000000 -0.000000 0.000000
Hess (exact) 0.000000 0.000000 0.000000
Testing x
Grad (approx) 1.000000 -0.000000
Grad (exact) 1.000000 0.000000
Hess (approx) -0.000000 0.000000 0.000000
Hess (exact) 0.000000 0.000000 0.000000
Testing y
Grad (approx) -0.000000 1.000000
Grad (exact) 0.000000 1.000000
Hess (approx) 0.000000 -0.000000 0.000000
Hess (exact) 0.000000 0.000000 0.000000
Testing x^2
Grad (approx) 0.862000 0.000000
Grad (exact) 0.862000 0.000000
Hess (approx) 2.000000 -0.000000 0.000000
Hess (exact) 2.000000 0.000000 0.000000
Testing y^2
Grad (approx) -0.000000 1.074000
Grad (exact) 0.000000 1.074000
Hess (approx) 0.000000 -0.000000 2.000000
Hess (exact) 0.000000 0.000000 2.000000
Testing x*y
Grad (approx) 0.537000 0.431000
Grad (exact) 0.537000 0.431000
Hess (approx) 0.000000 1.000000 0.000000
Hess (exact) 0.000000 1.000000 0.000000
Testing general quad
Grad (approx) 6.734000 6.094000
Grad (exact) 6.734000 6.094000
Hess (approx) 6.000000 4.000000 10.000000
Hess (exact) 6.000000 4.000000 10.000000
Testing smooth function f(x,y) = sin(pi x)*cos(pi y)
Grad (approx) -0.076949 -3.072093
Grad (exact) -0.078364 -3.047367
Hess (approx) 1.121192 -2.065178 1.184418
Hess (exact) 1.117863 -2.108393 1.117863
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
phs_poly-0.2.2.tar.gz
(9.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phs_poly-0.2.2.tar.gz.
File metadata
- Download URL: phs_poly-0.2.2.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfdf017413ceb50a4a9c1610eabdff5f333de18167fcae927d068a419265091c
|
|
| MD5 |
f8d866dd064d86114353f0f390e61d4f
|
|
| BLAKE2b-256 |
15633c620077221af9706e54b835600805b5a290cba30353588694e95456329c
|
File details
Details for the file phs_poly-0.2.2-cp39-cp39-macosx_15_0_arm64.whl.
File metadata
- Download URL: phs_poly-0.2.2-cp39-cp39-macosx_15_0_arm64.whl
- Upload date:
- Size: 9.6 kB
- Tags: CPython 3.9, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eaf6a21137a8050b6af4548802579ce0b4bcb98d73e25152967a5b53e75de98
|
|
| MD5 |
cd4bf09f83968c068a227b222c9d9bce
|
|
| BLAKE2b-256 |
cd9e469ff38f302497bd2fffebcd0b83717b59752932611e839d5d8e5b389e55
|