From 577950151ad8b3572811a0065328e89d2ea6816f Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 5 Sep 2019 16:14:21 -0400 Subject: [PATCH] Fix undefined references for set_zero_all --- include/deal.II/lac/la_vector.h | 24 ++++++++++++++++++++++++ source/lac/affine_constraints.cu | 17 +++++++++++++++++ source/lac/affine_constraints.inst.in | 13 +++++++++++++ 3 files changed, 54 insertions(+) diff --git a/include/deal.II/lac/la_vector.h b/include/deal.II/lac/la_vector.h index 66e8f57e82..6bb3a3bfdd 100644 --- a/include/deal.II/lac/la_vector.h +++ b/include/deal.II/lac/la_vector.h @@ -160,6 +160,15 @@ namespace LinearAlgebra reinit(const VectorSpaceVector &V, const bool omit_zeroing_entries = false) override; + /** + * Returns `false` as this is a serial vector. + * + * This functionality only needs to be called if using MPI based vectors and + * exists in other objects for compatibility. + */ + bool + has_ghost_elements() const; + /** * Copies the data of the input vector @p in_vector. */ @@ -508,6 +517,21 @@ template struct is_serial_vector> : std::true_type {}; +#ifndef DOXYGEN +/*----------------------- Inline functions ----------------------------------*/ + +namespace LinearAlgebra +{ + template + inline bool + Vector::has_ghost_elements() const + { + return false; + } +} // namespace LinearAlgebra + +#endif + DEAL_II_NAMESPACE_CLOSE diff --git a/source/lac/affine_constraints.cu b/source/lac/affine_constraints.cu index c686dc4fb2..8b79fe6d61 100644 --- a/source/lac/affine_constraints.cu +++ b/source/lac/affine_constraints.cu @@ -17,6 +17,23 @@ DEAL_II_NAMESPACE_OPEN + +namespace internal +{ + namespace AffineConstraintsImplementation + { + template void + set_zero_all( + const std::vector & cm, + LinearAlgebra::distributed::Vector &vec); + + template void + set_zero_all( + const std::vector & cm, + LinearAlgebra::distributed::Vector &vec); + } // namespace AffineConstraintsImplementation +} // namespace internal + template void AffineConstraints::set_zero< LinearAlgebra::distributed::Vector>( diff --git a/source/lac/affine_constraints.inst.in b/source/lac/affine_constraints.inst.in index 4523cad087..bb0d4f5b42 100644 --- a/source/lac/affine_constraints.inst.in +++ b/source/lac/affine_constraints.inst.in @@ -345,3 +345,16 @@ for (T : DEAL_II_VEC_TEMPLATES) template void dealii::AffineConstraints::distribute>( T &) const; } + + +for (T : VECTOR_TYPES) + { + namespace internal + { + namespace AffineConstraintsImplementation + { + template void + set_zero_all(const std::vector &, T &vec); + \} + \} + } -- 2.39.5