xref: /petsc/src/ksp/pc/impls/python/pythonpc.c (revision 67b8a455b8687dfb2f87ed52b249206f831b8117)
1af0996ceSBarry Smith #include <petsc/private/pcimpl.h>          /*I "petscpc.h" I*/
2245f004bSJed Brown 
3245f004bSJed Brown /*@C
4a5b23f4aSJose E. Roman    PCPythonSetType - Initialize a PC object implemented in Python.
5245f004bSJed Brown 
6245f004bSJed Brown    Collective on PC
7245f004bSJed Brown 
8d8d19677SJose E. Roman    Input Parameters:
9245f004bSJed Brown +  pc - the preconditioner (PC) context.
10245f004bSJed Brown -  pyname - full dotted Python name [package].module[.{class|function}]
11245f004bSJed Brown 
12245f004bSJed Brown    Options Database Key:
13*67b8a455SSatish Balay .  -pc_python_type <pyname> - python class
14245f004bSJed Brown 
15245f004bSJed Brown    Level: intermediate
16245f004bSJed Brown 
17245f004bSJed Brown .seealso: PCCreate(), PCSetType(), PCPYTHON, PetscPythonInitialize()
18245f004bSJed Brown @*/
19245f004bSJed Brown PetscErrorCode  PCPythonSetType(PC pc,const char pyname[])
20245f004bSJed Brown {
21245f004bSJed Brown   PetscErrorCode ierr;
22245f004bSJed Brown 
23245f004bSJed Brown   PetscFunctionBegin;
24245f004bSJed Brown   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
25245f004bSJed Brown   PetscValidCharPointer(pyname,2);
26245f004bSJed Brown   ierr = PetscTryMethod(pc,"PCPythonSetType_C",(PC, const char[]),(pc,pyname));CHKERRQ(ierr);
27245f004bSJed Brown   PetscFunctionReturn(0);
28245f004bSJed Brown }
29