# Periodic condition in FEM space

**URL:** <https://community.freefem.org/t/periodic-condition-in-fem-space/649>\
**Category:** General Discussion\
**Created:** [November 11, 2020, 2:49pm UTC](https://community.freefem.org/t/periodic-condition-in-fem-space/649 "2020-11-11T14:49:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RYP](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@RYP](https://community.freefem.org/u/RYP)\
**Post date:** [November 11, 2020, 2:49pm UTC](https://community.freefem.org/t/periodic-condition-in-fem-space/649/1 "2020-11-11T14:49:35Z")

</div>

Hi everybody,

I want to know how the function “periodic” work in FEM space.

For example, If I define fespace Vh(Th, P1, periodic = [[1, x], [3, x], [2, y], [4, y]]) with mesh Th = square(2, 2). Is it equivalent to define fespace Vh(Th, P1), and just force the degrees of freedom on 1, 3 sides to be equal (so are 2,4 sides)？

Best regards.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 11, 2020, 2:54pm UTC](https://community.freefem.org/t/periodic-condition-in-fem-space/649/2 "2020-11-11T14:54:22Z")

</div>

Yes, that is correct. There are multiple examples with periodic BC in the `examples` folder of FreeFEM if you need.

---

<div class="post-metadata">

**Author:** ![RYP](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@RYP](https://community.freefem.org/u/RYP)\
**Post date:** [November 11, 2020, 3:45pm UTC](https://community.freefem.org/t/periodic-condition-in-fem-space/649/3 "2020-11-11T15:45:16Z")

</div>

Thanks @prj for your reply.

I wrote two files about this，  
[test1.edp](https://community.freefem.org/uploads/short-url/yFBdTVbZJy5ZDeflCfgkmdXeMCb.edp) (505 Bytes)  
[test2.edp](https://community.freefem.org/uploads/short-url/voYBZ9ODClVfcH16l042ZImDP7v.edp) (1.3 KB)  
I am confused that I get different results , could you please check it?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 11, 2020, 3:58pm UTC](https://community.freefem.org/t/periodic-condition-in-fem-space/649/4 "2020-11-11T15:58:19Z")

</div>

`test1.edp` is correct, `test2.edp` is wrong.

---

<div class="post-metadata">

**Author:** ![RYP](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@RYP](https://community.freefem.org/u/RYP)\
**Post date:** [November 11, 2020, 4:13pm UTC](https://community.freefem.org/t/periodic-condition-in-fem-space/649/5 "2020-11-11T16:13:18Z")

</div>

Is there any error in the finite element interpolation in test2.edp? I tried to achieve the same result as test1.edp without using function “periodic”, but failed.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 11, 2020, 4:15pm UTC](https://community.freefem.org/t/periodic-condition-in-fem-space/649/6 "2020-11-11T16:15:57Z")

</div>

I have no idea of what you are doing in `test2.edp`.

---

<div class="post-metadata">

**Author:** ![RYP](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@RYP](https://community.freefem.org/u/RYP)\
**Post date:** [November 11, 2020, 4:17pm UTC](https://community.freefem.org/t/periodic-condition-in-fem-space/649/7 "2020-11-11T16:17:42Z")

</div>

I will check it carefully. Thank you so much again @prj
