← Back to team overview

dolfin team mailing list archive

Re: dolfin <-> scipy <-> pyamg

 

By the way, I think many of your algorithms in PyAMG will work with
Dolfin matrices and vectors almost out of the box (The +-/* operators
work as then  should.)  There are however a few functions
like e.g conjugate in numpy that are not present in Dolfin. 
Is it a point to separate pyamg from numpy in the sense that one 
could have a small set of operators and functions that are required
but can be defined by a backend? If so, I think Dolfin, with any 
backend, could be used out of the box in your project. 

BTW, we have also implemented a bunch of Krylov algorithms. They look
like this: 

def precondconjgrad(B, A, x, b, tolerance=1.0E-05, relativeconv=False,
maxiter=500):
    r"""Preconditioned Conjugate Gradients method. Algorithm described
here; 
    http://www.math-linux.com/spip.php?article55""";
    r = b - A*x
    z = B*r
    d = 1.0*z

    rz = inner(r,z)

    if relativeconv: tolerance *= sqrt(rz)
    iter = 0
    while sqrt(rz) > tolerance and iter <= maxiter:
        z = A*d
        alpha = rz / inner(d,z)
        x += alpha*d
        r -= alpha*z
        z = B*r
        rz_prev = rz
        rz = inner(r,z)
        print "rho ", sqrt(rz) 
        beta =  rz / rz_prev
        d = z + beta*d
        iter += 1
    return x





Kent
 


On ti., 2009-02-24 at 20:27 -0600, Luke Olson wrote:
> Kent,
> 
> Thanks for the shout-out.  PyAMG is nearing a stable release and we're
> looking for compatibility with related projects.  We'd love to hear
> any success stories.
> 
> I'm also interested in hearing about any attempts at more closely
> integrating the scipy.sparse module with Dolfin.  Keep up the superb
> work with the Fenics project; it's very impressive.
> 
> Luke
> --
> Luke Olson
> http://www.cs.uiuc.edu/homes/lukeo
> http://www.pyamg.com
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev



References