xref: /petsc/src/ksp/ksp/impls/python/pythonksp.c (revision 5becb6a3a7fe6fe66ca978502f4679a4b24b29fc)
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   PetscFunctionBegin;
22   PetscValidHeaderSpecific(ksp,KSP_CLASSID,1);
23   PetscValidCharPointer(pyname,2);
24   PetscTryMethod(ksp,"KSPPythonSetType_C",(KSP, const char[]),(ksp,pyname));
25   PetscFunctionReturn(0);
26 }
27