Thank you for the answer. I have been looking at a way of doing what you 
suggested and I found the function* FEInterfaceValues 
<https://dealii.org/developer/doxygen/deal.II/classFEInterfaceValues.html>::interface_dof_to_dof_indices()*
 
which seems to be doing what I want. 
I provide it with the interface index "i" and it returns a pair of local 
indices corresponding to the active and neighbouring cell. If then I query 
the first element  *dof_index[0]*, I obtain the local index of the current 
cell, so I though of using it like this :

*            //get the local indices of the current cell and neighbouring 
cell*
*            std::array<unsigned int, 2> dof_index = 
fe_iv.interface_dof_to_dof_indices(i);*
 
*           //use local index to obtain component of shape function.*
*           unsigned int component_i = 
fe_RTE.system_to_component_index(dof_index[0]).first;*

Then with the debugger and printing some values I realised that 
dof_index[0] is kind of always below 160 as expected, but on a couple of 
occasion it goes to 22116; 89130 or 4294967295 and triggers the error of 
system_to_component_index(). Those values looks like global indices whereas 
interface_dof_to_dof_indices(i) should returns local_indices. I must be 
doing something horribly wrong but I could not find a tutorial that uses 
interface_dof_to_dof_indices(). Am I confused with how to use those 
functions ?

Best,

Sylvain

El jueves, 22 de julio de 2021 a la(s) 21:53:19 UTC+2, Wolfgang Bangerth 
escribió:

>
> > Here *n_dofs = 320* and so *system_to_component_index()* does not like 
> to have 
> > an argument i>=160 and throws an error.
> > How come n_dofs=320 in this case ? I was expecting 2 interfaces * 2 
> nodes * 40 
> > components = 160 dofs, unless I am considering all the interfaces of the 
> cell 
> > at onces in which case I have 2 interfaces * 4 nodes * 40 components = 
> 320.
> > 
> > *My main question is therefore:*
> > How can I access the ith component of my shape function in face_worker 
> like in 
> > the cell_worker if I cannot use system_to_component_index() ?
>
> You are using FEInterfaceValues, which considers the shape functions that 
> live 
> on the interface. This set of shape functions is the union of the shape 
> functions living on the two adjacent cells. Because you have a 
> discontinuous 
> element, this set has size 2 * the number of dofs per cell, which gives 
> you 
> exactly the 2*160=320 you observe.
>
> Since you can't use FiniteElement::system_to_component_index on your index 
> 'i', you need to find a different way. One approach is to compute a 
> mapping 
> from this index 'i' to a pair '(here_or_there, index within cell)' and 
> then 
> call system_to_component_index() on the second half of the pair.
>
> Best
> W.
>
> -- 
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/2dcbdfa0-8a7f-4520-8614-558df5cf2287n%40googlegroups.com.

Reply via email to