Skip to content

Commit 06590ed

Browse files
Merge pull request #1613 from PrincetonUniversity/copilot/sub-pr-1608
Add compile-time enforcement for N_SLS > 1 in compute_tau_sigma
2 parents 9e06b4f + bf892df commit 06590ed

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

core/specfem/attenuation/compute_tau_sigma.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
namespace specfem {
99
namespace attenuation {
1010

11-
// TODO (Lucas : CPP20): and requires N_SLS>1
12-
1311
/**
1412
* @brief Compute stress relaxation times \f$\tau_{\sigma}\f$ equally spaced in
1513
* log10 frequency.

core/specfem/attenuation/compute_tau_sigma.tpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace attenuation {
1111
template <int N_SLS>
1212
Kokkos::View<type_real[N_SLS], Kokkos::LayoutRight, Kokkos::HostSpace>
1313
compute_tau_sigma(const type_real min_period, const type_real max_period) {
14+
static_assert(N_SLS > 1, "N_SLS must be greater than 1 to avoid division by zero");
1415

1516
Kokkos::View<type_real[N_SLS], Kokkos::LayoutRight, Kokkos::HostSpace> tau_s(
1617
"tau_sigma");

0 commit comments

Comments
 (0)