Skip to main content

Python wrappers for particle FMMs

Project description

https://gitlab.tiker.net/inducer/pyfmmlib/badges/master/pipeline.svg https://badge.fury.io/py/pyfmmlib.png

pyfmmlib is a Python wrapper for fmmlib2d and fmmlib3d implementations of the fast multipole method for Laplace and Helmholtz potentials by Zydrunas Gimbutas and Leslie Greengard (and including code by many more people).

This wrapper is far from comprehensive. It just catches the things I ended up needing. Nonetheless, the FMMs and a fair bit of other useful stuff is accessible.

Installation

Binary wheels and source code are available from the Python package index. Thank you to Isuru Fernando for working on infrastructure to build those wheels.

To build this from source, you need

Run:

python setup.py install

as usual and cross your fingers.

Documentation

Not much, unfortunately. Here’s what I do to figure out how to use stuff:

>>> import pyfmmlib
>>> dir(pyfmmlib)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '_add_plot', ...]

Fish the desired function from this list (let's use 'legefder' as an
example) and run:

>>> print pyfmmlib.legefder.__doc__
legefder - Function signature:
  val,der = legefder(x,pexp,[n])
Required arguments:
  x : input float
  pexp : input rank-1 array('d') with bounds (n + 1)
Optional arguments:
  n := (len(pexp)-1) input int
Return objects:
  val : float
  der : float

This tells you how to call the function from Python. You can then use grep to fish out the right Fortran source:

$ grep -icl 'legefder' fmmlib*/*/*.f
fmmlib3d/src/legeexps.f

Then look at the docs there, and you’re in business. No idea what function name to look for? Just use the same grep procedure to look for keywords.

Crude, but effective. :)

Two more things:

  • Some functions are wrapped with a _vec suffix. This means they apply to whole vectors of arguments at once. They’re also parallel via OpenMP.

  • pyfmmlib.fmm_part and pyfmmlib.fmm_tria are (dimension-independent) wrappers that make the calling sequence for the FMMs just a wee bit less obnoxious. See examples/fmm.py for more.

    Here’s a rough idea how these are called:

    from pyfmmlib import fmm_part, HelmholtzKernel
    
    pot, grad = fmm_part("PG", iprec=2, kernel=HelmholtzKernel(5),
            sources=sources, mop_charge=1, target=targets)

    Unlike the rest of the library (which calls directly into Fortran), these routines expect (n,3)-shaped (that is, C-Order) arrays.

License

fmmlib{2,3}d are licensed under the 3-clause BSD license. (as of November 2017)

This wrapper is licensed under the MIT license, as below.

Copyright (C) 2013 Andreas Kloeckner

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

pyfmmlib-2018.1.2.tar.gz (464.4 kB view details)

Uploaded Source

Built Distributions

pyfmmlib-2018.1.2-cp37-cp37m-manylinux1_x86_64.whl (956.3 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2018.1.2-cp37-cp37m-manylinux1_i686.whl (802.2 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2018.1.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.7m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

pyfmmlib-2018.1.2-cp36-cp36m-manylinux1_x86_64.whl (956.1 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2018.1.2-cp36-cp36m-manylinux1_i686.whl (802.0 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2018.1.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.6m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

pyfmmlib-2018.1.2-cp35-cp35m-manylinux1_x86_64.whl (957.1 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2018.1.2-cp35-cp35m-manylinux1_i686.whl (804.0 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2018.1.2-cp34-cp34m-manylinux1_x86_64.whl (958.1 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2018.1.2-cp34-cp34m-manylinux1_i686.whl (805.1 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2018.1.2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.4m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

pyfmmlib-2018.1.2-cp27-cp27mu-manylinux1_x86_64.whl (954.9 kB view details)

Uploaded CPython 2.7mu

pyfmmlib-2018.1.2-cp27-cp27mu-manylinux1_i686.whl (802.7 kB view details)

Uploaded CPython 2.7mu

pyfmmlib-2018.1.2-cp27-cp27m-manylinux1_x86_64.whl (954.9 kB view details)

Uploaded CPython 2.7m

pyfmmlib-2018.1.2-cp27-cp27m-manylinux1_i686.whl (802.7 kB view details)

Uploaded CPython 2.7m

pyfmmlib-2018.1.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.4 MB view details)

Uploaded CPython 2.7m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

File details

Details for the file pyfmmlib-2018.1.2.tar.gz.

File metadata

  • Download URL: pyfmmlib-2018.1.2.tar.gz
  • Upload date:
  • Size: 464.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for pyfmmlib-2018.1.2.tar.gz
Algorithm Hash digest
SHA256 846cc671efa243fc0c1199be93a15d7a200050cb0bfa1fe03c40b32c6e93e2c1
MD5 5f2381e2e519ca1dd476c05ee74b3338
BLAKE2b-256 f3c0cb33ad352c40140f867e051e38ecf3d293c6a8af7956e8c9fc288222bc3e

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 956.3 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9e1232d03db9ad39d830b5b0beff461e29b31599ad5bc3592b4e834fb227e395
MD5 1fa6c9eaaea96c466fd5c6132a330b8d
BLAKE2b-256 af8f213ed2538b40d3d9ba2c6a493ff765ff30b63bb983e02e78e47cb6a6e34a

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp37-cp37m-manylinux1_i686.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 802.2 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ca6c5ae45a11b77b73f4b7a8e81614e54232dbb1b3f74b94f5e25a6ae153290b
MD5 900c7c03c9387f4a8f5e714ef14b5725
BLAKE2b-256 c671c3a733c804e069fda0bbf793c41835590feb395cba115e1c1e90b5051db7

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for pyfmmlib-2018.1.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 8f0213f4c7ef451d6cf862429f6a0dca02cdc35936c7fcd5c23cbc92b1b67ad4
MD5 5e0a4d2c6ae2469c1490708655f2bdca
BLAKE2b-256 fd8dcd65feed34ab7d87862b232713b6286f9ce997a936cfa4c46005e3bbb65b

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 956.1 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 096d5d676ac1dbe56150805463e4201eb8b4cb17dc6084a07bba8aaefddddfe3
MD5 bf0db75ad5eaee8bc533cec1a427ca04
BLAKE2b-256 29f757f7fe9bf085f06be29b526d0d98eb77cad4b1ff4fb734779ccab284a436

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp36-cp36m-manylinux1_i686.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 802.0 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 214c118005a49096cdcab905e30d20a90f06f3f76d67e47c83d54215551379fd
MD5 2d5a368a5a642e2e64ec6211af7e014e
BLAKE2b-256 d8cfe8e6ab2ed0c3b7ec427d32393266c83d267133428e041b312ad898488f49

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for pyfmmlib-2018.1.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 80f4b4f88d4ae8773292eee045bfa3285b114ad15fe2df53f0f2f1196095e24d
MD5 cb0009da16a2e994393c93d763e487f5
BLAKE2b-256 2e761a74d85b1c03e29b242d1db6e65a0e1beb80b2da19edf0aa653d21c43f77

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 957.1 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d2ffeaad601def4ff5ffaa9534b1912ea4c8a69ac98596cd4bddf77f3c5ad421
MD5 263fe0eefe2152351cb4d19198afdc9f
BLAKE2b-256 b8989e065f34cf71a106d27c0d8bd90235fad6eb1f2ff2906354d678740ad4fe

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp35-cp35m-manylinux1_i686.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 804.0 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 1a3b19d9924d239314a3626b8154d2e93c2cefba0275af9f55d656a9e0347426
MD5 e2d6faf236b015f9d27f6d3399a8aa39
BLAKE2b-256 b4ceb70bce9200dc201c22b11ce43e0ce2fe2e0de62ed0e0e85d99490a69545f

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 958.1 kB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6c5d5a02d571cf7aca0a60a9c6bf7d06dcb066f63ee4058e8c204013a0f9b46e
MD5 eaf0af7fced5e9af1782c25b07b3c229
BLAKE2b-256 65a9e48f9316883ddd7fa322a0efcdf1019f62e5a59acc940f3a164d458eeff2

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp34-cp34m-manylinux1_i686.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp34-cp34m-manylinux1_i686.whl
  • Upload date:
  • Size: 805.1 kB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 092d416b28d9acf16e6b3ef76e3c55b6b262cfe4824976ac32cd3a31db29cf5b
MD5 2855a6578c6412db141b348e8965f36b
BLAKE2b-256 c1b33c48a0f70a1dc2c05119d76ffb762a40d67a54879a878024d545c55999a6

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for pyfmmlib-2018.1.2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 ca84e88e8956384cba9f332e61bb2fd7a833d264b4fe380735d7031e03c23ca7
MD5 339d26fbb3b70c53c4b7d582335361b0
BLAKE2b-256 78603d5f38d3ad5f9b1a24c6ae943445e75c235ea3bfba3ac501251049e319e7

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 954.9 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 af749f9aa5d6df0552e324b38067d4d6d5946b448a2d6cb5a37adc837b514261
MD5 a4a917cc86544eb0e8e692f70d60e918
BLAKE2b-256 3ddfd2d897cb82cef4976bec1b3cd43d993d197980893ab54ef33882dd7c952b

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp27-cp27mu-manylinux1_i686.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp27-cp27mu-manylinux1_i686.whl
  • Upload date:
  • Size: 802.7 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 10382319c3e89e050471fd7536cb4f04e3dbea421267878c10c91e6e9781a6fe
MD5 8aa5db960eeed70bdf4d4b57b502e4b5
BLAKE2b-256 1f5a30934eac07321da8a3c2a72c4f8089e09595ae0a47fb8ca436394d85befb

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 954.9 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2427a2828d6f1f07ea38aa41c0ce0247d7f26a2822c3e2034a9764e9acd05093
MD5 27ab8b668bd0de5cc7bf955909853509
BLAKE2b-256 7ac0c7b87803eae9f263c58308e4832d97781e717f2b9295e3fa79c06507143d

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp27-cp27m-manylinux1_i686.whl.

File metadata

  • Download URL: pyfmmlib-2018.1.2-cp27-cp27m-manylinux1_i686.whl
  • Upload date:
  • Size: 802.7 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyfmmlib-2018.1.2-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 793ef8ba29d063c39d684b1b6f2080ba6dd5da4346200511b24c134166a3068e
MD5 b303faf3d22cb2478753e3b0d4a8139a
BLAKE2b-256 103150d525eb1bded0488a36bdb284aa763067ef2b31bd70a1432114e5494e9b

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for pyfmmlib-2018.1.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 dbf726871abcaa0c60e18cda4d84dac87fa0d8946fc3037f7500fa2f7a98c20f
MD5 ccc226fcd522e6b5679581f7574e3355
BLAKE2b-256 63fddd6aac0bdcdd7850ea67e15a1a526bba2e559bd664518dce629e84fcc735

See more details on using hashes here.

Supported by

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