xref: /petsc/src/ts/adapt/impls/none/adaptnone.c (revision 5b6bfdb9644f185dbf5e5a09b808ec241507e1e7)
1 #include <petsc/private/tsimpl.h> /*I "petscts.h" I*/
2 
3 static PetscErrorCode TSAdaptChoose_None(TSAdapt adapt,TS ts,PetscReal h,PetscInt *next_sc,PetscReal *next_h,PetscBool *accept,PetscReal *wlte,PetscReal *wltea,PetscReal *wlter)
4 {
5 
6   PetscFunctionBegin;
7   *accept  = PETSC_TRUE;
8   *next_sc = 0;                 /* Reuse the same order scheme */
9   *next_h  = h;                 /* Reuse the old step */
10   *wlte    = -1;                /* Weighted local truncation error was not evaluated */
11   *wltea   = -1;                /* Weighted absolute local truncation error was not evaluated */
12   *wlter   = -1;                /* Weighted relative local truncation error was not evaluated */
13   PetscFunctionReturn(0);
14 }
15 
16 /*MC
17    TSADAPTNONE - Time stepping controller that always accepts the current step and does not change it
18 
19    Level: intermediate
20 
21 .seealso: TS, TSAdapt, TSSetAdapt()
22 M*/
23 PETSC_EXTERN PetscErrorCode TSAdaptCreate_None(TSAdapt adapt)
24 {
25 
26   PetscFunctionBegin;
27   adapt->ops->choose = TSAdaptChoose_None;
28   PetscFunctionReturn(0);
29 }
30