xref: /petsc/src/ts/impls/python/pythonts.c (revision ebead697dbf761eb322f829370bbe90b3bd93fa3)
1 #include <petsc/private/tsimpl.h>          /*I "petscts.h" I*/
2 
3 /*@C
4    TSPythonSetType - Initialize a TS object implemented in Python.
5 
6    Collective on TS
7 
8    Input Parameters:
9 +  ts - the TS context
10 -  pyname - full dotted Python name [package].module[.{class|function}]
11 
12    Options Database Key:
13 .  -ts_python_type <pyname> - python class
14 
15    Level: intermediate
16 
17 .seealso: `TSCreate()`, `TSSetType()`, `TSPYTHON`, `PetscPythonInitialize()`
18 @*/
19 PetscErrorCode  TSPythonSetType(TS ts,const char pyname[])
20 {
21   PetscFunctionBegin;
22   PetscValidHeaderSpecific(ts,TS_CLASSID,1);
23   PetscValidCharPointer(pyname,2);
24   PetscTryMethod(ts,"TSPythonSetType_C",(TS, const char[]),(ts,pyname));
25   PetscFunctionReturn(0);
26 }
27 
28 /*@C
29    TSPythonGetType - Get the type of a TS object implemented in Python.
30 
31    Not collective
32 
33    Input Parameter:
34 .  ts - the TS context
35 
36    Output Parameter:
37 .  pyname - full dotted Python name [package].module[.{class|function}]
38 
39    Level: intermediate
40 
41 .seealso: `TSCreate()`, `TSSetType()`, `TSPYTHON`, `PetscPythonInitialize()`, `TSPythonSetType()`
42 @*/
43 PetscErrorCode  TSPythonGetType(TS ts,const char *pyname[])
44 {
45   PetscFunctionBegin;
46   PetscValidHeaderSpecific(ts,TS_CLASSID,1);
47   PetscValidPointer(pyname,2);
48   PetscUseMethod(ts,"TSPythonGetType_C",(TS, const char*[]),(ts,pyname));
49   PetscFunctionReturn(0);
50 }
51