Subdomain based on cell index

I want to do some post-processing (calculating an integration) on some elements that are intersected by a specified curved line. Is it possible to loop over all cells and based on some conditions mark some cells and make those marked cells as a subdomain for later use? I am wondering if you could provide some hints regarding the matter.

I would suggest having a look at: Marking subdomains of a mesh — DOLFIN documentation

1 Like