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

How to create a cube mesh with arbitrary dimensions?

0 votes

I used

omega = UnitCubeMesh(4, 4, 4)

But I need to make a cube $\Omega = [-1,1]\times [-2,2] \times [-1,3]$

Which is the function that does this?

asked Aug 9, 2013 by ljofre FEniCS Novice (720 points)
edited Aug 10, 2013 by ljofre

1 Answer

+5 votes
 
Best answer

Try

omega = BoxMesh(-1, -2, -1, 1, 2, 3, 4, 4, 4)

Mikael

answered Aug 9, 2013 by mikael-mortensen FEniCS Expert (29,340 points)
selected Aug 9, 2013 by Garth N. Wells

in python:

NameError: name 'BoxMesh' is not defined

That means your FEniCS version is older and you should simply use Box.

...