Skip to content

Commit e7b3bfc

Browse files
authored
Merge pull request #116 from fastalgorithms/docs
Docs
2 parents 8c84d9d + f969912 commit e7b3bfc

33 files changed

+1235
-72
lines changed

chunkie/+chnk/+helm2d/transmission_helper.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@
8484
ncurve = length(chnkrs);
8585
sources = cell(1,ncurve);
8686
charges = cell(1,ncurve);
87-
exposed_curves = ones(1,ncurve);
87+
88+
exposed_curves = (cs(1,:)==1) -(cs(2,:)==1);
89+
8890
for i=1:ncurve
8991
sources{i} = zeros(2,1);
9092
charges{i} = 0 + 1j*0;

chunkie/@chunker/merge.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
w = chnkrs(1).wstor;
2929
chnkrout = chunker(pref,t,w);
3030

31-
for i = 1:length(chnkrs)
31+
for i = 1:numel(chnkrs)
3232
chnkrtemp = chnkrs(i);
3333
assert(chnkrtemp.dim == chnkrout.dim && chnkrtemp.k == chnkrout.k,...
3434
'chunkers to merge must be in same dimension and same order');

chunkie/@chunkgraph/chunkgraph.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
% obj = refine(obj,varargin) - refine the curve
5959
% wts = weights(obj) - scaled integration weights on curve
6060
% rn = normals(obj) - recompute normal vectors
61+
% flag = flagnear(obj,pts) - find points close to the chunkgraph
62+
% flag = flagnear_rectangle(obj,pts) - find points close to chunkgraph
63+
% using bounding rectangles
64+
% flag = flagnear_rectangle_grid(obj,x,y) - find points defined via
65+
% a meshgrid of points that are close to the chunkgraph
6166
% obj = obj.move(r0,r1,trotat,scale) - translate, rotate, etc
6267
% rmin = min(obj) - minimum of coordinate values
6368
% rmax = max(obj) - maximum of coordinate values
@@ -70,9 +75,8 @@
7075
% kappa = signed_curvature(obj) - get signed curvature along curve
7176
% obj = makedatarows(obj,nrows) - add nrows rows to the data storage.
7277
% rflag = datares(obj,opts) - check if data in data rows is resolved
73-
%
74-
% To add:
75-
% flagnear
78+
% edge_reg = find_regions_of_edges(obj) - determine regions on either
79+
% side of each edge
7680
%
7781
% Syntax:
7882
%
@@ -418,6 +422,7 @@
418422
obj = makedatarows(obj, nrows)
419423
scatter(obj, varargin)
420424
rres = datares(obj, opts)
425+
edge_regs = find_edge_regions(obj)
421426

422427

423428
end
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
function edge_regs = find_edge_regions(obj)
2+
%FIND_EDGE_REGIONS find regions on either side of the edges
3+
% in a chunkgraph.
4+
%
5+
% Syntax: edge_regs = find_edge_regions(obj)
6+
%
7+
% Input:
8+
% obj - chunkgraph object describing curve
9+
%
10+
% Output:
11+
% edge_regs - (2,nedge) array where nedges
12+
% is the number of edges in the chunkgraph.
13+
% edge_reg(1,i) is index of the region in which the
14+
% normal to edge i is pointing and edge_reg(2,i)
15+
% is the index corresponding to the negative of
16+
% the normal.
17+
%
18+
% author: Tristan Goodwill
19+
20+
21+
edge_regs = zeros(2,size(obj.edgesendverts,2));
22+
nreg = length(obj.regions);
23+
for i = 1:nreg
24+
id_edge = obj.regions{i}{1};
25+
edge_regs(1,id_edge(id_edge>0)) = i;
26+
edge_regs(2,-id_edge(id_edge<0)) = i;
27+
end
28+
end

chunkie/@kernel/elast2d.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
%
3131
% See also CHNK.ELAST2D.KERN
3232

33+
% author : Dan Fortunato, Travis Askham, Manas Rachh
34+
3335
if ( nargin < 1 )
3436
error('Missing elasticity kernel type.');
3537
end

chunkie/@kernel/helm2d.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
% COEFS(2)*KERNEL.HELM2D('sp', ZK).
2121
% See also CHNK.HELM2D.KERN.
2222

23+
% author: Dan Fortunato
24+
2325
if ( nargin < 1 )
2426
error('Missing Helmholtz kernel type.');
2527
end

chunkie/@kernel/kernel.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@
4848
% single source and target, respectively. For scalar kernels,
4949
% opdims = [1 1].
5050
%
51+
% - K.sing: a string/character array specifying the singularity
52+
% strength of the kernel for sources and targets which are on
53+
% the same curve. Currently recognized singularities are considered
54+
% as part of a hierarchy
55+
% - 'smooth' a smooth integral kernel
56+
% - 'log' sum of above type kernel and phi(s)log(s-t)
57+
% - 'pv' sum of above type kernels and phi(s)/(s-t)
58+
% - 'hs' sum of above type kernels and phi(s)/(s-t)^2
59+
%
5160
% - K.fmm: A function handle which calls the FMM for the corresponding
5261
% kernel. K.fmm(eps, s, t, sigma) evaluates the kernel with density
5362
% sigma from sources s to targets t with accuracy eps.

chunkie/@kernel/stok2d.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555

5656
% See also CHNK.STOK2D.KERN.
5757

58+
% author: Dan Fortunato
59+
5860
if ( nargin < 1 )
5961
error('Missing Stokes kernel type.');
6062
end

chunkie/demo/demo_Neumann_combined.m

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
rado = 5;
1919
for i = 1:narms
2020
verts(:,2*i-1) = radi*[real(rots(i));imag(rots(i))];
21-
verts(:,2*i ) = rado*[real(rots(i));imag(rots(i))];
21+
verts(:,2*i) = rado*[real(rots(i));imag(rots(i))];
2222
end
2323
nverts = size(verts,2);
2424
edge2verts = [1:nverts;circshift(1:nverts,-1)];
@@ -28,27 +28,18 @@
2828
frq = 5;
2929

3030
% define curve for each edge
31-
fchnks = {};
31+
fchnks = cell(2*narms,1);
3232
for i = 1:narms
3333
% odd edges are straight
3434
fchnks{2*i-1} = [];
3535
% even edges are curved
36-
fchnks{2*i } = @(t) sinearc(t,amp,frq);
36+
fchnks{2*i} = @(t) sinearc(t,amp,frq);
3737
end
3838

3939
cparams = [];
4040
cparams.maxchunklen = min(4.0/zk,.5);
4141
[cgrph] = chunkgraph(verts,edge2verts,fchnks,cparams);
4242

43-
44-
% plot
45-
figure(1);clf
46-
plot(cgrph)
47-
% hold on
48-
% quiver(cgrph)
49-
% hold off
50-
axis equal
51-
5243
%% Define system
5344

5445
% define kernels
@@ -74,6 +65,8 @@
7465
c3*Sik Z Z ;
7566
c3*Sikp Z Z ];
7667
K = kernel(K);
68+
69+
7770
Keval = c1*kernel([Sk 1i*alpha*Dk Z]);
7871

7972
npts = cgrph.npt;
@@ -132,6 +125,8 @@
132125
plot(cgrph,'k')
133126
axis equal
134127
title('$u^{\textrm{tot}}$','Interpreter','latex','FontSize',12)
128+
% END DEMO NEUMANN COMBINED
129+
saveas(figure(2),"demo_neumann_combined_plot.png")
135130

136131

137132
function [r,d,d2] = sinearc(t,amp,frq)
65.8 KB
Loading

0 commit comments

Comments
 (0)