From 7dc84a38c38308f3c90de9e2a4efd1739d93b073 Mon Sep 17 00:00:00 2001 From: Travis Askham Date: Tue, 17 Sep 2024 12:35:02 -0400 Subject: [PATCH] fixes bug in fmm name and other issues for prime kernels --- chunkie/+chnk/+helm2d/fmm.m | 4 ++-- chunkie/+chnk/+lap2d/fmm.m | 6 +++++- chunkie/@kernel/lap2d.m | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/chunkie/+chnk/+helm2d/fmm.m b/chunkie/+chnk/+helm2d/fmm.m index 4a50233..9e4a706 100644 --- a/chunkie/+chnk/+helm2d/fmm.m +++ b/chunkie/+chnk/+helm2d/fmm.m @@ -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); @@ -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); diff --git a/chunkie/+chnk/+lap2d/fmm.m b/chunkie/+chnk/+lap2d/fmm.m index 1e3ddc3..611e21a 100644 --- a/chunkie/+chnk/+lap2d/fmm.m +++ b/chunkie/+chnk/+lap2d/fmm.m @@ -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 @@ -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); diff --git a/chunkie/@kernel/lap2d.m b/chunkie/@kernel/lap2d.m index 86233dc..e7317bd 100644 --- a/chunkie/@kernel/lap2d.m +++ b/chunkie/@kernel/lap2d.m @@ -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'}