v0.14.0
Searching...
No Matches
Go to the documentation of this file.
1/**
4 *
5 * \brief Problem implementation for mix element for large-strain elasticity
6 *
7 * \todo Implementation of plasticity
8 */
9
12
13#include <petsc/private/tsimpl.h>
14
16
18
20 PetscInt *next_sc, PetscReal *next_h,
21 PetscBool *accept, PetscReal *wlte,
22 PetscReal *wltea, PetscReal *wlter) {
23 PetscFunctionBegin;
24
26
27 *next_sc = 0; /* Reuse the same order scheme */
28 *wlte = -1; /* Weighted local truncation error was not evaluated */
29 *wltea = -1; /* Weighted absolute local truncation error is not used */
30 *wlter = -1; /* Weighted relative local truncation error is not used */
31
32 *accept = PETSC_TRUE;
33 *next_h = h; /* Reuse the old step */
34
35 SNES snes;
36 ierr = TSGetSNES(ts, &snes);
38
39 SNESConvergedReason reason;
40 ierr = SNESGetConvergedReason(snes, &reason);
42
43 int it;
44 ierr = SNESGetIterationNumber(snes, &it);
46
47 if (reason < 0) {
48 h *= 0.75;
49 *next_h = h;
50 PetscPrintf(
51 PETSC_COMM_WORLD,
52 "\tDiverged set step length: it = %d, h = %3.4g set h = %3.4g \n", it,
53 h, *next_h);
54 } else if (reason > 0) {
55
56 int its_d = 6;
57 ierr = PetscOptionsGetInt(PETSC_NULL, "", "-desired_nb_of_its", &its_d,
58 PETSC_NULL);
60
61 h *= 1;//sqrt(static_cast<double>(its_d) / static_cast<double>(it + 1));
63 PetscPrintf(
64 PETSC_COMM_WORLD,
65 "\tConverged set step length: it = %d, h = %3.4g set h = %3.4g \n", it,
66 h, *next_h);
67 }
68
69 PetscFunctionReturn(0);
70}
71
74 PetscFunctionBegin;
75 PetscFunctionReturn(0);
76}
77
79 PetscFunctionBegin;
84 PetscFunctionReturn(0);
85}
86
89 PetscFunctionBegin;
96 PetscFunctionReturn(0);
97}
98