From cd2e8f9a54a9efb7b4d2fe141d02bd82d12fbfbd Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 12 Feb 2024 13:54:08 -0700 Subject: [PATCH] Add an assertion. --- include/deal.II/lac/trilinos_tpetra_vector.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/deal.II/lac/trilinos_tpetra_vector.h b/include/deal.II/lac/trilinos_tpetra_vector.h index c5d134e2b5..67bb9c42ee 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.h @@ -1003,6 +1003,10 @@ namespace LinearAlgebra const size_type *indices, const Number *values) { + // if we have ghost values, do not allow + // writing to this vector at all. + Assert(!has_ghost_elements(), ExcGhostsPresent()); + // First create an alias for the type of a view into our vectors. // The actual type is declared through several re-directions in // Tpetra, so instead of spelling it out, we get it via decltype: -- 2.39.5