[Commits] [svn:einsteintoolkit] EOS_Omni/trunk/src/nuc_eos_cxx/ (Rev. 105)
rhaas at tapir.caltech.edu
rhaas at tapir.caltech.edu
Wed Mar 12 22:02:09 CDT 2014
User: rhaas
Date: 2014/03/12 10:02 PM
Modified:
/trunk/src/nuc_eos_cxx/
nuc_eos_press_cs2.cc
Log:
EOS_Omni nuc_eos_cxx: ensure cs2 is 0 or positive
From: Christian Ott <cott at tapir.caltech.edu>
File Changes:
Directory: /trunk/src/nuc_eos_cxx/
==================================
File [modified]: nuc_eos_press_cs2.cc
Delta lines: +8 -2
===================================================================
--- trunk/src/nuc_eos_cxx/nuc_eos_press_cs2.cc 2014-03-13 03:02:05 UTC (rev 104)
+++ trunk/src/nuc_eos_cxx/nuc_eos_press_cs2.cc 2014-03-13 03:02:09 UTC (rev 105)
@@ -63,7 +63,10 @@
prs[i] = exp(prs[i]);
eps[i] = exp(eps[i]) - energy_shift;
#if HAVEGR
- cs2[i] = rho[i] * cs2[i] / (rho[i] + rho[i] * eps[i] + prs[i]);
+ cs2[i] = MAX(rho[i] * cs2[i] / (rho[i] + rho[i] * eps[i] + prs[i]),
+ 0.0e0);
+#else
+ cs2[i] = MAX(cs2[i], 0.0e0);
#endif
}
@@ -175,7 +178,10 @@
for(int i=0;i<n;i++) {
prs[i] = exp(prs[i]);
#if HAVEGR
- cs2[i] = rho[i] * cs2[i] / (rho[i] + rho[i]*eps[i] + prs[i]);
+ cs2[i] = MAX(rho[i] * cs2[i] / (rho[i] + rho[i] * eps[i] + prs[i]),
+ 0.0e0);
+#else
+ cs2[i] = MAX(cs2[i], 0.0e0);
#endif
}
More information about the Commits
mailing list