# Compilation error in code " err code 6 , mpirank 0 " application of boundary conditions

**URL:** https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228
**Category:** General Discussion
**Created:** [January 18, 2023, 11:52am UTC](https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228 "2023-01-18T11:52:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![chaimaa](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@chaimaa](https://community.freefem.org/u/chaimaa)
#### Post date: [January 18, 2023, 11:52am UTC](https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228/1 "2023-01-18T11:52:22Z")

</div>

hi,  
I get this error when I apply periodic boundary conditions. Can any one help me please !  
current line = 133  
Assertion fail : (im-\>second == kv)  
line :250, in file lgmesh3.cpp  
Assertion fail : (im-\>second == kv)  
line :250, in file lgmesh3.cpp  
err code 6 , mpirank 0

you find in attached a part of the code and .mesh files  
[aircc.mesh](https://community.freefem.org/uploads/short-url/3JPwtt9y2nP3ByPPMXiXVFE6SuC.mesh) (78.7 KB)  
[airco.mesh](https://community.freefem.org/uploads/short-url/2QUORcVV2eIrWjgwd753MFaxFm5.mesh) (91.9 KB)  
[Mixed\_cell\_hom.edp](https://community.freefem.org/uploads/short-url/hAKG3hI8kuGRpVBy7OWdKeaVuPK.edp) (3.4 KB)  
[pucc.mesh](https://community.freefem.org/uploads/short-url/wKVqVfyvkmTgFiGYxtf6hAxQDCV.mesh) (57.6 KB)  
[puco.mesh](https://community.freefem.org/uploads/short-url/jnc9b5kMUDvazHdS1QVa0D1aqLy.mesh) (55.7 KB)

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [January 18, 2023, 8:55pm UTC](https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228/2 "2023-01-18T20:55:54Z")

</div>

The mesh of face have correct, possible problem of round off.

I have had the code to see if the face mesh are compatible.

{  
for (int i=1; i\<=6;i=i+2)  
{  
int[int] ll=[i\*100], ll1=[(i+1)\*100];  
meshS Th1 =extract(Th,label=ll);  
meshS Th2 =extract(Th,label=ll1);  
real s1 =Th1.mesure;  
real s2 =Th2.mesure;

```
	real vx = (int2d(Th1)(x)/s1 - int2d(Th2)(x)/s2)*1.01 ;
	real vy = (int2d(Th1)(y)/s1 - int2d(Th2)(y)/s2)*1.01 ;
	real vz = (int2d(Th1)(z)/s1 - int2d(Th2)(z)/s2)*1.01;
	Th1 = movemesh(Th1,[x-vx,y-vy,z-vz]);
	cout << " move ??? " << vx << " " << vy << " "<< vz << " m=" << s1 << endl;
	plot(Th1,Th2,wait=1,cmm=ll[0]);
}

```

}

The next Idea is to try to see the Th1 and Th2 are equal or very close .

with the projection function.

If I had time I try to add this functionality.

---

<div class="post-metadata">

### Author: ![chaimaa](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@chaimaa](https://community.freefem.org/u/chaimaa)
#### Post date: [January 18, 2023, 9:15pm UTC](https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228/3 "2023-01-18T21:15:19Z")

</div>

Thank you so much.  
i try this code and i find :  
move ??? -9.2019e-05 -9.39775e-05 -4.03997 m=16  
move ??? -4.0401 -2.27204e-05 -3.01004e-06 m=16  
move ??? -2.3316e-05 -4.04011 -4.70643e-06 m=16.0001

 ![3](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/3/3088970c0406a5870e9f61c9640b45ed24fb105e.png)  
 ![2](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/5/5fbbfa6880705ca6d127e1ade549daf6c25d7da7.png)  
 ![1](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/6/6f920f88f3727dda41d1b6075fd561f9efd8d3e4.png)

Do I need to make a mesh or geometry correction ?

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [January 18, 2023, 9:36pm UTC](https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228/4 "2023-01-18T21:36:17Z")

</div>

remark, the number of vertices i face 100 and 200 are no the same

```
cout << " Ns ?? " <<Th1.nv <<" "<< Th2.nv << endl;

```

Ns ?? 1561 1241  
Nt ?? 2272 2272

so the Problem is before !!!

---

<div class="post-metadata">

### Author: ![chaimaa](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@chaimaa](https://community.freefem.org/u/chaimaa)
#### Post date: [January 19, 2023, 2:49pm UTC](https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228/5 "2023-01-19T14:49:48Z")

</div>

Yes, i test also the number of elements and i find that the surfaces have the same number :

 ![11](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/7/7ac736c209f6841732b2fc4db0f72f017acf58ad.png)  
then when i reduce the geometry.tolerance on gmsh :  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/7/78cc64e270a02b973fe0fbac06581a5eb65a9b87.png)  
i get other error :  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/e/e895f84de2221a05d6cba8337af4b3b3226b3d50.png)

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [January 23, 2023, 8:43pm UTC](https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228/6 "2023-01-23T20:43:32Z")

</div>

The Numbers of vertices are incorrect, this is Wh y thé périodicité bcp do not works

---

<div class="post-metadata">

### Author: ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)
#### Post date: [January 23, 2023, 8:50pm UTC](https://community.freefem.org/t/compilation-error-in-code-err-code-6-mpirank-0-application-of-boundary-conditions/2228/7 "2023-01-23T20:50:12Z")

</div>

By round off error you mean it can’t connect the pieces? A long time ago, I was  
curious about making a mesh with rational numbers. Floating point is a huge  
problem if you are ever going to do equality tests lol. You could object to  
things like speed or other factors but at some point maybe you could  
convert it to float.
