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

Uploaded Source

Built Distributions

pyfmmlib-2019.1-cp37-cp37m-manylinux1_x86_64.whl (975.4 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2019.1-cp37-cp37m-manylinux1_i686.whl (818.8 kB view details)

Uploaded CPython 3.7m

pyfmmlib-2019.1-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-2019.1-cp36-cp36m-manylinux1_x86_64.whl (975.3 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2019.1-cp36-cp36m-manylinux1_i686.whl (818.6 kB view details)

Uploaded CPython 3.6m

pyfmmlib-2019.1-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-2019.1-cp35-cp35m-manylinux1_x86_64.whl (979.6 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2019.1-cp35-cp35m-manylinux1_i686.whl (821.0 kB view details)

Uploaded CPython 3.5m

pyfmmlib-2019.1-cp34-cp34m-manylinux1_x86_64.whl (976.5 kB view details)

Uploaded CPython 3.4m

pyfmmlib-2019.1-cp34-cp34m-manylinux1_i686.whl (821.9 kB view details)

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

pyfmmlib-2019.1-cp27-cp27mu-manylinux1_i686.whl (818.9 kB view details)

Uploaded CPython 2.7mu

pyfmmlib-2019.1-cp27-cp27m-manylinux1_x86_64.whl (973.6 kB view details)

Uploaded CPython 2.7m

pyfmmlib-2019.1-cp27-cp27m-manylinux1_i686.whl (818.9 kB view details)

Uploaded CPython 2.7m

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

File metadata

  • Download URL: pyfmmlib-2019.1.tar.gz
  • Upload date:
  • Size: 466.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.3rc1

File hashes

Hashes for pyfmmlib-2019.1.tar.gz
Algorithm Hash digest
SHA256 50bf64b30c2fd08cfb79a2c8bf237ae54ba5814ce3643599cab76c2fb827c5b9
MD5 ca274f33ed508f8c3be13c090aa2f53d
BLAKE2b-256 48c52b09ab13b89d4d379e58652b1a615b2ab424f6e16432751ea79c59f001c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 975.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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 14eaadc31c893ef1be5461c9e21448bf0128d62a1b72f6ebd9fad0dfa92bf08a
MD5 b12f63353af93d3a49f0754cc7faf38a
BLAKE2b-256 d89cc6b9addbe7dba83c1d9c4caa82e591c6f3384fbc3062d1fd006967dad845

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 818.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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 6b5369e2b7e9b0c4bc5e524366faeb2901c7c22f6fcb6e04fcba3e786a20b657
MD5 a91d3b0f596829f4a38c13e6e2e6d1b8
BLAKE2b-256 b8941a37a1d8677940a8be235db7d69eb2609bdcc0e5e0ff5e2d8661f3348774

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1-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-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 949dd28fa1f4f14abbc0da49819d2981f03460f9287f34028164550543f9771a
MD5 89b780afeba51ae6dbc28261746e4225
BLAKE2b-256 316ee275455df805bda662aa57847ad8ba982e6af1f55f3568491506c3397567

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 975.3 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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 716c0a2ca64b39e7b15c449d7beb9c9b0dfe20fe5f1b82405c4c6732923de2e0
MD5 a2e78f4750eca89cf28a5b5f485e4c6c
BLAKE2b-256 dd1004d393bc0b8c9a7faf5e57d48f6e63484e2d28c88955f2307c04a531b62d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 818.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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 eb300b6908cd8afc1a2ec3490463c86f709d22a629c76cecfb992d041c4db212
MD5 4633abf84e3b58e7799e5f594843161d
BLAKE2b-256 8a634b3ab971dea9c4c5c521db716a8d38b651f726497f72d373bacb6719d343

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1-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-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 c693beef0f4f0e8a65575782972ecaea788d95fe058d93fb3e28b02ee10498aa
MD5 1ec21019c08ab98ada5dd98d8e66ea41
BLAKE2b-256 10251a0fe69031e3ebf9457a796ca8d617c504636e069eca9fa2a7c522aab6b0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyfmmlib-2019.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dd73aa05042fb17cf6338d5e526782045a9279b1041573deb6c2c4ad695100cb
MD5 53385138f232afad3a43d76ba857c8bf
BLAKE2b-256 2b5c78ef8e7fdfdd34bc16057af6c47c42542a4ffabf0c26dba8983c8012c2f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 821.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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b5a0c45ad711b31724ac8a9b157087383017d3e4c712cdd4431eb5af148e8067
MD5 5a1d27ea241173fab50208f5bd135433
BLAKE2b-256 207a8d5e98787b4879b28b8e181bb65fb650bc63c49ed00b2d62fb35b9b1dc70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 976.5 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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0dcbb1d6b5fb79dd874c14062aa48af13cf18fc98284c7a0f1d42aed2c78ac9d
MD5 688978e5322cf2a44ca8018bc5296fec
BLAKE2b-256 6e03dd7639ed8b8145738ba32e3ba8b928fb9d246c93370b502dd5b2b6fc86c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp34-cp34m-manylinux1_i686.whl
  • Upload date:
  • Size: 821.9 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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d207762d00d6fc3c71e246dcd1fdc993c5d4da5fdbdd605953fd1b4c1575f29c
MD5 faf4897d2ca5964b18318dc862126fc8
BLAKE2b-256 ceb110d6bea2c474b2663156a71ec9cda48dfd15905d7a968a60db1d487482ba

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1-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-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 4b3b358fa0b1ce19d6be9f5db88433a35e1aa32fe9e7a216001e0477d377a602
MD5 9ce3c4e8b1aa3eeb62ed0aa94f1e0cfc
BLAKE2b-256 666a70991cc93fc483ede508030720fb2646074eb2f3eee4245c6b972a0caa55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 973.6 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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1d9bdbf93a09dad1309f11bd4665490aecb7c1ad98d7dbadea561021d8ba4d9c
MD5 e72a478c35d2bf66961907c17be7dbcd
BLAKE2b-256 ec90da8897a1077b0246e045a063c51eb053a41f4c114d1a04c207b3d95076fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp27-cp27mu-manylinux1_i686.whl
  • Upload date:
  • Size: 818.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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 aac92fb991afbd253d8865437c93970dbedb8e50b36f5fe82cce15a012cdd5fd
MD5 66f5d3e5142698ffd7c44685a4d15f1d
BLAKE2b-256 c792144fe2447408131438572c86cc335b769555aaffe36481a4a8744c70c81e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 973.6 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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1d9e8a540d1b20c0bdf4f8b4c74f91e0d15e307481accd22f6b166e16dc3c90d
MD5 55ac1677cacf46994e97128d7385a269
BLAKE2b-256 1b836540d60bec50e1829253b905cb8623170176741fabe24a2d5f5abd744e59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfmmlib-2019.1-cp27-cp27m-manylinux1_i686.whl
  • Upload date:
  • Size: 818.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.3rc1

File hashes

Hashes for pyfmmlib-2019.1-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 493a1efe069ea58662461cd6b37a4ef426ff8736291e24373dd273dace483144
MD5 35796a6dba6e2ebd70e20fb9c6d43f34
BLAKE2b-256 af339f7d36cf1aac3c50ac0c189c51c30d71ae85d860364077a783909c38af6d

See more details on using hashes here.

File details

Details for the file pyfmmlib-2019.1-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-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 6c354598c88a9e3e1b1f882d37b08ac608523573720638e7f674b57263df0e93
MD5 55557912f45a1ab8ad45b6144e9e4c7a
BLAKE2b-256 61a37b87eb05d62736c10b5281365e7a5ea95ef2dccbe6d3957f0bea93640262

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