From 2c188593f099c7361f8c8cb1c089d1bbe616832f Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Fri, 29 Nov 2024 14:03:46 +0100 Subject: [PATCH] Remove some branches for now unsupported versions of Trilinos. --- source/lac/trilinos_epetra_vector.cc | 15 --------------- source/lac/trilinos_precondition_ml.cc | 3 --- source/lac/trilinos_vector.cc | 14 -------------- 3 files changed, 32 deletions(-) diff --git a/source/lac/trilinos_epetra_vector.cc b/source/lac/trilinos_epetra_vector.cc index 998ed14981..1155fbdfe0 100644 --- a/source/lac/trilinos_epetra_vector.cc +++ b/source/lac/trilinos_epetra_vector.cc @@ -287,27 +287,12 @@ namespace LinearAlgebra Assert(this->size() == V.size(), ExcDimensionMismatch(this->size(), V.size())); -# if DEAL_II_TRILINOS_VERSION_GTE(11, 11, 0) Epetra_Import data_exchange(vector->Map(), V.trilinos_vector().Map()); const int ierr = vector->Import(V.trilinos_vector(), data_exchange, Epetra_AddLocalAlso); Assert(ierr == 0, ExcTrilinosError(ierr)); (void)ierr; -# else - // In versions older than 11.11 the Import function is broken for - // adding Hence, we provide a workaround in this case - - Epetra_MultiVector dummy(vector->Map(), 1, false); - Epetra_Import data_exchange(dummy.Map(), V.trilinos_vector().Map()); - - int ierr = dummy.Import(V.trilinos_vector(), data_exchange, Insert); - Assert(ierr == 0, ExcTrilinosError(ierr)); - - ierr = vector->Update(1.0, dummy, 1.0); - Assert(ierr == 0, ExcTrilinosError(ierr)); - (void)ierr; -# endif } return *this; diff --git a/source/lac/trilinos_precondition_ml.cc b/source/lac/trilinos_precondition_ml.cc index af3c801540..4cd2efca96 100644 --- a/source/lac/trilinos_precondition_ml.cc +++ b/source/lac/trilinos_precondition_ml.cc @@ -94,10 +94,7 @@ namespace TrilinosWrappers parameter_list.set("coarse: type", coarse_type); // Force re-initialization of the random seed to make ML deterministic - // (only supported in trilinos >12.2): -# if DEAL_II_TRILINOS_VERSION_GTE(12, 4, 0) parameter_list.set("initialize random seed", true); -# endif parameter_list.set("smoother: sweeps", static_cast(smoother_sweeps)); parameter_list.set("cycle applications", static_cast(n_cycles)); diff --git a/source/lac/trilinos_vector.cc b/source/lac/trilinos_vector.cc index 1edc195bcf..8c18173170 100644 --- a/source/lac/trilinos_vector.cc +++ b/source/lac/trilinos_vector.cc @@ -733,25 +733,11 @@ namespace TrilinosWrappers AssertThrow(size() == v.size(), ExcDimensionMismatch(size(), v.size())); -# if DEAL_II_TRILINOS_VERSION_GTE(11, 11, 0) Epetra_Import data_exchange(vector->Map(), v.vector->Map()); int ierr = vector->Import(*v.vector, data_exchange, Epetra_AddLocalAlso); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); last_action = Add; -# else - // In versions older than 11.11 the Import function is broken for - // adding Hence, we provide a workaround in this case - - Epetra_MultiVector dummy(vector->Map(), 1, false); - Epetra_Import data_exchange(dummy.Map(), v.vector->Map()); - - int ierr = dummy.Import(*v.vector, data_exchange, Insert); - AssertThrow(ierr == 0, ExcTrilinosError(ierr)); - - ierr = vector->Update(1.0, dummy, 1.0); - AssertThrow(ierr == 0, ExcTrilinosError(ierr)); -# endif } } -- 2.39.5