← Back to team overview

dolfin team mailing list archive

Important bug fix in Dirichlet BC

 

I've pushed a fix for a long-standing bug in the application of
Dirichlet BC that I wasn't aware of which Marie pointed out earlier
today.

The fix affects application of boundary conditions based on
SubDomain::inside when the "topological" option is used (which is the
default).

The DirichletBC class calls SubDomain::mark to mark which facets are
"inside" the boundary and SubDomain::mark calls the inside function for
each vertex on the facet to see if all of them are inside and if so
marks the facet as being inside.

This means that a facet such as the one in the drawing below will be
included in the boundary condition since both its vertices are on the
boundary.

          |
          |
         /|
        / |
       /  |
  ____/___|

This has consequences for P2 elements where this will lead to the dof
on the midpoint of the domain to be included in the boundary
condition.

I have fixed this by making sure that SubDomain::mark also checks the
midpoint of the facet.

Note that this only has an effect when the user does not use the
on_boundary flag, which in the above case will be false.

--
Anders

Attachment: signature.asc
Description: Digital signature