diff --git a/source/simulator/core.cc b/source/simulator/core.cc index e5bd906fbaa..29141ecfbc1 100644 --- a/source/simulator/core.cc +++ b/source/simulator/core.cc @@ -799,12 +799,11 @@ namespace aspect if (parameters.include_melt_transport) melt_handler->add_current_constraints (new_current_constraints); - // Finally update and let the prescribed solution plugins constrain parts of the solution + // Update and let the prescribed solution plugins constrain parts of the solution: prescribed_solution_manager.update(); prescribed_solution_manager.constrain_solution(new_current_constraints); - // let plugins add more constraints if they so choose, then close the - // constraints object + // Finally, let plugins add more constraints if they so choose: signals.post_constraints_creation(*this, new_current_constraints); new_current_constraints.close(); diff --git a/source/simulator/solver/stokes_matrix_free_local_smoothing.cc b/source/simulator/solver/stokes_matrix_free_local_smoothing.cc index 0e63829d70c..8dae037acb6 100644 --- a/source/simulator/solver/stokes_matrix_free_local_smoothing.cc +++ b/source/simulator/solver/stokes_matrix_free_local_smoothing.cc @@ -1610,13 +1610,18 @@ namespace aspect sim.compute_initial_velocity_boundary_constraints(constraints_v); sim.compute_current_velocity_boundary_constraints(constraints_v); - VectorTools::compute_no_normal_flux_constraints (dof_handler_v, /* first_vector_component= */ 0, this->get_boundary_velocity_manager().get_tangential_boundary_velocity_indicators(), constraints_v, this->get_mapping()); + + sim.prescribed_solution_manager.constrain_solution(constraints_v); + + // Let plugins add more constraints if they so choose: + sim.signals.post_constraints_creation(*this, constraints_v); + constraints_v.close (); } diff --git a/tests/prescribed_solution_velocity_function_spherical_unit/screen-output b/tests/prescribed_solution_velocity_function_spherical_unit/screen-output index 4193ecd01e4..53dc8b36060 100644 --- a/tests/prescribed_solution_velocity_function_spherical_unit/screen-output +++ b/tests/prescribed_solution_velocity_function_spherical_unit/screen-output @@ -4,23 +4,23 @@ Number of degrees of freedom: 1,836 (1,122+153+561) *** Timestep 0: t=0 years, dt=0 years Solving temperature system... 0 iterations. - Solving Stokes system (GMG)... 10+0 iterations. + Solving Stokes system (GMG)... 28+0 iterations. Postprocessing: - RMS, max velocity: 0.167 m/year, 0.591 m/year + RMS, max velocity: 9.59e-05 m/year, 0.000511 m/year Temperature min/avg/max: 273 K, 1552 K, 2014 K - Heat fluxes through boundary parts: -1.101e+05 W, 1.439e+04 W, 0 W, 0 W + Heat fluxes through boundary parts: -6.058e+04 W, 2.003e+05 W, 0 W, 0 W Writing graphical output: output-prescribed_solution_velocity_function_spherical_unit/solution/solution-00000 Writing heat flux map output-prescribed_solution_velocity_function_spherical_unit/heat_flux.00000 *** Timestep 1: t=1 years, dt=1 years - Solving temperature system... 3 iterations. - Solving Stokes system (GMG)... 8+0 iterations. + Solving temperature system... 2 iterations. + Solving Stokes system (GMG)... 25+0 iterations. Postprocessing: - RMS, max velocity: 1e+06 m/year, 2.53e+06 m/year + RMS, max velocity: 1.02e+06 m/year, 2.53e+06 m/year Temperature min/avg/max: 273 K, 1552 K, 2014 K - Heat fluxes through boundary parts: 8.551e+11 W, 2.76e+13 W, 0 W, 0 W + Heat fluxes through boundary parts: 8.551e+11 W, 2.815e+13 W, 0 W, 0 W Writing graphical output: output-prescribed_solution_velocity_function_spherical_unit/solution/solution-00001 Writing heat flux map output-prescribed_solution_velocity_function_spherical_unit/heat_flux.00001 diff --git a/tests/prescribed_velocity/screen-output b/tests/prescribed_velocity/screen-output index 473ee233ea0..4c3db50a300 100644 --- a/tests/prescribed_velocity/screen-output +++ b/tests/prescribed_velocity/screen-output @@ -6,10 +6,10 @@ Number of degrees of freedom: 948 (578+81+289) *** Timestep 0: t=0 years, dt=0 years Skipping temperature solve because RHS is zero. - Solving Stokes system (GMG)... 13+0 iterations. + Solving Stokes system (GMG)... 29+0 iterations. Postprocessing: - RMS, max velocity: 8.51e+06 m/year, 4.46e+07 m/year + RMS, max velocity: 3.27e+07 m/year, 4.63e+07 m/year Termination requested by criterion: end time diff --git a/tests/prescribed_velocity/statistics b/tests/prescribed_velocity/statistics index 5a0ee8a86ff..5585bcee447 100644 --- a/tests/prescribed_velocity/statistics +++ b/tests/prescribed_velocity/statistics @@ -10,4 +10,4 @@ # 10: Schur complement iterations in Stokes preconditioner # 11: RMS velocity (m/year) # 12: Max. velocity (m/year) -0 0.000000000000e+00 0.000000000000e+00 64 659 289 0 13 14 14 8.50510440e+06 4.46282695e+07 +0 0.000000000000e+00 0.000000000000e+00 64 659 289 0 29 30 30 3.27071609e+07 4.63396811e+07 diff --git a/tests/pressure_constraint.cc b/tests/pressure_constraint.cc index 0372893d1a3..aca1135c993 100644 --- a/tests/pressure_constraint.cc +++ b/tests/pressure_constraint.cc @@ -38,12 +38,15 @@ namespace aspect const double value = 100; - current_constraints.add_line(first_pressure_dof); - current_constraints.set_inhomogeneity (first_pressure_dof, value); - - std::cout << "adding constraint idx= " << first_pressure_dof - << " to value= " << value - << std::endl; + if (current_constraints.can_store_line(first_pressure_dof)) + { + current_constraints.add_line(first_pressure_dof); + current_constraints.set_inhomogeneity (first_pressure_dof, value); + + std::cout << "adding constraint idx= " << first_pressure_dof + << " to value= " << value + << std::endl; + } } // Connect constraints function to correct signal. diff --git a/tests/signals_connect/screen-output b/tests/signals_connect/screen-output index f3e0c623728..94d1a99eedb 100644 --- a/tests/signals_connect/screen-output +++ b/tests/signals_connect/screen-output @@ -6,6 +6,9 @@ Number of active cells: 16 (on 3 levels) Number of degrees of freedom: 268 (162+25+81) +*** constraints signal called *** + + *** constraints signal called *** *** Timestep 0: t=0 seconds, dt=0 seconds diff --git a/tests/signals_post_constraints/statistics b/tests/signals_post_constraints/statistics index 9bd54983e8a..f99ee2b6798 100644 --- a/tests/signals_post_constraints/statistics +++ b/tests/signals_post_constraints/statistics @@ -19,9 +19,10 @@ # 19: Outward heat flux through boundary with indicator 1 ("right") (W) # 20: Outward heat flux through boundary with indicator 2 ("bottom") (W) # 21: Outward heat flux through boundary with indicator 3 ("top") (W) +260 0 0.000000000000e+00 0.000000000000e+00 0 0 0 0 0 0 0 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 390 0 0.000000000000e+00 0.000000000000e+00 0 0 0 0 0 0 0 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 390 0 0.000000000000e+00 0.000000000000e+00 1024 9539 4225 0 8 9 9 1.79112171e+01 2.53303041e+01 0.00000000e+00 5.00000000e-01 1.00000000e+00 5.00000000e-01 0.00000000e+00 0.00000000e+00 -4.88438682e+00 4.88438700e+00 390 1 6.168500750772e-04 6.168500750772e-04 1024 9539 4225 29 8 9 9 1.79244868e+01 2.54944861e+01 0.00000000e+00 5.00000259e-01 1.00000000e+00 5.00000259e-01 0.00000000e+00 0.00000000e+00 -4.82475981e+00 4.82482619e+00 -390 2 1.229727696416e-03 6.128776213387e-04 1024 9539 4225 21 7 8 8 1.79669736e+01 2.57038384e+01 0.00000000e+00 5.00000701e-01 1.00000000e+00 5.00000701e-01 0.00000000e+00 0.00000000e+00 -4.70504606e+00 4.70521356e+00 -390 3 1.837613558742e-03 6.078858623263e-04 1024 9539 4225 21 7 8 8 1.80474105e+01 2.59702915e+01 0.00000000e+00 5.00001184e-01 1.00000000e+00 5.00001184e-01 0.00000000e+00 0.00000000e+00 -4.52419537e+00 4.52447515e+00 -390 4 2.000000000000e-03 1.623864412578e-04 1024 9539 4225 10 6 7 7 1.80758318e+01 2.60520559e+01 0.00000000e+00 5.00001313e-01 1.00000000e+00 5.00001313e-01 0.00000000e+00 0.00000000e+00 -4.46707367e+00 4.46738271e+00 +390 2 1.229727696416e-03 6.128776213385e-04 1024 9539 4225 21 7 8 8 1.79669736e+01 2.57038384e+01 0.00000000e+00 5.00000701e-01 1.00000000e+00 5.00000701e-01 0.00000000e+00 0.00000000e+00 -4.70504606e+00 4.70521356e+00 +390 3 1.837613558746e-03 6.078858623300e-04 1024 9539 4225 21 7 8 8 1.80474105e+01 2.59702915e+01 0.00000000e+00 5.00001184e-01 1.00000000e+00 5.00001184e-01 0.00000000e+00 0.00000000e+00 -4.52419537e+00 4.52447515e+00 +390 4 2.000000000000e-03 1.623864412543e-04 1024 9539 4225 10 6 7 7 1.80758318e+01 2.60520559e+01 0.00000000e+00 5.00001313e-01 1.00000000e+00 5.00001313e-01 0.00000000e+00 0.00000000e+00 -4.46707367e+00 4.46738271e+00