]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix step-77: zero out residual before assembly 15210/head
authorSebastian Proell <sebastian.proell@tum.de>
Sat, 13 May 2023 09:56:17 +0000 (11:56 +0200)
committerSebastian Proell <sebastian.proell@tum.de>
Sat, 13 May 2023 13:14:23 +0000 (15:14 +0200)
examples/step-77/step-77.cc
tests/sundials/step-77.cc

index b58f350b20f4c3cfd961423d13168d582ba65deb..ab75a26d721c14b72b38930602d39a1cfb0fad5e 100644 (file)
@@ -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,
index 4c427d2636854adcb0fc16923b4e2883198e631f..d8aa4ffd28d26eac4a0193feeacb7df7fd8504b6 100644 (file)
@@ -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,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.