Skip to content

Commit

Permalink
Merge branch 'main' of github.com:flatironinstitute/fmm2d
Browse files Browse the repository at this point in the history
  • Loading branch information
mrachh committed Jun 10, 2023
2 parents 4e2f6a4 + e43f6f8 commit 1da75f6
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ jobs:
path: wheelhouse/*.whl

MacOS:
runs-on: macos-latest
runs-on: macos-11
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_DEPLOYMENT_TARGET: 10.9

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ int2
*.mex*
*debug*
*~
lib-static/*.a
lib-static/*.a
GPATH
GRTAGS
GTAGS
14 changes: 14 additions & 0 deletions include/fmm2d/helmholtz.h
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
95 changes: 95 additions & 0 deletions meson.build
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)
16 changes: 16 additions & 0 deletions src/helmholtz_c.f03
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

0 comments on commit 1da75f6

Please sign in to comment.