### How to find the dof of a given cell index?

116

views

0

Hi,

I know that we can find the cell index of a given dof. Is there a way to do the reverse?

Thanks

I know that we can find the cell index of a given dof. Is there a way to do the reverse?

Thanks

Community: FEniCS Project

### 1 Answer

0

Appropriately named...

`vertex_to_dof_map(*V);`

` dof_to_vertex_map(*V);`

Thanks for your reply. But I was talking about cell to dof not vertex to dof. Do you happen to know about that?

written
3 months ago by
Nima

I only know the C++ syntax: there is a mesh->str() function that will list the connectivity:

`sstream<<"mesh->str(true): "<<std::endl<<mesh->str(true);//connectivity, long print`

Also, the cardinality of each:

```
sstream<<"mesh->num_cells(): "<<mesh->num_cells()<<std::endl;
sstream<<"mesh->num_vertices(): "<<mesh->num_vertices()<<std::endl;
sstream<<"mesh->num_edges(): "<<mesh->num_edges()<<std::endl;
sstream<<"mesh->num_faces(): "<<mesh->num_faces()<<std::endl;
sstream<<"mesh->num_facets(): "<<mesh->num_facets()<<std::endl;
```

But each cell can have several dofs associated with it depending on the polynomial degree of your element, so you need to choose a vertex in a cell of interest.

written
3 months ago by
jwinkle

Please login to add an answer/comment or follow this question.