From: Wolfgang Bangerth Date: Wed, 17 Apr 2024 19:46:07 +0000 (-0600) Subject: Fix use of incorrect Epetra function. X-Git-Tag: v9.6.0-rc1~361^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caee06673ced8c91b170e8bb36a94f3b072a203c;p=dealii.git Fix use of incorrect Epetra function. --- 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];