xref: /petsc/src/ksp/pc/impls/python/pythonpc.c (revision 5b6bfdb9644f185dbf5e5a09b808ec241507e1e7)
1 #include <petsc/private/pcimpl.h>          /*I "petscpc.h" I*/
2 
3 /*@C
4    PCPythonSetType - Initalize a PC object implemented in Python.
5 
6    Collective on PC
7 
8    Input Parameter:
9 +  pc - the preconditioner (PC) context.
10 -  pyname - full dotted Python name [package].module[.{class|function}]
11 
12    Options Database Key:
13 .  -pc_python_type <pyname>
14 
15    Level: intermediate
16 
17 .keywords: PC, Python
18 
19 .seealso: PCCreate(), PCSetType(), PCPYTHON, PetscPythonInitialize()
20 @*/
21 PetscErrorCode  PCPythonSetType(PC pc,const char pyname[])
22 {
23   PetscErrorCode ierr;
24 
25   PetscFunctionBegin;
26   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
27   PetscValidCharPointer(pyname,2);
28   ierr = PetscTryMethod(pc,"PCPythonSetType_C",(PC, const char[]),(pc,pyname));CHKERRQ(ierr);
29   PetscFunctionReturn(0);
30 }
31