Hi, everyone, I’m new here. I don’t know how to create elliptical domain? Can somebody help me?
The mshr module has some basic constructive solid geometry functions for mesh generation. That is sufficient to create a mesh of an elliptical domain, as follows:
from dolfin import *
# Constructive solid geometry functiontionality
from mshr import *
# Specify an ellipse geometry
center = Point(0.0,0.0)
horizontal_semi_axis = 2.0
vertical_semi_axis = 1.0
e = Ellipse(center,
horizontal_semi_axis,
vertical_semi_axis)
# Generate a mesh from it
resolution = 10
mesh = generate_mesh(e,resolution)
# View the mesh:
from matplotlib import pyplot as plt
plot(mesh)
plt.show()
For more complicated geometries, you can import meshes from Gmsh, but I have less experience with that.
Thank you very much!