# 1D boundary periodic conditions

**URL:** <https://community.freefem.org/t/1d-boundary-periodic-conditions/983>\
**Category:** General Discussion\
**Created:** [May 18, 2021, 9:07am UTC](https://community.freefem.org/t/1d-boundary-periodic-conditions/983 "2021-05-18T09:07:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonenatipoltri](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@simonenatipoltri](https://community.freefem.org/u/simonenatipoltri)\
**Post date:** [May 18, 2021, 9:07am UTC](https://community.freefem.org/t/1d-boundary-periodic-conditions/983/1 "2021-05-18T09:07:45Z")

</div>

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(d_n)+b3(n)+b4(d_n));  
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,  
Simone.

---

<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:** [May 18, 2021, 4:20pm UTC](https://community.freefem.org/t/1d-boundary-periodic-conditions/983/2 "2021-05-18T16:20:18Z")

</div>

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](https://github.com/FreeFem/FreeFem-sources/blob/master/examples/3dCurve/periodicL.edp)
