From 6d57299e6df70b94ab8704faba88d40b91b38cea Mon Sep 17 00:00:00 2001 From: "Marc T. Henry de Frahan" Date: Wed, 17 Apr 2024 14:41:33 -0600 Subject: [PATCH] A couple more fixes due to trilinos update (#1257) --- include/TpetraLinearSystem.h | 2 +- include/matrix_free/LinSysInfo.h | 2 +- include/matrix_free/MomentumOperator.h | 5 +++-- include/tabular_props/LU.h | 12 ++++++------ src/TpetraLinearSystem.C | 4 ++-- src/TpetraSegregatedLinearSystem.C | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/TpetraLinearSystem.h b/include/TpetraLinearSystem.h index b676df031f..554013bbcb 100644 --- a/include/TpetraLinearSystem.h +++ b/include/TpetraLinearSystem.h @@ -363,7 +363,7 @@ copy_kokkos_unordered_map( fail_count += insert_result.failed() ? 1 : 0; } } - ThrowRequire(fail_count == 0); + STK_ThrowRequire(fail_count == 0); } int getDofStatus_impl(stk::mesh::Entity node, const Realm& realm); diff --git a/include/matrix_free/LinSysInfo.h b/include/matrix_free/LinSysInfo.h index a7f23a17e6..beaae74030 100644 --- a/include/matrix_free/LinSysInfo.h +++ b/include/matrix_free/LinSysInfo.h @@ -35,7 +35,7 @@ struct linsys_info static stk::mesh::NgpField get_gid_field(const stk::mesh::MetaData& meta) { - ThrowRequire(meta.get_field(stk::topology::NODE_RANK, gid_name)); + STK_ThrowRequire(meta.get_field(stk::topology::NODE_RANK, gid_name)); return stk::mesh::get_updated_ngp_field( *meta.get_field(stk::topology::NODE_RANK, gid_name)); } diff --git a/include/matrix_free/MomentumOperator.h b/include/matrix_free/MomentumOperator.h index 7e2a12a185..84d6c8beab 100644 --- a/include/matrix_free/MomentumOperator.h +++ b/include/matrix_free/MomentumOperator.h @@ -57,8 +57,9 @@ class MomentumResidualOperator dirichlet_bc_active_ = dirichlet_offsets_in.extent_int(0) > 0; dirichlet_bc_offsets_ = dirichlet_offsets_in; bc_ = bc; - ThrowRequire(bc.up1.extent_int(0) == dirichlet_bc_offsets_.extent_int(0)); - ThrowRequire(bc.ubc.extent_int(0) == bc.up1.extent_int(0)); + STK_ThrowRequire( + bc.up1.extent_int(0) == dirichlet_bc_offsets_.extent_int(0)); + STK_ThrowRequire(bc.ubc.extent_int(0) == bc.up1.extent_int(0)); } private: diff --git a/include/tabular_props/LU.h b/include/tabular_props/LU.h index 3188503c96..12e6ae6a78 100644 --- a/include/tabular_props/LU.h +++ b/include/tabular_props/LU.h @@ -22,8 +22,8 @@ class LU // Writable element access inline double& operator()(int row, int col) { - ThrowRequire(row <= dim_); - ThrowRequire(col <= dim_); + STK_ThrowRequire(row <= dim_); + STK_ThrowRequire(col <= dim_); isReady_ = false; return AA_(row, col); }; @@ -31,8 +31,8 @@ class LU // Read-only element access inline double operator()(int row, int col) const { - ThrowRequire(row <= dim_); - ThrowRequire(col <= dim_); + STK_ThrowRequire(row <= dim_); + STK_ThrowRequire(col <= dim_); return AA_(row, col); }; @@ -40,8 +40,8 @@ class LU // the overloaded const operator() when possible for some reason. inline double value(int row, int col) const { - ThrowRequire(row <= dim_); - ThrowRequire(col <= dim_); + STK_ThrowRequire(row <= dim_); + STK_ThrowRequire(col <= dim_); return AA_(row, col); }; diff --git a/src/TpetraLinearSystem.C b/src/TpetraLinearSystem.C index 047ab87d67..1d998ff269 100644 --- a/src/TpetraLinearSystem.C +++ b/src/TpetraLinearSystem.C @@ -1508,7 +1508,7 @@ reset_rows( const LocalOrdinal actualLocalId = useOwned ? localId : (localId - maxOwnedRowId); - STK_NGP_ThrowRequireMsg(localId <= maxSharedNotOwnedRowId); + STK_NGP_ThrowRequireMsg(localId <= maxSharedNotOwnedRowId, "Error"); // Adjust the LHS; zero out all entries (including diagonal) reset_row(localMatrix.row(actualLocalId), actualLocalId, diag_value); @@ -2214,7 +2214,7 @@ TpetraLinearSystem::copy_tpetra_to_stk( const LocalOrdinal localIdOffset = entityToLID[node.local_offset()]; for (unsigned d = 0; d < numDof; ++d) { const LocalOrdinal localId = localIdOffset + d; - STK_NGP_ThrowRequireMsg(localId < maxOwnedRowId); + STK_NGP_ThrowRequireMsg(localId < maxOwnedRowId, "Error"); ngpField.get(meshIdx, d) = deviceVector(localId, 0); } diff --git a/src/TpetraSegregatedLinearSystem.C b/src/TpetraSegregatedLinearSystem.C index ec16e608a1..fade166aae 100644 --- a/src/TpetraSegregatedLinearSystem.C +++ b/src/TpetraSegregatedLinearSystem.C @@ -1283,7 +1283,7 @@ reset_rows( const LocalOrdinal actualLocalId = useOwned ? localId : (localId - maxOwnedRowId); - STK_NGP_ThrowRequireMsg(localId <= maxSharedNotOwnedRowId); + STK_NGP_ThrowRequireMsg(localId <= maxSharedNotOwnedRowId, "Error"); // Adjust the LHS; zero out all entries (including diagonal) reset_row(localMatrix.row(actualLocalId), actualLocalId, diag_value);