# Spatial coordinate local values

**URL:** <https://fenicsproject.discourse.group/t/spatial-coordinate-local-values/11021>\
**Category:** mesh\
**Created:** [April 24, 2023, 7:45pm UTC](https://fenicsproject.discourse.group/t/spatial-coordinate-local-values/11021 "2023-04-24T19:45:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bagla0](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bagla0/32/4677_2.png) [@bagla0](https://fenicsproject.discourse.group/u/bagla0)\
**Post date:** [April 24, 2023, 7:45pm UTC](https://fenicsproject.discourse.group/t/spatial-coordinate-local-values/11021/1 "2023-04-24T19:45:36Z")

</div>

Hi FEniCS family,

I wanted to know guass point coordinates used by form.

```auto
mesh=UnitCubeMesh(1,1,1)
x = SpatialCoordinate(mesh)
x.get_local()

---> 3 x.get_local()

AttributeError: 'SpatialCoordinate' object has no attribute 'get_local'

```

Can you tell me how I can get the guass points location of mesh.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [April 24, 2023, 7:52pm UTC](https://fenicsproject.discourse.group/t/spatial-coordinate-local-values/11021/2 "2023-04-24T19:52:55Z")

</div>

You do you want the explicit representation of the gauss coordinates in the physical space?

Note that `x = SpatialCoordinate(mesh)` is a symbolic representation of the quadrature point.

The quadrature degree depends on the variational form (see: [How to obtain the Gauss quadrature degree estimated by the form compiler - #2 by dokken](https://fenicsproject.discourse.group/t/how-to-obtain-the-gauss-quadrature-degree-estimated-by-the-form-compiler/4099/2)) and thus the quadrature points will vary depending on if you look at your linear or bilinear form.

---

<div class="post-metadata">

**Author:** ![bagla0](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bagla0/32/4677_2.png) [@bagla0](https://fenicsproject.discourse.group/u/bagla0)\
**Post date:** [April 24, 2023, 10:32pm UTC](https://fenicsproject.discourse.group/t/spatial-coordinate-local-values/11021/3 "2023-04-24T22:32:15Z")

</div>

Thanks @dokken for your response. The symfem really helps.

1. How can we get the determinant of jacobian matrix which is multiplied during assemble operation?  
If not values, at least, I could get the formulation used by FEniCS for tetrahedron elements.

```auto
from dolfin import *
mesh=UnitCubeMesh(1,1,1)
x = SpatialCoordinate(mesh)
 assemble((x[1]*x[2])*dx)

```

1. Can we make the mesh to brick element from default tetrahedron element ?

```auto
from dolfin import *
mesh=UnitCubeMesh(1,1,1)

```

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [April 25, 2023, 6:38am UTC](https://fenicsproject.discourse.group/t/spatial-coordinate-local-values/11021/4 "2023-04-25T06:38:42Z")

</div>

> [@bagla0](#):
>
> How can we get the determinant of jacobian matrix which is multiplied during assemble operation?  
> If not values, at least, I could get the formulation used by FEniCS for tetrahedron elements.

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

```python
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())

```

> [@bagla0](#):
>
> Can we make the mesh to brick element from default tetrahedron element ?

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](https://bitbucket.org/fenics-project/dolfin/src/8060a84e8ada0df018772497534092727b06bd56/python/test/unit/geometry/test_intersection.py?at=master#lines-80). 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](https://github.com/FEniCS/dolfinx/) as has full support for hexes (also non-affine hexes)
