2 % flatpak run org.octave.Octave <filename>
4 % octave --no-window-system --no-gui -qf <filename>
9 %
g=[2 0 2 0 0 1 0; % #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
17 % g=[2 0 1 0 0 1 0; % #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
23 %
g=[2 0 1 0 0 1 0; % 1 #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
27 % 2 1 2 0 0 2 0; % 2 #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
33 g=[2 0 1 0 0 1 0; % 1 #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
37 2 1 2 0 0 2 0; % 2 #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
41 % 2 0 1 1 1 3 1; % 3 #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
45 % 2 1 2 1 1 4 2; % 4 #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
53 [p,e,t] = initmesh(
g,
'hmax',1); % works correctly
54 %
p(1,15) = 1.51; %% angle in trangle >
pi/2 ==> now the second refinement produces irregular meshes!
55 %
p(1,15) = 1.7; %% angle in trangle >
pi/2 ==> now the second refinement produces irregular meshes!
62 % [p,e,t] = initmesh(
g); % problems in solution after 2
refinements
63 % [p,e,t] = initmesh(
g,
'hmax',0.5); % problems in solution after 2
refinements (peaks with
h=0.5, oscillations in (1,1)
for h=0.1
64 % [
p,
e,
t] = initmesh(
g,
'hmax',0.1/4); % no problems in solution with 0 refinemnet steps
68 % pdemesh(
p,
e,
t,
'NodeLabels',
'on')
72 %
p = jigglemesh(
p,
e,
t,
'opt',
'minimum',
'iter',inf);
76 %% Refine mesh, see comments in
"Generate mesh from geometry"
81 [p,e,t] = refinemesh(
g,
p,
e,
t);
82 %
p = jigglemesh(
p,
e,
t,
'opt',
'minimum',
'iter',inf); % improve mesh
86 % figure; pdemesh(
p,
e,
t,'NodeLabels','on')
92 % coordinates
p: [2][
nnode]
94 % edges
e: [7][nedges] boundary edges
95 %
e([1,2],:) - start/
end vertex of edge
96 %
e([3,4],:) - start/
end values
97 %
e(5,:) - segment number
98 %
e([6,7],:) - left/right subdomain