← Back to team overview

dolfin team mailing list archive

Re: matrix action

 

Anders, Martin:
Dirichlet Boundary conditions?


On Sun, Apr 5, 2009 at 5:58 AM, Martin Sandve Alnæs <martinal@xxxxxxxxx>wrote:

> UFL defines action so you don't have to rewrite/duplicate your form:
>
> a = u*v*dx
> b = action(a, f) # == f*v*dx
>
> Martin
>
>
>
> On Sun, Apr 5, 2009 at 10:34 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Sat, Apr 04, 2009 at 08:30:39PM -0500, Robert Kirby wrote:
> >> Thanks, I'll take a look next week.
> >>
> >> One thought that would take a little work but might be worth exploring
> from the
> >> ffc end would be
> >> to define matrix actions in the form compiler that map to KrylovMatrix
> rather
> >> than Matrix.
> >> For example, one can take the Poisson code, replacing the TrialFunction
> with
> >> Function, so that
> >>
> >> v = TestFunction(V)
> >> u = Function(V)
> >> a = dot(grad(v), grad(u))*dx
> >>
> >> and then generate code for a KrylovMatrix subclass.  Anders and I
> experimented
> >> with the effects of ferari-optimization and found that they were most
> profound
> >> in this context.  It also removes the assembly bottleneck since you
> don't have
> >> to beat on a sparse matrix.  On the other hand, you don't have the
> matrix to
> >> feed to algebraic preconditioners.  No free lunch.
> >>
> >> Rob
> >
> > This wouldn't require anything on the FFC end. It would just require a
> > new C++ class which subclasses either of the Krylov matrices (or maybe
> > a new GenericKrylovMatrix) that takes a linear form (like your 'a'
> > above) to the constructor and calls assemble() in the overloaded mult().
> >
> > This should be easy to add.
> >
> > --
> > Anders
> >
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> >
> > iEYEARECAAYFAknYbQkACgkQTuwUCDsYZdHiCgCeOk8lUh47at3BIt9E7/Xkinw1
> > 3KEAniQRFbDbirrEOgNznCFdPaLfKD9E
> > =YC3r
> > -----END PGP SIGNATURE-----
> >
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> >
> >
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>

Follow ups

References