# Elements with several labels

**URL:** https://community.freefem.org/t/elements-with-several-labels/1979
**Category:** General Discussion
**Created:** [August 31, 2022, 10:43am UTC](https://community.freefem.org/t/elements-with-several-labels/1979 "2022-08-31T10:43:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AdrienLer](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@AdrienLer](https://community.freefem.org/u/AdrienLer)
#### Post date: [August 31, 2022, 10:43am UTC](https://community.freefem.org/t/elements-with-several-labels/1979/1 "2022-08-31T10:43:01Z")

</div>

Hello,

I have been trying to compute integral on a label surface Sr using imported mesh from GMSH.

There are 2 surfaces : Sr and Si.

Several elements are on Sr AND Si and other only on Sr or Si. They are (normally) well defined in the .msh file following:

Element id - Element dimension - Number of tags - \< Tags \> - Nodes

When I try to compute: `int2d(Th,Sr) (1.)` ,

it only integrates on elements which are only on Sr. Elements which are on Sr AND Si are not taken into account.

It may be a basic problem but I haven’t found similar issues. Sorry if solution has been already provided.

Best regards,

Adrien

---

<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: [August 31, 2022, 10:54am UTC](https://community.freefem.org/t/elements-with-several-labels/1979/2 "2022-08-31T10:54:58Z")

</div>

You need to compute `int2d(Th,Sr,Si) (1.)`.

---

<div class="post-metadata">

### Author: ![AdrienLer](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@AdrienLer](https://community.freefem.org/u/AdrienLer)
#### Post date: [August 31, 2022, 11:01am UTC](https://community.freefem.org/t/elements-with-several-labels/1979/3 "2022-08-31T11:01:01Z")

</div>

It’s not what I am looking for. Sorry, it may be not clear.

I want to integrate on all elements of Sr.

But in the definition of the elements in .msh file, some belong to Sr (case 1), and some belong Sr and Si (case 2), such as:

Case 1:  
Element Id - 2 - 1 - Sr - Nodes

Case 2:  
Element Id - 2 - 2 - Sr - Si - Nodes

Elements of case 2 are not taken into account in the integral.

---

<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: [August 31, 2022, 11:48am UTC](https://community.freefem.org/t/elements-with-several-labels/1979/4 "2022-08-31T11:48:43Z")

</div>

In FreeFEM, elements only have a single region. Boundary elements have only a single label. If `Sr` and `Si` are boundary element labels, my answer still holds.

---

<div class="post-metadata">

### Author: ![AdrienLer](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@AdrienLer](https://community.freefem.org/u/AdrienLer)
#### Post date: [September 1, 2022, 8:03am UTC](https://community.freefem.org/t/elements-with-several-labels/1979/5 "2022-09-01T08:03:46Z")

</div>

> In FreeFEM, elements only have a single region.

I ignored that. Thank you. I managed to do it in a different way by creating an other label : SrSi ( Sr ∩ Si ).

And I integrate on Sr and Sr ∩ Si :`int2d(Th,Sr,SrSi) (1.)`

Thanks @prj
