# int1d(Th, label) on a 3D mesh

**URL:** https://community.freefem.org/t/int1d-th-label-on-a-3d-mesh/1892
**Category:** General Discussion
**Created:** [July 14, 2022, 3:27pm UTC](https://community.freefem.org/t/int1d-th-label-on-a-3d-mesh/1892 "2022-07-14T15:27:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)
#### Post date: [July 14, 2022, 3:27pm UTC](https://community.freefem.org/t/int1d-th-label-on-a-3d-mesh/1892/1 "2022-07-14T15:27:49Z")

</div>

How can I compute a curve integral, which is part of a 3D mesh, such as:  
` int1d(Th, label)(1.)`  
where Th is a 3D mesh?

---

<div class="post-metadata">

### Author: ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)
#### Post date: [July 14, 2022, 4:56pm UTC](https://community.freefem.org/t/int1d-th-label-on-a-3d-mesh/1892/2 "2022-07-14T16:56:58Z")

</div>

My approach would be to define a 3D line mesh, interpolate the results onto the line mesh, and do the integration there.

---

<div class="post-metadata">

### Author: ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)
#### Post date: [July 14, 2022, 6:03pm UTC](https://community.freefem.org/t/int1d-th-label-on-a-3d-mesh/1892/3 "2022-07-14T18:03:12Z")

</div>

Thank you @aszaboa !

Unfortunately, it is an integration of unknowns, which should go to the variation form.

The problem is an optimisation as follows:

`L(u,f) = int1d(Th, 1) + int3d(Th)(...) + int2d(Th, 2) (|f|^2)`

The first term is objective, the second term is constraint PDE and the last term is the control.

Variation of L(u,f) leads to a FEM weak form involving integration in different domains. The problem may not be well defined initially, but I just want to give it a try, and then some regularisation terms may be introduced to make the problem solvable.

Any ideas?

---

<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: [July 15, 2022, 12:06pm UTC](https://community.freefem.org/t/int1d-th-label-on-a-3d-mesh/1892/4 "2022-07-15T12:06:04Z")

</div>

Generaly, make 1d integration on 3d objet have no mathematics sense at continious level,  
So this is why it is not coded

---

<div class="post-metadata">

### Author: ![usiu5555](https://avatars.discourse-cdn.com/v4/letter/u/e19adc/32.png) [@usiu5555](https://community.freefem.org/u/usiu5555)
#### Post date: [January 24, 2025, 3:25am UTC](https://community.freefem.org/t/int1d-th-label-on-a-3d-mesh/1892/5 "2025-01-24T03:25:39Z")

</div>

How about a situation where the integral assumes that the line of integration has a defined, but not meshed area? For example, a very thin heater is in contact with with our domain on the boundary, such as the heater’s width d is much smaller than our domain. This would require to increase the number of mesh elements by orders of magnitude to model it explicitly. Can we include a term int1d that is scaled by the heater’s width? Something like d\*int1d (…) or int1d (d \* …)? In mathematical sense, this is a 2D integraltion.
