This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

uniformly distributed mesh size

0 votes

Hi FEniCS users,

I am coding the following to generate a diamond- shaped mesh with one edge cut and I am not sure how to proceed regarding how to set uniform mesh size (I was expecting to get uniform mesh size like in the case for a square-shaped domain) :

from dolfin import *
from mshr import *
from pylab import show,triplot
domain_vertices = [Point(0.0, 0.0125),
               Point(0.0, -0.0125),
               Point(1.0, -1.0),
               Point(2.0, 0.0),
               Point(1.0, 1.0)]
domain = Polygon(domain_vertices)
mesh = generate_mesh(domain,40)
coords = mesh.coordinates()
triplot(coords[:,0], coords[:,1], triangles=mesh.cells())
print mesh.num_cells()
show()

which generates a mesh with non-uniform mesh size. Is it possible to accomplish this with a single FEniCS code, or should I use an external mesh generator? if so, which one do you guys recommend me?

Thanks a lot for any help,

asked Sep 27, 2016 by sapenacl FEniCS Novice (270 points)
...