Dolfinx mpc overlapping constraints

Hi,

I would like to have a set of mixed periodic conditions, for some I use create_periodic_constraint_geometrical, for others create_periodic_constraint_topological. Doing this, there could be issues when the dofs where the periodicity is applied overlap, as already discussed in https://fenicsproject.discourse.group/t/handling-contraints-with-dolfinx-mpc/9886/2 . Would it be possible to have a method just to discard the slaves dofs that also appear as master right before finalizing the mpc (e.g. removing them from slaves and adjusting offsets and coeffs) rather then trying to find the implicit constraint as in https://fenicsproject.discourse.group/t/handling-contraints-with-dolfinx-mpc/9886/2 ?

Mattia

It would be possible to implement such a method, but note that there are many corner cases for such problems, and therefore it is hard to create a generalized version that will work for every potential combination.

As DOLFINx_MPC (during the finalize call, creates the proper data structures, you could make a custom finalize that does the additional analysis of discarding slaves that are also masters (i.e. modify the self._.... objects before calling the lines after: dolfinx_mpc/python/src/dolfinx_mpc/multipointconstraint.py at main · jorgensd/dolfinx_mpc · GitHub)