In [1]:
from mshr import *
from dolfin import *
dolfin.set_log_level(dolfin.TRACE)

# Define 2D geometry
domain = Rectangle(dolfin.Point(0., 0.), dolfin.Point(1., 1.)) - Circle(dolfin.Point(0.0, 0.0), .35)
domain.set_subdomain(1, Rectangle(dolfin.Point(.05, .05), dolfin.Point(.95, .95)))
domain.set_subdomain(2, Circle(dolfin.Point(0, 0), .45))
domain.set_subdomain(3, Circle(dolfin.Point(0,0), .6))

# Generate and plot mesh
mesh2d = generate_mesh(domain, 45)

In [2]:
plot(mesh2d)


Out[2]:
<dolfin.cpp.io.VTKPlotter; proxy of <Swig Object of type 'std::shared_ptr< dolfin::VTKPlotter > *' at 0x10dc0d540> >

In [ ]:


In [ ]:


In [3]:
mesh = mf.mesh()

In [5]:
mesh.num_cells()


Out[5]:
3584

In [ ]:


In [ ]: