# Coordinates of subspaces

**URL:** <https://fenicsproject.discourse.group/t/coordinates-of-subspaces/9824>\
**Category:** General\
**Created:** [November 23, 2022, 8:03am UTC](https://fenicsproject.discourse.group/t/coordinates-of-subspaces/9824 "2022-11-23T08:03:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbuFEniCS](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@AbuFEniCS](https://fenicsproject.discourse.group/u/AbuFEniCS)\
**Post date:** [November 23, 2022, 8:03am UTC](https://fenicsproject.discourse.group/t/coordinates-of-subspaces/9824/1 "2022-11-23T08:03:46Z")

</div>

Hello,

I am trying to obtain the coordinates for the subspaces, but I get an error. Please see the code below

```auto
from fenics import *
from fenics_adjoint import *
import ufl
from mshr import *
import matplotlib.pyplot as plt
import numpy as np
%matplotlib notebook

Length = 1.  
Radius = 0.1 
mesh_density = 50

domain = Rectangle(Point(0., 0.), Point(Length, Length))
mesh = generate_mesh(domain, mesh_density)
dimens = mesh.geometry().dim() 

Vue = VectorElement('CG', mesh.ufl_cell(), 2) # displacement finite element
Vte = FiniteElement('CG', mesh.ufl_cell(), 1) # temperature finite element
V = FunctionSpace(mesh, MixedElement([Vue, Vte]))

coord_all = V.tabulate_dof_coordinates()
coord_T = Vte.tabulate_dof_coordinates()                      
coord_u = Vue.tabulate_dof_coordinates()

```

I get the following error  
AttributeError: ‘FiniteElement’ object has no attribute ‘tabulate\_dof\_coordinates’

---

<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:** [November 23, 2022, 8:24am UTC](https://fenicsproject.discourse.group/t/coordinates-of-subspaces/9824/2 "2022-11-23T08:24:51Z")

</div>

The error is quite clear, you are trying to call `tabulate_dof_coordinates()` a function that belongs to a `FunctionSpace`, not a `FiniteElement`.  
You would need to tabulate it for the collapsed sub space:

```python
V.sub(0).collapse().tabulate_dof_coordinates()
V.sub(1).collapse().tabulate_dof_coordinates()

```

---

<div class="post-metadata">

**Author:** ![AbuFEniCS](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@AbuFEniCS](https://fenicsproject.discourse.group/u/AbuFEniCS)\
**Post date:** [November 23, 2022, 9:36am UTC](https://fenicsproject.discourse.group/t/coordinates-of-subspaces/9824/3 "2022-11-23T09:36:11Z")

</div>

Thank you very much @dokken
