Solving pde for geometry with concentric rings. Error: Invalid geometry detected. Edges overlap or intersect at non-end points.

9 次查看(过去 30 天)
Here is my code which defines a geometry of 6 concentric rings:
function rings_6x_1
model = createpde(1);
d1 = 6.2e-3;
d2 = 8.2e-3;
d3 = 8.3e-3;
d4 = 13.2e-3;
d5 = 13.4e-3;
d6 = 15.0e-3;
% Create 6 circles
C1 = [1 0 0 d1/2]';
C2 = [1 0 0 d2/2]';
C3 = [1 0 0 d3/2]';
C4 = [1 0 0 d4/2]';
C5 = [1 0 0 d5/2]';
C6 = [1 0 0 d6/2]';
% Combine the shapes into one matrix
gd = [C1,C2,C3,C4,C5,C6];
% Give names for the three shapes
ns = char('C1','C2','C3','C4','C5','C6');
ns = ns';
% Specify the concentric rings geometry
sf = 'C1+(C2-C1)+(C3-C2)+(C4-C3)+(C5-C4)+(C6-C5)';
% combines the basic shapes using the set formula
%[dl,bt] = decsg(gd,sf,ns);
g = decsg(gd,sf,ns);
% View the geometry
figure;
geometryFromEdges(model,g);
pdegplot(model,'EdgeLabels','on')
xlim([-d6,d6])
axis equal
hmax = .1; % element size
msh = generateMesh(model,'Hmax',hmax);
figure;
pdeplot(model);
end
The mesh generator produces the following error:
Error using rings_6x_1 (line 39)
Invalid geometry detected. Edges overlap or intersect at non-end points.
Am I doing something wrong or this is a bug? how can I go around?

回答(2 个)

Ma Yalin
Ma Yalin 2016-8-11
i have the same problem have no idea how to solve it......

Alan Weiss
Alan Weiss 2017-6-28
I believe that this answer will fix your problems. Sorry, I do believe that this is likely a bug.
Alan Weiss
MATLAB mathematical toolbox documentation

类别

Help CenterFile Exchange 中查找有关 Geometry and Mesh 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by