xref: /petsc/src/ksp/ksp/impls/python/pythonksp.c (revision 3c859ba3a04a72e8efcb87bc7ffc046a6cbab413)
1 #include <petsc/private/kspimpl.h>          /*I "petscksp.h" I*/
2 
3 /*@C
4    KSPPythonSetType - Initialize a KSP object implemented in Python.
5 
6    Collective on ksp
7 
8    Input Parameters:
9 +  ksp - the linear solver (KSP) context.
10 -  pyname - full dotted Python name [package].module[.{class|function}]
11 
12    Options Database Key:
13 .  -ksp_python_type <pyname> - python class
14 
15    Level: intermediate
16 
17 .seealso: KSPCreate(), KSPSetType(), KSPPYTHON, PetscPythonInitialize()
18 @*/
19 PetscErrorCode  KSPPythonSetType(KSP ksp,const char pyname[])
20 {
21   PetscErrorCode ierr;
22 
23   PetscFunctionBegin;
24   PetscValidHeaderSpecific(ksp,KSP_CLASSID,1);
25   PetscValidCharPointer(pyname,2);
26   ierr = PetscTryMethod(ksp,"KSPPythonSetType_C",(KSP, const char[]),(ksp,pyname));CHKERRQ(ierr);
27   PetscFunctionReturn(0);
28 }
29 
30