# Reduced dimension in the right hand side using levelset

**URL:** https://community.freefem.org/t/reduced-dimension-in-the-right-hand-side-using-levelset/2329
**Category:** General Discussion
**Created:** [March 13, 2023, 4:58pm UTC](https://community.freefem.org/t/reduced-dimension-in-the-right-hand-side-using-levelset/2329 "2023-03-13T16:58:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jsmacd](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jsmacd](https://community.freefem.org/u/jsmacd)
#### Post date: [March 13, 2023, 4:58pm UTC](https://community.freefem.org/t/reduced-dimension-in-the-right-hand-side-using-levelset/2329/1 "2023-03-13T16:58:23Z")

</div>

I’d like to implement a problem where the right-hand side integral is over a reduced dimension. I believe I want to implement the level sets argument, like I found under the heading “Problem Definition” : [https://doc.freefem.org/documentation/finite-element.html](https://doc.freefem.org/documentation/finite-element.html)

I can’t figure out how to properly define phi, and I can’t find an example code. There was one similar question I found in the General Discussion, but it’s not general enough because I want to integrate over a parametrised curve inside the interior of a cube.

Does anyone have an example they can share with me?

---

<div class="post-metadata">

### Author: ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)
#### Post date: [March 13, 2023, 5:25pm UTC](https://community.freefem.org/t/reduced-dimension-in-the-right-hand-side-using-levelset/2329/2 "2023-03-13T17:25:47Z")

</div>

Define phi so that it is equal to zero along your curve. For example, to integrate along x=1, `int1d(Th,levelset=(x-1))(…);`

---

<div class="post-metadata">

### Author: ![jsmacd](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jsmacd](https://community.freefem.org/u/jsmacd)
#### Post date: [March 13, 2023, 6:37pm UTC](https://community.freefem.org/t/reduced-dimension-in-the-right-hand-side-using-levelset/2329/3 "2023-03-13T18:37:40Z")

</div>

Thank you for your quick response! So I guess this is my confusion, in R^3, x =1 is a plane. So how does FreeFEM decide where the curve that I want to integrate over is in that plane? For example suppose I want to integrate only along the line x = 1, y = t, z = 2, a \< t \< b.

---

<div class="post-metadata">

### Author: ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)
#### Post date: [March 13, 2023, 6:51pm UTC](https://community.freefem.org/t/reduced-dimension-in-the-right-hand-side-using-levelset/2329/4 "2023-03-13T18:51:43Z")

</div>

Ah, sorry didn’t realize you wanted a curve from a 3d mesh. I do not think you can directly extract a parameterized curve from a 3D mesh using the `levelset` argument. A possible solution would be to define a meshS that contains your curve of interest and then use the `levelset` option in an `int1d` involving that 2D surface mesh.

---

<div class="post-metadata">

### Author: ![jsmacd](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jsmacd](https://community.freefem.org/u/jsmacd)
#### Post date: [March 13, 2023, 7:00pm UTC](https://community.freefem.org/t/reduced-dimension-in-the-right-hand-side-using-levelset/2329/5 "2023-03-13T19:00:31Z")

</div>

ok I see, I will give this a try. Thank you!
