Solving pde for geometry with concentric rings. Error: Invalid geometry detected. Edges overlap or intersect at non-end points.
조회 수: 2 (최근 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
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
2016년 6월 27일
Please learn to use the "{} Code" button to designate code. I've done that for you here, once.
답변 (2개)
Ma Yalin
2016년 8월 11일
i have the same problem have no idea how to solve it......
댓글 수: 1
antoine jury
2017년 6월 28일
From the gui it's possible if this script can help someone
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!