Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • dumux dumux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 101
    • Merge requests 101
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • dumux-repositories
  • dumuxdumux
  • Issues
  • #175
Closed
Open
Created Jan 09, 2013 by Christoph Grüninger@gruenichMaintainer

FS#175 Replace assert by NumericalProblem

Metadata

Property Value
Project dumux
Category General
Reported by Christoph Grüninger (gruenich@iws.uni-stuttgart.de)
Reported at Jan 9, 2013 06:58
Type Bug Report
Version Git
Last edited by Christoph Grüninger (gruenich@iws.uni-stuttgart.de)
Last edited at Jan 11, 2013 14:04
Closed by Christoph Grüninger (gruenich@iws.uni-stuttgart.de)
Closed at Jan 11, 2013 14:04
Closed in version 2.3
Resolution Implemented

Description

In the Box assembler dumux/implicit/box/boxassembler.hh:306 we have a test whether all entries are finite. I like the test and it already helped me finding bugs. Unfortunately it breaks the execution if the test fails. In many cases it would be better to try a smaller time step.

The following patch would implement this behavior and improve the error message.

Any objections?
Philipp proposed this behavoir when we talked the last time about this topic.

--- dumux/dumux/implicit/box/boxassembler.hh    (revision 9943)
+++ dumux/dumux/implicit/box/boxassembler.hh    (working copy)
@@ -24,6 +24,7 @@
 #ifndef DUMUX_BOX_ASSEMBLER_HH
 #define DUMUX_BOX_ASSEMBLER_HH
 
+#include <dumux/common/exceptions.hh>
 #include <dumux/implicit/common/implicitassembler.hh>
 #include <dumux/parallel/vertexhandles.hh>
 
@@ -302,8 +303,12 @@
 
             // update the right hand side
             this->residual_[globI] += this->model_().localJacobian().residual(i);
-            for (int j = 0; j < this->residual_[globI].dimension; ++j)
-                assert(std::isfinite(this->residual_[globI][j]));
+            for (int j = 0; j < this->residual_[globI].dimension; ++j) {
+                if (!std::isfinite(this->residual_[globI][j])) {
+                    DUNE_THROW(NumericalProblem, 
+                               \"residual_[\" << globI << \"][\" << j << \" is not finite\");
+                }
+            }
             if (this->enableJacobianRecycling_()) {
                 this->storageTerm_[globI] +=
                     this->model_().localJacobian().storageTerm(i);
Assignee
Assign to
Time tracking