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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5m

pyfmmlib-2019.1.3-cp35-cp35m-manylinux1_i686.whl (823.9 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2019.1.3-cp34-cp34m-manylinux1_x86_64.whl (981.6 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2019.1.3-cp34-cp34m-manylinux1_i686.whl (824.1 kB view details)

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

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

File metadata

  • Download URL: pyfmmlib-2019.1.3.tar.gz
  • Upload date:
  • Size: 469.9 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.3.tar.gz
Algorithm Hash digest
SHA256 e4fdd1b168ac91e506ec56242af1142c3643130c5f54edd3c28f3b3899ee97c1
MD5 a6dc21485bfb1440b93c8e94a4bddaf8
BLAKE2b-256 6a2c85a4747f8a523645baff891981f5ef9da7b301e16d506c6d2c057a3c2d49

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-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.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ba1a679116d9e3b51ca0736efc20d0a22edc76321882d836ab3139d4e4fb3246
MD5 594956440ed51553fc3f9bcadd099a00
BLAKE2b-256 1ca43f26fa32cb398385eb63226f3c06b81822aeac81d2961f4f69cf1d7d7a61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-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.3-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 537f8c427f80fee2d26459cbec0a63e16260f5ea9ca4576054e2179d17240da9
MD5 6137b86c06dd80f96162e6ff9d90a7cd
BLAKE2b-256 3e45944fb97786d9f40c99a4780705000037313c8d1caffd6642d43a4ee2f094

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.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-2019.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 5268a8f1015c6bebf088cb7db74d43225b179eab2b1a813998fa7484c747f605
MD5 d0becd51762b9dc18e19298c1f78f317
BLAKE2b-256 e7b5eb920f87895308d8aadaaf0b151b75f589464123b66467ff4aecd957d9f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-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.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 db882caa273dd7317ac1c4625ec7f8062bb55f7368030ea394772aac7a3547ce
MD5 e2e0529695f5c283cf668c37a781ca38
BLAKE2b-256 0eae04aae8acfdc41b4a599e6f930422254f519fe0562304e9ec8a9b4d59fd10

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-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.3-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d6039c9052623d3af5ad66050ed34a0ad9450a01ff935503f57cb109ecf4648a
MD5 227276e709ce49503582aad4986e0f83
BLAKE2b-256 76507d19c2ba069e5e2ac09eacc13332a2ba0c73d9ba07605aa80d58dce42128

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.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-2019.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 dc9ef15f7e152479119d45bde80255bf99870f985f6642ef0a1161c02010a3f6
MD5 5c048f94582eb1bdba3a2898ef8e79f8
BLAKE2b-256 024aebc6f76f0a643eeff5ea01fcbd0028f26a83a913ec6582ce026f6c5b93d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 980.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.3

File hashes

Hashes for pyfmmlib-2019.1.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bcc5afb81af564f9cd14c7c665131d6fcd8bdf3ac7743acc3d66cfcb526ee0f6
MD5 8dc88f37c3bb6304dbd3e8110362eebd
BLAKE2b-256 1c889215849431424df6348fe2539da05bb3bec1aad17145a8a6bb8c33645e4b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 823.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.3-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 1c0c033051f8219e673f3075a3b202c685f664830d91564a809cedf6f2194028
MD5 55089e85f5afec056cee5f6ca2e54a3d
BLAKE2b-256 ed4ff38f278415c57e915d403fb32907e4266b10ba736e9f6f1bbdac573df1c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 981.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.3-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1c34c183702e07a3c22820a6ec012b02b0b41198d6604c4c26d85773a4eb18aa
MD5 cf662e7dc1fb38de19848391f7fabf9b
BLAKE2b-256 67326682792cad26016a9d12fbcd3663512f97ce2c0591604e13f96a78854172

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-cp34-cp34m-manylinux1_i686.whl
  • Upload date:
  • Size: 824.1 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.3-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 49ca9c181432b2d7392959b5633e2a6b9047edebce9ac6661fa60f980ee7f7e3
MD5 c5b8a4feddb628825f6fe6ee6482b0f7
BLAKE2b-256 ea51822e7f036ae1d936036457666fe8e02a5e873f6339ed18f6b27d572e4725

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.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-2019.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 1d0a5d29b9137f1a4911a2e4983dc9eaca7fb0199f1625f535ce597cb8ed1735
MD5 a0723644bb0fc871de544edb23e14641
BLAKE2b-256 69bbcb0391ddc9f73767356151634a61a3762ca2ab517bd71c4ad05d2dd4e168

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-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.3-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cee7a6d43f4863bc2aa741286b2bfd79ed55ac488513440c7487f19bddd2d9f0
MD5 b2779ef8035d225b770de129448b9831
BLAKE2b-256 933d27adf6cb9431b1791d300e6f6ce51b2eac55e6383b10ab0f993ce5aa558c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-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.3-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 168bafa3ea52624dc6118d08444e3787ec64c3a9d5629713d8634e0c9a971c4e
MD5 00b115b735d443992122ad31c4e6c7e5
BLAKE2b-256 f153922a42a6529580fcc21e8af306a309f9b31c0dcad150df783deeb091e410

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-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.3-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 20d9c4c090e4390a2e6dc7bb05f92b37b41de35293fc3ae72b06451038d54b24
MD5 c0a0cde7e81d5801aa3aa1840f83090d
BLAKE2b-256 33be40224b0ebd2a2a06472a275462b0f80a7f7704e8924b79f0f0aa0ddb8899

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1.3-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.3-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 629c24ae4263fb5085f550c8b4f445088f196adcf51ab5dbd0ccd9b456f30662
MD5 2532a020b0718e4fee4fa58b32d4ba1b
BLAKE2b-256 acb218e1cc0bed33cf942cd0b1acd61fc7e1e5d99fcab66622431ea89fa9581b

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.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-2019.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 4e99776501ad207828b50bcb7ee86b6afa0e1ad49746bed7d3bcca49dda95eff
MD5 2b4d92409bb5f3c165b4d3d256983088
BLAKE2b-256 d134aa766fadbf33c10971489186e58326c4015ccb8c876a6d3bfd8c171168a5

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