Skip to content

Commit 5b2b652

Browse files
committed
return 1 if screening fac is negative
1 parent ee3d67c commit 5b2b652

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

screening/screen.H

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ number_t chugunov2007 (const plasma_state_t<number_t>& state,
445445
// machine limit the output
446446
constexpr amrex::Real h_max = 300.e0_rt;
447447
h = admath::min(h, h_max);
448+
if (h <= 0.0) {
449+
return 1.0;
450+
}
448451
return admath::exp(h);
449452
}
450453

@@ -537,6 +540,9 @@ number_t chugunov2009 (const plasma_state_t<number_t>& state,
537540
// machine limit the output
538541
constexpr amrex::Real h12_max = 300.e0_rt;
539542
h12 = admath::min(h12, h12_max);
543+
if (h12 <= 0.0) {
544+
return 1.0;
545+
}
540546
return admath::exp(h12);
541547
}
542548

@@ -632,7 +638,9 @@ number_t chabrier1998 (const plasma_state_t<number_t>& state,
632638

633639
constexpr amrex::Real h12_max = 300.0_rt;
634640
h12 = admath::min(h12_max, h12);
635-
641+
if (h12 <= 0.0) {
642+
return 1.0;
643+
}
636644
return admath::exp(h12);
637645
}
638646
#endif

0 commit comments

Comments
 (0)