I'm attempting some rapid prototyping with petsc4py. The idea is basically to read-in a matrix and rhs, setup GAMG as ksppreonly, get the smoother and overrule it with a python function of my own, similar to the demo where the Jacobi method is user-defined in python. So far I have something like this:
pc = PETSc.PC().create() pc.setOperators(A) pc.setType(PETSc.PC.Type.GAMG) pc.PCMGGetSmoother(l=0,ksp=smoother) which triggers the following error: AttributeError: 'petsc4py.PETSc.PC' object has no attribute 'PCMGGetSmoother' 1) Am I doing something wrong, or is this function just not available through python? 2) How can I tell up front if a function is available, only if it is listed in libpetsc4py.pyx? 3) Given the function description in C from the manual pages, how can I deduce the python syntax? (perhaps it's supposed to be ksp = pc.PCMGGetSmoother(l=0), or something else entirely) Thanks for your help, dr. ir. Christiaan Klaij | Senior Researcher | Research & Development T +31 317 49 33 44 | c.kl...@marin.nl | https://urldefense.us/v3/__http://www.marin.nl__;!!G_uCfscf7eWS!fuGSX2r2dc6Uj05gGWmXIUBhKmH4GUWf4FdVk1fonAxLxhy9cN2iLnXPgauopyAAtW08jyABFGurfeZ-5GDS9n8$