From caee06673ced8c91b170e8bb36a94f3b072a203c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 17 Apr 2024 13:46:07 -0600 Subject: [PATCH] Fix use of incorrect Epetra function. --- source/lac/trilinos_epetra_vector.cc | 8 ++++++++ source/lac/trilinos_vector.cc | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/source/lac/trilinos_epetra_vector.cc b/source/lac/trilinos_epetra_vector.cc index 54556de525..0fce03c6d8 100644 --- a/source/lac/trilinos_epetra_vector.cc +++ b/source/lac/trilinos_epetra_vector.cc @@ -52,11 +52,19 @@ namespace LinearAlgebra vector.vector->Map().LID( static_cast(index)); +# ifndef DEAL_II_WITH_64BIT_INDICES Assert(local_index >= 0, ExcAccessToNonLocalElement(index, vector.vector->Map().NumMyElements(), vector.vector->Map().MinMyGID(), vector.vector->Map().MaxMyGID())); +# else + Assert(local_index >= 0, + ExcAccessToNonLocalElement(index, + vector.vector->Map().NumMyElements(), + vector.vector->Map().MinMyGID64(), + vector.vector->Map().MaxMyGID64())); +# endif return (*(vector.vector))[0][local_index]; } diff --git a/source/lac/trilinos_vector.cc b/source/lac/trilinos_vector.cc index 47885f0879..f3404b72cb 100644 --- a/source/lac/trilinos_vector.cc +++ b/source/lac/trilinos_vector.cc @@ -52,12 +52,21 @@ namespace TrilinosWrappers const TrilinosWrappers::types::int_type local_index = vector.vector->Map().LID( static_cast(index)); +# ifndef DEAL_II_WITH_64BIT_INDICES Assert(local_index >= 0, MPI::Vector::ExcAccessToNonLocalElement( index, vector.vector->Map().NumMyElements(), vector.vector->Map().MinMyGID(), vector.vector->Map().MaxMyGID())); +# else + Assert(local_index >= 0, + MPI::Vector::ExcAccessToNonLocalElement( + index, + vector.vector->Map().NumMyElements(), + vector.vector->Map().MinMyGID64(), + vector.vector->Map().MaxMyGID64())); +# endif return (*(vector.vector))[0][local_index]; @@ -690,11 +699,19 @@ namespace TrilinosWrappers // continue. This is the main difference to the el() function. if (trilinos_i == -1) { +# ifndef DEAL_II_WITH_64BIT_INDICES Assert(false, ExcAccessToNonLocalElement(index, vector->Map().NumMyElements(), vector->Map().MinMyGID(), vector->Map().MaxMyGID())); +# else + Assert(false, + ExcAccessToNonLocalElement(index, + vector->Map().NumMyElements(), + vector->Map().MinMyGID64(), + vector->Map().MaxMyGID64())); +# endif } else value = (*vector)[0][trilinos_i]; -- 2.39.5