# FETI-method in FreeFEM

**URL:** <https://community.freefem.org/t/feti-method-in-freefem/1854>\
**Category:** General Discussion\
**Created:** [June 27, 2022, 8:54pm UTC](https://community.freefem.org/t/feti-method-in-freefem/1854 "2022-06-27T20:54:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pechi](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@Pechi](https://community.freefem.org/u/Pechi)\
**Post date:** [June 27, 2022, 8:54pm UTC](https://community.freefem.org/t/feti-method-in-freefem/1854/1 "2022-06-27T20:54:42Z")

</div>

Hi everyone,

I changed some things up in my code and all of a sudden, my Dirichlet conditions aren’t working anymore. I receive the message “We expected an unknown u=… of the problem”. Can please someone tell me what is wrong here? The error occurs in problem pb1 and pb2:

macro dn(u)(dx(u)\*N.x+dy(u)\*N.y) //

// Parameters  
int inside = 2; int outside = 1; int n = 4;

// Mesh  
border a(t=1, 2){x=t; y=0; label=outside;};  
border b(t=0, 1){x=2; y=t; label=outside;};  
border c(t=2, 0){x=t; y=1; label=outside;};  
border d(t=1, 0){x=1-t; y=t; label=inside;};  
border g(t=0, 1){x=1-t; y=t; label=inside;};  
border g1(t=pi/2, 2\*pi){x=cos(t); y=sin(t); label=outside;};

mesh th = buildmesh(a(5_n) + b(5_n) + c(10_n) + d(5_n));  
mesh TH = buildmesh(g(5_n) + g1(25_n));

fespace vh(th, P2);  
vh u, v, w=0, e;

fespace VH(TH, P2);  
VH U, V, W=0, E;

// Problem  
problem PB1 (U, V, init=0, solver=Cholesky)  
= int2d(TH)(  
dx(U)_dx(V)  
+ dy(U)dy(V)  
)  
+ int2d(TH)(  
- V  
)  
+ int1d(TH, inside)(  
V(dn(W) - (1/2)_(dn(W) + dn(w))))  
+ on(outside, U=0);

problem PB2 (u, v, init=0, solver=Cholesky)  
= int2d(th)(  
dx(u)_dx(v)  
+ dy(u)dy(v)  
)  
+ int2d(th)(  
- v  
)  
+ int1d(th, inside)(  
v(dn(w) - (1/2)_(dn(W) + dn(w))))  
+ on(outside, u=0);

problem pb1 (E, V, init=0, solver=Cholesky)  
= int2d(TH)(  
dx(E)\*dx(V)  
+ dy(E)_dy(V)  
)  
+ on(inside, E=(1/2)_(u-U));  
+ on(outside, E=0);

problem pb2 (e, v, init=0, solver=Cholesky)  
= int2d(th)(  
dx(e)\*dx(v)  
+ dy(e)_dy(v)  
)  
+ on(inside, e=(1/2)_(U-u));  
+ on(outside, e=0);

int i = 0;  
for (i = 0; i \< 10; i++){  
// Solve  
PB1;  
PB2;  
pb1;  
pb2;

```
W = U + E;
w = u + e;
plot(W, w, wait=true);

```

}

// Plot  
plot(W, w);

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Pechi](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@Pechi](https://community.freefem.org/u/Pechi)\
**Post date:** [June 28, 2022, 7:54am UTC](https://community.freefem.org/t/feti-method-in-freefem/1854/2 "2022-06-28T07:54:50Z")

</div>

Okay, unnecessary question: The problems are the semicola behind “+ on(inside, E=(1/2)\*(u-U))”

I somehow dont get the right output. I tried to implement the FETI-method from the Domain Decomposition book of Nataf (see picture). Can someone see what’s the issue here? The plots are just the same and do not look like a good solution.

 ![FETI](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/a/a49eb551079693214a124e050b4ce5643e5df143.png)
