Actual source code: pythonK.c

  1: #include "private/kspimpl.h"          /*I "petscksp.h" I*/

  5: /*@C
  6:    KSPPythonSetType - Initalize a KSP object implemented in Python.

  8:    Collective on KSP

 10:    Input Parameter:
 11: +  ksp - the linear solver (KSP) context.
 12: -  pyname - full dotted Python name [package].module[.{class|function}]

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

 17:    Level: intermediate

 19: .keywords: KSP, Python

 21: .seealso: KSPCreate(), KSPSetType(), KSPPYTHON, PetscPythonInitialize()
 22: @*/
 23: PetscErrorCode  KSPPythonSetType(KSP ksp,const char pyname[])
 24: {
 25:   PetscErrorCode (*f)(KSP, const char[]) = 0;

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