← Back to team overview

dolfin team mailing list archive

Re: Functions for applying boundary conditions to the RHS vector only now accept the solution vector x. Where Dirichlet boundary conditions are applied, b = x - bc.The is useful for applying boundary conditions within Newton iterations. [...]

 

Quoting Anders Logg <logg@xxxxxxxxx>:

> > 
> > I don't see how a user could supply boundary conditions without an
> > expression in terms of x, y, z. 
> 
> Perhaps they have a previously computed solution and want to use that
> for boundary conditions for another solution. 

OK.

>Or in your case, you
> want to supply a very special boundary condition which is obtained
> from a combination of a vector and an expression.

I wouldn't call the boundary conditions I'm using very special. They are
standard when using Newton solution methods ;-). In many codes they are more the
rule than the exception.

> 
> > > Then you would be able to have one applyBC() function but in your case
> > > you give it a special boundary condition that returns the residual.

This could be the way to go. As a quick start, I could associate the approximate
solution function with the BoundaryCondition object, and return bc - u. This
won't work for inhomogeneous Neumann boundary conditions though. These will have
to be dealt with somehow in applyBC(). In this case we need return the
difference between the "internal force vector"and the "external force vector".

It would be nice to keep a simple BoundaryCondition class which doesn't require
the user to think about the details of the iterative solution procedure.

Garth





Follow ups

References