## FMMLIB2D.jl

The fast multipole method (FMM). Julia interface to the library FMMLIB2D.
Author ludvigak
Popularity
8 Stars
Updated Last
2 Years Ago
Started In
April 2018

# FMMLIB2D

This is a Julia interface to the Fast Multipole Method (FMM) library FMMLIB2D by Leslie Greengard and Zydrunas Gimbutas. Currently v1.2.3 is used.

Documentation for the library can be found in the FMMLIB2D User's Guide.

This package currently provides interfaces to the FMM's for Laplace (real and complex), Helmholtz, and complex sums: `rfmm2dpartself`, `rfmm2dparttarg`, `lfmm2dpartself`, `lfmm2dparttarg`, `hfmm2dparttarg`, `zfmm2dparttarg`

The most convenient way of calling them is through the Julia interfaces with keyword arguments, e.g.

```x = rand(2, 10)
y = rand(2, 20)
q = rand(10) + 1im*rand(10)
U = lfmm2d(source=x, charge=q, target=y, ifgradtarg=true, tol=1e-9)```

### Real Laplace FMM:

```U = rfmm2d(source::Array{Float64} = ...,
target::Array{Float64} = ...,
charge::Array{Float64} = ...,
dipstr::Array{Float64} = ...,
dipvec::Array{Float64} = ...,
tol::Float64 = ...,
ifpot::Bool = ...,
ifhess::Bool = ...,
ifpottarg::Bool = ...,
ifhesstarg::Bool = ...,
)```

Output format:

```U.pot      (Nsrc)
U.hess     (3,Nsrc)
U.pottarg  (Ntrg)
U.hesstarg (3,Ntrg)```

### Complex Laplace FMM:

```U = lfmm2d(source::Array{Float64} = ...,
target::Array{Float64} = ...,
charge::Array{ComplexF64} = ...,
dipstr::Array{ComplexF64} = ...,
dipvec::Array{Float64} = ...,
tol::Float64 = ...,
ifpot::Bool = ...,
ifhess::Bool = ...,
ifpottarg::Bool = ...,
ifhesstarg::Bool = ...,
)```

Output format:

```U.pot      (Nsrc)
U.hess     (3,Nsrc)
U.pottarg  (Ntrg)
U.hesstarg (3,Ntrg)```

### Helmholtz FMM:

```U = hfmm2d(source::Array{Float64} = ...,
target::Array{Float64} = ...,
charge::Array{ComplexF64} = ...,
dipstr::Array{ComplexF64} = ...,
dipvec::Array{Float64} = ...,
tol::Float64 = ...,
zk::ComplexF64 = ...,
ifpot::Bool = ...,
ifhess::Bool = ...,
ifpottarg::Bool = ...,
ifhesstarg::Bool = ...,
)```

Output format:

```U.pot      (Nsrc)
U.hess     (3,Nsrc)
U.pottarg  (Ntrg)
U.hesstarg (3,Ntrg)```

### Complex FMM:

```U = zfmm2d(source::Array{ComplexF64} = ...,
target::Array{ComplexF64} = ...,
dipstr::Array{ComplexF64} = ...,
tol::Float64 = 1e-15,
ifpot::Bool = true,
ifhess::Bool = false,
ifpottarg::Bool = true,
ifhesstarg::Bool = false
)```

Output format:

```U.pot      (Nsrc)