Actual source code: pythonts.c

  1: #include <petsc/private/tsimpl.h>

  3: /*@C
  4:    TSPythonSetType - Initialize a `TS` object implemented in Python.

  6:    Collective

  8:    Input Parameters:
  9: +  ts - the `TS` context
 10: -  pyname - full dotted Python name [package].module[.{class|function}]

 12:    Options Database Key:
 13: .  -ts_python_type <pyname> - python class

 15:    Level: intermediate

 17: .seealso: [](chapter_ts), `TSCreate()`, `TSSetType()`, `TSPYTHON`, `PetscPythonInitialize()`
 18: @*/
 19: PetscErrorCode TSPythonSetType(TS ts, const char pyname[])
 20: {
 23:   PetscTryMethod(ts, "TSPythonSetType_C", (TS, const char[]), (ts, pyname));
 24:   return 0;
 25: }

 27: /*@C
 28:    TSPythonGetType - Get the type of a `TS` object implemented in Python.

 30:    Not Collective

 32:    Input Parameter:
 33: .  ts - the `TS` context

 35:    Output Parameter:
 36: .  pyname - full dotted Python name [package].module[.{class|function}]

 38:    Level: intermediate

 40: .seealso: [](chapter_ts), `TSCreate()`, `TSSetType()`, `TSPYTHON`, `PetscPythonInitialize()`, `TSPythonSetType()`
 41: @*/
 42: PetscErrorCode TSPythonGetType(TS ts, const char *pyname[])
 43: {
 46:   PetscUseMethod(ts, "TSPythonGetType_C", (TS, const char *[]), (ts, pyname));
 47:   return 0;
 48: }