I would like to know what exactly fenics does when the line below of code is called:
# Define regions as tuples of subdomain labels
DL, DM, DR = (1,2), (2,), (2,3) # ***
How does fenics do this “overlap” over domains?
I see that there is a spacing between the domains in the example, and if it were really considered an overlap of the domains, would there be any difference? As follows:
class Left(SubDomain):
def inside(self, x, on_boundary):
return (x[0] <= 0.25+DOLFIN_EPS)
class Mid(SubDomain):
def inside(self, x, on_boundary):
return (x[0] >= 0.2-DOLFIN_EPS) and (x[0] <= 0.6+DOLFIN_EPS)
class Right(SubDomain):
def inside(self, x, on_boundary):
return (x[0] >= 0.55-DOLFIN_EPS)
FEniCS is open source. You are welcome to read the implementation details. Many of the CutFEM papers by Hansbo and Logg provide even greater detail. @dokken may know more literature sources.
You cannot mark an overlap in a single mesh function (as each cell only can contain one marker).
You need to assemble each domain, and the add together the matrices, as shown in the example below: