# Is it possible to apply assembler in some specific entities

**URL:** <https://fenicsproject.discourse.group/t/is-it-possible-to-apply-assembler-in-some-specific-entities/17503>\
**Category:** dolfinx\
**Tags:** mesh, assembly\
**Created:** [April 24, 2025, 10:59pm UTC](https://fenicsproject.discourse.group/t/is-it-possible-to-apply-assembler-in-some-specific-entities/17503 "2025-04-24T22:59:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WjjSteve](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/wjjsteve/32/4389_2.png) [@WjjSteve](https://fenicsproject.discourse.group/u/WjjSteve)\
**Post date:** [April 24, 2025, 10:59pm UTC](https://fenicsproject.discourse.group/t/is-it-possible-to-apply-assembler-in-some-specific-entities/17503/1 "2025-04-24T22:59:43Z")

</div>

Hello,

I’m wondering that is it possible to apply the assembler over specific entities instead of the whole domain  
For example, if I define the form:

a = f \* dx

Then I can compute the integral of the function f over the mesh it is defined in using assemble\_scalar, but if I want to compute its integral only in some specific cells, is there any way to do that?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [April 25, 2025, 4:42am UTC](https://fenicsproject.discourse.group/t/is-it-possible-to-apply-assembler-in-some-specific-entities/17503/2 "2025-04-25T04:42:44Z")

</div>

That is what subdomain\_data and subdomain\_id is for. See [Integration over sub-domains — FEniCS Workshop](http://jsdokken.com/FEniCS-workshop/src/deep_dive/restriction.html)
