# From generic element to periodic element

**URL:** <https://community.freefem.org/t/from-generic-element-to-periodic-element/1188>\
**Category:** General Discussion\
**Created:** [September 3, 2021, 6:43pm UTC](https://community.freefem.org/t/from-generic-element-to-periodic-element/1188 "2021-09-03T18:43:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neutrino](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@Neutrino](https://community.freefem.org/u/Neutrino)\
**Post date:** [September 3, 2021, 6:43pm UTC](https://community.freefem.org/t/from-generic-element-to-periodic-element/1188/1 "2021-09-03T18:43:29Z")

</div>

Hi there!

So I have the following problem. I have two finite element spaces over a square domain in my program:

> fespace Vh(Th, P1);  
> fespace Vhp( Th , P1 , periodic = [[2,y],[4,y],[1,x],[3,x] ]);

I have an element u of type Vh which is zero on the boundary. Since u is clearly periodic, is there a way to turn u from type Vh to type Vhp? Or is there a clean way to create a new element v of type Vhp that is equal to u?

---

<div class="post-metadata">

**Author:** ![Neutrino](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@Neutrino](https://community.freefem.org/u/Neutrino)\
**Post date:** [September 14, 2021, 11:40am UTC](https://community.freefem.org/t/from-generic-element-to-periodic-element/1188/2 "2021-09-14T11:40:46Z")

</div>

I would like to add that my domain in a square.

```auto
mesh Th = square(n, m, [x0+(x1-x0)*x, y0+(y1-y0)*y]);
Vh u;

```

I’ve tried to guess which indices of `u[] ` correspond to the boundary elements but this was to no avail. Anyone can help?

---

<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:** [September 15, 2021, 8:31am UTC](https://community.freefem.org/t/from-generic-element-to-periodic-element/1188/3 "2021-09-15T08:31:44Z")

</div>

Have you tried simply `Vhp up = u`?
