Skip to content

Commit

Permalink
Fix step-77: zero out residual before assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
sebproell committed May 13, 2023
1 parent 89a79f2 commit ce7b7b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/step-77/step-77.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ namespace Step77

std::cout << " Computing residual vector..." << std::flush;

residual = 0.0;

const QGauss<dim> quadrature_formula(fe.degree + 1);
FEValues<dim> fe_values(fe,
quadrature_formula,
Expand Down
2 changes: 2 additions & 0 deletions tests/sundials/step-77.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ namespace Step77
const Vector<double> &evaluation_point,
Vector<double> & residual)
{
residual = 0.0;

const QGauss<dim> quadrature_formula(fe.degree + 1);
FEValues<dim> fe_values(fe,
quadrature_formula,
Expand Down

0 comments on commit ce7b7b6

Please sign in to comment.