Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions source/simulator/core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so we had a bug here? Is that why the prescribed_velocity test and the other signal tests need an update even though they dont use the prescribed solution manager?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both were missing: prescribed_solution_manager and the signal (the old way of adding constraints)


constraints_v.close ();
}

Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand why only this test is affected, even though the other three prescribed_solution_velocity_function_... tests have the same settings? And in #6660 we tested that these tests give the expected results, which they did. Do you understand the difference between the tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think I at least understand the second part. Looking at this again: #6660 (comment) We likely had this problem from the beginning that only the velocities inside the indicated region were prescribed and velocities outside just wouldnt react to them. However, that still doesnt explain why the other 3 tests are not affected by this change. Do the tests maybe not see/expect velocities outside the prescribed region?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, yes. It could be that the output we print doesn't show the change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, the tests work fine if the values are constrained to velocity 0.

Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/prescribed_velocity/screen-output
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/prescribed_velocity/statistics
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 9 additions & 6 deletions tests/pressure_constraint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions tests/signals_connect/screen-output
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions tests/signals_post_constraints/statistics
Original file line number Diff line number Diff line change
Expand Up @@ -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