|
23 | 23 | #include "libmesh/numeric_vector.h"
|
24 | 24 | #include "libmesh/adjoint_refinement_estimator.h"
|
25 | 25 |
|
| 26 | +// Remove before committing |
| 27 | +#include "libmesh/system_norm.h" |
| 28 | +#include "libmesh/enum_norm_type.h" |
| 29 | + |
26 | 30 | namespace libMesh
|
27 | 31 | {
|
28 | 32 |
|
@@ -284,7 +288,7 @@ void EulerSolver::integrate_adjoint_refinement_error_estimate(AdjointRefinementE
|
284 | 288 | next_step_deltat = _system.deltat;
|
285 | 289 | _system.deltat = last_step_deltat;
|
286 | 290 |
|
287 |
| - // The adjoint error estimate expression for a backwards facing step |
| 291 | + // The adjoint error estimate expression for a backward Euler |
288 | 292 | // scheme needs the adjoint for the last time instant, so save the current adjoint for future use
|
289 | 293 | for (auto j : make_range(_system.n_qois()))
|
290 | 294 | {
|
@@ -439,17 +443,21 @@ void EulerSolver::advance_postprocessing_timestep(std::vector<std::function<void
|
439 | 443 | std::unique_ptr<NumericVector<Number>> weighted_vector = NumericVector<Number>::build(_system.comm());
|
440 | 444 | weighted_vector->init(_system.get_vector("_old_nonlinear_solution"));
|
441 | 445 |
|
442 |
| - weighted_vector->add((1.0 - theta)*(time_right - time_left), _system.get_vector("_old_nonlinear_solution")); |
| 446 | + weighted_vector->add((1.0 - theta), _system.get_vector("_old_nonlinear_solution")); |
443 | 447 |
|
444 |
| - weighted_vector->add(theta*(time_right - time_left), *(_system.solution)); |
| 448 | + weighted_vector->add(theta, *(_system.solution)); |
445 | 449 |
|
446 | 450 | _system.solution->swap(*weighted_vector);
|
447 | 451 |
|
| 452 | + std::cout<<"Weighted solution norm: "<<_system.calculate_norm(*_system.solution, 0, H1)<<std::endl; |
| 453 | + |
| 454 | + _system.update(); |
| 455 | + |
448 | 456 | // Mesh and solution read in. Ready to call the user's integration operations.
|
449 | 457 | // Since we have already weighted the solution and old solution, we just pass 1.0
|
450 | 458 | // as the time quadrature weight.
|
451 | 459 | for (auto integration_operations_iterator:integration_operations)
|
452 |
| - integration_operations_iterator(1.0, dynamic_cast<System&>(_system)); |
| 460 | + integration_operations_iterator(1.0*(time_right - time_left), dynamic_cast<System&>(_system)); |
453 | 461 |
|
454 | 462 | // Swap back
|
455 | 463 | _system.solution->swap(*weighted_vector);
|
|
0 commit comments