-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:flatironinstitute/fmm2d
- Loading branch information
Showing
5 changed files
with
131 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,7 @@ int2 | |
*.mex* | ||
*debug* | ||
*~ | ||
lib-static/*.a | ||
lib-static/*.a | ||
GPATH | ||
GRTAGS | ||
GTAGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include <complex.h> | ||
#include <stddef.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void hfmm2d_s_c_p(double eps, double _Complex zk, int64_t ns, double const *sources, double _Complex const *charge, double _Complex *pot, int64_t *ier); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
project('fmm2d', ['fortran', 'c']) | ||
|
||
pkg = import('pkgconfig') | ||
|
||
fmm2d_src = [ | ||
# ./src/biharmonic | ||
'src/biharmonic/bh2dterms.f', | ||
'src/biharmonic/bhfmm2d.f', | ||
'src/biharmonic/bhfmm2dwrap.f', | ||
'src/biharmonic/bhkernels2d.f', | ||
'src/biharmonic/bhndiv2d.f', | ||
'src/biharmonic/bhrouts2d.f', | ||
|
||
# ./src/common | ||
'src/common/cdjseval2d.f', | ||
'src/common/cumsum.f', | ||
# 'src/common/dfft.f', # TODO: unused? | ||
'src/common/dfft_threadsafe.f', | ||
'src/common/dlaran.f', | ||
'src/common/fmmcommon2d.f', | ||
'src/common/hank103.f', | ||
'src/common/hkrand.f', | ||
'src/common/next235.f', | ||
'src/common/prini.f', | ||
'src/common/pts_tree2d.f', | ||
'src/common/tree_routs2d.f', | ||
|
||
# ./src/helmholtz | ||
'src/helmholtz_c.f03', # c wrappers | ||
'src/helmholtz/h2dcommon.f', | ||
'src/helmholtz/h2dterms.f', | ||
'src/helmholtz/helmkernels2d.f', | ||
'src/helmholtz/helmrouts2d.f', | ||
'src/helmholtz/hfmm2d.f', | ||
'src/helmholtz/hfmm2d_mps.f', | ||
'src/helmholtz/hfmm2d_mps_ndiv.f', | ||
'src/helmholtz/hfmm2d_ndiv.f', | ||
'src/helmholtz/hfmm2dwrap.f', | ||
'src/helmholtz/hfmm2dwrap_vec.f', | ||
'src/helmholtz/hndiv2d.f', | ||
'src/helmholtz/wideband2d.f', | ||
|
||
# ./src/laplace | ||
'src/laplace/cauchykernels2d.f', | ||
'src/laplace/cfmm2d.f', | ||
'src/laplace/cfmm2d_ndiv.f', | ||
'src/laplace/cfmm2dwrap.f', | ||
'src/laplace/cfmm2dwrap_vec.f', | ||
'src/laplace/l2dterms.f', | ||
'src/laplace/lapkernels2d.f', | ||
'src/laplace/laprouts2d.f', | ||
'src/laplace/lfmm2d.f', | ||
'src/laplace/lfmm2d_ndiv.f', | ||
'src/laplace/lfmm2dwrap.f', | ||
'src/laplace/lfmm2dwrap_vec.f', | ||
'src/laplace/lndiv2d.f', | ||
'src/laplace/rfmm2d.f', | ||
'src/laplace/rfmm2d_ndiv.f', | ||
'src/laplace/rfmm2dwrap.f', | ||
'src/laplace/rfmm2dwrap_vec.f', | ||
'src/laplace/rlapkernels2d.f', | ||
|
||
# TODO: there's some code generation using happening with the | ||
# modified biharmonic kernel (commented out lines below). Look into | ||
# this later. | ||
|
||
# ./src/modified-biharmonic | ||
# 'src/modified-biharmonic/jinjaroot.yaml', | ||
# 'src/modified-biharmonic/jinjaroot.yaml.py', | ||
# 'src/modified-biharmonic/mbhfmm2d.f', | ||
# 'src/modified-biharmonic/mbhgreen2d.f', | ||
# 'src/modified-biharmonic/mbhkernels2d.f', | ||
# 'src/modified-biharmonic/mbhkernels2d.f.j2', | ||
# 'src/modified-biharmonic/mbhrouts2d.f', | ||
# 'src/modified-biharmonic/mbhrouts2d.f.j2', | ||
|
||
# ./src/stokes | ||
'src/stokes/stfmm2d.f', | ||
'src/stokes/stokkernels2d.f', | ||
] | ||
|
||
# TODO: set these the right way using meson instead of doing it manually... | ||
fmm2d_fortran_args = ['-fPIC', '-O3', '-march=native', '-funroll-loops', '-std=legacy', '-w'] | ||
fmm2d_c_args = ['-std=c99'] + fmm2d_fortran_args | ||
|
||
fmm2d_lib = library( | ||
'fmm2d', | ||
fmm2d_src, | ||
fortran_args : fmm2d_fortran_args, | ||
install : true | ||
) | ||
|
||
install_subdir('include/fmm2d', install_dir : 'include', install_tag : 'devel') | ||
|
||
pkg.generate(fmm2d_lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module c_helmholtz | ||
use iso_c_binding | ||
contains | ||
subroutine c_hfmm2d_s_c_p(eps, zk, ns, sources, charge, pot, ier) & | ||
bind(c, name='hfmm2d_s_c_p') | ||
implicit none | ||
real(c_double), value :: eps | ||
complex(c_double_complex), value, intent(in) :: zk | ||
integer(c_int64_t), value :: ns | ||
real(c_double), intent(in) :: sources(2, ns) | ||
complex(c_double_complex), intent(in) :: charge(ns) | ||
complex(c_double_complex), intent(out) :: pot(ns) | ||
integer(c_int64_t), intent(out) :: ier | ||
call hfmm2d_s_c_p(eps, zk, ns, sources, charge, pot, ier) | ||
end subroutine c_hfmm2d_s_c_p | ||
end module c_helmholtz |