Actual source code: pythontao.c

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

  3: /*@C
  4:    TaoPythonSetType - Initialize a Tao object implemented in Python.

  6:    Collective

  8:    Input Parameters:
  9: +  tao - the optimation solver (Tao) context.
 10: -  pyname - full dotted Python name [package].module[.{class|function}]

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

 15:    Level: intermediate

 17: .seealso: `TaoCreate()`, `TaoSetType()`, `TAOPYTHON`, `PetscPythonInitialize()`
 18: @*/
 19: PetscErrorCode TaoPythonSetType(Tao tao, const char pyname[])
 20: {
 23:   PetscTryMethod(tao, "TaoPythonSetType_C", (Tao, const char[]), (tao, pyname));
 24:   return 0;
 25: }

 27: /*@C
 28:    TaoPythonGetType - Get the type of a Tao object implemented in Python.

 30:    Not collective

 32:    Input Parameter:
 33: .  tao - the optimation solver (Tao) context.

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

 38:    Level: intermediate

 40: .seealso: `TaoCreate()`, `TaoSetType()`, `TaoPYTHON`, `PetscPythonInitialize()`, `TaoPythonSetType()`
 41: @*/
 42: PetscErrorCode TaoPythonGetType(Tao tao, const char *pyname[])
 43: {
 46:   PetscUseMethod(tao, "TaoPythonGetType_C", (Tao, const char *[]), (tao, pyname));
 47:   return 0;
 48: }