This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Error in "amg" possion solver

0 votes

Here is my code:

for i in range(6):
    for j in range(i+1):

        tmpb=frx[i]*frx[j]*v*dx
        a=0.25/pi*inner(nabla_grad(u), nabla_grad(v))*dx
        if i==j:
            problem = LinearVariationalProblem(a, tmpb, tmpf, bc1)
        else:
            problem = LinearVariationalProblem(a, tmpb, tmpf, bc)
        solver = LinearVariationalSolver(problem)
        solver.parameters["linear_solver"] = "cg"
        solver.parameters["preconditioner"] = "amg"
        solver.solve()
        vpo[findex(i,j)]=tmpf

I always get such error after 8 successful solvers:

Solving linear variational problem.
Solving linear variational problem.
Solving linear variational problem.
Solving linear variational problem.
Solving linear variational problem.
Solving linear variational problem.
Solving linear variational problem.
[0]PETSC ERROR: --------------------- Error Message ------------------------------------
[0]PETSC ERROR: Error in external library!
[0]PETSC ERROR: Error in HYPRE solver, error code 1!
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 8, Thu Mar 17 13:37:48 CDT 2011
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Unknown Name on a linux-gnu named sobolev by vincehouhou Wed Jun 18 21:19:16 2014
[0]PETSC ERROR: Libraries linked from /build/buildd/petsc-3.1.dfsg/linux-gnu-c-opt/lib
[0]PETSC ERROR: Configure run at Mon Jan 2 08:46:13 2012
[0]PETSC ERROR: Configure options --with-shared --with-debugging=0 --useThreads 0 --with-clanguage=C++ --with-c-support --with-fortran-interfaces=1 --with-mpi-dir=/usr/lib/openmpi --with-mpi-shared=1 --with-blas-lib=-lblas --with-lapack-lib=-llapack --with-blacs=1 --with-blacs-include=/usr/include --with-blacs-lib="[/usr/lib/libblacsCinit-openmpi.so,/usr/lib/libblacs-openmpi.so]" --with-scalapack=1 --with-scalapack-include=/usr/include --with-scalapack-lib=/usr/lib/libscalapack-openmpi.so --with-mumps=1 --with-mumps-include=/usr/include --with-mumps-lib="[/usr/lib/libdmumps.so,/usr/lib/libzmumps.so,/usr/lib/libsmumps.so,/usr/lib/libcmumps.so,/usr/lib/libmumps_common.so,/usr/lib/libpord.so]" --with-umfpack=1 --with-umfpack-include=/usr/include/suitesparse --with-umfpack-lib="[/usr/lib/libumfpack.so,/usr/lib/libamd.so]" --with-spooles=1 --with-spooles-include=/usr/include/spooles --with-spooles-lib=/usr/lib/libspooles.so --with-hypre=1 --with-hypre-dir=/usr --with-scotch=1 --with-scotch-include=/usr/include/scotch --with-scotch-lib=/usr/lib/libscotch.so --with-hdf5=1 --with-hdf5-dir=/usr
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: PCApply_HYPRE() line 181 in src/ksp/pc/impls/hypre/hypre.c
[0]PETSC ERROR: PCApply() line 357 in src/ksp/pc/interface/precon.c
[0]PETSC ERROR: KSPSolve_CG() line 153 in src/ksp/ksp/impls/cg/cg.c
[0]PETSC ERROR: KSPSolve() line 396 in src/ksp/ksp/interface/itfunc.c
[0]PETSC ERROR: PCDestroy_HYPRE() line 201 in src/ksp/pc/impls/hypre/hypre.c
[0]PETSC ERROR: PCDestroy() line 83 in src/ksp/pc/interface/precon.c
[0]PETSC ERROR: KSPDestroy() line 695 in src/ksp/ksp/interface/itfunc.c

I have checked all of my functions "frx" are right. Any suggestions? Thanks.

asked Jun 19, 2014 by vincehouhou FEniCS Novice (540 points)

Have you tried other solver / preconditioner pairs? Specifically, I'm wondering if gmres would do it for the solver.
Does AMG preserve the symmetry of the system matrix? If not, I think that would cause CG to fail no?

1 Answer

0 votes

Your version if PETSc (3.1) is very old, which also implies that your version of DOLFIN is old. Update PETSc and test again.

answered Jun 23, 2014 by Garth N. Wells FEniCS Expert (35,930 points)
...