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

Uploaded Source

Built Distributions

pyfmmlib-2019.1.4-cp37-cp37m-manylinux1_x86_64.whl (977.1 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2019.1.4-cp37-cp37m-manylinux1_i686.whl (820.8 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2019.1.4-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.5 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-2019.1.4-cp36-cp36m-manylinux1_x86_64.whl (977.0 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2019.1.4-cp36-cp36m-manylinux1_i686.whl (820.6 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2019.1.4-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.5 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-2019.1.4-cp35-cp35m-manylinux1_x86_64.whl (981.9 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2019.1.4-cp35-cp35m-manylinux1_i686.whl (820.0 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2019.1.4-cp34-cp34m-manylinux1_x86_64.whl (979.6 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2019.1.4-cp34-cp34m-manylinux1_i686.whl (818.7 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2019.1.4-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-2019.1.4-cp27-cp27mu-manylinux1_x86_64.whl (975.3 kB view details)

Uploaded CPython 2.7mu

pyfmmlib-2019.1.4-cp27-cp27mu-manylinux1_i686.whl (820.9 kB view details)

Uploaded CPython 2.7mu

pyfmmlib-2019.1.4-cp27-cp27m-manylinux1_x86_64.whl (975.3 kB view details)

Uploaded CPython 2.7m

pyfmmlib-2019.1.4-cp27-cp27m-manylinux1_i686.whl (820.9 kB view details)

Uploaded CPython 2.7m

pyfmmlib-2019.1.4-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-2019.1.4.tar.gz.

File metadata

  • Download URL: pyfmmlib-2019.1.4.tar.gz
  • Upload date:
  • Size: 470.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4.tar.gz
Algorithm Hash digest
SHA256 5ad11ab54816473f220f4db0b648546b3a9047bdee349c730de7b47c0e0cf1c8
MD5 40cc0b297b2f1bab09cca0abe582f630
BLAKE2b-256 259702cb4a7bbf173c7259867c6b6dcd8b974576162fd1474e04fba1f57d1154

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 977.1 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 07710d11118bd87cc93d0717470673c2673247c3ee406d6334d9a7bc81af3ec5
MD5 00813e8d014e8de09b2a13f45149039b
BLAKE2b-256 25eaf6c79366f52f3f3a8f53489c693721c8302e6479d04a000103bc7492613a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 820.8 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 0998db23d65e7a07c3a922d23b1768927ff0dc02fc0daeed7a9d2d320e856d9e
MD5 513892d9e0902074111466fcbda58a79
BLAKE2b-256 81057840e74be920100996dd8d77e3939374d92baf3b94d71b6d9fd5e7d2bc3b

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1.4-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-2019.1.4-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 cb091fbf3322bb3f4dc613aa94fcbe917e65fd4c0913744ba9ad3ac91ce482a3
MD5 604186c91f76312d6347006b4c7a9100
BLAKE2b-256 b0a6ab439ba5e2f15c9ebba4923f4672ee140e471990b2a36023f0b3d1b140da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 977.0 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0272547a980fcd7a0924f6f5e5baf83e247a7b6e33293ff0b838742d7900512f
MD5 762c1d1ea6db87411cd4c9a41ff4006b
BLAKE2b-256 a9c91197112195da5bd7ae28355c179578981c203d238bfe6bba846ed04fcf29

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 820.6 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 3573ad8f7c8def4fb292aabe08b9844c7323716fc2b598b0ebc4929a524846e9
MD5 a6d3a9a8cee17d89a72432a7db30b1c0
BLAKE2b-256 7b5789fbeaf03c9d382dff8b808a23a53dff204cef2ab9b13e4dc5e4a49f2a25

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1.4-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-2019.1.4-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 b5cdde282fcce2a91cf274693e63b62d815483d8e8acffe34e970b141e9c755e
MD5 45f4e80a966241ab2ae7914a2acea1c7
BLAKE2b-256 72e9c54fb1f1a76e25ed84545598a888b12a786e96d526d8dd19dfb64ed22f91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 981.9 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bb196b21710601bda486cfa1ab586c37272b61c2292842a09560d7ae04a8f2e5
MD5 bcf58a8d6a566d94c21aaef88cdd5c82
BLAKE2b-256 d3dcd5f3aa1e66a94ad8d129243a0f2656df9701c381e768c4fd152e272d7825

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 820.0 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 082d6097b5f56054ff205129ced60d1599c169dd67890c7021fb9433430e266e
MD5 2645fa58ee18dd82f6d061dc997b3d9d
BLAKE2b-256 208fae814f62f540cd32b78ba8afb944016583e1fabf2a1b88385a39d5938578

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 979.6 kB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a14c73ce1e251788c1a244402d52061e90f6021e66187910eae157cd8efe3abd
MD5 b51c1f3ce198564f134bd760ed4963f7
BLAKE2b-256 efc4ff0c1bf80cbcbfb6937269501b16a5bfd5619e3ab2d63664253b20266c33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp34-cp34m-manylinux1_i686.whl
  • Upload date:
  • Size: 818.7 kB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 440d2048eb34ba9c8f8ba34563d3bbeb84cb8394bd78d896b89304292088f1c2
MD5 a2985df092ebfdd8609ebd91fe1a2e7c
BLAKE2b-256 9faec11d09171ac921850eed7c1e39878c2aebc5a40a12aa65460c704f12a4c9

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1.4-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-2019.1.4-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 3e74717773353a20da9d51a94329b355d7449e659a32030b40b35bcd132b695b
MD5 6314e246f1d9b0237070c295103434ca
BLAKE2b-256 4d109f81bb3782b00cdab3ab3126cfd8023cc5322951fe65873c55506abe73ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 975.3 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cde688647daebeaab8e8b34d93fa34237cf15cacc3a5d0a99fdaf85f378bcaee
MD5 65f701876a026196f8549b5df0f30cf3
BLAKE2b-256 9e922cd7006fa58ebf3841d377703408fa42b4eed1e3b4bcc0dd244c36985663

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp27-cp27mu-manylinux1_i686.whl
  • Upload date:
  • Size: 820.9 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 bfbbcd02c0c85eb7411d2e9214b0e17cd739373d20792a4eaa1764a79b6c6f16
MD5 0ad33a334393535afb21946cb9251dd0
BLAKE2b-256 7f6675a492f011412bb6bc997cf8c4006f5032e3f0ee3bdf4a2582e828975f48

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 975.3 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1f037d696f5730809e772e085ee19b75b7badee4a6e70f4d3d0e1c2e7dc702ee
MD5 b56fc1ebe7fe705f24721520c511a3d4
BLAKE2b-256 54df07c4caba1a60fab440bc5633f8c7d312000e2280a1841d9970a86be735d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.4-cp27-cp27m-manylinux1_i686.whl
  • Upload date:
  • Size: 820.9 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

File hashes

Hashes for pyfmmlib-2019.1.4-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 abb274e3836cfa63e9746549727f56c3a5da01eeb197c88239d6eea25945ebcc
MD5 65b0cf0b6cbf7e61d0ad2ca2b992adda
BLAKE2b-256 9778fbbb515b09543f725132d4d8be2b04a0a6b7c644edb0b57f928c1caafb0b

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1.4-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-2019.1.4-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 9a9461177685ecf3b13371bdaaaa6cd401fd7339c2e7c05a532a9ac0e02e6b8e
MD5 d6131a8ed906ae8baf11fb31a04f0d67
BLAKE2b-256 cc00fb55a90b52bb344f9363ef66458a842125bbb5d6af665d0495e60db36beb

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