# Weak dirichlet BC

Hello

Is it possible to enforce dirichlet BC in weak form, the so called primal mixed approach. An example is given here, Remark 7.1.4

Is it possible to do this in fenics and are there any examples ?

## Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Praveen C
Solved:
Last query:
 Revision history for this message Kaspar Müller (kasparmueller) said on 2011-07-07: #1

Hi Praveen,

Yes, it is possible to enforce Dirichlet BC in a weak sense. I did this in my Master-thesis. (http://www.csc.kth.se/~kasparm/)
Have a look at section 3.4.1 for the description.
In this work I apply the weak form several times. In Chapter 4 I apply this type of boundary condition to a Stokes problem. In Section 4.4.2 you find the description of the boundary integral implementation. In the appendix of the thesis you find the UFL file for the Stokes problem (Section 9.1).
Let me know if you need more help.

Best wishes,
Kaspar

 Revision history for this message Praveen C (cpraveen) said on 2011-07-08: #2

Thanks Kaspar. That was very useful. But this seems to introduce an ad-hoc parameter delta. Is it known how this affects the accuracy of the solution ? Also, can this approach be used for something like time-dependent heat equation, with weakly enforced dirichlet bc.

 Revision history for this message Andre Massing (massing) said on 2011-07-08: #3

Hi!

On 07/08/2011 12:45 PM, Praveen C wrote:
> Question #164065 on DOLFIN changed:
>
>
> Praveen C confirmed that the question is solved:
> Thanks Kaspar. That was very useful. But this seems to introduce an ad-
> hoc parameter delta. Is it known how this affects the accuracy of the
> solution ? Also, can this approach be used for something like time-
> dependent heat equation, with weakly enforced dirichlet bc.
>

I just quickly jump into the discussion...
There exists also another related method to weakly enforce dirichlet bc,
known as Nitsche's method. A nice overview of it possibilities and
especially its formulation is the simplest case of Dirichlet bc for a
Poisson can be found for instance in

"Nitsche’s method for interface problems in
computational mechanics" by Peter Hansbo

http://www.math.chalmers.se/~hansbo/nitscherev_preprint.pdf

This method is know to be consistent and stable, retaining the order of
convergence you would aspect from you FEM. This can (same for kaspar's
suggestion) applied to time-dependent problems as well (if you are
talking about imposing the bc there), since the weak incorporation of
the bc are part of your weak formulation of the let say elliptic
operator. One part in the Nitsche's formulation is a penalty part (same
as in Kaspars suggestion) which looks like
\int_{\partial \Omega} c/h (u-u_0)v dS
where h is local meshsize. If you choose c really too small, then you
loose ellipticity of your numerical formulation, choosing c really too
large gives you an ill-conditioned matrix. See the cited paper for some