Spatial coordinate local values

Consider the following (works for affine cells such as triangles, tetrahedrons and affine quads/hexes)

import dolfin
from ufl import Jacobian
mesh = dolfin.UnitCubeMesh(1,1,1)
J = abs(dolfin.det(Jacobian(mesh)))

Q = dolfin.FunctionSpace(mesh, "DG", 0)
cell_jac = dolfin.project(J, Q)
print(cell_jac.vector().get_local())

When you say “brick” element, I suspect you mean: "Can we use hexahedral mesh elements.

Short answer is: This is not fully supported in legacy DOLFIN, and you are recommended to use DOLFINx if you want such elements.

Long answer: You can try to use it in DOLFIN, see: Bitbucket. However, it is not guaranteed to work (it does not for for other meshes than the “built-in” ones). You are recommended to use DOLFINx: GitHub - FEniCS/dolfinx: Next generation FEniCS problem solving environment as has full support for hexes (also non-affine hexes)

2 Likes