Solving pde for geometry with concentric rings. Error: Invalid geometry detected. Edges overlap or intersect at non-end points.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Alan Weiss
am 27 Jun. 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
am 27 Jun. 2016
Please learn to use the "{} Code" button to designate code. I've done that for you here, once.
Antworten (2)
Ma Yalin
am 11 Aug. 2016
i have the same problem have no idea how to solve it......
1 Kommentar
antoine jury
am 28 Jun. 2017
From the gui it's possible if this script can help someone
Siehe auch
Kategorien
Mehr zu Geometry and Mesh finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!