From: Wolfgang Bangerth Date: Sat, 28 Nov 2015 21:57:16 +0000 (-0600) Subject: Fix copy constructor of SymmetricTensor. X-Git-Tag: v8.4.0-rc2~191^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccb1f90aab7a1113fafe8676509cefcafb6a0669;p=dealii.git Fix copy constructor of SymmetricTensor. --- 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()); +}