# Error in compilator

**URL:** <https://community.freefem.org/t/error-in-compilator/2570>\
**Category:** General Discussion\
**Created:** [June 30, 2023, 6:58am UTC](https://community.freefem.org/t/error-in-compilator/2570 "2023-06-30T06:58:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jawahar264](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/jawahar264/32/1783_2.png) [@jawahar264](https://community.freefem.org/u/jawahar264)\
**Post date:** [June 30, 2023, 6:58am UTC](https://community.freefem.org/t/error-in-compilator/2570/1 "2023-06-30T06:58:32Z")

</div>

load “msh3”

load “bem”

real k = 10;

int n = 100;

border circle(t = 0, 2\*pi){x=cos(t); y=sin(t);}

meshL ThL = buildmeshL(circle(n));

ThL = OrientNormal(ThL,unbounded=1);

BemKernel Ker(“SL”, k=2\*pi);

varf vbem(u,v) = int1dx1d(ThL)(ThL)(BEM(ker,u,v));

fespace Uh(ThL,P1);

HMatrix H = vbem(Uh,Uh);

func uinc = exp(1i_k_x);

Uh p, b;

varf vrhs(u,v) = -int1d(ThL)(uinc\*v);

b = vrhs(0,Uh);

p = H^-1\*b;

BemPotential Pot(“SL”, k=2\*pi);

varf vpot(u,v) = int1d(ThL)(POT(Pot,u,v));

int np = 200;

int R = 4;

border b1(t=-R, R){x=t; y=-R;}

border b2(t=-R, R){x=R; y=t;}

border b3(t=-R, R){x=-t; y=R;}

border b4(t=-R, R){x=-R; y=-t;}

mesh ThOut = buildmesh(b1(np)+b2(np)+b3(np)+b4(np)+circle(-n));

fespace UhOut(ThOut,P1);

HMatrix HP = vpot(Uh,UhOut);

UhOut u, utot;

u = HP\*p;

utot = u + uinc;

plot(utot,fill=1,value=1,cmm=“u\_total”);

**Error**  
– FreeFem++ v4.6 (Fri, Apr 03, 2020 2:08:08 PM - git v4.6)  
Load: lg\_fem lg\_mesh lg\_mesh3 eigenvalue  
1 : load “msh3”(load: loadLibary C:\Program Files (x86)\FreeFem++\.\msh3 = 0)  
2 : load “bem”(load: loadLibary C:\Program Files (x86)\FreeFem++\.\bem = 0)  
3 : real k = 10;  
4 : int n = 100;  
5 : border circle(t = 0, 2_pi){x=cos(t); y=sin(t);}  
6 : meshL ThL = buildmeshL(circle(n));  
7 : ThL = OrientNormal(ThL,unbounded=1);  
8 : BemKernel Ker(“SL”, k=2_pi)  
Error line number 8, in file C:\Users\jawahar ali\OneDrive\Desktop\freefemm\bdm.edp, before token )  
They are used Named parameter  
current line = 8  
Compile error : They are used Named parameter  
line number :8, )  
error Compile error : They are used Named parameter  
line number :8, )  
code = 1 mpirank: 0

---

<div class="post-metadata">

**Author:** ![phtournier](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@phtournier](https://community.freefem.org/u/phtournier)\
**Post date:** [June 30, 2023, 11:41am UTC](https://community.freefem.org/t/error-in-compilator/2570/2 "2023-06-30T11:41:59Z")

</div>

your FreeFEM version (4.6) is too old and does not support Boundary Element formulations. Consider upgrading FreeFEM to v4.13 (v4.12 will do too, binaries are here [Release FreeFEM v4.12 · FreeFem/FreeFem-sources · GitHub](https://github.com/FreeFem/FreeFem-sources/releases/tag/v4.12))

---

<div class="post-metadata">

**Author:** ![jawahar264](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/jawahar264/32/1783_2.png) [@jawahar264](https://community.freefem.org/u/jawahar264)\
**Post date:** [July 1, 2023, 8:03am UTC](https://community.freefem.org/t/error-in-compilator/2570/3 "2023-07-01T08:03:57Z")

</div>

\*\*Not compiling with new version also \*\*  
– FreeFem++ v4.12 (Wed Feb 15 11:36:54 CET 2023 - git v4.12-27-g58d32866)  
file : C:\Users\jawahar ali\OneDrive\Desktop\freefemm\bdm.edp  
Load: lg\_fem lg\_mesh lg\_mesh3 eigenvalue  
1 : load “msh3”(load: loadLibary C:\Program Files (x86)\FreeFem++\.\msh3 = 0)  
2 : load “bem”(load: loadLibary C:\Program Files (x86)\FreeFem++\.\bem = 0)  
Init\_Bem

```
3 : real k = 10;
4 : int n = 100;
5 : border circle(t = 0, 2*pi){x=cos(t); y=sin(t);}
6 : meshL ThL = buildmeshL(circle(n));
7 : ThL = OrientNormal(ThL,unbounded=1);
8 : BemKernel Ker("SL", k=2*pi)
9 : varf

```

Error line number 9, in file C:\Users\jawahar ali\OneDrive\Desktop\freefemm\bdm.edp, before token varf  
syntax error  
current line = 8  
Compile error : syntax error  
line number :9, varf  
error Compile error : syntax error  
line number :9, varf  
code = 1 mpirank: 0  
try getConsole C:\Users\jawahar ali\OneDrive\Desktop\freefemm\bdm.edp  
save log in : ‘C:\Users\jawahar ali\OneDrive\Desktop\freefemm\bdm.log’  
wait enter ?

---

<div class="post-metadata">

**Author:** ![phtournier](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@phtournier](https://community.freefem.org/u/phtournier)\
**Post date:** [July 1, 2023, 9:57am UTC](https://community.freefem.org/t/error-in-compilator/2570/4 "2023-07-01T09:57:42Z")

</div>

missing semicolon line 8 ?

---

<div class="post-metadata">

**Author:** ![jawahar264](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/jawahar264/32/1783_2.png) [@jawahar264](https://community.freefem.org/u/jawahar264)\
**Post date:** [July 1, 2023, 10:26am UTC](https://community.freefem.org/t/error-in-compilator/2570/5 "2023-07-01T10:26:55Z")

</div>

i copy pasted the example in documentation on BEM

You chose the file “C:\Users\jawahar ali\OneDrive\Desktop\freefemm\try.edp”  
– FreeFem++ v4.12 (Wed Feb 15 11:36:54 CET 2023 - git v4.12-27-g58d32866)  
file : C:\Users\jawahar ali\OneDrive\Desktop\freefemm\try.edp  
Load: lg\_fem lg\_mesh lg\_mesh3 eigenvalue  
1 : load “bem”(load: loadLibary C:\Program Files (x86)\FreeFem++\.\bem = 0)  
Init\_Bem

```
2 : load "msh3"(load: loadLibary C:\Program Files (x86)\FreeFem++\\.\msh3 = 0)
3 : real k = 10;
4 : int n = 100;
5 : border circle(t = 0, 2*pi){x=cos(t); y=sin(t);}
6 : meshL ThL = buildmeshL(circle(n));
7 : ThL = OrientNormal(ThL,unbounded=1);
8 : varf vbem(u,v) = int1dx1d(ThL)(ThL)(BEM(BemKernel("SL",k=k),u,v));
9 : fespace Uh(ThL,P1);

```

10 : HMatrix H = vbem(Uh,Uh);  
11 : func uinc = exp(1i_k_x);  
12 : Uh p, b;  
13 : varf vrhs(u,v) = -int1d(ThL)(uinc_v);  
14 : b[] = vrhs(0,Uh);  
15 : p[] = H^-1_b;  
16 : varf vpot(u,v) = int1d(ThL)(POT(BemPotential(“SL”,k=k),u,v));  
17 : int np = 200;  
18 : int R = 4;  
19 : border b1(t=-R, R){x=t; y=-R;}  
20 : border b2(t=-R, R){x=R; y=t;}  
21 : border b3(t=-R, R){x=-t; y=R;}  
22 : border b4(t=-R, R){x=-R; y=-t;}  
23 : mesh ThOut = buildmesh(b1(np)+b2(np)+b3(np)+b4(np)+circle(-n));  
24 : fespace UhOut(ThOut,P1);  
25 : HMatrix HP = vpot(Uh,UhOut);  
26 : UhOut u, utot;  
27 : u = HP\*p;  
28 : utot = u + uinc;  
29 : plot(utot,fill=1,value=1,cmm=“u\_total”); sizestack + 1024 =2256 ( 1232 )

– FESpace: Nb of Nodes 100 Nb of DoF 100  
Attempting to use an MPI routine before initializing MPI  
try getConsole C:\Users\jawahar ali\OneDrive\Desktop\freefemm\try.edp  
save log in : ‘C:\Users\jawahar ali\OneDrive\Desktop\freefemm\try.log’  
wait enter ?

---

<div class="post-metadata">

**Author:** ![phtournier](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@phtournier](https://community.freefem.org/u/phtournier)\
**Post date:** [July 1, 2023, 11:53am UTC](https://community.freefem.org/t/error-in-compilator/2570/6 "2023-07-01T11:53:17Z")

</div>

You need to run FreeFEM in parallel, i.e. with FreeFem++-mpi or ff-mpirun, as FreeFEM uses the parallel library htool under the hood for BEM

---

<div class="post-metadata">

**Author:** ![jawahar264](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/jawahar264/32/1783_2.png) [@jawahar264](https://community.freefem.org/u/jawahar264)\
**Post date:** [July 3, 2023, 5:31am UTC](https://community.freefem.org/t/error-in-compilator/2570/7 "2023-07-03T05:31:04Z")

</div>

– FreeFem++ v4.12 (Wed Feb 15 11:36:54 CET 2023 - git v4.12-27-g58d32866)  
file : .\mesh.edp  
Load: lg\_fem lg\_mesh lg\_mesh3 eigenvalue parallelempi  
1 :  
2 : load “bem”(load: loadLibary C:\Program Files (x86)\FreeFem++\.\bem = 0)  
Init\_Bem

```
3 : load "msh3"(load: loadLibary C:\Program Files (x86)\FreeFem++\\.\msh3 = 0)
4 : real k = 10;
5 : int n = 100;
6 : border circle(t = 0, 2*pi){x=cos(t); y=sin(t);}
7 : meshL ThL = buildmeshL(circle(n));
8 : ThL = OrientNormal(ThL,unbounded=1);
9 : varf vbem(u,v) = int1dx1d(ThL)(ThL)(BEM(BemKernel("SL",k=k),u,v));

```

10 : fespace Uh(ThL,P1);  
11 : HMatrix H = vbem(Uh,Uh);  
12 : func uinc = exp(1i_k_x);  
13 : Uh p, b;  
14 : varf vrhs(u,v) = -int1d(ThL)(uinc_v);  
15 : b[] = vrhs(0,Uh);  
16 : p[] = H^-1_b;  
17 : varf vpot(u,v) = int1d(ThL)(POT(BemPotential(“SL”,k=k),u,v));  
18 : int np = 200;  
19 : int R = 4;  
20 : border b1(t=-R, R){x=t; y=-R;}  
21 : border b2(t=-R, R){x=R; y=t;}  
22 : border b3(t=-R, R){x=-t; y=R;}  
23 : border b4(t=-R, R){x=-R; y=-t;}  
24 : mesh ThOut = buildmesh(b1(np)+b2(np)+b3(np)+b4(np)+circle(-n));  
25 : fespace UhOut(ThOut,P1);  
26 : HMatrix HP = vpot(Uh,UhOut);  
27 : UhOut u, utot;  
28 : u = HP\*p;  
29 : utot = u + uinc;  
30 : plot(utot,fill=1,value=1,cmm=“u\_total”); sizestack + 1024 =2256 ( 1232 )

– FESpace: Nb of Nodes 100 Nb of DoF 100  
\*\* fgmres has converged in 26 iterations The relative residual is 8.9438e-07 Cl: 0.618035  
– mesh: Nb of Triangles = 63398, Nb of Vertices 32149  
Plot:: Sorry no ps version for this type of plot 11  
times: compile 0.172s, execution 2.632s, mpirank:0  
######## We forget of deleting 57 Nb pointer, 0Bytes , mpirank 0, memory leak =0  
CodeAlloc : nb ptr 4524, size :590968 mpirank: 0  
Ok: Normal End

---

<div class="post-metadata">

**Author:** ![phtournier](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@phtournier](https://community.freefem.org/u/phtournier)\
**Post date:** [July 3, 2023, 7:46am UTC](https://community.freefem.org/t/error-in-compilator/2570/8 "2023-07-03T07:46:59Z")

</div>

It works, but with parallel FreeFEM you need to add the command line flag ‘-wg’ (with graphics) to see plots

---

<div class="post-metadata">

**Author:** ![jawahar264](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/jawahar264/32/1783_2.png) [@jawahar264](https://community.freefem.org/u/jawahar264)\
**Post date:** [July 3, 2023, 9:37am UTC](https://community.freefem.org/t/error-in-compilator/2570/9 "2023-07-03T09:37:07Z")

</div>

Thanks you for the help I am really grateful and your lecture on BEM also helpful while learning as there are very little recourses in web.
