2016-02-19 4 views
0

У меня есть вопрос о Matlab сетки поколений:Matlab ошибка: pdelib: initmesh: LargeMesh

  1. Как управлять размером OFTHE сетки в Matlab?
  2. Что я могу сделать, чтобы обход этой ошибки?

Сообщение об ошибке

Error using message 
Error filling holes for pdelib:initmesh:LargeMesh. Floating point numbers are not 
allowed as holes. They should be converted to strings. 

Error in initmesh (line 135) 
    fprintf(['\n' message('pdelib:initmesh:LargeMesh', ntg).getString() '\n']); 

Error in pdegplot>plotTwoDGeometry (line 112) 
     [p1,~,t1]=initmesh(g,'hmax',0.1,'init','on', 'MesherVersion','R2013a'); 

Error in pdegplot (line 73) 
     hh = plotTwoDGeometry(g.geom, plotEdgeNums, plotSubLabels); 

Error in test_ellips_10 (line 102) 
pdegplot(model,'EdgeLabels','on','SubdomainLabels','on') 

Эта ошибка генерируется Matlab R2015b, когда следующий код запускается:

% Rectangle R1 
R1_x1 = 0; 
R1_x2 = 3810; 
R1_y1 = 0; 
R1_y2 = 6800; 

% Rectangle R2 
R2_x1 = (3810/4); 
R2_x2 = (3*3810/4); 
R2_y1 = (6800+3810/4); 
R2_y2 = 6800; 

% Rectangle R5 
R5_x1 = (3810/4); 
R5_x2 = (3*3810/4); 
R5_y1 = 0; 
R5_y2 = -(3810/4); 

% Rectangle R3 
R3_x1 = (3810/2-75); 
R3_x2 = (3810/2+75); 
R3_y1 = (6800+3810/4+100); 
R3_y2 = (6800+3810/4); 

% Rectangle R4 
R4_x1 = (3810/2-75); 
R4_x2 = (3810/2+75); 
R4_y1 = -3810/4; 
R4_y2 = -(3810/4+100); 

% Ellipse E1 
% pdeellip(xc,yc,a,b,phi,label) 
E1_xc = 3810/4; 
E1_yc = 6800; 
E1_a = 3810/4; 
E1_b = 3810/4; 
E1_phi = 0; 

% Ellipse E2 
% pdeellip(xc,yc,a,b,phi,label) 
E2_xc = 3*3810/4; 
E2_yc = 6800; 
E2_a = 3810/4; 
E2_b = 3810/4; 
E2_phi = 0; 

% Ellipse E3 
% pdeellip(xc,yc,a,b,phi,label) 
E3_xc = 3810/4; 
E3_yc = 0; 
E3_a = 3810/4; 
E3_b = 3810/4; 
E3_phi = 0; 

% Ellipse E4 
% pdeellip(xc,yc,a,b,phi,label) 
E4_xc = 3*3810/4; 
E4_yc = 0; 
E4_a = 3810/4; 
E4_b = 3810/4; 
E4_phi = 0; 

model = createpde(1); 
% Rectangle is code 3, 4 sides, 
% followed by x-coordinates and then y-coordinates 
R1 = [3, 4, R1_x1,R1_x2,R1_x2, R1_x1, R1_y1, R1_y1, R1_y2, R1_y2]'; 
R1 = [3, 4, R1_x1,R1_x2,R1_x2, R1_x1, R1_y1, R1_y1, R1_y2, R1_y2]'; 
R2 = [3, 4, R2_x1,R2_x2,R2_x2, R2_x1, R2_y1, R2_y1, R2_y2, R2_y2]'; 
R3 = [3, 4, R3_x1,R3_x2,R3_x2, R3_x1, R3_y1, R3_y1, R3_y2, R3_y2]'; 
R4 = [3, 4, R4_x1,R4_x2,R4_x2, R4_x1, R4_y1, R4_y1, R4_y2, R4_y2]'; 
R5 = [3, 4, R5_x1,R5_x2,R5_x2, R5_x1, R5_y1, R5_y1, R5_y2, R5_y2]'; 
% Ellipse is code 1, center (E1_x,E1_y), First semiaxis length (strictly positive),Second semiaxis length (strictly positive),Angle in radians from x axis to first semiaxis 
E1 = [4,E1_xc,E1_yc,E1_a,E1_b,E1_phi]'; 
E2 = [4,E2_xc,E2_yc,E2_a,E2_b,E2_phi]'; 
E3 = [4,E3_xc,E3_yc,E3_a,E3_b,E3_phi]'; 
E4 = [4,E4_xc,E4_yc,E4_a,E4_b,E4_phi]'; 

% Pad E1 with zeros to enable concatenation with R1 
E1 = [E1;zeros(length(R1) - length(E1),1)]; 
E2 = [E2;zeros(length(R1) - length(E2),1)]; 
E3 = [E3;zeros(length(R1) - length(E3),1)]; 
E4 = [E4;zeros(length(R1) - length(E4),1)]; 

% Combine the shapes into one matrix 
geom = [R1,R2,R3,R4,R5,E1,E2,E3,E4]; 
% Names for the geometric objects 
ns = (char('R1','R2','R3','R4','R5','E1','E2','E3','E4')); 
ns = ns'; 
% Set formula 
sf = 'R1+R2+R3+R4+R5+E1+E2+E3+E4'; 
% Create geometry 
DL=decsg(geom,sf,ns); 

% Check model 
% If all elements of 0 geometry is OK 
gstat=csgchk(geom); 

% Include the geometry in the model 
geometryFromEdges(model,DL); 

% View geometry 
pdegplot(model,'EdgeLabels','on','SubdomainLabels','on') 
xlim('auto') 
ylim('auto') 
axis equal 

generateMesh(model,'Hgrad',1.3,'Hmax',10,'Box','on','Init','on','jiggle','on','MesherVersion','R2013a'); 
pdeplot(model) 
+0

поддержка ответа Mathwork, что это ошибка в среде MATLAB. Чтобы исправить, вам нужно исправить pdeplot: >> edit pdegplot отредактировать строку 112 [p1, ~, t1] = initmesh (g, 'hmax', 0,1, 'init', 'on', 'MesherVersion', 'R2013a «); измените его на [p1, ~, t1] = initmesh (g, 'init', 'on', 'MesherVersion', 'R2013a'); – vserge

ответ

0

поддержка ответ Mathwork, что это ошибка в среде MATLAB. Чтобы исправить вам нужно исправить pdeplot:

>>edit pdegplot 

редактировать линия 112

[p1,~,t1]=initmesh(g,'hmax',0.1,'init','on', 'MesherVersion','R2013a'); 

изменить его

[p1,~,t1]=initmesh(g,'init','on', 'MesherVersion','R2013a');