# Assertion fail: (kkk++\<10)

**URL:** https://community.freefem.org/t/assertion-fail-kkk-10/2485
**Category:** General Discussion
**Created:** [May 23, 2023, 5:14am UTC](https://community.freefem.org/t/assertion-fail-kkk-10/2485 "2023-05-23T05:14:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![forgotthesemicolon](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@forgotthesemicolon](https://community.freefem.org/u/forgotthesemicolon)
#### Post date: [May 23, 2023, 5:14am UTC](https://community.freefem.org/t/assertion-fail-kkk-10/2485/1 "2023-05-23T05:14:06Z")

</div>

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._pi_0. /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._pi_11. /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._pi_1 /12.)\*x+cos( -2._pi_1. /12.)\*y] , [8 , sin( -2._pi_1. /12.)\*x+cos( -2._pi_1. /12.)\*y] ,

[3 , sin( -2._pi_2 /12.)\*x+cos( -2._pi_2. /12.)\*y] , [9 , sin( -2._pi_2. /12.)\*x+cos( -2._pi_2. /12.)\*y] ,

[4 , sin( -2._pi_3 /12.)\*x+cos( -2._pi_3. /12.)\*y] , [10 , sin( -2._pi_3. /12.)\*x+cos( -2._pi_3. /12.)\*y] ,

[5 , sin( -2._pi_4 /12.)\*x+cos( -2._pi_4. /12.)\*y] , [11 , sin( -2._pi_4. /12.)\*x+cos( -2._pi_4. /12.)\*y] ,

[6 , sin( -2._pi_5 /12.)\*x+cos( -2._pi_5. /12.)\*y] , [12 , sin( -2._pi_5. /12.)\*x+cos( -2._pi_5. /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
