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

Uploaded Source

Built Distributions

pyfmmlib-2019.1.5-cp37-cp37m-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.7m

pyfmmlib-2019.1.5-cp37-cp37m-manylinux1_i686.whl (851.4 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2019.1.5-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.5-cp36-cp36m-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.6m

pyfmmlib-2019.1.5-cp36-cp36m-manylinux1_i686.whl (851.2 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2019.1.5-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.5-cp35-cp35m-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.5m

pyfmmlib-2019.1.5-cp35-cp35m-manylinux1_i686.whl (854.7 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2019.1.5-cp34-cp34m-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.4m

pyfmmlib-2019.1.5-cp34-cp34m-manylinux1_i686.whl (855.2 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2019.1.5-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.5-cp27-cp27mu-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 2.7mu

pyfmmlib-2019.1.5-cp27-cp27mu-manylinux1_i686.whl (851.4 kB view details)

Uploaded CPython 2.7mu

pyfmmlib-2019.1.5-cp27-cp27m-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 2.7m

pyfmmlib-2019.1.5-cp27-cp27m-manylinux1_i686.whl (851.4 kB view details)

Uploaded CPython 2.7m

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

File metadata

  • Download URL: pyfmmlib-2019.1.5.tar.gz
  • Upload date:
  • Size: 480.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.4

File hashes

Hashes for pyfmmlib-2019.1.5.tar.gz
Algorithm Hash digest
SHA256 b47e61be41474425852dfa2ad00757fd1327b76869d518c10c9578a522ba46d8
MD5 f7e1362124a94babae4ab19893dab9ec
BLAKE2b-256 b9c3c796d4f2485b4a83de2f953f6c8c4a4e2e5111e668f9dd172a4ac1a1970b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5338221dfb801ee1ed50ccf7bd6755d77458a32087e78f55353099a9369a4f06
MD5 7ff1864186a0b38986af331f4f2be8d7
BLAKE2b-256 b92ed4e95ea306d775d8c449cbff4ff68bc5ac25e61b01892c2f584bfed7d47a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 851.4 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 1c1fd7687057da0cc55e9af43a5c81f7f8faf8867b3c00c8a2f3121ed0ebb815
MD5 672b04907eb3d000fbf639730fcc3e46
BLAKE2b-256 6a6d3eff2c7368814742cca259909643ac1e30dd4a97fe8f471fafbef05e85ac

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1.5-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.5-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 e4882fe3ac4741008ec48b8b6150c42127890441e063c2472fb2e288e6f3ebc6
MD5 ae7074b245b477d001080d595d46beab
BLAKE2b-256 85b00a92ac258bdda34794a65eeb74b28fd8737bb1b2eeefb4d5d2fd5f01fc3d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0590c97c97541ff8eb1ded763403498c8344a2a30adf2aa13af55d12522f296d
MD5 52ec91fa879698541ecd0aa75c095ea9
BLAKE2b-256 b399ad22ce933069d0b448c4fc4d7a8df9ac20d519e90d92ef841acaf8e58de6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 851.2 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 cf2bac59cac257ddeaf61b6f6252f4502c4e62b2bf47ab65b4841662df5468db
MD5 05db495dd7eb48c26a213b84b4b8d095
BLAKE2b-256 00932e2f4ce92d347f78a2e0cc4cd09883328854bc75ef75ad4ad1c255362aa6

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1.5-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.5-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 80609824223dd18c36e46ad33e3f45b0c4688dc424a325f7e7538950a2d362a1
MD5 82b6301add52eb63579a8c0868c6f089
BLAKE2b-256 7090ea536e44fdfda2f76394f492ff3867b6d1c7d64061e264b41b1851de249b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e0439273dc29478e056e714cef79c7818d75a24895f217334b2b63359955775f
MD5 dab10aafc812bb3014b2cbc9e7149493
BLAKE2b-256 e6ed645864c1be5e384d4bfcf79a78372441d0de5c95c0944a385ffb2f4aa612

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 854.7 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 333615d90ccb5d0664621aaf77997fa998ffdb3b28b917a557a690049f466201
MD5 9b51543e1c32722bf97d15add1e4cde9
BLAKE2b-256 c2ffe5f76cf8190631962218f695ac5118d52b288b982474a94400d8e60ec711

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ea834382d5fafde5c0a90ea9fc6b6bf4d9fb16d2560c5951735e07ff06ca3519
MD5 6f197273d17681bb21679823dbe2a964
BLAKE2b-256 902f96d3faf52050c9f204ad6e64a1be650703ff2b91099953731313dac824a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp34-cp34m-manylinux1_i686.whl
  • Upload date:
  • Size: 855.2 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4c62ddf672c7cc678765bc543d4bd8d54aa400f149f21e2a711e35a2483e9be0
MD5 b613cff232d0621b115efa18a7c1ffa7
BLAKE2b-256 f2a6385747ef2ba54e14735ad2af554e498fd069965cf66f2320ea10d8f0ee56

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1.5-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.5-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 63ff54384dfed9e21eb71342f150594f3a05bc10c6ad49e78ce22a7844506cde
MD5 b93a393d5e29434e8c0d83ca5d823ba1
BLAKE2b-256 aefe7759ce891907690c214d7b7d127fa063b1d4a9fe2ac30ec319957710406f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3ce385579a86bedb78cbc29a44a4ce78c365065eb0a1b38b9b8f1f1026038509
MD5 6bb2c7e70d592abaf3b124f1389fea01
BLAKE2b-256 f527cbe8f7710a24f40f4d87be290a1d4f8382cbb18ef25ae98eb2b0f99e714c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp27-cp27mu-manylinux1_i686.whl
  • Upload date:
  • Size: 851.4 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b3b3623753e1413b31d0a6ac602a3d53723402f34646cd965a76e94879ea1ff5
MD5 11facfc7bdc14cb5d06ae5b26b41f0b9
BLAKE2b-256 66661a3eefe8542b9ed935a8c1a1f367222a463c05bb7359f9173434eb645a0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6a89a1f1da7824e42ed826c71629689c07c9bb1dd2366fc50b450d68364a378e
MD5 23c4eb82770af9aefb919ae7b8302bf2
BLAKE2b-256 58291b5c94d0bc949a42e61a21b2accb90e3285372f8fe54ec5f9927a9e39983

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.5-cp27-cp27m-manylinux1_i686.whl
  • Upload date:
  • Size: 851.4 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.4

File hashes

Hashes for pyfmmlib-2019.1.5-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ecc470ccd3efeb74beff39dc371968044303c106131c49d5395ffb087df88940
MD5 6c99ac7d75e2c85e238481d7dbd0a60b
BLAKE2b-256 1b967b9ebdfc9fba27c5a19c604cda8e3b83939a3ad6d66ed8942fa77e35d973

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1.5-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.5-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 bd6bc31e11a364688779740681920d448b21cf078916d1636d00ed0fa96285af
MD5 05926a9904648c6f9b8bdb8de39b8d48
BLAKE2b-256 18b0c850f42170fd961712c05f7985d4135c03a4b39c6f61c9ad01b601146bf8

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