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

Diamond shaped two-dimensional domain

0 votes

Hi FEniCS users,

How could I generate a diamond-shaped domain?

Here is an example

Many thanks for any help

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

1 Answer

0 votes
 
Best answer

Hi,
you can create an square mesh and then rotate it 45 degrees. Something like this:

mesh = RectangleMesh(Point(0.0, 0.0), Point(1.0, 1.0), 10, 10)
mesh.rotate(45, 2, Point(0.5, 0.5))
plot(mesh, interactive=True)

See the mesh documentation for more information.

answered Sep 22, 2016 by hernan_mella FEniCS Expert (19,460 points)
selected Oct 30, 2016 by sapenacl
...