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

2 ビュー (過去 30 日間)
Alexander
Alexander 2016 年 6 月 27 日
回答済み: Alan Weiss 2017 年 6 月 28 日
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 件のコメント
Alan Weiss
Alan Weiss 2016 年 6 月 27 日
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 2016 年 6 月 27 日
Please learn to use the "{} Code" button to designate code. I've done that for you here, once.

サインインしてコメントする。

回答 (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 Center および File ExchangeGeometry and Mesh についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by