hippylib / hippylibx

The next version of hIPPYlib powered by dolfinx
GNU General Public License v2.0
0 stars 1 forks source link

Implementation of Dirichlet BC #6

Closed uvilla closed 6 months ago

uvilla commented 6 months ago

We should create a new version of the Poisson example to illustrate the use of Dirichlet Boundary conditions.

Note that we will have two types of BC. One list, called bc, contains the (possibly different from 0) boundary conditions for the forward problem. The other list, called bc0, contains a homogeneous (i.e = 0) version of the boundary conditions.

Boundary conditions are applied both to the state and adjoint variable. They should be handled both by the PDEProblem and the Misfit class.

uvilla commented 6 months ago

See also here for the ordering: https://github.com/FEniCS/dolfinx/blob/387ff1279c3470fb4956e54f47e00ce81d2f9c1d/python/dolfinx/fem/petsc.py#L826

First we assemble, then we apply the lifting, then we scatter reverse, and finally we apply the bc to the Dirichlet nodes.

uvilla commented 6 months ago

This has been implemented in #11