mesh generation

Asked by Chaffra Affouda

I like the new feature to generate complex meshes directly. Here is a small example where I try to generate a stack of layers to be meshed. How do I build the mesh so that it generates the triangles only within the square boundaries?

            ____
______||||||||______
||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||

from dolfin import *
t1 = 1.0
t2 = 0.5
w = 4

x1 = t1
x2 = x1+t2

vertices = [Point(0.0,0.0), Point(x1,0.0), Point(x1,w/2.0-t2/2.0), Point(x2,w/2.0-t2/2.0),
Point(x2,w/2.0+t2/2.0), Point(x1,w/2.0+t2/2.0), Point(x1,w), Point(0.0,w), Point(0.0,0.0)]
mesh = Mesh()
PolygonalMeshGenerator.generate(mesh, vertices,0.25);
plot(mesh, interactive=True)

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Garth Wells
Solved:
Last query:
Last reply:
Revision history for this message
Best Garth Wells (garth-wells) said :
#1

I've committed a fix in lp:dolfin. Take a look at the updated mesh generation demo.

Revision history for this message
Chaffra Affouda (chaffra) said :
#2

Thanks Garth Wells, that solved my question.