Hi everyone,
I have a code where I have to make a mesh with periodic conditions for some sufaces with various number of sides and while it works for surfaces with 8 sides, for more sides I just keep getting this error : “assertion fail: (kkk++<10)”. Here is my code:
border G1 ( t=pi+(pi/2. - ((pi/(2.3.))/2. + pi/12.)) ,pi-(pi/2. - ((pi/(2.3.))/2. + pi/12.))) { x=cos( 2.pi0. /12.)( c+r * cos( t ))-sin( 2.pi0. /12.) r * sin( t ) ;
y=sin( 2.pi0. /12.)( c+r * cos( t ))+cos( 2.pi0. /12.) r * sin( t ) ; } ;
.
.
.
border G12 ( t=pi+(pi/2. - ((pi/(2.3.))/2. + pi/12.)) ,pi-(pi/2. - ((pi/(2.3.))/2. + pi/12.))) { x=cos( 2.pi11. /12.)( c+r * cos( t ))-sin( 2.pi11. /12.) r * sin( t ) ;
y=sin( 2.pi11. /12.)( c+r * cos( t ))+cos( 2.pi11. /12.) r * sin( t ) ; } ;
plot(G1(n)+G2(n)+G3(n)+G4(n)+G5(n)+G6(n)+G7(n)+G8(n)+G9(n)+G10(n)+G11(n)+G12(n));
mesh Th = buildmesh(G1(n) + G2(n) + G3(n) + G4(n) + G5(n) + G6(n) + G7(n) + G8(n) + G9(n) + G10(n) + G11(n) + G12(n), fixeborder=true ) ;
plot(Th, wait=true , fill=true ) ;
// glues opposite sides such that orientation is preserved
fespace Vh(Th,P2 , periodic =[ [ 1 , y ] , [ 7 , y] ,
[ 2 , sin( -2.pi1 /12.)*x+cos( -2.pi1. /12.)*y ] , [ 8 , sin( -2.pi1. /12.)*x+cos( -2.pi1. /12.)*y ] ,
[ 3 , sin( -2.pi2 /12.)*x+cos( -2.pi2. /12.)*y ] , [ 9 , sin( -2.pi2. /12.)*x+cos( -2.pi2. /12.)*y ] ,
[ 4 , sin( -2.pi3 /12.)*x+cos( -2.pi3. /12.)*y ] , [ 10 , sin( -2.pi3. /12.)*x+cos( -2.pi3. /12.)*y ] ,
[ 5 , sin( -2.pi4 /12.)*x+cos( -2.pi4. /12.)*y ] , [ 11 , sin( -2.pi4. /12.)*x+cos( -2.pi4. /12.)*y ] ,
[ 6 , sin( -2.pi5 /12.)*x+cos( -2.pi5. /12.)*y ] , [ 12 , sin( -2.pi5. /12.)*x+cos( -2.pi5. /12.)*y ]]);
and here is the error I get, where the line 44 is this one “fespace Vh(Th,P2 , periodic =…” :
– mesh: Nb of Triangles = 11596, Nb of Vertices 5979
current line = 44
Assertion fail : (kkk++ < 10)
line :972, in file lgfem.cpp
If someone has an idea on what to do, that would be much appreciated !
Émile