On 12/19/24 11:52, Sclah wrote:
> Thank you for your help.Yes, I am using the same finite element for the two
> variables.
> I just checked and face_component_to_system_index() doesn't seem to exist
> inside the library, will component_to_system_index() work just fine?
Ah, that's a bummer. When you call
cell->face(f)->get_dof_indices(face_dof_indices)
you get a list of global DoF indices, say
[12, 13, 14, 27, 28, 29]
and you want to find out which of these corresponds to, say, an x-velocity
DoF. fe.system_to_component_index() can tell you that if the list was a list
of DoF indices for the *cell*, but you have a list of DoF indices on the *face*.
Since there is no face_system_to_component_index(), you have two options:
* You write a function FiniteElement::face_system_to_component_index(), using
FiniteElement::system_to_component_index() as an example.
* You find a way to translate from face to cell DoF indices, for example to
know that the 14 above is the face DoF index for shape function 2 (starting
counting at zero) on the cell and that that is, say, shape function 8 on the
cell. Then you can use FiniteElement::system_to_component_index(8) to query
the properties of the 8th shape function. You can make that translation by calling
cell->get_dof_indices(cell_dof_indices)
and then finding where each of the elements of face_dof_indices is located in
cell_dof_indices.
That said, looking this up just now, there *is* a function called
FiniteElement::face_system_to_component_index(). Why can't you use that? There
is not one for the other direction, i.e., there is no
FiniteElement::face_component_to_system_index() but you only need things in
one direction and can get the other direction as the inverse of that mapping.
Best
W.