What's wrong with my geometry definition that I have to mesh after?

6 views (last 30 days)
I can't get my geometry to mesh using MATLAB's mesher through the initmesh function. The error message is so brief that I can't identify the source of the error.
Here is the geometry definition :
%---------------- Geometric parameters ----------------------%
% Plate
Ep_plaque = 5e-3;
R_plaque = 20e-2;
% Coil
R_int_ind = 5e-2;
R_ext_ind = 15e-2;
Ep_ind = 2e-3;
Airgap = 2e-3;
% Airbox
R_air = 5*R_plaque;
H_air = 100*Ep_plaque;
% Plate
x1 = 0; y1 = 0;
x2 = R_plaque; y2 = 0;
x3 = R_plaque; y3 = Ep_plaque;
x4 = 0; y4 = Ep_plaque;
% Coil
x100 = R_int_ind; y100 = -Airgap-Ep_ind;
x101 = R_ext_ind; y101 = -Airgap-Ep_ind;
x102 = R_ext_ind; y102 = -Airgap;
x103 = R_int_ind; y103 = -Airgap;
% Air
x20 = 0; y20 = -H_air/2;
x21 = R_air; y21 = -H_air/2;
x22 = R_air; y22 = H_air/2;
x23 = 0; y23 = H_air/2;
% zone 1 : air
% zone 10 : plate
% zone 100 : coil
n_couches = 2;
Ep_layer = [5.2e-7 2.3e-6];
g_couche = [];
xs1 = R_plaque;
xs2 = 0;
xs3 = R_plaque;
xs4 = 0;
for i = 1:n_couches
ys1 = Ep_layer(i);
ys2 = ys1;
if i == 1
g_couche = [ g_couche ;
2 x1 x2 y1 y2 10 1 0 0 0;...
2 x2 xs1 y2 ys1 10 1 0 0 0;...
2 xs1 xs2 ys1 ys2 10 39 0 0 0;...
2 xs2 x1 ys2 y1 10 0 0 0 0;...
];
elseif i == n_couches
ys3 = Ep_layer(1);
ys4 = ys3;
g_couche= [ g_couche ;
2 xs3 xs1 ys3 ys1 39 1 0 0 0;...
2 xs1 xs2 ys1 ys2 39 50 0 0 0;...
2 xs2 xs4 ys2 ys4 39 0 0 0 0;...
] ;
end
end
g_plaque = [2 xs1 x3 ys1 y3 50 1 0 0 0; ...
2 x3 x4 y3 y4 50 1 0 0 0;...
2 x4 xs2 y4 ys2 50 0 0 0 0;...
];
g_ind_air = [2 x100 x101 y100 y101 100 1 0 0 0;...
2 x101 x102 y101 y102 100 1 0 0 0;...
2 x102 x103 y102 y103 100 1 0 0 0;...
2 x103 x100 y103 y100 100 1 0 0 0;...
2 x20 x21 y20 y21 1 0 0 0 0;...
2 x21 x22 y21 y22 1 0 0 0 0;...
2 x22 x23 y22 y23 1 0 0 0 0;...
2 x23 x4 y23 y4 1 0 0 0 0;...
2 x1 x20 y4 y20 1 0 0 0 0;...
];
g = [ g_couche.' g_ind_air.' g_plaque.'];
Here is how I call it and try to mesh it :
[p,e,t]=initmesh(g,'MesherVersion', 'R2013a');
Error using pdevoron
Geometry error.

Error in pderespe (line 30)
[p,t,c,h]=pdevoron(p,t,c,h,x,y,tol,Hmax,Hgrad);

Error in initmesh (line 166)
[p,e,t,c]=pderespe(g,p,e,t,c,Hmax,tol,tol2,Hmax,Hgrad);
You can visualize the geometry using :
pdegplot(g,'EdgeLabels','off');

Answers (1)

Govind KM
Govind KM on 7 Nov 2024
This error is usually caused by very small connected meshes or alignment issues within the geometry. More information on this error along with resolution steps can be found in the following MATLAB Answers post:

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!