Hi there.
I have a problem for define a subdomain .
The domain is a square. There are 5 subdomains :
-One rectangle
-and four cicles
The four small circles have a radius of 0.05 and the coordonate of their center are (±0.75 , ±0.75)
When i use the following code for the mesh, i jsut see the square and not other subdomains.
Idon’t know what is the problem
the whole code is :
‘’’
import matplotlib.pyplot as plt
from fenics import *
from dolfin import *
import numpy as np
from mshr import*
Rectangle = Polygon( [Point(-0.50, 0.20),Point(-0.50, -0.20),Point(0.50, -0.20),Point(0.50, 0.20)])
p0 = Point(np.array([-0.750, 0.750]))
p1 = Point(np.array([-0.750, -0.750]))
p2 = Point(np.array([0.750, -0.750]))
p3 = p0 = Point(np.array([0.750, 0.750]))
c0 = Circle(p0,0.05)
c1 = Circle(p1,0.05)
c2 = Circle(p2,0.05)
c3 = Circle(p3,0.05)
arre = Polygon( [Point(1.0, 1.0),Point(-1.0, 1.0),Point(-1.0, -1.0),Point(1.0, -1.0)])
carre.set_subdomain(1, Rectangle)
carre.set_subdomain(2, c0)
carre.set_subdomain(3, c1)
carre.set_subdomain(4, c2)
carre.set_subdomain(5, c3)
resolution =0.55
mesh = generate_mesh(carre,resolution)
plt.figure(figsize=(20, 8))
plot(mesh, title=“Mesh”)
‘’’