xref: /petsc/src/ts/adapt/impls/none/adaptnone.c (revision a69119a591a03a9d906b29c0a4e9802e4d7c9795)
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   PetscFunctionBegin;
5   *accept  = PETSC_TRUE;
6   *next_sc = 0;  /* Reuse the same order scheme */
7   *next_h  = h;  /* Reuse the old step */
8   *wlte    = -1; /* Weighted local truncation error was not evaluated */
9   *wltea   = -1; /* Weighted absolute local truncation error was not evaluated */
10   *wlter   = -1; /* Weighted relative local truncation error was not evaluated */
11   PetscFunctionReturn(0);
12 }
13 
14 /*MC
15    TSADAPTNONE - Time stepping controller that always accepts the current step and does not change it
16 
17    Level: intermediate
18 
19 .seealso: `TS`, `TSAdapt`, `TSAdaptChoose()`
20 M*/
21 PETSC_EXTERN PetscErrorCode TSAdaptCreate_None(TSAdapt adapt) {
22   PetscFunctionBegin;
23   adapt->ops->choose = TSAdaptChoose_None;
24   PetscFunctionReturn(0);
25 }
26