It seems like some of the functions in DOLFINX are not avaliable in DOLFINX_MPC, since I only with simple PBC (uniform mesh like interval), so I wonder that is it doable for me to write some PBC functional which is only depend on DOLFINX? Then maybe I can implement what I want with just DOLFINX.
To my understanding, to implement PBC, what we need to do is as follows:
Assemble the matrix and vectors as usual, the we get Ax = b to solve
Handle some entries of the matrix on the boundary, like set the ghost dof element in the vector to be 0
Solve the system as usual
Update the ghost nodes
Please let me know if what I said is wrong.
So then, since everything in DOLFINX work well, if I want to play with PETSc and borundary dofs a bit to apply the steps 1 and 3 above, is it possible? Or is there anything that may be a limit, like the computation may be expensive.
For a purely matching node, periodic problem what I would do would be to change the dofmap such that dofs on one interface is replaced by those ok the other side. This should be doable (especially in serial). You would then create a new FunctionSpace with this dofmap, you would use for assembly, and all commands would be dolfinx commands.
Another interesting option would be to create a continuous topology, But discontinuous geometry.
This would require some more work, but if I find time sometime this spring I might pursue it
Ghost dofs is a term I would use for dofs owned by other processes.
Usually term “master/slave” or “master/puppet” can be used to be described the dof relationships.
I would take the constrained dof from the initial dofmap (puppet dof) and replace it with the master dof.