Skip to content

Commit

Permalink
Merge pull request #93 from fastalgorithms/patch-kernel-fmm-bad-name-fix
Browse files Browse the repository at this point in the history
fixes bug in fmm name and other issues for prime kernels
  • Loading branch information
mrachh authored Sep 18, 2024
2 parents 60c7369 + 7dc84a3 commit a32d935
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions chunkie/+chnk/+helm2d/fmm.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
pg = 0;
pgt = min(nargout, 2);
switch lower(type)
case {'sprime', 'dprime', 'cprime'}
case {'sprime', 'dprime', 'cprime','sp','dp','cp'}
pgt = max(pgt, 2);
end
U = hfmm2d(eps, zk, srcuse, pg, targuse, pgt);
Expand All @@ -89,7 +89,7 @@
switch lower(type)
case {'s', 'd', 'c'}
varargout{1} = U.pottarg.';
case {'sprime', 'dprime', 'cprime'}
case {'sprime', 'dprime', 'cprime','sp','dp','cp'}
if ( ~isfield(targinfo, 'n') )
error('CHUNKIE:helm2d:fmm:normals', ...
'Targets require normal info when evaluating Helmholtz kernel ''%s''.', type);
Expand Down
6 changes: 5 additions & 1 deletion chunkie/+chnk/+lap2d/fmm.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@

pg = 0;
pgt = min(nargout, 3);
switch lower(type)
case {'sprime', 'dprime', 'cprime','sp','dp','cp'}
pgt = max(pgt, 2);
end
U = rfmm2d(eps, srcuse, pg, targuse, pgt);

% Assign potentials
Expand All @@ -85,7 +89,7 @@
varargout{1} = U.pottarg.';
case 'sgrad'
varargout{1} = U.gradtarg;
case {'sprime', 'dprime'}
case {'sprime', 'dprime','cprime','sp','dp','cp'}
if ( ~isfield(targinfo, 'n') )
error('CHUNKIE:lap2d:fmm:normals', ...
'Targets require normal info when evaluating Laplace kernel ''%s''.', type);
Expand Down
6 changes: 3 additions & 3 deletions chunkie/@kernel/lap2d.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@
case {'sp', 'sprime'}
obj.type = 'sp';
obj.eval = @(s,t) chnk.lap2d.kern(s, t, 'sprime');
obj.fmm = @(eps,s,t,sigma) chnk.lap.fmm(eps, s, t, 'sprime', sigma);
obj.fmm = @(eps,s,t,sigma) chnk.lap2d.fmm(eps, s, t, 'sprime', sigma);
obj.sing = 'smooth';

case {'st', 'stau'}
obj.type = 'st';
obj.eval = @(s,t) chnk.lap2d.kern(s, t, 'stau');
obj.fmm = @(eps,s,t,sigma) chnk.lap.fmm(eps, s, t, 'stau', sigma);
obj.fmm = @(eps,s,t,sigma) chnk.lap2d.fmm(eps, s, t, 'stau', sigma);
obj.sing = 'pv';

case {'dp', 'dprime'}
obj.type = 'dp';
obj.eval = @(s,t) chnk.lap2d.kern(s, t, 'dprime');
obj.fmm = @(eps,s,t,sigma) chnk.lap.fmm(eps, s, t, 'dprime', sigma);
obj.fmm = @(eps,s,t,sigma) chnk.lap2d.fmm(eps, s, t, 'dprime', sigma);
obj.sing = 'hs';

case {'sg', 'sgrad'}
Expand Down

0 comments on commit a32d935

Please sign in to comment.