<p> </p><p> </p><p> </p><p>Dear Gmshers, </p><p>I'm
trying to generate a revolution solid from a cosine function profile and
sequential 2D surface meshing. Although I could get to the
surface after a rotation around the x-axis with the
'Extrude' command, Gmsh returns an error if I try to mesh
this "apparently closed" resulting solid.</p><p>My
insight is that there's a problem with
overlapped entities after the 2*pi rotation, however I
can't get rid of the error. I tried a full rotation of 2*pi and 4 partial
rotations of pi/2 with the same profile, but
both the strategies haven't work,
while non-overlapping angles ( < 2*pi) have produced the
expected mesh.</p><p>Could someone help me
to understand what's going wrong and how can I have the mesh working?
Or maybe an alternative way. The .geo
is like below. </p><p>Thankfully,</p>
<div>
</div>
<div>
/* Defaults */</div>
<div>
Geometry.Surfaces = 1; //</div>
<p> </p><p> </p><p> </p>
<div>
</div>
<div>
/* Settings */ </div>
<div>
x0 = 0.0;</div>
<div>
y0 = 0.0;</div>
<div>
z0 = 0.0;</div>
<div>
c1 = 0.05;</div>
<div>
amp = 0.05; </div>
<div>
r1 = 0.5*amp; </div>
<div>
t0 = 2.0;</div>
<div>
R0 = 0.5;</div>
<div>
lambda = 2*R0;</div>
<div>
L = lambda;</div>
<div>
</div>
<div>
/* Discretization */</div>
<div>
np = 10;</div>
<div>
nt = 10;</div>
<div>
dx = L/(np - 1);</div>
<div>
Geometry.ExtrudeSplinePoints = nt;</div>
<div>
</div>
<div>
// initial point</div>
<div>
X[0] = x0 - lambda/2;</div>
<div>
Y[0] = y0 + r1;</div>
<div>
P0 = newp;</div>
<div>
P[0] = P0;</div>
<div>
Point(P0) = {X[0],Y[0],z0,c1};</div>
<div>
</div>
<div>
// 'revolution' profile </div>
<div>
For p In {1:np-1}</div>
<div>
X[p] = X[0] + p*dx;</div>
<div>
Y[p] = Y[0] + amp*Sinh(t0)*(1.0 + Cos(2*Pi*X[p]/lambda) );</div>
<div>
Pp = newp;</div>
<div>
Point(Pp) = {X[p],Y[p],z0,c1};</div>
<div>
P[p] = Pp;</div>
<div>
L = newl;</div>
<div>
Line(L) = {P[p-1],P[p]};</div>
<div>
extr[] = Extrude{ {0,0,0}, {1,0,0}, {0,0,0}, 2*Pi }{ Line{L};};</div>
<div>
EndFor</div>
<div>
</div>
<div>
/* Same profiles adapted for partial pi/2 revolution </div>
<div>
Y[0] = y0 - r1;</div>
<div>
P0 = newp;</div>
<div>
P[0] = P0;</div>
<div>
Point(P0) = {X[0],Y[0],z0,c1};</div>
<div>
</div>
<div>
For p In {1:np-1}</div>
<div>
X[p] = X[0] + p*dx;</div>
<div>
Y[p] = Y[0] - amp*Sinh(t0)*(1.0 + Cos(2*Pi*X[p]/lambda) );</div>
<div>
Pp = newp;</div>
<div>
Point(Pp) = {X[p],Y[p],z0,c1};</div>
<div>
P[p] = Pp;</div>
<div>
L = newl;</div>
<div>
Line(L) = {P[p-1],P[p]};</div>
<div>
extr[] = Extrude{ {0,0,0}, {1,0,0}, {0,0,0}, Pi/4 }{ Line{L};};</div>
<div>
EndFor</div>
<div>
</div>
<div>
Z[0] = z0 + r1;</div>
<div>
P0 = newp;</div>
<div>
P[0] = P0;</div>
<div>
Point(P0) = {X[0],y0,Z[0],c1};</div>
<div>
</div>
<div>
For p In {1:np-1}</div>
<div>
X[p] = X[0] + p*dx;</div>
<div>
Z[p] = Z[0] + amp*Sinh(t0)*(1.0 + Cos(2*Pi*X[p]/lambda) );</div>
<div>
Pp = newp;</div>
<div>
Point(Pp) = {X[p],y0,Z[p],c1};</div>
<div>
P[p] = Pp;</div>
<div>
L = newl;</div>
<div>
Line(L) = {P[p-1],P[p]};</div>
<div>
extr[] = Extrude{ {0,0,0}, {1,0,0}, {0,0,0}, Pi/4 }{ Line{L};};</div>
<div>
EndFor</div>
<div>
</div>
<div>
Z[0] = z0 - r1;</div>
<div>
P0 = newp;</div>
<div>
P[0] = P0;</div>
<div>
Point(P0) = {X[0],y0,Z[0],c1};</div>
<div>
</div>
<div>
For p In {1:np-1}</div>
<div>
X[p] = X[0] + p*dx;</div>
<div>
Z[p] = Z[0] - amp*Sinh(t0)*(1.0 + Cos(2*Pi*X[p]/lambda) );</div>
<div>
Pp = newp;</div>
<div>
Point(Pp) = {X[p],y0,Z[p],c1};</div>
<div>
P[p] = Pp;</div>
<div>
L = newl;</div>
<div>
Line(L) = {P[p-1],P[p]};</div>
<div>
extr[] = Extrude{ {0,0,0}, {1,0,0}, {0,0,0}, Pi/4 }{ Line{L};};</div>
<div>
EndFor</div>
<div>
*/</div>
<p> </p><p> </p><p> </p><p>--<br />
Gustavo PEIXOTO DE OLIVEIRA, Dr.<br />
State University of Rio de Janeiro<br />
</p><br />
<p> </p><br />
<p> </p><p> </p>