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