xref: /petsc/src/snes/impls/python/pythonsnes.c (revision c4762a1b19cd2af06abeed90e8f9d34fb975dd94)
1 #include <petsc/private/snesimpl.h>          /*I "petscsnes.h" I*/
2 
3 /*@C
4    SNESPythonSetType - Initalize a SNES object implemented in Python.
5 
6    Collective on SNES
7 
8    Input Parameter:
9 +  snes - the nonlinear solver (SNES) context.
10 -  pyname - full dotted Python name [package].module[.{class|function}]
11 
12    Options Database Key:
13 .  -snes_python_type <pyname>
14 
15    Level: intermediate
16 
17 .seealso: SNESCreate(), SNESSetType(), SNESPYTHON, PetscPythonInitialize()
18 @*/
19 PetscErrorCode  SNESPythonSetType(SNES snes,const char pyname[])
20 {
21   PetscErrorCode ierr;
22 
23   PetscFunctionBegin;
24   PetscValidHeaderSpecific(snes,SNES_CLASSID,1);
25   PetscValidCharPointer(pyname,2);
26   ierr = PetscTryMethod(snes,"SNESPythonSetType_C",(SNES, const char[]),(snes,pyname));CHKERRQ(ierr);
27   PetscFunctionReturn(0);
28 }
29