-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pre-0.1.5' into master.
- Loading branch information
Showing
56 changed files
with
3,009 additions
and
308 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
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,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 |
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,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 |
Oops, something went wrong.