Skip to content

Commit d08de4a

Browse files
authored
Merge pull request #6171 from gassmoeller/update_spiegelman_newton_benchmark_30
[3.0] Revert one change of PR #5580
2 parents 6035402 + fcea544 commit d08de4a

File tree

3 files changed

+45
-36
lines changed

3 files changed

+45
-36
lines changed

source/simulator/assemblers/newton_stokes.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,15 @@ namespace aspect
175175
else
176176
{
177177
const SymmetricTensor<2,dim> viscosity_derivative_wrt_strain_rate = derivatives->viscosity_derivative_wrt_strain_rate[q];
178-
const SymmetricTensor<2,dim> effective_strain_rate =
179-
elastic_out == nullptr ? deviator(scratch.material_model_inputs.strain_rate[q]) : elastic_out->viscoelastic_strain_rate[q];
180-
181178
const typename Newton::Parameters::Stabilization
182179
preconditioner_stabilization = this->get_newton_handler().parameters.preconditioner_stabilization;
183180

181+
SymmetricTensor<2,dim> effective_strain_rate = scratch.material_model_inputs.strain_rate[q];
182+
if (elastic_out != nullptr)
183+
effective_strain_rate = elastic_out->viscoelastic_strain_rate[q];
184+
else if ((preconditioner_stabilization & Newton::Parameters::Stabilization::PD) != Newton::Parameters::Stabilization::none)
185+
effective_strain_rate = deviator(effective_strain_rate);
186+
184187
// use the spd factor when the stabilization is PD or SPD
185188
const double alpha = (preconditioner_stabilization & Newton::Parameters::Stabilization::PD) != Newton::Parameters::Stabilization::none ?
186189
Utilities::compute_spd_factor<dim>(eta, effective_strain_rate, viscosity_derivative_wrt_strain_rate,
@@ -400,9 +403,6 @@ namespace aspect
400403
const double pressure = scratch.material_model_inputs.pressure[q];
401404
const double velocity_divergence = scratch.velocity_divergence[q];
402405

403-
const SymmetricTensor<2,dim> effective_strain_rate =
404-
elastic_out == nullptr ? deviator(scratch.material_model_inputs.strain_rate[q]) : elastic_out->viscoelastic_strain_rate[q];
405-
406406
const Tensor<1,dim>
407407
gravity = this->get_gravity_model().gravity_vector (scratch.finite_element_values.quadrature_point(q));
408408

@@ -479,6 +479,12 @@ namespace aspect
479479
const Newton::Parameters::Stabilization velocity_block_stabilization
480480
= this->get_newton_handler().parameters.velocity_block_stabilization;
481481

482+
SymmetricTensor<2,dim> effective_strain_rate = scratch.material_model_inputs.strain_rate[q];
483+
if (elastic_out != nullptr)
484+
effective_strain_rate = elastic_out->viscoelastic_strain_rate[q];
485+
else if ((velocity_block_stabilization & Newton::Parameters::Stabilization::PD) != Newton::Parameters::Stabilization::none)
486+
effective_strain_rate = deviator(effective_strain_rate);
487+
482488
// use the spd factor when the stabilization is PD or SPD
483489
const double alpha = (velocity_block_stabilization & Newton::Parameters::Stabilization::PD)
484490
!= Newton::Parameters::Stabilization::none

source/simulator/stokes_matrix_free.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,8 +1424,11 @@ namespace aspect
14241424

14251425
for (unsigned int q=0; q<n_q_points; ++q)
14261426
{
1427-
const SymmetricTensor<2,dim> effective_strain_rate =
1428-
elastic_out == nullptr ? deviator(in.strain_rate[q]) : elastic_out->viscoelastic_strain_rate[q];
1427+
SymmetricTensor<2,dim> effective_strain_rate = in.strain_rate[q];
1428+
if (elastic_out != nullptr)
1429+
effective_strain_rate = elastic_out->viscoelastic_strain_rate[q];
1430+
else if ((sim.newton_handler->parameters.velocity_block_stabilization & Newton::Parameters::Stabilization::PD) != Newton::Parameters::Stabilization::none)
1431+
effective_strain_rate = deviator(effective_strain_rate);
14291432

14301433
// use the spd factor when the stabilization is PD or SPD.
14311434
const double alpha = (sim.newton_handler->parameters.velocity_block_stabilization

tests/spiegelman_fail_test/screen-output

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,75 +29,75 @@ Number of degrees of freedom: 18,133 (8,514+1,105+4,257+4,257)
2929
The linear solver tolerance is set to 0.843263. Stabilization Preconditioner is none and A block is none.
3030
Rebuilding Stokes preconditioner...
3131
Solving Stokes system (AMG)... 0+1 iterations.
32-
Newton system information: Norm of the rhs: 9.54798e+14, Derivative scaling factor: 1
33-
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 1.33204e-16, 0.12306
34-
Relative nonlinear residual (total system) after nonlinear iteration 3: 0.12306
32+
Newton system information: Norm of the rhs: 9.16397e+14, Derivative scaling factor: 1
33+
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 1.33204e-16, 0.118111
34+
Relative nonlinear residual (total system) after nonlinear iteration 3: 0.118111
3535

3636
Skipping temperature solve because RHS is zero.
3737
Solving C_1 system ... 0 iterations.
3838
The linear solver tolerance is set to 0.758936. Stabilization Preconditioner is none and A block is none.
3939
Rebuilding Stokes preconditioner...
4040
Solving Stokes system (AMG)... 0+1 iterations.
41-
Newton system information: Norm of the rhs: 4.36974e+14, Derivative scaling factor: 1
42-
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 1.33204e-16, 0.0563199
43-
Relative nonlinear residual (total system) after nonlinear iteration 4: 0.0563199
41+
Newton system information: Norm of the rhs: 5.68132e+14, Derivative scaling factor: 1
42+
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 1.33204e-16, 0.0732243
43+
Relative nonlinear residual (total system) after nonlinear iteration 4: 0.0732243
4444

4545

4646
WARNING: The nonlinear solver in the current timestep failed to converge.
4747
Acting according to the parameter 'Nonlinear solver failure strategy'...
4848
Continuing to the next timestep even though solution is not fully converged.
4949
Postprocessing:
50-
RMS, max velocity: 6.76e-09 m/s, 1.5e-08 m/s
51-
Pressure min/avg/max: -7.019e+10 Pa, 1.063e+09 Pa, 2.587e+11 Pa
52-
Mass fluxes through boundary parts: -0.03241 kg/s, -0.03241 kg/s, 0 kg/s, -1.728 kg/s
50+
RMS, max velocity: 2.14e-08 m/s, 2.44e-07 m/s
51+
Pressure min/avg/max: -7.28e+10 Pa, 1.519e+09 Pa, 2.899e+11 Pa
52+
Mass fluxes through boundary parts: -0.03241 kg/s, -0.03241 kg/s, 0 kg/s, 4.106 kg/s
5353
Writing graphical output: output-spiegelman_fail_test/solution/solution-00000
5454

5555
*** Timestep 1: t=1 seconds, dt=1 seconds
5656
Skipping temperature solve because RHS is zero.
57-
Solving C_1 system ... 0 iterations.
58-
Initial Newton Stokes residual = 8.60842e+15, v = 8.60842e+15, p = 3.41939e+12
57+
Solving C_1 system ... 1 iterations.
58+
Initial Newton Stokes residual = 8.84992e+15, v = 8.84992e+15, p = 2.98258e+12
5959

6060
Rebuilding Stokes preconditioner...
6161
Solving Stokes system (AMG)... 0+0 iterations.
62-
Newton system information: Norm of the rhs: 4.36222e+14
63-
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 7.2409e-13, 0.0506738
64-
Relative nonlinear residual (total system) after nonlinear iteration 1: 0.0506738
62+
Newton system information: Norm of the rhs: 5.52475e+14
63+
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 2.43828e-12, 0.0624271
64+
Relative nonlinear residual (total system) after nonlinear iteration 1: 0.0624271
6565

6666
Skipping temperature solve because RHS is zero.
6767
Solving C_1 system ... 0 iterations.
6868
Rebuilding Stokes preconditioner...
6969
Solving Stokes system (AMG)... 0+1 iterations.
70-
Newton system information: Norm of the rhs: 2.17689e+14, Derivative scaling factor: 0
71-
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 7.2409e-13, 0.025288
72-
Relative nonlinear residual (total system) after nonlinear iteration 2: 0.025288
70+
Newton system information: Norm of the rhs: 2.2942e+14, Derivative scaling factor: 0
71+
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 1.2658e-13, 0.0259234
72+
Relative nonlinear residual (total system) after nonlinear iteration 2: 0.0259234
7373

7474
Skipping temperature solve because RHS is zero.
75-
Solving C_1 system ... 0 iterations.
75+
Solving C_1 system ... 1 iterations.
7676
Switching from defect correction form of Picard to the Newton solver scheme.
7777
The linear solver tolerance is set to 0.843263. Stabilization Preconditioner is none and A block is none.
7878
Rebuilding Stokes preconditioner...
79-
Solving Stokes system (AMG)... 0+1 iterations.
80-
Newton system information: Norm of the rhs: 1.35994e+14, Derivative scaling factor: 1
81-
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 6.76328e-13, 0.0157978
82-
Relative nonlinear residual (total system) after nonlinear iteration 3: 0.0157978
79+
Solving Stokes system (AMG)... 0+3 iterations.
80+
Newton system information: Norm of the rhs: 1.92576e+14, Derivative scaling factor: 1
81+
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 1.59356e-12, 0.0217602
82+
Relative nonlinear residual (total system) after nonlinear iteration 3: 0.0217602
8383

8484
Skipping temperature solve because RHS is zero.
8585
Solving C_1 system ... 0 iterations.
8686
The linear solver tolerance is set to 0.758936. Stabilization Preconditioner is none and A block is none.
8787
Rebuilding Stokes preconditioner...
8888
Solving Stokes system (AMG)... 0+1 iterations.
89-
Newton system information: Norm of the rhs: 7.18526e+13, Derivative scaling factor: 1
90-
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 5.87227e-13, 0.00834678
91-
Relative nonlinear residual (total system) after nonlinear iteration 4: 0.00834678
89+
Newton system information: Norm of the rhs: 1.08722e+14, Derivative scaling factor: 1
90+
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0, 2.92488e-13, 0.0122851
91+
Relative nonlinear residual (total system) after nonlinear iteration 4: 0.0122851
9292

9393

9494
WARNING: The nonlinear solver in the current timestep failed to converge.
9595
Acting according to the parameter 'Nonlinear solver failure strategy'...
9696
Continuing to the next timestep even though solution is not fully converged.
9797
Postprocessing:
98-
RMS, max velocity: 2.71e-09 m/s, 8.03e-09 m/s
99-
Pressure min/avg/max: -2.037e+10 Pa, 1.602e+08 Pa, 3.381e+10 Pa
100-
Mass fluxes through boundary parts: -0.03241 kg/s, -0.03241 kg/s, 0 kg/s, -1.176 kg/s
98+
RMS, max velocity: 2.94e-09 m/s, 1.54e-08 m/s
99+
Pressure min/avg/max: -2.771e+10 Pa, 3.617e+08 Pa, 6.167e+10 Pa
100+
Mass fluxes through boundary parts: -0.03241 kg/s, -0.03241 kg/s, 0 kg/s, -0.1108 kg/s
101101

102102
Termination requested by criterion: end time
103103

0 commit comments

Comments
 (0)