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

Specifying domain for a Cubic Mesh

0 votes

Hello All,

I am just starting to use fenics.

How do you specify the domain of a mesh if one is using a Cubemesh.

For example, I understand:

mesh = UnitCubeMesh(10,10,10)

and this is in the domain [0,1] for x,y and z.

Is it possible to make a cubic mesh specifying one vertex (say [0,0,0]) and the x,y,z extents?

Thanks,

Victor.

asked Aug 1, 2016 by wtpot FEniCS Novice (450 points)

1 Answer

+1 vote
 
Best answer

This is possible, but you will need to use BoxMesh and specify the points explicitly since UnitCubeMesh is defined to be in the domain [0,1]. See the mesh tutorial as well as the documentation page for BoxMesh.

For example, as shown in the tutorial,

mesh = BoxMesh(Point(0.0, 0.0, 0.0), Point(10.0, 4.0, 2.0), 10, 10, 10)
print("Plotting a BoxMesh")
plot(mesh, title="Box")
answered Aug 1, 2016 by FF FEniCS User (4,630 points)
selected Aug 16, 2016 by johannr

Just figured it out.

Thanks for the additional links.
This is amazing software.

...