Actual source code: pythonpc.c
1: #include <petsc/private/pcimpl.h>
3: /*@C
4: PCPythonSetType - Initialize a `PC` object implemented in Python, a `PCPYTHON`.
6: Collective
8: Input Parameters:
9: + pc - the preconditioner (`PC`) context.
10: - pyname - full dotted Python name [package].module[.{class|function}]
12: Options Database Key:
13: . -pc_python_type <pyname> - python class
15: Level: intermediate
17: .seealso: `PC`, `PCSHELL`, `PCCreate()`, `PCSetType()`, `PCPYTHON`, `PetscPythonInitialize()`
18: @*/
19: PetscErrorCode PCPythonSetType(PC pc, const char pyname[])
20: {
23: PetscTryMethod(pc, "PCPythonSetType_C", (PC, const char[]), (pc, pyname));
24: return 0;
25: }
27: /*@C
28: PCPythonGetType - Get the type of a `PC` object implemented in Python, a `PCPYTHON`.
30: Not collective
32: Input Parameter:
33: . pc - the preconditioner (`PC`) context.
35: Output Parameter:
36: . pyname - full dotted Python name [package].module[.{class|function}]
38: Level: intermediate
40: .seealso: `PC`, `PCSHELL`, `PCCreate()`, `PCSetType()`, `PCPYTHON`, `PetscPythonInitialize()`, `PCPythonSetType()`
41: @*/
42: PetscErrorCode PCPythonGetType(PC pc, const char *pyname[])
43: {
46: PetscUseMethod(pc, "PCPythonGetType_C", (PC, const char *[]), (pc, pyname));
47: return 0;
48: }