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

9 visualizaciones (últimos 30 días)
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 comentarios
Alan Weiss
Alan Weiss el 27 de Jun. de 2016
Please mark your code sections with the {} Code button to help us read it more easily.
Alan Weiss
MATLAB mathematical toolbox documentation
John D'Errico
John D'Errico el 27 de Jun. de 2016
Please learn to use the "{} Code" button to designate code. I've done that for you here, once.

Iniciar sesión para comentar.

Respuestas (2)

Ma Yalin
Ma Yalin el 11 de Ag. de 2016
i have the same problem have no idea how to solve it......

Alan Weiss
Alan Weiss el 28 de Jun. de 2017
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

Community Treasure Hunt

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

Start Hunting!

Translated by