2 #include <configure.hpp>
6 #include <athena/athena.hpp>
7 #include <athena/coordinates/coordinates.hpp>
8 #include <athena/hydro/hydro.hpp>
9 #include <athena/hydro/srcterms/hydro_srcterms.hpp>
10 #include <athena/mesh/mesh.hpp>
11 #include <athena/stride_iterator.hpp>
14 #include <application/application.hpp>
17 #include "../thermodynamics/thermodynamics.hpp"
20 Application::Logger app(
"snap");
22 auto &w = pmb->phydro->w;
24 for (
int k = pmb->ks; k <= pmb->ke; ++k)
25 for (
int j = pmb->js; j <= pmb->je; ++
j)
26 for (
int i = pmb->is; i <= pmb->ie; ++i) {
27 for (
int n = 0; n <= NHYDRO; ++n) {
28 if (w(n, k,
j, i) < 0.) {
29 app->Error(
"density is negative at (" + std::to_string(k) +
", " +
30 std::to_string(
j) +
", " + std::to_string(i) +
")");
34 if (NON_BAROTROPIC_EOS) {
35 if (w(IPR, k,
j, i) < 0.) {
36 app->Error(
"pressure is negative at (" + std::to_string(k) +
", " +
37 std::to_string(
j) +
", " + std::to_string(i) +
")");
41 Real
temp = pthermo->GetTemp(pmb, k,
j, i);
42 Real grav = -pmb->phydro->hsrc.GetG1();
44 Real Tmin = grav * pmb->pcoord->dx1f(i) / pthermo->GetRd();
46 app->Error(
"temperature is less than minimum temperature at (" +
47 std::to_string(k) +
", " + std::to_string(
j) +
", " +
48 std::to_string(i) +
")");
55 app->Log(
"Hydro check passed.");
void check_hydro_variables(MeshBlock *pmb)
static Thermodynamics const * GetInstance()
Return a pointer to the one and only instance of Thermodynamics.