Nitsche method

this documentation is in english and needs to be translated.

1. Weak treatment of Dirichlet boundary conditions

In order to treat the boundary conditions uniformly (i.e. the same way as Neumann and Robin Conditions), we wish to treat the Dirichlet BC (e.g. u=gu=g) weakly.

Initial Idea

Add the penalisation term

Ωμ(ug)Ωμ(ug)

where μμ is a constant. But this is not enough: this is not consistent with the initial formulation.

One can use the Nitsche method to implement weak Dirichlet conditions and follows the next steps:

  • write the equations in conservative form (i.e. identify the flux);

  • add the terms to ensure consistency (i.e the flux on the boundary);

  • symmetrize to ensure adjoint consistency;

  • add a penalisation term with factor γ(ug)/hγ(ug)/h that ensures that the solution will be set to the proper value at the boundary;

2. Penalisation parameter

2.1. Choosing γγ

γγ must be chosen such that the coercivity(or inf-sup) property is satisfied. It is difficult to do in general. We increase γγ until the weak Dirichlet boundary conditions are properly satisfied, e.g. start with γ=1γ=1, typical values are between 1 and 10.

The choice of γγ is a problem specially when hh is small.

2.2. Advantages, disadvantages

We compare the advantages and disadvantages of strong and weak Dirichlet boundary conditions treatment.

We start with the weak conditions

  • advantage uniform(weak) treatment of all boundary conditions type

  • advantage if boundary condition is independant of time, the terms are assembled once for all

  • disadvantage Introduction of the penalisation parameter γγ that needs to be tweaked

Strong treatment: Advantages

  • advantage Enforce exactely the boundary conditions

  • disadvantage Need to modify the matrix once assembled to reflect that the Dirichlet degree of freedom are actually known. Then even if the boundary condition is independant of time, at every time step if there are terms depending on time that need reassembly (e.g. convection) the strong treatment needs to be reapplied.

  • disadvantage it can be expensive to apply depending on the type of sparse matrix used, for example using CSR format setting rows to 0 except on the diagonal to 1 is not expensive but one must do that also for the columns associated with each Dirichlet degree of freedom and that is expensive.

3. Example: Laplacian

We look for uu such that

(ku)=f inΩ,u=g|Ω(ku)=f inΩ,u=g|Ω
Ωkuv+Ωkunvintegration by partkvnuadjoint consistency: symetrisation+γhuvpenalisation: enforce Dirichlet condition=Ωfv+Ω(kvnadjoint consistency+γhv)gpenalisation: enforce Dirichlet condition

3.1. Implementation

// contribution to bilinear form (left hand side)
form2( _test=Xh, _trial=Xh ) +=
integrate( boundaryfaces(mesh),
           // integration by part
           -(gradt(u)*N())*id(v)
           // adjoint consistency
           -(grad(v)*N())*idt(u)
           // penalisation
           +gamma*id(v)*idt(u)/hFace());
// contribution to linear form (right hand side)
form1( _test=Xh ) +=
integrate( boundaryfaces(mesh),
           // adjoint consistency
           -(grad(v)*N())*g
           // penalisation
           +gamma*id(v)*g/hFace());
cpp

4. Example: Convection-Diffusion

Convection Diffusion Consider now the following problem, find u such that

(ϵu+cu)=f,u=g|Ω,c=0

the flux vector field is F=u.

Note that here the condition, c=0 was crucial to expand (cu) into cu since

(cu)=cu+uc=0

Weak formulation for convection diffusion Multiplying by any test function v and integration by part of ([eq:2]) gives

Ωϵuv+(cu)v+Ω(Fn)v=Ωfv

where n is the outward unit normal to Ω.

We now introduce the penalisation term that will ensure that ug as h0 on Ω. ([eq:4]) reads now

Ωϵuv+(cu)v+Ω(Fn)v+γhuv=Ωfv+Ωγhgv

Finally we can incorporate the symetrisation

Ωϵuv+(cu)v+Ω((ϵu)n)v+(ϵvn+cnv)u+γhuv=Ωfv+Ω(ϵvn+cnv)g+γhgv

4.1. Implementation

// bilinear form (left hand side)
form2( _trial=Xh, _test=Xh ) +=
integrate( boundaryfaces(mesh),
  // integration by part
  -($\epsilon$ gradt(u)*N())*id(v) + (idt(u)*trans(idv(c))*N())*id(v)
  // adjoint consistency
  -($\epsilon$ grad(v)*N())*idt(u) + (idt(u)*trans(idv(c))*N())*id(v)
  // penalisation
  +gamma*id(v)*idt(u)/hFace());
// linear form (right hand side)
form1( _test=Xh ) +=
integrate( boundaryfaces(mesh),
  // adjoint consistency
  -($\epsilon$ grad(v)*N())*g
  + g*trans(idv(c))*N())*id(v)
  // penalisation
  +gamma*id(v)*g/hFace());
cpp