xref: /petsc/src/ksp/pc/impls/python/pythonpc.c (revision af0996ce37bc06907c37d8d91773840993d61e62)
1*af0996ceSBarry Smith #include <petsc/private/pcimpl.h>          /*I "petscpc.h" I*/
2245f004bSJed Brown 
3245f004bSJed Brown #undef __FUNCT__
4245f004bSJed Brown #define __FUNCT__ "PCPythonSetType"
5245f004bSJed Brown /*@C
6245f004bSJed Brown    PCPythonSetType - Initalize a PC object implemented in Python.
7245f004bSJed Brown 
8245f004bSJed Brown    Collective on PC
9245f004bSJed Brown 
10245f004bSJed Brown    Input Parameter:
11245f004bSJed Brown +  pc - the preconditioner (PC) context.
12245f004bSJed Brown -  pyname - full dotted Python name [package].module[.{class|function}]
13245f004bSJed Brown 
14245f004bSJed Brown    Options Database Key:
15245f004bSJed Brown .  -pc_python_type <pyname>
16245f004bSJed Brown 
17245f004bSJed Brown    Level: intermediate
18245f004bSJed Brown 
19245f004bSJed Brown .keywords: PC, Python
20245f004bSJed Brown 
21245f004bSJed Brown .seealso: PCCreate(), PCSetType(), PCPYTHON, PetscPythonInitialize()
22245f004bSJed Brown @*/
23245f004bSJed Brown PetscErrorCode  PCPythonSetType(PC pc,const char pyname[])
24245f004bSJed Brown {
25245f004bSJed Brown   PetscErrorCode ierr;
26245f004bSJed Brown 
27245f004bSJed Brown   PetscFunctionBegin;
28245f004bSJed Brown   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
29245f004bSJed Brown   PetscValidCharPointer(pyname,2);
30245f004bSJed Brown   ierr = PetscTryMethod(pc,"PCPythonSetType_C",(PC, const char[]),(pc,pyname));CHKERRQ(ierr);
31245f004bSJed Brown   PetscFunctionReturn(0);
32245f004bSJed Brown }
33