Actual source code: pythonksp.c
1: #include <petsc/private/kspimpl.h>
3: /*@C
4: KSPPythonSetType - Initialize a `KSP` object to a type implemented in Python.
6: Collective
8: Input Parameters:
9: + ksp - the linear solver `KSP` context.
10: - pyname - full dotted Python name [package].module[.{class|function}]
12: Options Database Key:
13: . -ksp_python_type <pyname> - python class
15: Level: intermediate
17: .seealso: [](chapter_ksp), `KSPCreate()`, `KSPSetType()`, `KSPPYTHON`, `PetscPythonInitialize()`
18: @*/
19: PetscErrorCode KSPPythonSetType(KSP ksp, const char pyname[])
20: {
23: PetscTryMethod(ksp, "KSPPythonSetType_C", (KSP, const char[]), (ksp, pyname));
24: return 0;
25: }
27: /*@C
28: KSPPythonGetType - Get the type of a `KSP` object implemented in Python.
30: Not collective
32: Input Parameter:
33: . ksp - the linear solver `KSP` context.
35: Output Parameter:
36: . pyname - full dotted Python name [package].module[.{class|function}]
38: Level: intermediate
40: .seealso: [](chapter_ksp), `KSPCreate()`, `KSPSetType()`, `KSPPYTHON`, `PetscPythonInitialize()`, `KSPPythonSetType()`
41: @*/
42: PetscErrorCode KSPPythonGetType(KSP ksp, const char *pyname[])
43: {
46: PetscUseMethod(ksp, "KSPPythonGetType_C", (KSP, const char *[]), (ksp, pyname));
47: return 0;
48: }