Skip to content

Commit

Permalink
sanity check at every time step.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer2368 committed May 9, 2024
1 parent 80b5334 commit f846f7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sketches/usns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ class NavierSolver

time += dt;
}

void SanityCheck()
{
assert(!isnan(u->Min()) && !isnan(u->Max()));
assert(!isnan(p->Min()) && !isnan(p->Max()));
}
};

int main(int argc, char *argv[])
Expand Down Expand Up @@ -404,6 +410,7 @@ int main(int argc, char *argv[])
}

navier.Step(time, step);
navier.SanityCheck();
}

// 17. Free the used memory.
Expand Down

0 comments on commit f846f7e

Please sign in to comment.