Skip to content

Commit 904da56

Browse files
committed
simplifying pquadTest, used to bomb (too much memory) on smaller machines
1 parent b26fa64 commit 904da56

File tree

1 file changed

+8
-49
lines changed

1 file changed

+8
-49
lines changed

devtools/test/pquadTest.m

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
1-
%DEMO_BARBELL_2
2-
%
3-
% Define a polygonal "barbell" shaped domain with
4-
% prescribed constant boundary data on each edge.
5-
% Solves the corresponding Helmholtz Dirichlet problem
6-
% using corner rounding and smoothing the boundary data
7-
% across the rounded corners
8-
%
9-
10-
% profile clear
11-
% profile on
12-
13-
clearvars; close all;
14-
iseed = 8675309;
15-
rng(iseed,'twister');
16-
addpaths_loc();
17-
1+
% testing product quadrature rule
182
% planewave vec
193

204
kvec = 10*[1;-1.5];
@@ -25,35 +9,10 @@
259

2610
% define geometry and boundary conditions
2711
% (vertices defined by another function)
28-
verts = chnk.demo.barbell(2.0,2.0,1.0,1.0);
29-
nv = size(verts,2);
30-
edgevals = randn(1,nv);
31-
32-
% parameters for curve rounding/chunking routine to oversample boundary
33-
cparams = [];
34-
cparams.widths = 0.1*ones(size(verts,2),1);% width to cut about each corner
35-
cparams.eps = 1e-12; % tolerance at which to resolve curve
36-
cparams.rounded = true;
37-
38-
% call smoothed-polygon chunking routine
39-
% a smoothed version of edgevals is returned in
40-
% chnkr.data
41-
chnkr = chunkerpoly(verts,cparams,[],edgevals);
42-
chnkr = refine(chnkr,struct('nover',1));
43-
%
44-
% plot smoothed geometry and data
4512

46-
figure(1)
47-
clf
48-
plot(chnkr,'-x')
49-
hold on
50-
quiver(chnkr)
51-
axis equal
52-
53-
figure(2)
54-
clf
55-
nchplot = 1:chnkr.nch;
56-
plot3(chnkr,1)
13+
cparams = []; cparams.eps = 1e-9;
14+
chnkr = chunkerfunc(@(t) starfish(t),cparams);
15+
chnkr = refine(chnkr,struct('nover',1));
5716

5817
% solve and visualize the solution
5918

@@ -111,9 +70,9 @@
11170
fprintf('%5.2e s : time for kerneval (adaptive for near)\n',t1);
11271

11372
% Compare with reference solution Dsol
114-
error = max(abs(Csol-Csolpquad))/max(abs(Csol));
115-
fprintf('%5.2e : Relative max error\n',error);
73+
rel_error = max(abs(Csol-Csolpquad))/max(abs(Csol));
74+
fprintf('%5.2e : Relative max error\n',rel_error);
11675
%
11776

118-
assert(error < 1e-10)
119-
% profile viewer
77+
assert(rel_error < 1e-10)
78+
% profile viewer

0 commit comments

Comments
 (0)