Python wrappers for particle FMMs
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file pyfmmlib-2019.1.1.tar.gz
.
File metadata
- Download URL: pyfmmlib-2019.1.1.tar.gz
- Upload date:
- Size: 469.6 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2af271df581d5fc76a5721aa229e73af93ad2c8fb47bcc316baa62e06d1ddad7 |
|
MD5 | 3e735fae4e96d95aca5724e80e4cb4bf |
|
BLAKE2b-256 | 9dccf13784bcf96cbcf1369c4ba51fd0aa6963426e028881ead073c37f62c778 |
File details
Details for the file pyfmmlib-2019.1.1-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 702fc8e4fed7e95705958ef1d4e3ac034fa3d6545d2c8bb222846592ed944e3e |
|
MD5 | c3c69b3fb91682bdd4084d82e51d3066 |
|
BLAKE2b-256 | a515a17ac4670681cb96bae95b34de09ff0dec837d75db544b6f38fb9b55281f |
File details
Details for the file pyfmmlib-2019.1.1-cp37-cp37m-manylinux1_i686.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.1-cp37-cp37m-manylinux1_i686.whl
- Upload date:
- Size: 818.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e1da0820d40010bf9c9b18216e85f02f12a717b12bace7f2955b921dbac71a5 |
|
MD5 | 8897c8fd2c853b8ff06d5bf14289af0c |
|
BLAKE2b-256 | a910d3f73e4b8719ec0ddfc767f8ac2618e298b897a4d7b6b54b4b7824fd063f |
File details
Details for the file pyfmmlib-2019.1.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
- Download URL: pyfmmlib-2019.1.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
- Upload date:
- Size: 1.4 MB
- Tags: 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
- 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9737facd95095a075817db43c016e8150fdfda879aa750a05bac51b48d80a99e |
|
MD5 | 7625d833bf7aef0edf0b956e510c91de |
|
BLAKE2b-256 | c2d6674d2748bc7112b38a676b6dcfbcdec72dcc778522a1538cdb9e04c537ce |
File details
Details for the file pyfmmlib-2019.1.1-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc330b2fb0487ab33cfa3039f10ad64000f7be063d9e13d339f156551e035fe8 |
|
MD5 | 1fb8bff2173d8c99ba4f639759a17caa |
|
BLAKE2b-256 | 12e6614ef88bc66a4a210a2c33177f215518a7ad9ba04bf3477333a6da399384 |
File details
Details for the file pyfmmlib-2019.1.1-cp36-cp36m-manylinux1_i686.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.1-cp36-cp36m-manylinux1_i686.whl
- Upload date:
- Size: 818.7 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 276af73d2abd70a0449be95498c5f59edb35b7c8d1a37fab52123f3b41337025 |
|
MD5 | 1461256779432feb144c6a4764641548 |
|
BLAKE2b-256 | 69219c5534436efaae1de20f5b15561dc695243fcc6fee6ac64ee05666f4685b |
File details
Details for the file pyfmmlib-2019.1.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
- Download URL: pyfmmlib-2019.1.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
- Upload date:
- Size: 1.4 MB
- Tags: 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
- 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e02bec83f434ed07ba83ee0d5e2a5917c1dcf11cfdbb5fa153fdad133024506 |
|
MD5 | 2035295b8237a60b3ec7a3d49f7615a3 |
|
BLAKE2b-256 | 581b12134fa2b3198f544372c8530fc0359c5051c91e0a255e91214701b99e2a |
File details
Details for the file pyfmmlib-2019.1.1-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.1-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 975.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a207f6d1e27ae0cc72917ff59a70b43629eee32bfd4c4cdc6f803f2c3e2670 |
|
MD5 | 3d66db7b6f1611902c07efe685e05775 |
|
BLAKE2b-256 | 917074df520cedff084fee56df33d4b08f0354906606ca188fc714e973f8effd |
File details
Details for the file pyfmmlib-2019.1.1-cp35-cp35m-manylinux1_i686.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.1-cp35-cp35m-manylinux1_i686.whl
- Upload date:
- Size: 822.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64fa40d4d8b08450c565c2608013c93bc8575f917ae3a7964f71fcf6abb8fc46 |
|
MD5 | 24013b0473edf8e4364be1a3d6ed1221 |
|
BLAKE2b-256 | b1f900f76bfbe08100d071668b86c18c06e8bb5515a65b2552dd9811d91af2fb |
File details
Details for the file pyfmmlib-2019.1.1-cp34-cp34m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.1-cp34-cp34m-manylinux1_x86_64.whl
- Upload date:
- Size: 976.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.3rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1a2fcda1f7fa8630f6a7f2ab7c24d9e01283328dde5450ee3e2d019334c3ed2 |
|
MD5 | 1297ce8c0f122afa40e1b841793e8b99 |
|
BLAKE2b-256 | 1694d1a1615d80328538b6b1526d1daa353ec25877defaa6f2b23c78e328dc44 |
File details
Details for the file pyfmmlib-2019.1.1-cp34-cp34m-manylinux1_i686.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.1-cp34-cp34m-manylinux1_i686.whl
- Upload date:
- Size: 822.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.3rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3c028679fd066e4f71c2b4c57db116898a223b4f1cdecf1879cd7f40283f940 |
|
MD5 | da4bbbe106e67d71641271d985850f71 |
|
BLAKE2b-256 | f8e0afde9f6019ffd4904a19b54495604182d9371817429aa6045afc7106908f |
File details
Details for the file pyfmmlib-2019.1.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
- Download URL: pyfmmlib-2019.1.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
- Upload date:
- Size: 1.4 MB
- Tags: 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
- 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f446ba30ae238debd9a4ed38019819c102ec8cb26793fcb5919ce15a1e51fad |
|
MD5 | 0e8e8f7d86c5ffffbbc950d67ecf6b17 |
|
BLAKE2b-256 | 7d2d8772ff6bb27ad3051ab90e79dab1f5dbde9cdbde78c1345f47952ae00af6 |
File details
Details for the file pyfmmlib-2019.1.1-cp27-cp27mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54bcc6adeef4744d8e23d00dc630394f2d337cf1a4b742c12b733075bbacd5bc |
|
MD5 | 0de3fb778b9880fe3e26b2bb1e0cafb3 |
|
BLAKE2b-256 | 530078f0a48d313f568dedce7849b8a89873686a2cbb0b7d4df695ab0c7e4d2f |
File details
Details for the file pyfmmlib-2019.1.1-cp27-cp27mu-manylinux1_i686.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b22f953ed3c4fa1c2089dd402f7db7ce3a930440e9b147134cd040d0f32bd92 |
|
MD5 | 2c4a49198a1776abd9fbab7be4d49043 |
|
BLAKE2b-256 | f8fc2605f5504ebc35e549d02efed395887796b9d0ce2bf82f72076ad861d7b9 |
File details
Details for the file pyfmmlib-2019.1.1-cp27-cp27m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c59f06db5a938800f3611787d7943cdc5eea30b7f230bf32241fe34a264e82f1 |
|
MD5 | f3b68ffa0a7489066faae0f8425ed787 |
|
BLAKE2b-256 | fba2c9d0c1915d1b6b06f9294dc6bc66d863528c43900fe9580fc3fc51da77de |
File details
Details for the file pyfmmlib-2019.1.1-cp27-cp27m-manylinux1_i686.whl
.
File metadata
- Download URL: pyfmmlib-2019.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55e8220d75e3dab75848a079122cda770cc2da80d007f1ca80dcee0b797b34d7 |
|
MD5 | 217e0ef76ed3369f16208fa8b0343005 |
|
BLAKE2b-256 | 539f42a84f45ac01e6159a90a7f75a444453f6228ca3b243cc8be06851221b9d |
File details
Details for the file pyfmmlib-2019.1.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
- Download URL: pyfmmlib-2019.1.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
- Upload date:
- Size: 1.4 MB
- Tags: 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
- 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fd20b792675108a98a7042a939f174904d8d6a1d2c4e45d00b111f00d7899f3 |
|
MD5 | 76a8727f75c496e75a116aab95a2316d |
|
BLAKE2b-256 | 52d3c41fb08f52fa9db06cac1a5bf4bc8dd64345cac5304a6a9a207a647bfb1d |