Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TpetraWrappers: fix various compiler warnings #16498

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ namespace LinearAlgebra
{
matrix->getLocalRowView(i, indices, values);

for (size_t j = 0; j < indices.size(); ++j)
for (size_type j = 0; j < indices.size(); ++j)
out << "(" << matrix->getRowMap()->getGlobalElement(i) << ","
<< matrix->getColMap()->getGlobalElement(indices[j]) << ") "
<< values[j] << std::endl;
Expand Down
10 changes: 6 additions & 4 deletions include/deal.II/lac/trilinos_tpetra_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -1001,10 +1001,12 @@ namespace LinearAlgebra
# endif

if (local_row != Teuchos::OrdinalTraits<int>::invalid())
if (nonlocal)
vector_1d_nonlocal(local_row) += values[i];
else
vector_1d_local(local_row) += values[i];
{
if (nonlocal)
vector_1d_nonlocal(local_row) += values[i];
else
vector_1d_local(local_row) += values[i];
}
}

# if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
Expand Down
4 changes: 3 additions & 1 deletion include/deal.II/lac/trilinos_tpetra_vector.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,16 @@ namespace LinearAlgebra
vector->getMap()->getLocalElement(row);


# if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
Assert(
local_row != Teuchos::OrdinalTraits<int>::invalid(),
# if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
ExcAccessToNonLocalElement(row,
vector->getMap()->getLocalNumElements(),
vector->getMap()->getMinLocalIndex(),
vector->getMap()->getMaxLocalIndex()));
# else
Assert(
local_row != Teuchos::OrdinalTraits<int>::invalid(),
ExcAccessToNonLocalElement(row,
vector->getMap()->getNodeNumElements(),
vector->getMap()->getMinLocalIndex(),
Expand Down
2 changes: 2 additions & 0 deletions source/lac/trilinos_tpetra_sparsity_pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,8 @@ namespace LinearAlgebra

return static_cast<size_t>(local_col_index) != col_indices.size();
# else
(void)i;
(void)j;
Assert(false, ExcNotImplemented());
return false;
# endif
Expand Down