1c4aff060SBarry Smith #include "private/tsimpl.h" /*I "petscts.h" I*/ 2c4aff060SBarry Smith 3c4aff060SBarry Smith #undef __FUNCT__ 4c4aff060SBarry Smith #define __FUNCT__ "TSPythonSetType" 5c4aff060SBarry Smith /*@C 6c4aff060SBarry Smith TSPythonSetType - Initalize a TS object implemented in Python. 7c4aff060SBarry Smith 8c4aff060SBarry Smith Collective on TS 9c4aff060SBarry Smith 10c4aff060SBarry Smith Input Parameter: 11c4aff060SBarry Smith + ts - the nonlinear solver (TS) context. 12c4aff060SBarry Smith - pyname - full dotted Python name [package].module[.{class|function}] 13c4aff060SBarry Smith 14c4aff060SBarry Smith Options Database Key: 15c4aff060SBarry Smith . -ts_python_type <pyname> 16c4aff060SBarry Smith 17c4aff060SBarry Smith Level: intermediate 18c4aff060SBarry Smith 19c4aff060SBarry Smith .keywords: TS, Python 20c4aff060SBarry Smith 21*9596e0b4SJed Brown .seealso: TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize() 22c4aff060SBarry Smith @*/ 23c4aff060SBarry Smith PetscErrorCode PETSCTS_DLLEXPORT TSPythonSetType(TS ts,const char pyname[]) 24c4aff060SBarry Smith { 25c4aff060SBarry Smith PetscErrorCode (*f)(TS, const char[]) = 0; 26c4aff060SBarry Smith PetscErrorCode ierr; 27c4aff060SBarry Smith PetscFunctionBegin; 28c4aff060SBarry Smith PetscValidHeaderSpecific(ts,TS_COOKIE,1); 29c4aff060SBarry Smith PetscValidCharPointer(pyname,2); 30c4aff060SBarry Smith ierr = PetscObjectQueryFunction((PetscObject)ts,"TSPythonSetType_C", 31c4aff060SBarry Smith (PetscVoidFunction*)&f);CHKERRQ(ierr); 32c4aff060SBarry Smith if (f) {ierr = (*f)(ts,pyname);CHKERRQ(ierr);} 33c4aff060SBarry Smith PetscFunctionReturn(0); 34c4aff060SBarry Smith } 35