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

Uploaded Source

Built Distributions

pyfmmlib-2018.1.3-cp37-cp37m-manylinux1_x86_64.whl (965.6 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2018.1.3-cp37-cp37m-manylinux1_i686.whl (810.1 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2018.1.3-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.3-cp36-cp36m-manylinux1_x86_64.whl (965.5 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2018.1.3-cp36-cp36m-manylinux1_i686.whl (809.9 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2018.1.3-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.3-cp35-cp35m-manylinux1_x86_64.whl (964.9 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2018.1.3-cp35-cp35m-manylinux1_i686.whl (811.2 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2018.1.3-cp34-cp34m-manylinux1_x86_64.whl (965.9 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2018.1.3-cp34-cp34m-manylinux1_i686.whl (809.7 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2018.1.3-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.3-cp27-cp27mu-manylinux1_x86_64.whl (964.3 kB view details)

Uploaded CPython 2.7mu

pyfmmlib-2018.1.3-cp27-cp27mu-manylinux1_i686.whl (810.4 kB view details)

Uploaded CPython 2.7mu

pyfmmlib-2018.1.3-cp27-cp27m-manylinux1_x86_64.whl (964.3 kB view details)

Uploaded CPython 2.7m

pyfmmlib-2018.1.3-cp27-cp27m-manylinux1_i686.whl (810.4 kB view details)

Uploaded CPython 2.7m

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

File metadata

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

File hashes

Hashes for pyfmmlib-2018.1.3.tar.gz
Algorithm Hash digest
SHA256 99f242210f235d80bc828f0fa64d63fad003aa1f568e6702450adb56bdd65f3c
MD5 10ec687a0b1ba3e322a09b5ef1b899b5
BLAKE2b-256 613cc77407f7671d992a09de55f8667d877a6e1f589d4ad70fcdae88eab9708d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 965.6 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.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2d49171adf28caefea1d343805a6672979b64390094ef628dde824763e2874da
MD5 576024db3d7c814a84885b7a366c023d
BLAKE2b-256 15c0c9d1b955343034ff5fd780bac91f7aa4d876e89dc58bf833c37a15904c41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 810.1 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.3-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a69eada90bf89d8025d92fee861275587a99430836669cf066bfcb467d0bcaa8
MD5 6aa256f3b15a7a842a3848cd9bebf6fe
BLAKE2b-256 3645288759bd6a58f6aeebf29e83a3762484d4dce847c4f601f53d97e4dca88a

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.3-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.3-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 ef16a70ac48ebe2b2e05a97d4022c4c54988b988b851c32573e8f21373d5ac3f
MD5 34986974e696ccca4827806ce8338f06
BLAKE2b-256 5dd67e75ec69ae3dc38fc1d3e88efc872fb257f0f96bac2c4225e841ffc1ff4e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 965.5 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.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d567788b94a14df1bde5d605a2afad5d1a545495bd5b22c6afcbbd2b6563a159
MD5 c90f3a5a1c7dd1d8054cde0c3af08eef
BLAKE2b-256 6918b15e759e66b439909b4be1e6ceea7b1160203e8e21e033836614f3d572de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 809.9 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.3-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 326efe334c2ebd51a0adc9b73c34ae24ce1fe4cb1f77d0cfd15ec10c9bb2fca1
MD5 98732dda304699961392c6afc8631668
BLAKE2b-256 7c740dc1da21468d47a57fa676c3d074dd1b087413bbdb6d5c332261614512f1

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.3-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.3-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 cf193fb696d5fe76f5a05f52994cb5c0551c346ae6e632313b421f77a7880125
MD5 124d16795a695edf9b27af1fcd2e11e1
BLAKE2b-256 ef10951efcca20f2ced3262815d3cee6e7edd955bc4f551b95d9557a03305ebd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 964.9 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.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1dd10a430b4fb5ce6d14b4d42c12989e6e2dc1fabd9db1fa9c4e7fee486da3c2
MD5 ab1edfd4008ce1ee0855436f0415a94a
BLAKE2b-256 65fcaf6a1b80f739401e16de362715148b18a36feb19d0f64be75ff1551f8858

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 811.2 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.3-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a8623644db9e12a944b1504e136f20f083f6293d433dad8d336607dc1f360fbb
MD5 32c987224f56dc8c1bd14f6e8af25ce3
BLAKE2b-256 5b3176dda616f4f65a8515003b809ca03aa9dd7278606fda34893a51629b282e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 965.9 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.3-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 50454c8a30a6745c7819d332b7a82d01236af493f528306ce59a724ab14122be
MD5 bde6bbcf8d8935a0557188c018a3e3d4
BLAKE2b-256 d70f21c28e2d5568d1cf42f0457a16f3ddcdc8ff15e348e14a368f5e0b119a42

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp34-cp34m-manylinux1_i686.whl
  • Upload date:
  • Size: 809.7 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.3-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 e04f4df351b45e378861d568d06a2b6cbfe555f90a4ffe2ba611f4d169985d76
MD5 15b3b6718691d2f42884bcf672c906b4
BLAKE2b-256 26b33d1408171b86030482cbce1f2eb4025d78f1cd6d02e02ef325d7ae6f5fef

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.3-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.3-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 8093700a0a0184c952541a135d5cd7c238721bdf0fdf0239b119e8bb169e6abc
MD5 9516bb61cc3856b5e3a70e2293d26253
BLAKE2b-256 98d98e9f2e9979bf3d1841af8c8b351129c8e731a1354677aa13e286e2ef8668

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 964.3 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.3-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 29dda27f423578636650ac24cf4de0e7ae364d21d0f2ec3fab83b19188084089
MD5 056f5e0c03b1f16058b340741ca23c35
BLAKE2b-256 046a611ba3dbf848c94504acae680449d755e2d3ab912eb60b7cbf288f5de022

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp27-cp27mu-manylinux1_i686.whl
  • Upload date:
  • Size: 810.4 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.3-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 615d14bb498c366300f10d16b0618eb0a288aa487491d8c74343d9f4a01e73ae
MD5 a23f3edbb860fb6d9e2cf8aa97a5aade
BLAKE2b-256 9a32e79453e112b3f47436f97fae2a3aca2a56571dc1aed2ccd2bc771242e297

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 964.3 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.3-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ebcd764191b5735fef21b8f52fdf0083c6a1e4b161d809668adf86fb31779714
MD5 d2086277108ae0082f4c6862677da6ce
BLAKE2b-256 02e983a8d14dc655a5e13a066f8d408eb9239b7359827ca38bd298802c075b6b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2018.1.3-cp27-cp27m-manylinux1_i686.whl
  • Upload date:
  • Size: 810.4 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.3-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 29fb80e30670d08c136a579e7d5a9a79ccd0ca2a494b8b3a59df2fa23878e7f1
MD5 26f5f5be2fb144f9e955f44203c43dba
BLAKE2b-256 7a9c0cab4a43696d15877a74f8cc5c038270e0235b50ae541d08c15c6c096016

See more details on using hashes here.

File details

Details for the file pyfmmlib-2018.1.3-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.3-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 b094955b641e5df26f76417bd754a8f6799a0188dd45c09a8f993a4ecaa6d181
MD5 dc017d8da361886b20c10e6b00f282a8
BLAKE2b-256 fd24d682fa7a20ebef0087d1ed98ad7103d58723406ae03ba3aa822119d5d5f8

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