Hi I learnt how to define subdomains with classes as shown in other topics
class S0(SubDomain): \quad def inside(self, x, on_boundary): \quad\quad return (near_line(0,x) and not(near_line(1,x)))
class S1(SubDomain): \quad def inside(self, x, on_boundary): \quad\quad return (near_line(1,x) and not(near_line(2,x)))
…
and
s0 = S0()
s1 = S1()
…
This method works, but the issue is I have like 10+ subdomains so I do not want to define 10+ classes as what people tend to do in their cases (e.g. 4 classes for 4 subdomains, which is not a lot).
I wonder if it is possible to define 1 class instead. I tried
Please supply a minimal example that shows how the structure of your subdomains (where they are located and how your mesh looks like). In many cases, one can benefit from defining the subdomains during mesh generation, and load them as a MeshFunction.
So I have this star inclusion in the fluid. The subdomains are edges of the star and basically I want to find the stress on it. The mesh is generated by