1 #include "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 PETSCSNES_DLLEXPORT SNESPythonSetType(SNES snes,const char pyname[]) 24 { 25 PetscErrorCode (*f)(SNES, const char[]) = 0; 26 PetscErrorCode ierr; 27 PetscFunctionBegin; 28 PetscValidHeaderSpecific(snes,SNES_CLASSID,1); 29 PetscValidCharPointer(pyname,2); 30 ierr = PetscObjectQueryFunction((PetscObject)snes,"SNESPythonSetType_C", 31 (PetscVoidFunction*)&f);CHKERRQ(ierr); 32 if (f) {ierr = (*f)(snes,pyname);CHKERRQ(ierr);} 33 PetscFunctionReturn(0); 34 } 35