Skip to content

Commit

Permalink
Merge branch 'pre-0.1.5' into master.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehkropf committed Aug 23, 2016
2 parents b4a3904 + eef84dd commit 7fb3356
Show file tree
Hide file tree
Showing 56 changed files with 3,009 additions and 308 deletions.
10 changes: 5 additions & 5 deletions +PoDoc/DefinedTerms.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function greensC0(do)
function thetaj(do)
do.addln(...
['the mobius transformation ', ...
do.eqInline('\theta_j(\zeta)'), ' w.r.t. circle ', ...
do.eqInline('C_j'), ' by'])
do.eqInline('\theta_j(\zeta)'), ' w.r.t. circles ', ...
do.eqInline('\{C_j:j=1,\dots,m\}'), ' by'])
do.addln(do.eqDisplay(...
['\theta_j(\zeta) = \delta_j + \frac{q_j^2\zeta}', ...
'{1 - \overline{\delta_j}\zeta}']))
Expand All @@ -57,14 +57,14 @@ function thetaj(do)
function greensCj(do)
PoDoc.DefinedTerms.thetaj(do)
do.addln(...
['the modified Green''s function with respect to circle ', ...
do.eqInline('C_j'), ' as'])
['the modified Green''s function with respect to circles ', ...
do.eqInline('\{C_j:j=1,\dots,m\}'), ' as'])
do.addln(do.eqDisplay(...
['G_j(\zeta,\alpha,\overline{\alpha}) = ' ...
'\frac{1}{2\pi\mathrm{i}}\log \left[ ' ...
'\frac{q_j}{|\alpha - \delta_j|}', ...
'\frac{\omega(\zeta,\alpha)}' ...
'{\omega(\zeta,1/\overline{\alpha})} \right]']))
'{\omega(\zeta,\theta_j(1/\overline{\alpha}))} \right]']))
end

function firstKindIntegral(do)
Expand Down
2 changes: 1 addition & 1 deletion +PoTk/Evaluable.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
% You should have received a copy of the GNU General Public License
% along with PoTk. If not, see <http://www.gnu.org/licenses/>.

methods
methods(Abstract)
v = feval(obj, z)
end

Expand Down
52 changes: 52 additions & 0 deletions +PoTk/boundaryPartMake.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
function r = boundaryPartMake(domain, f0, f1)
% Specify different boundary conditions on unit disk c0 the other disks c_k, k > 0.

% Everett Kropf, 2016
% Rhodri Nelson, 2016
%
% This file is part of the Potential Toolkit (PoTk).
%
% PoTk is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% PoTk is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with PoTk. If not, see <http://www.gnu.org/licenses/>.

%boundaryPartMake makes a function to evaluate points on the boundary from
%a list of functions.
%
% r = boundaryPartMake(domain, f0, f1, ..., fm)
% Takes a list of functions and returns a function r which is restricted to
% the boundary. The function r gives f0 values for points on C0, f1 values
% for points on C1, etc., up to fm values for points on Cm.

% Everett Kropf, 2016

if ~isa(domain, 'skpDomain')
error('First argument must be an "skpDomain" object.')
end

if ~all(cellfun(@(x) isa(x, 'function_handle'), {f0, f1}))
error('Expected a list of function handles following the domain.')
end

function v = reval(z)
v = nan(size(z));
[~, onj] = ison(domain, z);
v(onj==0)=f0(z(onj==0));
for j = 1:domain.m
ix = onj == j;
v(ix) = f1(z(ix));
end
end

r = @reval;

end
128 changes: 128 additions & 0 deletions +PoTk/uniformFlowBVP.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
classdef uniformFlowBVP < bvpFun
% Boundary value problem for a uniform flow.

% Everett Kropf, 2016
% Rhodri Nelson, 2016
%
% This file is part of the Potential Toolkit (PoTk).
%
% PoTk is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% PoTk is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with PoTk. If not, see <http://www.gnu.org/licenses/>.

properties(SetAccess=protected)
parameter

ufa
singCorrFact
normConstant = 0
end

methods
function guf = uniformFlowBVP(beta, U, kai, a, D)
if ~nargin
sargs = {};
else
if nargin > 5
sargs = {D, N};
else
sargs = {D};
end
end

guf = guf@bvpFun(sargs{:});
if ~nargin
return
end

guf.parameter = skpParameter(beta, guf.domain);
beta = guf.parameter;
if ~beta.inUnitDomain
error('SKPrime:InvalidArgument', ...
'Parameter must have magnitude <= 1.')
end

if ~isempty(beta.ison) && beta.ison == 0
% Beta on the unit circle means.
ufb = @(z) ...
0.5*U*(a*exp(-1i*kai)*(1./(z-beta)+0.5./beta) ...
-conj(a)*exp(1i*kai)*(1./(conj(beta)^2*(z-1./conj(beta)))+0.5./conj(beta)));
elseif ~isempty(beta.ison) && beta.ison > 0
error('SKPrime:UndefinedState', ...
'The case beta on inner boundary not implemented.')
elseif beta == 0
error('SKPrime:UndefinedState', ...
'The case beta == 0 not yet implemented.')
else
ufb = @(z) ...
U*(a*exp(-1i*kai)*(1./(z-beta)+0.5./beta) ...
-conj(a)*exp(1i*kai)*(1./(conj(beta)^2*(z-1./conj(beta)))+0.5./conj(beta)));
end
guf.ufa = ufb;

if guf.domain.m == 0
% Nothing more to do.
return
end

% Known part on the boundary.
if ~isempty(beta.ison) && beta.ison == 0
f0 = @(z) 0.0;
f1 = @(z) -imag(ufb(z));
% Note the boundary function that comes back takes care of deciding if a
% given point is on a boundary or not, and what boundary it is on. (Really
% handled in the skpDomain class code.)
ha = PoTk.boundaryPartMake(D, f0, f1);
else
ha = @(z) -imag(ufb(z));
end

% Solve for unknown part on the boundary.
% TO DO: Add case when beta is on aboundary
guf.phiFun = solve(guf.phiFun, ha);

% Boundary function and Cauchy interpolant.
guf.boundaryFunction = @(z) guf.phiFun(z) + 1i*ha(z);
guf.continuedFunction = SKP.bmcCauchy(...
guf.boundaryFunction, guf.domain, 2*guf.truncation);

end

function dgufh = diffh(guf,n)

if nargin < 2
n = 1;
end

dgufh = dftDerivative(guf, @guf.hat, n);

end

function v = feval(guf, z)
%provides function evaluation for the Green's function.

v = guf.ufa(z) + guf.hat(z);
end

function v = hat(guf, z)
%evaluate the "analytic" part of the function.

if guf.domain.m == 0
v = complex(zeros(size(z)));
return
end

v = bvpEval(guf, z);
end
end

end
Loading

0 comments on commit 7fb3356

Please sign in to comment.