← 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. [...]

 

This looks strange to me, but maybe I don't understand it.

What if you don't even have a vector x? What vector should x should
you then give as an argument?

Maybe it is better to just call the standard version of applyBC()
without x and then do

b *= -1.0;
b += x;

This would be two lines of code extra (one if you put them on the same
line... :-). It's probably better to put this in the Newton solver
since the Newton solver knows why this operation should be performed.

/Anders


On Thu, Dec 01, 2005 at 02:16:12PM +0100, dolfin@xxxxxxxxxx wrote:
> Commit from garth (2005-12-01 14:16 CET)
> -----------------
> 
> 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.
> 
> This is not consistent with the other applyBC functions which return b = bc (no minus sign). This is due to the definition of the nonlinear function F(u)=0.
> For Poisson's equation, I've been using the format F(u) = (grad v,grad u) - (v,f), hence the need for the minus. Is there a preference as to how we set-up nonlinear problems?
> 
> Would it be better to use a different name for funtions that return the difference between the current approximate solution and the Dirichlet BC?
> 
>   dolfin  src/kernel/fem/FEM.cpp       1.43
>   dolfin  src/kernel/fem/dolfin/FEM.h  1.23
> 
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
> 

-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/



References