Actual source code: pythonP.c

  1: #include "private/pcimpl.h"          /*I "petscpc.h" I*/

  5: /*@C
  6:    PCPythonSetType - Initalize a PC object implemented in Python.

  8:    Collective on PC

 10:    Input Parameter:
 11: +  pc - the preconditioner (PC) context.
 12: -  pyname - full dotted Python name [package].module[.{class|function}]

 14:    Options Database Key:
 15: .  -pc_python_type <pyname>

 17:    Level: intermediate

 19: .keywords: PC, Python

 21: .seealso: PCCreate(), PCSetType(), PCPYTHON, PetscPythonInitialize()
 22: @*/
 23: PetscErrorCode  PCPythonSetType(PC pc,const char pyname[])
 24: {
 25:   PetscErrorCode (*f)(PC, const char[]) = 0;

 31:   PetscObjectQueryFunction((PetscObject)pc,"PCPythonSetType_C",(PetscVoidFunction*)&f);
 32:   if (f) {(*f)(pc,pyname);}
 33:   return(0);
 34: }