Hello everyone, I would like to make a 2D quadrangular mesh on a heterogeneous structure (defined by two rectangular domains). Here is the syntax that does not work :
from fenics import *
import dolfin
from mshr import *
###################
P1 = Point(0,0)
P2 = Point(1,1-0.003)
P3 = Point(0,1-0.003)
P4 = Point(1,1)
nx1 = 50
ny1 = 50
nx2 = 100
ny2 = 100
############
mesh1 = RectangleMesh.create([P1,P2],[nx2,ny2],CellType.Type.quadrilateral)
###########
mesh2 = RectangleMesh.create([P3,P4],[nx1,ny1],CellType.Type.quadrilateral)
domain_mesh = mesh1 + mesh2
mesh = generate_mesh(domain_mesh)
info(mesh)
import matplotlib.pyplot as plt
dolfin.plot(mesh, "2D mesh","Subdomains")
plt.show()
Error lessage :
Blockquote
Traceback (most recent call last):
File “maillage_Banouho.py”, line 21, in
domain = mesh1 - mesh2
TypeError: unsupported operand type(s) for +: ‘dolfin.cpp.mesh.Mesh’ and ‘dolfin.cpp.mesh.Mesh’
Blockquote
Could someone help me to solve this problem. Thanks in advance