On 7/23/21 8:59 AM, Sylvain Mathonnière wrote:
> Thank you for the answer. I have been looking at a way of doing what you
> suggested and I found the function*FEInterfaceValues
> <
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdealii.org%2Fdeveloper%2Fdoxygen%2Fdeal.II%2FclassFEInterfaceValues.html&data=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7Cbe067ec5c8ab4601e70308d94dea8304%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637626491881337201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=hrnX9t7udM50eZvFVTiCBunh8ShGkow1iyI4AZq7udw%3D&reserved=0>::interface_dof_to_dof_indices()*
> which seems to be doing what I want.
Ah yes, I had forgotten about this function!
> 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 ?
No, I think you're right that that is how the function is supposed to work.
4294967295 is numbers::invalid_dof_index, which is the case discussed in the
documentation where a DoF lives only one one side of the interface. The other
values (22116; 89130) shouldn't happen. If that's what you get, then there is
a bug somewhere.
Do you think you could construct a small testcase that illustrates what you have?