Skip to content

Commit f412e89

Browse files
committed
TSPSEUDO
1 parent 3ae4c05 commit f412e89

File tree

6 files changed

+43
-1
lines changed

6 files changed

+43
-1
lines changed

src/pdes/petsc_ts.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,24 @@ int feenox_problem_solve_petsc_transient(void) {
3434
feenox.pde.ksp = NULL;
3535

3636
} else if (feenox.pde.math_type == math_type_nonlinear) {
37+
38+
// when using PSEUDO, we should not solve the initial SNES because
39+
// in pseudo we do not have to scale the BCs so the full problem is
40+
// already set up at t=0 and then we don't take advantage of pseudo
41+
int do_not_solve_update = 0;
42+
int do_not_solve_old = feenox.pde.do_not_solve;
43+
if (feenox.pde.ts_type != NULL && strcmp(feenox.pde.ts_type, TSPSEUDO) == 0) {
44+
do_not_solve_update = 1;
45+
feenox.pde.do_not_solve = 1;
46+
}
47+
3748
feenox_call(feenox_problem_solve_petsc_nonlinear());
3849
petsc_call(SNESDestroy(&feenox.pde.snes));
3950
feenox.pde.snes = NULL;
40-
51+
52+
if (do_not_solve_update) {
53+
feenox.pde.do_not_solve = do_not_solve_old;
54+
}
4155
}
4256
} else {
4357
feenox_function_to_phi(feenox.pde.initial_condition, feenox.pde.phi);

tests/beam-ldef-quasi-many-steps.fee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ BC right tz=-25*t
1313

1414
SOLVE_PROBLEM
1515

16+
# PRINT t w(0.5,-0.25,+0.01)
17+
1618
IF done
1719
PRINT w(0.5,-0.25,+0.01)+0.016062
1820
ENDIF

tests/beam-ldef-quasi-pseudo.fee

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
PROBLEM mechanical QUASISTATIC TS pseudo
2+
READ_MESH beam-cantilever-tet4.msh
3+
4+
ldef = 1
5+
end_time = 1
6+
dt_0 = 0.01
7+
8+
E = 100000
9+
nu = 0.3
10+
11+
BC left fixed
12+
BC right tz=-25
13+
14+
SOLVE_PROBLEM
15+
16+
# PRINT t w(0.5,-0.25,+0.01)
17+
18+
IF done
19+
PRINT w(0.5,-0.25,+0.01)+0.016062
20+
ENDIF

tests/beam-ldef-quasi-single-step.fee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ BC right tz=-25*t
1313

1414
SOLVE_PROBLEM
1515

16+
# PRINT t w(0.5,-0.25,+0.01)
17+
1618
IF done
1719
PRINT w(0.5,-0.25,+0.01)+0.016062
1820
ENDIF

tests/beam-ldef-quasi-two-steps.fee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ BC right tz=-25*t
1313

1414
SOLVE_PROBLEM
1515

16+
# PRINT t w(0.5,-0.25,+0.01)
17+
1618
IF done
1719
PRINT w(0.5,-0.25,+0.01)+0.016062
1820
ENDIF

tests/beam-quasi.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ exitifwrong $?
3131
answerzero beam-ldef-quasi-many-steps.fee
3232
exitifwrong $?
3333

34+
answerzero beam-ldef-quasi-pseudo.fee
35+
exitifwrong $?

0 commit comments

Comments
 (0)