From ccb1f90aab7a1113fafe8676509cefcafb6a0669 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 28 Nov 2015 15:57:16 -0600 Subject: [PATCH] Fix copy constructor of SymmetricTensor. --- doc/news/changes.h | 7 +++++++ include/deal.II/base/symmetric_tensor.h | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index 5a951c6250..f215637d94 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -451,6 +451,13 @@ inconvenience this causes.
    +
  1. Fixed: The constructor of SymmetricTensor that takes an array + of initializing elements led to a compiler error. This is now + fixed. +
    + (Wolfgang Bangerth, 2015/11/28) +
  2. +
  3. Fixed: parallel::distributed::Vector now detects if the size of MPI messages exceeds 2GB or if the local range exceeds the size of 32-bit integers and throws an exception informing about the unsupported sizes. diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index 2f98689dd3..bd73ad2cd2 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -989,8 +989,13 @@ template inline SymmetricTensor::SymmetricTensor (const Number (&array) [n_independent_components]) : - data (array) -{} + data (*reinterpret_cast(array)) +{ + // ensure that the reinterpret_cast above actually works + Assert (sizeof(typename base_tensor_type::array_type) + == sizeof(array), + ExcInternalError()); +} -- 2.39.5