xref: /petsc/src/ksp/pc/impls/python/pythonpc.c (revision a5b23f4acc7afc99d3844ebd5fb65a81c16e8b8c)
1af0996ceSBarry Smith #include <petsc/private/pcimpl.h>          /*I "petscpc.h" I*/
2245f004bSJed Brown 
3245f004bSJed Brown /*@C
4*a5b23f4aSJose E. Roman    PCPythonSetType - Initialize a PC object implemented in Python.
5245f004bSJed Brown 
6245f004bSJed Brown    Collective on PC
7245f004bSJed Brown 
8245f004bSJed Brown    Input Parameter:
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:
13245f004bSJed Brown .  -pc_python_type <pyname>
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