Skip to content

Commit

Permalink
A couple more fixes due to trilinos update (#1257)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Apr 17, 2024
1 parent da0d9f6 commit 6d57299
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion include/TpetraLinearSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/matrix_free/LinSysInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct linsys_info
static stk::mesh::NgpField<gid_type>
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<gid_type>(
*meta.get_field(stk::topology::NODE_RANK, gid_name));
}
Expand Down
5 changes: 3 additions & 2 deletions include/matrix_free/MomentumOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions include/tabular_props/LU.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ 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);
};

// 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);
};

// Read-only element access that works. Compiler refuses to use
// 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);
};

Expand Down
4 changes: 2 additions & 2 deletions src/TpetraLinearSystem.C
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/TpetraSegregatedLinearSystem.C
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6d57299

Please sign in to comment.