Dear deal.ii community,
first of all, a big thank you for all the effort going into this
software.
I am currently developing an application and I stumbled upon
implementing periodic boundary conditions for discontinuous Lagrange
elements.
I found the following thread
https://groups.google.com/g/dealii/c/WlOiww5UVxc/m/mtQJDUwiBQAJ
In this thread Dr. Arndt explains that when discontinuous elements were
used, it made more sense to enforce boundary conditions weakly instead
of using strong boundary conditions. In deal.ii this seems to be
tantamount to telling the MeshWorker to treat the boundary faces as
internal faces without using an additional constraint matrix enforcing
the equality of DoFs on the periodic parts of the domain.
If I understand correctly the MeshWorker can be informed to treat the
boundary faces as internal faces by modifying the triangulation with a
call of the function triangulation.add_periodocity(periodicity_vector).
Where the periodicity vector is filled by calling the function
collect_periodic_faces.
I tried this and it works as expected in 1D, but in 2D I get the
following error message.
> An error occurred in line <1001> of file </home/schween/.tmp/dealii/src/dealii-9.4.1/include/deal.II/grid/tria_iterator.h> in function
> const Accessor& dealii::TriaRawIterator<Accessor>::operator*() const [with Accessor = dealii::CellAccessor<2, 2>]
> The violated condition was:
> Accessor::structure_dimension != Accessor::dimension || state() == IteratorState::valid
> Additional information:
> You tried to dereference a cell iterator for which this is not
> possible. More information on this iterator: level=-1, index=-1,
> state=past_the_end
I adapted the step 12 tutorial such that it is easy for you to reproduce
the error. I attach the code to this email. Just change the template
argument for the parameter dim from 1 to 2 to see for yourself.
I should mention the adapted tutorial is not working with a distributed
triangulation. In my application I am. So at first I thought, that I was
using a wrong filter for the iterator range which I am handing over to
mesh_loop function. But since the error persist even when using only one
processor, it must be something else.
What am I doing wrong? Any help is appreciated.
Thank you very much.
Regards,
Nils