From 0a2483e9c8fad2824323fa3ad0c342c0351e6c41 Mon Sep 17 00:00:00 2001
From: Denis Davydov
Date: Mon, 22 Feb 2016 13:45:39 +0100
Subject: [PATCH] change instantiation of constraint matrix functions to allow
complex-valued vectors
---
doc/news/changes.h | 5 +++++
source/lac/constraint_matrix.cc | 9 +++++----
source/lac/constraint_matrix.inst.in | 8 +++++++-
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/doc/news/changes.h b/doc/news/changes.h
index 75e448c8c4..6bff97718f 100644
--- a/doc/news/changes.h
+++ b/doc/news/changes.h
@@ -38,6 +38,11 @@ inconvenience this causes.
+ - Changed: ConstraintMatrix::distribute_local_to_global() now requires
+ matching data types. This is done to correctly handle complex-valued case.
+
+ (Denis Davydov, 2016/02/22)
+
diff --git a/source/lac/constraint_matrix.cc b/source/lac/constraint_matrix.cc
index d105f489ab..214d602358 100644
--- a/source/lac/constraint_matrix.cc
+++ b/source/lac/constraint_matrix.cc
@@ -1222,17 +1222,18 @@ ConstraintMatrix::resolve_indices (std::vector &indices
VectorType &condensed) const;\
template void ConstraintMatrix::condense(VectorType &vec) const;\
template void ConstraintMatrix:: \
- distribute_local_to_global (const Vector &, \
+ distribute_local_to_global (const Vector &, \
const std::vector &, \
VectorType &, \
- const FullMatrix &) const
+ const FullMatrix &) const
+
#define PARALLEL_VECTOR_FUNCTIONS(VectorType) \
template void ConstraintMatrix:: \
- distribute_local_to_global (const Vector &, \
+ distribute_local_to_global (const Vector &, \
const std::vector &, \
VectorType &, \
- const FullMatrix &) const
+ const FullMatrix &) const
#ifdef DEAL_II_WITH_PETSC
diff --git a/source/lac/constraint_matrix.inst.in b/source/lac/constraint_matrix.inst.in
index 11418f93fa..78c03f8d5f 100644
--- a/source/lac/constraint_matrix.inst.in
+++ b/source/lac/constraint_matrix.inst.in
@@ -38,7 +38,7 @@ for (V: EXTERNAL_SEQUENTIAL_VECTORS)
template void ConstraintMatrix::condense(const V&, V&) const;
template void ConstraintMatrix::condense(V&vec) const;
template void ConstraintMatrix::distribute_local_to_global (
- const Vector&, const std::vector &, V&, const FullMatrix&) const;
+ const Vector&, const std::vector &, V&, const FullMatrix&) const;
template void ConstraintMatrix::set_zero(V&) const;
}
@@ -67,3 +67,9 @@ for (Vec : SERIAL_VECTORS)
{
template void ConstraintMatrix::distribute(Vec &) const;
}
+
+for (S: COMPLEX_SCALARS; T : DEAL_II_VEC_TEMPLATES)
+ {
+ template void ConstraintMatrix::distribute >(T &) const;
+ }
+
--
2.39.5