Assembly of integrals over interal boundaries messes up DirichletBCs
In forms that contain integral over internal boundaries where also DirichletBCs are applied,
the solution does not agree with the given DirichletBC, when the assembly of matrix, rhs-vector and BCs is
done via assemble_system
or some other method relying on SystemAssembler
.
Correct solutions are obtained when BCs are applied ‘manually’ after assembly of matrix and vector.
Interestingly, solve
work correctly in its form for linear problems, but gives wrong results in the nonlinear format.
While this looks like a quite contrived example in case of scalar-valued problems, it makes perfect sense in
elasticity. Consider for example a face which is displaced in horizontal direction and experiences a traction in
vertical direction.
A (not so) minimal working example is attached.
I observed this behavior for versions 2018.1.0 and 2019.1.0 (older versions not tested).
Comments (2)
-
-
Have either of you made any progress on identifying the cause of this error. Jorgen Dokken linked to this issue from my recently posted question on Discourse. I have found a problem similar to what you have when I use the internal-facet measure
dS
in an extremely simple form, with assembly using the SystemAssembler.
Strangely, I only have it on some meshes and not others. - Log in to comment
I believe that I have encountered a similar problem.
The MWE that I have is:
Note that this case is slightly different to the OP’s: I apply Dirichlet BCs on external facets, but the RHS consists of an integral over internal facets.
Nevertheless, I believe the underlying cause to be the same, as different results are obtained when using
SystemAssembler
(called byassemble_system
) orAssembler
(called byassemble
.I observed this issue on version 2019.1.0, but have not tested against other versions.
What follows is a script that implements the MWE (it seems Bitbucket does not allow commenters to attach files in a way that do not modify the OP):