Skip to main content

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.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phs_poly-0.2.0-cp39-cp39-macosx_15_0_arm64.whl (9.6 kB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

File details

Details for the file phs_poly-0.2.0.tar.gz.

File metadata

  • Download URL: phs_poly-0.2.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for phs_poly-0.2.0.tar.gz
Algorithm Hash digest
SHA256 73ac9ea5f4b10c87f44c0b16fccd579e80d068295f0b8de4aa47bdfce3cb3054
MD5 fabbefb8d3a3b167ad60dee17676c539
BLAKE2b-256 ba28133a63d88928721944422becaa343553d1c47883bbe2cda0d69da38e7817

See more details on using hashes here.

File details

Details for the file phs_poly-0.2.0-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for phs_poly-0.2.0-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 30508c29691bd109eb3d6977327ed4c97205f0ac4e64330de06a63a77d4750b6
MD5 695d5926ee159801db9a11f0c90aeefa
BLAKE2b-256 5cfd2afb440235d101584d74e9efbc010a17195d57c35dac443e479d6636fd7e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page