← Back to team overview

dolfin team mailing list archive

Re: -Make FEM:nzsize public [...]

 

On Tue, Nov 01, 2005 at 05:59:06PM +0100, Garth N. Wells wrote:

> Need to think about how to do this best. The problem is that PETSc needs
> pointers to functions that update the function F(u) and the Jacobian, and the
> argument list is fixed by PETSc. Playing with this can be tricky. I want to keep
> it simple for the user to define the update function, without worrying about
> PETSc (or even being aware of it) or the technicalities of applying boundary
> conditions within the iterative process. 

Yes, a user shouldn't need to worry about PETSc. You would still
declare a function according to the PETSc format that you give to
PETSc in NonlinearSolver, but this function would call the
user-supplied F function with some proper arguments, something like

    class NonlinearFunction
    {
    public:

        /// Compute y = F(x)
        virtual void F(const Vector& x, Vector& y);

    };

This would be similar to VirtualMatrix, where we give PETSc the
pointer to

    int usermult(Mat A, Vec x, Vec y);

which in turn calls the user implemented function

    virtual void VirtualMatrix::mult(const Vector& x, Vector& y) const = 0;

/Anders

> > 
> >    The functionality for PDEs can be put in a subclass of
> >    NonlinearFunction that we could call NonlinearPDE, or maybe
> >    just PDE if we assume that it is nonlinear in general.
> > 
> >    The nonlinear solver could then be used for other problems than
> >    PDEs, for example in the ODE solvers.
> 
> Good idea. I'll work on it.
> 
> Garth
> > 
> > /Anders
> > 
> > On Tue, Nov 01, 2005 at 10:42:14AM +0100, dolfin@xxxxxxxxxx wrote:
> > > Commit from garth (2005-11-01 10:42 CET)
> > > -----------------
> > > 
> > > -Make FEM:nzsize public
> > > -Nonlinear solver is now working. Equations of the form F(u)=0 can be
> > solved. Will add demo soon.
> > > 
> > > Nonlinear solver still requires some clean up. Issues include:
> > > - More general initialisation required.
> > > - Allow user to specify parameters for the Newton procedure.
> > > - Allow user to set parameters for the iterative solver (what's the plan
> > for the GMRES class?).
> > > - Inhomogeneous Dirichlet boundary conditions. Some new functions are
> > required in the class FEM to do this.
> > > - Addition of an incremental Newton procedure. PETSc functions exist for
> > this.
> > > 
> > >   dolfin  src/kernel/fem/dolfin/FEM.h                1.19
> > >   dolfin  src/kernel/nls/NonlinearFunction.cpp       1.2
> > >   dolfin  src/kernel/nls/NonlinearSolver.cpp         1.11
> > >   dolfin  src/kernel/nls/dolfin/NonlinearFunction.h  1.2
> > >   dolfin  src/kernel/nls/dolfin/NonlinearSolver.h    1.8
> > > 
> > > _______________________________________________
> > > 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