1D boundary periodic conditions

Hi there!
I’m working on a code modeling a 2D-1D coupling. I don’t have any problem in imposing 2D periodic boundary conditions, but I do in imposing 1D ones. The variable is c(x) in (0,1) and the boundary condition to be imposed is c(0) = c(1). The structure of borders, mesh and fespace is the following:

int n = 10;
int d = 5;
border b1(t=0,1) { x=t; y=0; label=1; }
border b2(t=0,d) { x=1; y=t; label=2; }
border b3(t=1,0) { x=t; y=d; label=3; }
border b4(t=d,0) { x=0; y=t; label=4; }

mesh Th = buildmesh(b1(n)+b2(dn)+b3(n)+b4(dn));
meshL Th1=buildmeshL(b1(n));
//plot (Th);
//plot (Th1);

fespace Vh(Th,P2, periodic=[[2,y],[4,y]]);
fespace Qh(Th1,P1); //how do impose periodicity in this fespace?

Thank you,

fespace Qh(Th1,P1,periodic=[[1],[2]]);
warning you need version 4.9
see example FreeFem-sources/periodicL.edp at master · FreeFem/FreeFem-sources · GitHub

1 Like