# Integration on a part of the boundary

**URL:** <https://community.freefem.org/t/integration-on-a-part-of-the-boundary/4231>\
**Category:** General Discussion\
**Created:** [February 26, 2026, 8:44pm UTC](https://community.freefem.org/t/integration-on-a-part-of-the-boundary/4231 "2026-02-26T20:44:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucassfernandez](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lucassfernandez](https://community.freefem.org/u/lucassfernandez)\
**Post date:** [February 26, 2026, 8:44pm UTC](https://community.freefem.org/t/integration-on-a-part-of-the-boundary/4231/1 "2026-02-26T20:44:03Z")

</div>

Suppose I have constructed a circular geometric domain by joining `n` subarcs, which are labeled from 1 to 10. Now, I need to compute a boundary integral, but only on the arcs from 1 to 9.

Can I create a vector of labels and pass it to `int1d`?

```auto
n = 10;
int[int] labsext(n-1);
for(int i=0; i<n-1; ++i)
    labsext[i] = i+1;
varf NeumannRHS(u,eta) = int1d(Th,labsext)( (dxGj*N.x + dyGj*N.y)*eta );

```

Another way may be:

```auto
n = 10;
varf NeumannRHS(u,eta) = int1d(Th)((label>=1 && label<n)*( (dxGj*N.x + dyGj*N.y)*eta ));

```

The results of these two constructions should be the same, right? Some of the constructions above compile correctly, but may return incorrect results?

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 27, 2026, 5:11pm UTC](https://community.freefem.org/t/integration-on-a-part-of-the-boundary/4231/2 "2026-02-27T17:11:37Z")

</div>

Yes both ways to take into account the labels are correct. However the integrand should be linear with respect to the test function eta.

---

<div class="post-metadata">

**Author:** ![lucassfernandez](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lucassfernandez](https://community.freefem.org/u/lucassfernandez)\
**Post date:** [February 27, 2026, 5:23pm UTC](https://community.freefem.org/t/integration-on-a-part-of-the-boundary/4231/3 "2026-02-27T17:23:00Z")

</div>

Okay! Thanks for the clarification.
