Skip to content

Commit 1bc5d2a

Browse files
committed
fix amrex_assert on cot
1 parent e6fd89b commit 1bc5d2a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/driver/Castro_math.H

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ cross_product(amrex::GpuArray<amrex::Real, 3> const& a,
2525
AMREX_GPU_HOST_DEVICE AMREX_INLINE
2626
amrex::Real cot(amrex::Real x) {
2727

28-
AMREX_ASSERT(x != 0.0_rt || x != M_PI);
28+
AMREX_ASSERT(x != 0.0_rt && x != M_PI);
29+
2930
// we want to reflect outside of x in [0, pi]
31+
// i.e. if x = -0.1 -> x = 0.1
32+
// and if x = 5π/4 -> x = 3π/4
33+
3034
if (x < 0.0_rt || x > M_PI) {
3135
x = M_PI - x;
3236
}

0 commit comments

Comments
 (0)