1 /* 2 User interface for the timestepping package. This package 3 is for use in solving time-dependent PDEs. 4 */ 5 #if !defined(__PETSCTS_H) 6 #define __PETSCTS_H 7 #include "petscsnes.h" 8 PETSC_EXTERN_CXX_BEGIN 9 10 /*S 11 TS - Abstract PETSc object that manages all time-steppers (ODE integrators) 12 13 Level: beginner 14 15 Concepts: ODE solvers 16 17 .seealso: TSCreate(), TSSetType(), TSType, SNES, KSP, PC 18 S*/ 19 typedef struct _p_TS* TS; 20 21 /*E 22 TSType - String with the name of a PETSc TS method or the creation function 23 with an optional dynamic library name, for example 24 http://www.mcs.anl.gov/petsc/lib.a:mytscreate() 25 26 Level: beginner 27 28 .seealso: TSSetType(), TS 29 E*/ 30 #define TSType char* 31 #define TSEULER "euler" 32 #define TSBEULER "beuler" 33 #define TSPSEUDO "pseudo" 34 #define TSCN "cn" 35 #define TSSUNDIALS "sundials" 36 #define TSRK "rk" 37 #define TSPYTHON "python" 38 #define TSTHETA "theta" 39 #define TSALPHA "alpha" 40 #define TSGL "gl" 41 #define TSSSP "ssp" 42 #define TSARKIMEX "arkimex" 43 #if defined(PETSC_HAVE_ROSW) 44 #define TSROSW "rosw" 45 #endif 46 47 /*E 48 TSProblemType - Determines the type of problem this TS object is to be used to solve 49 50 Level: beginner 51 52 .seealso: TSCreate() 53 E*/ 54 typedef enum {TS_LINEAR,TS_NONLINEAR} TSProblemType; 55 56 typedef enum { 57 TS_CONVERGED_ITERATING = 0, 58 TS_CONVERGED_TIME = 1, 59 TS_CONVERGED_ITS = 2, 60 TS_DIVERGED_NONLINEAR_SOLVE = -1, 61 TS_DIVERGED_STEP_REJECTED = -2 62 } TSConvergedReason; 63 extern const char *const*TSConvergedReasons; 64 65 /* Logging support */ 66 extern PetscClassId TS_CLASSID; 67 68 extern PetscErrorCode TSInitializePackage(const char[]); 69 70 extern PetscErrorCode TSCreate(MPI_Comm,TS*); 71 extern PetscErrorCode TSDestroy(TS*); 72 73 extern PetscErrorCode TSSetProblemType(TS,TSProblemType); 74 extern PetscErrorCode TSGetProblemType(TS,TSProblemType*); 75 extern PetscErrorCode TSMonitorSet(TS,PetscErrorCode(*)(TS,PetscInt,PetscReal,Vec,void*),void *,PetscErrorCode (*)(void**)); 76 extern PetscErrorCode TSMonitorCancel(TS); 77 78 extern PetscErrorCode TSSetOptionsPrefix(TS,const char[]); 79 extern PetscErrorCode TSAppendOptionsPrefix(TS,const char[]); 80 extern PetscErrorCode TSGetOptionsPrefix(TS,const char *[]); 81 extern PetscErrorCode TSSetFromOptions(TS); 82 extern PetscErrorCode TSSetUp(TS); 83 extern PetscErrorCode TSReset(TS); 84 85 extern PetscErrorCode TSSetSolution(TS,Vec); 86 extern PetscErrorCode TSGetSolution(TS,Vec*); 87 88 extern PetscErrorCode TSSetDuration(TS,PetscInt,PetscReal); 89 extern PetscErrorCode TSGetDuration(TS,PetscInt*,PetscReal*); 90 extern PetscErrorCode TSSetExactFinalTime(TS,PetscBool); 91 92 extern PetscErrorCode TSMonitorDefault(TS,PetscInt,PetscReal,Vec,void*); 93 extern PetscErrorCode TSMonitorSolution(TS,PetscInt,PetscReal,Vec,void*); 94 extern PetscErrorCode TSMonitorSolutionCreate(TS,PetscViewer,void**); 95 extern PetscErrorCode TSMonitorSolutionDestroy(void**); 96 extern PetscErrorCode TSMonitorSolutionBinary(TS,PetscInt,PetscReal,Vec,void*); 97 98 extern PetscErrorCode TSStep(TS); 99 extern PetscErrorCode TSSolve(TS,Vec,PetscReal*); 100 extern PetscErrorCode TSGetConvergedReason(TS,TSConvergedReason*); 101 102 extern PetscErrorCode TSSetInitialTimeStep(TS,PetscReal,PetscReal); 103 extern PetscErrorCode TSGetTimeStep(TS,PetscReal*); 104 extern PetscErrorCode TSGetTime(TS,PetscReal*); 105 extern PetscErrorCode TSSetTime(TS,PetscReal); 106 extern PetscErrorCode TSGetTimeStepNumber(TS,PetscInt*); 107 extern PetscErrorCode TSSetTimeStep(TS,PetscReal); 108 109 typedef PetscErrorCode (*TSRHSFunction)(TS,PetscReal,Vec,Vec,void*); 110 typedef PetscErrorCode (*TSRHSJacobian)(TS,PetscReal,Vec,Mat*,Mat*,MatStructure*,void*); 111 extern PetscErrorCode TSSetRHSFunction(TS,Vec,TSRHSFunction,void*); 112 extern PetscErrorCode TSGetRHSFunction(TS,Vec*,TSRHSFunction*,void**); 113 extern PetscErrorCode TSSetRHSJacobian(TS,Mat,Mat,TSRHSJacobian,void*); 114 extern PetscErrorCode TSGetRHSJacobian(TS,Mat*,Mat*,TSRHSJacobian*,void**); 115 116 typedef PetscErrorCode (*TSIFunction)(TS,PetscReal,Vec,Vec,Vec,void*); 117 typedef PetscErrorCode (*TSIJacobian)(TS,PetscReal,Vec,Vec,PetscReal,Mat*,Mat*,MatStructure*,void*); 118 extern PetscErrorCode TSSetIFunction(TS,Vec,TSIFunction,void*); 119 extern PetscErrorCode TSGetIFunction(TS,Vec*,TSIFunction*,void**); 120 extern PetscErrorCode TSSetIJacobian(TS,Mat,Mat,TSIJacobian,void*); 121 extern PetscErrorCode TSGetIJacobian(TS,Mat*,Mat*,TSIJacobian*,void**); 122 123 extern PetscErrorCode TSComputeRHSFunctionLinear(TS,PetscReal,Vec,Vec,void*); 124 extern PetscErrorCode TSComputeRHSJacobianConstant(TS,PetscReal,Vec,Mat*,Mat*,MatStructure*,void*); 125 extern PetscErrorCode TSComputeIFunctionLinear(TS,PetscReal,Vec,Vec,Vec,void*); 126 extern PetscErrorCode TSComputeIJacobianConstant(TS,PetscReal,Vec,Vec,PetscReal,Mat*,Mat*,MatStructure*,void*); 127 extern PetscErrorCode TSDefaultComputeJacobianColor(TS,PetscReal,Vec,Mat*,Mat*,MatStructure*,void*); 128 extern PetscErrorCode TSDefaultComputeJacobian(TS,PetscReal,Vec,Mat*,Mat*,MatStructure*,void*); 129 130 extern PetscErrorCode TSSetPreStep(TS, PetscErrorCode (*)(TS)); 131 extern PetscErrorCode TSSetPostStep(TS, PetscErrorCode (*)(TS)); 132 extern PetscErrorCode TSPreStep(TS); 133 extern PetscErrorCode TSPostStep(TS); 134 extern PetscErrorCode TSSetRetainStages(TS,PetscBool); 135 extern PetscErrorCode TSInterpolate(TS,PetscReal,Vec); 136 137 extern PetscErrorCode TSPseudoSetTimeStep(TS,PetscErrorCode(*)(TS,PetscReal*,void*),void*); 138 extern PetscErrorCode TSPseudoDefaultTimeStep(TS,PetscReal*,void*); 139 extern PetscErrorCode TSPseudoComputeTimeStep(TS,PetscReal *); 140 141 extern PetscErrorCode TSPseudoSetVerifyTimeStep(TS,PetscErrorCode(*)(TS,Vec,void*,PetscReal*,PetscBool *),void*); 142 extern PetscErrorCode TSPseudoDefaultVerifyTimeStep(TS,Vec,void*,PetscReal*,PetscBool *); 143 extern PetscErrorCode TSPseudoVerifyTimeStep(TS,Vec,PetscReal*,PetscBool *); 144 extern PetscErrorCode TSPseudoSetTimeStepIncrement(TS,PetscReal); 145 extern PetscErrorCode TSPseudoIncrementDtFromInitialDt(TS); 146 147 extern PetscErrorCode TSPythonSetType(TS,const char[]); 148 149 extern PetscErrorCode TSComputeRHSFunction(TS,PetscReal,Vec,Vec); 150 extern PetscErrorCode TSComputeRHSJacobian(TS,PetscReal,Vec,Mat*,Mat*,MatStructure*); 151 extern PetscErrorCode TSComputeIFunction(TS,PetscReal,Vec,Vec,Vec,PetscBool); 152 extern PetscErrorCode TSComputeIJacobian(TS,PetscReal,Vec,Vec,PetscReal,Mat*,Mat*,MatStructure*,PetscBool); 153 154 extern PetscErrorCode TSVISetVariableBounds(TS,Vec,Vec); 155 156 /* Dynamic creation and loading functions */ 157 extern PetscFList TSList; 158 extern PetscBool TSRegisterAllCalled; 159 extern PetscErrorCode TSGetType(TS,const TSType*); 160 extern PetscErrorCode TSSetType(TS,const TSType); 161 extern PetscErrorCode TSRegister(const char[], const char[], const char[], PetscErrorCode (*)(TS)); 162 extern PetscErrorCode TSRegisterAll(const char[]); 163 extern PetscErrorCode TSRegisterDestroy(void); 164 165 /*MC 166 TSRegisterDynamic - Adds a creation method to the TS package. 167 168 Synopsis: 169 PetscErrorCode TSRegisterDynamic(const char *name, const char *path, const char *func_name, PetscErrorCode (*create_func)(TS)) 170 171 Not Collective 172 173 Input Parameters: 174 + name - The name of a new user-defined creation routine 175 . path - The path (either absolute or relative) of the library containing this routine 176 . func_name - The name of the creation routine 177 - create_func - The creation routine itself 178 179 Notes: 180 TSRegisterDynamic() may be called multiple times to add several user-defined tses. 181 182 If dynamic libraries are used, then the fourth input argument (create_func) is ignored. 183 184 Sample usage: 185 .vb 186 TSRegisterDynamic("my_ts", "/home/username/my_lib/lib/libO/solaris/libmy.a", "MyTSCreate", MyTSCreate); 187 .ve 188 189 Then, your ts type can be chosen with the procedural interface via 190 .vb 191 TS ts; 192 TSCreate(MPI_Comm, &ts); 193 TSSetType(ts, "my_ts") 194 .ve 195 or at runtime via the option 196 .vb 197 -ts_type my_ts 198 .ve 199 200 Notes: $PETSC_ARCH occuring in pathname will be replaced with appropriate values. 201 If your function is not being put into a shared library then use TSRegister() instead 202 203 Level: advanced 204 205 .keywords: TS, register 206 .seealso: TSRegisterAll(), TSRegisterDestroy() 207 M*/ 208 #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 209 #define TSRegisterDynamic(a,b,c,d) TSRegister(a,b,c,0) 210 #else 211 #define TSRegisterDynamic(a,b,c,d) TSRegister(a,b,c,d) 212 #endif 213 214 extern PetscErrorCode TSGetSNES(TS,SNES*); 215 extern PetscErrorCode TSGetKSP(TS,KSP*); 216 217 extern PetscErrorCode TSView(TS,PetscViewer); 218 219 extern PetscErrorCode TSSetApplicationContext(TS,void *); 220 extern PetscErrorCode TSGetApplicationContext(TS,void *); 221 222 extern PetscErrorCode TSMonitorLGCreate(const char[],const char[],int,int,int,int,PetscDrawLG *); 223 extern PetscErrorCode TSMonitorLG(TS,PetscInt,PetscReal,Vec,void *); 224 extern PetscErrorCode TSMonitorLGDestroy(PetscDrawLG*); 225 226 /*S 227 TSGLAdapt - Abstract object that manages time-step adaptivity 228 229 Level: beginner 230 231 .seealso: TSGL, TSGLAdaptCreate(), TSGLAdaptType 232 S*/ 233 typedef struct _p_TSGLAdapt *TSGLAdapt; 234 235 /*E 236 TSGLAdaptType - String with the name of TSGLAdapt scheme or the creation function 237 with an optional dynamic library name, for example 238 http://www.mcs.anl.gov/petsc/lib.a:mytsgladaptcreate() 239 240 Level: beginner 241 242 .seealso: TSGLAdaptSetType(), TS 243 E*/ 244 #define TSGLAdaptType char* 245 #define TSGLADAPT_NONE "none" 246 #define TSGLADAPT_SIZE "size" 247 #define TSGLADAPT_BOTH "both" 248 249 /*MC 250 TSGLAdaptRegisterDynamic - adds a TSGLAdapt implementation 251 252 Synopsis: 253 PetscErrorCode TSGLAdaptRegisterDynamic(const char *name_scheme,const char *path,const char *name_create,PetscErrorCode (*routine_create)(TS)) 254 255 Not Collective 256 257 Input Parameters: 258 + name_scheme - name of user-defined adaptivity scheme 259 . path - path (either absolute or relative) the library containing this scheme 260 . name_create - name of routine to create method context 261 - routine_create - routine to create method context 262 263 Notes: 264 TSGLAdaptRegisterDynamic() may be called multiple times to add several user-defined families. 265 266 If dynamic libraries are used, then the fourth input argument (routine_create) 267 is ignored. 268 269 Sample usage: 270 .vb 271 TSGLAdaptRegisterDynamic("my_scheme",/home/username/my_lib/lib/libO/solaris/mylib.a, 272 "MySchemeCreate",MySchemeCreate); 273 .ve 274 275 Then, your scheme can be chosen with the procedural interface via 276 $ TSGLAdaptSetType(ts,"my_scheme") 277 or at runtime via the option 278 $ -ts_adapt_type my_scheme 279 280 Level: advanced 281 282 Notes: Environmental variables such as ${PETSC_ARCH}, ${PETSC_DIR}, ${PETSC_LIB_DIR}, 283 and others of the form ${any_environmental_variable} occuring in pathname will be 284 replaced with appropriate values. 285 286 .keywords: TSGLAdapt, register 287 288 .seealso: TSGLAdaptRegisterAll() 289 M*/ 290 #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 291 # define TSGLAdaptRegisterDynamic(a,b,c,d) TSGLAdaptRegister(a,b,c,0) 292 #else 293 # define TSGLAdaptRegisterDynamic(a,b,c,d) TSGLAdaptRegister(a,b,c,d) 294 #endif 295 296 extern PetscErrorCode TSGLAdaptRegister(const char[],const char[],const char[],PetscErrorCode (*)(TSGLAdapt)); 297 extern PetscErrorCode TSGLAdaptRegisterAll(const char[]); 298 extern PetscErrorCode TSGLAdaptRegisterDestroy(void); 299 extern PetscErrorCode TSGLAdaptInitializePackage(const char[]); 300 extern PetscErrorCode TSGLAdaptFinalizePackage(void); 301 extern PetscErrorCode TSGLAdaptCreate(MPI_Comm,TSGLAdapt*); 302 extern PetscErrorCode TSGLAdaptSetType(TSGLAdapt,const TSGLAdaptType); 303 extern PetscErrorCode TSGLAdaptSetOptionsPrefix(TSGLAdapt,const char[]); 304 extern PetscErrorCode TSGLAdaptChoose(TSGLAdapt,PetscInt,const PetscInt[],const PetscReal[],const PetscReal[],PetscInt,PetscReal,PetscReal,PetscInt*,PetscReal*,PetscBool *); 305 extern PetscErrorCode TSGLAdaptView(TSGLAdapt,PetscViewer); 306 extern PetscErrorCode TSGLAdaptSetFromOptions(TSGLAdapt); 307 extern PetscErrorCode TSGLAdaptDestroy(TSGLAdapt*); 308 309 /*E 310 TSGLAcceptType - String with the name of TSGLAccept scheme or the function 311 with an optional dynamic library name, for example 312 http://www.mcs.anl.gov/petsc/lib.a:mytsglaccept() 313 314 Level: beginner 315 316 .seealso: TSGLSetAcceptType(), TS 317 E*/ 318 #define TSGLAcceptType char* 319 #define TSGLACCEPT_ALWAYS "always" 320 321 typedef PetscErrorCode (*TSGLAcceptFunction)(TS,PetscReal,PetscReal,const PetscReal[],PetscBool *); 322 extern PetscErrorCode TSGLAcceptRegister(const char[],const char[],const char[],TSGLAcceptFunction); 323 324 /*MC 325 TSGLAcceptRegisterDynamic - adds a TSGL acceptance scheme 326 327 Synopsis: 328 PetscErrorCode TSGLAcceptRegisterDynamic(const char *name_scheme,const char *path,const char *name_create,PetscErrorCode (*routine_create)(TS)) 329 330 Not Collective 331 332 Input Parameters: 333 + name_scheme - name of user-defined acceptance scheme 334 . path - path (either absolute or relative) the library containing this scheme 335 . name_create - name of routine to create method context 336 - routine_create - routine to create method context 337 338 Notes: 339 TSGLAcceptRegisterDynamic() may be called multiple times to add several user-defined families. 340 341 If dynamic libraries are used, then the fourth input argument (routine_create) 342 is ignored. 343 344 Sample usage: 345 .vb 346 TSGLAcceptRegisterDynamic("my_scheme",/home/username/my_lib/lib/libO/solaris/mylib.a, 347 "MySchemeCreate",MySchemeCreate); 348 .ve 349 350 Then, your scheme can be chosen with the procedural interface via 351 $ TSGLSetAcceptType(ts,"my_scheme") 352 or at runtime via the option 353 $ -ts_gl_accept_type my_scheme 354 355 Level: advanced 356 357 Notes: Environmental variables such as ${PETSC_ARCH}, ${PETSC_DIR}, ${PETSC_LIB_DIR}, 358 and others of the form ${any_environmental_variable} occuring in pathname will be 359 replaced with appropriate values. 360 361 .keywords: TSGL, TSGLAcceptType, register 362 363 .seealso: TSGLRegisterAll() 364 M*/ 365 #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 366 # define TSGLAcceptRegisterDynamic(a,b,c,d) TSGLAcceptRegister(a,b,c,0) 367 #else 368 # define TSGLAcceptRegisterDynamic(a,b,c,d) TSGLAcceptRegister(a,b,c,d) 369 #endif 370 371 /*E 372 TSGLType - family of time integration method within the General Linear class 373 374 Level: beginner 375 376 .seealso: TSGLSetType(), TSGLRegister() 377 E*/ 378 #define TSGLType char* 379 #define TSGL_IRKS "irks" 380 381 /*MC 382 TSGLRegisterDynamic - adds a TSGL implementation 383 384 Synopsis: 385 PetscErrorCode TSGLRegisterDynamic(const char *name_scheme,const char *path,const char *name_create,PetscErrorCode (*routine_create)(TS)) 386 387 Not Collective 388 389 Input Parameters: 390 + name_scheme - name of user-defined general linear scheme 391 . path - path (either absolute or relative) the library containing this scheme 392 . name_create - name of routine to create method context 393 - routine_create - routine to create method context 394 395 Notes: 396 TSGLRegisterDynamic() may be called multiple times to add several user-defined families. 397 398 If dynamic libraries are used, then the fourth input argument (routine_create) 399 is ignored. 400 401 Sample usage: 402 .vb 403 TSGLRegisterDynamic("my_scheme",/home/username/my_lib/lib/libO/solaris/mylib.a, 404 "MySchemeCreate",MySchemeCreate); 405 .ve 406 407 Then, your scheme can be chosen with the procedural interface via 408 $ TSGLSetType(ts,"my_scheme") 409 or at runtime via the option 410 $ -ts_gl_type my_scheme 411 412 Level: advanced 413 414 Notes: Environmental variables such as ${PETSC_ARCH}, ${PETSC_DIR}, ${PETSC_LIB_DIR}, 415 and others of the form ${any_environmental_variable} occuring in pathname will be 416 replaced with appropriate values. 417 418 .keywords: TSGL, register 419 420 .seealso: TSGLRegisterAll() 421 M*/ 422 #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 423 # define TSGLRegisterDynamic(a,b,c,d) TSGLRegister(a,b,c,0) 424 #else 425 # define TSGLRegisterDynamic(a,b,c,d) TSGLRegister(a,b,c,d) 426 #endif 427 428 extern PetscErrorCode TSGLRegister(const char[],const char[],const char[],PetscErrorCode(*)(TS)); 429 extern PetscErrorCode TSGLRegisterAll(const char[]); 430 extern PetscErrorCode TSGLRegisterDestroy(void); 431 extern PetscErrorCode TSGLInitializePackage(const char[]); 432 extern PetscErrorCode TSGLFinalizePackage(void); 433 extern PetscErrorCode TSGLSetType(TS,const TSGLType); 434 extern PetscErrorCode TSGLGetAdapt(TS,TSGLAdapt*); 435 extern PetscErrorCode TSGLSetAcceptType(TS,const TSGLAcceptType); 436 437 #define TSARKIMEXType char* 438 #define TSARKIMEX2D "2d" 439 #define TSARKIMEX2E "2e" 440 #define TSARKIMEX3 "3" 441 #define TSARKIMEX4 "4" 442 #define TSARKIMEX5 "5" 443 extern PetscErrorCode TSARKIMEXGetType(TS ts,const TSARKIMEXType*); 444 extern PetscErrorCode TSARKIMEXSetType(TS ts,const TSARKIMEXType); 445 extern PetscErrorCode TSARKIMEXSetFullyImplicit(TS,PetscBool); 446 extern PetscErrorCode TSARKIMEXRegister(const TSARKIMEXType,PetscInt,PetscInt,const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],PetscInt,const PetscReal[],const PetscReal[]); 447 extern PetscErrorCode TSARKIMEXFinalizePackage(void); 448 extern PetscErrorCode TSARKIMEXInitializePackage(const char path[]); 449 extern PetscErrorCode TSARKIMEXRegisterDestroy(void); 450 extern PetscErrorCode TSARKIMEXRegisterAll(void); 451 452 #if defined(PETSC_HAVE_ROSW) 453 #define TSRosWType char* 454 #define TSROSW2D "2d" 455 #define TSROSW2E "2e" 456 #define TSROSW3 "3" 457 #define TSROSW4 "4" 458 #define TSROSW5 "5" 459 extern PetscErrorCode TSRosWGetType(TS ts,const TSRosWType*); 460 extern PetscErrorCode TSRosWSetType(TS ts,const TSRosWType); 461 extern PetscErrorCode TSRosWSetFullyImplicit(TS,PetscBool); 462 extern PetscErrorCode TSRosWRegister(const TSRosWType,PetscInt,PetscInt,const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],PetscInt,const PetscReal[],const PetscReal[]); 463 extern PetscErrorCode TSRosWFinalizePackage(void); 464 extern PetscErrorCode TSRosWInitializePackage(const char path[]); 465 extern PetscErrorCode TSRosWRegisterDestroy(void); 466 extern PetscErrorCode TSRosWRegisterAll(void); 467 #endif 468 469 /* 470 PETSc interface to Sundials 471 */ 472 #ifdef PETSC_HAVE_SUNDIALS 473 typedef enum { SUNDIALS_ADAMS=1,SUNDIALS_BDF=2} TSSundialsLmmType; 474 extern const char *TSSundialsLmmTypes[]; 475 typedef enum { SUNDIALS_MODIFIED_GS = 1,SUNDIALS_CLASSICAL_GS = 2 } TSSundialsGramSchmidtType; 476 extern const char *TSSundialsGramSchmidtTypes[]; 477 extern PetscErrorCode TSSundialsSetType(TS,TSSundialsLmmType); 478 extern PetscErrorCode TSSundialsGetPC(TS,PC*); 479 extern PetscErrorCode TSSundialsSetTolerance(TS,PetscReal,PetscReal); 480 extern PetscErrorCode TSSundialsSetMinTimeStep(TS,PetscReal); 481 extern PetscErrorCode TSSundialsSetMaxTimeStep(TS,PetscReal); 482 extern PetscErrorCode TSSundialsGetIterations(TS,PetscInt *,PetscInt *); 483 extern PetscErrorCode TSSundialsSetGramSchmidtType(TS,TSSundialsGramSchmidtType); 484 extern PetscErrorCode TSSundialsSetGMRESRestart(TS,PetscInt); 485 extern PetscErrorCode TSSundialsSetLinearTolerance(TS,PetscReal); 486 extern PetscErrorCode TSSundialsMonitorInternalSteps(TS,PetscBool ); 487 extern PetscErrorCode TSSundialsGetParameters(TS,PetscInt *,long*[],double*[]); 488 extern PetscErrorCode TSSundialsSetMaxl(TS,PetscInt); 489 #endif 490 491 extern PetscErrorCode TSRKSetTolerance(TS,PetscReal); 492 493 extern PetscErrorCode TSThetaSetTheta(TS,PetscReal); 494 extern PetscErrorCode TSThetaGetTheta(TS,PetscReal*); 495 extern PetscErrorCode TSThetaGetEndpoint(TS,PetscBool*); 496 extern PetscErrorCode TSThetaSetEndpoint(TS,PetscBool); 497 498 extern PetscErrorCode TSAlphaSetAdapt(TS,PetscErrorCode(*)(TS,PetscReal,Vec,Vec,PetscReal*,PetscBool*,void*),void*); 499 extern PetscErrorCode TSAlphaAdaptDefault(TS,PetscReal,Vec,Vec,PetscReal*,PetscBool*,void*); 500 extern PetscErrorCode TSAlphaSetRadius(TS,PetscReal); 501 extern PetscErrorCode TSAlphaSetParams(TS,PetscReal,PetscReal,PetscReal); 502 extern PetscErrorCode TSAlphaGetParams(TS,PetscReal*,PetscReal*,PetscReal*); 503 504 extern PetscErrorCode TSSetDM(TS,DM); 505 extern PetscErrorCode TSGetDM(TS,DM*); 506 507 extern PetscErrorCode SNESTSFormFunction(SNES,Vec,Vec,void*); 508 extern PetscErrorCode SNESTSFormJacobian(SNES,Vec,Mat*,Mat*,MatStructure*,void*); 509 510 PETSC_EXTERN_CXX_END 511 #endif 512