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