Skip to content

Commit 86861aa

Browse files
committed
Fixup for b51d0c4
1 parent becb2c8 commit 86861aa

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/solvers/euler_solver.C

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#include "libmesh/numeric_vector.h"
2424
#include "libmesh/adjoint_refinement_estimator.h"
2525

26+
// Remove before committing
27+
#include "libmesh/system_norm.h"
28+
#include "libmesh/enum_norm_type.h"
29+
2630
namespace libMesh
2731
{
2832

@@ -284,7 +288,7 @@ void EulerSolver::integrate_adjoint_refinement_error_estimate(AdjointRefinementE
284288
next_step_deltat = _system.deltat;
285289
_system.deltat = last_step_deltat;
286290

287-
// The adjoint error estimate expression for a backwards facing step
291+
// The adjoint error estimate expression for a backward Euler
288292
// scheme needs the adjoint for the last time instant, so save the current adjoint for future use
289293
for (auto j : make_range(_system.n_qois()))
290294
{
@@ -439,17 +443,21 @@ void EulerSolver::advance_postprocessing_timestep(std::vector<std::function<void
439443
std::unique_ptr<NumericVector<Number>> weighted_vector = NumericVector<Number>::build(_system.comm());
440444
weighted_vector->init(_system.get_vector("_old_nonlinear_solution"));
441445

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"));
443447

444-
weighted_vector->add(theta*(time_right - time_left), *(_system.solution));
448+
weighted_vector->add(theta, *(_system.solution));
445449

446450
_system.solution->swap(*weighted_vector);
447451

452+
std::cout<<"Weighted solution norm: "<<_system.calculate_norm(*_system.solution, 0, H1)<<std::endl;
453+
454+
_system.update();
455+
448456
// Mesh and solution read in. Ready to call the user's integration operations.
449457
// Since we have already weighted the solution and old solution, we just pass 1.0
450458
// as the time quadrature weight.
451459
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));
453461

454462
// Swap back
455463
_system.solution->swap(*weighted_vector);

0 commit comments

Comments
 (0)