was trying to use dolfinx_MPC to apply periodic boundary conditions together with Dirichlet bcs, something like
u3 = u2 + u4, with u4=10.
However, the results show that only part of the Dirichlet BCS are applied. Can create_general_constraint be used with fem.dirichletbc together? Same codes are as following
Thanks in advance
bc1x = fem.dirichletbc(0.0, dofs=n1x, V=V.sub(0))
bc1y = fem.dirichletbc(0.0, dofs=n1y, V=V.sub(1))
bc2x = fem.dirichletbc(0.0, dofs=n2x, V=V.sub(0))
bc4x = fem.dirichletbc(10.0, dofs=n4x, V=V.sub(0))
bc4y = fem.dirichletbc(0.0, dofs=n4y, V=V.sub(1))
bcs = [bc1x, bc2x, bc1y, bc4y, bc4x]
#MPC
mpc = MultiPointConstraint(V)
mpcx = {np.array([ a/2, b/2], dtype=np.float64).tobytes():
{np.array([ -a/2, b/2], dtype=np.float64).tobytes(): 1,
np.array([ a/2, -b/2], dtype=np.float64).tobytes(): -1}}
mpcy = {np.array([a/2, b/2], dtype=np.float64).tobytes():
{np.array([ -a/2, b/2], dtype=np.float64).tobytes(): 1}}
mpc.create_general_constraint(mpcx, subspace_master=0, subspace_slave=0)
mpc.create_general_constraint(mpcy, subspace_master=1, subspace_slave=1)
mpc.finalize()
problem = LinearProblem(a, L, mpc, bcs=bcs,
petsc_options={"ksp_type": "preonly", "pc_type": "lu"})