]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Remove wrong bugfix
authorMatthias Maier <tamiko@43-1.org>
Sat, 12 Sep 2015 05:46:19 +0000 (00:46 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 13 Sep 2015 00:51:43 +0000 (19:51 -0500)
This is just a mistake. We should tackle the fundamental problem, namely
that we do not have templated operator* for mixed std::complex types
available.

Explicitly casting to product_type at every occurence of a possible product
of another scalar with a complex number type is not just tedious, it is
also strictly speaking not correct:

The type trait ProductType<Left, Right>::type defines the type that results
from calling operator* on those types - but neither Left, nor Right, have
to be convertible to a ProductType... (The contraction of tensors as we do
with operator* is an example)

cmake/checks/check_03_compiler_bugs.cmake
include/deal.II/base/config.h.in
include/deal.II/base/tensor.h

index a1d8d1cd3429e4cab54499f5474fba0b6a4dfe3f..03d63f6ab1101c4589fc5ef1a5d47ecad650ef3f 100644 (file)
@@ -423,18 +423,3 @@ IF(DEAL_II_WITH_CXX11)
   RESET_CMAKE_REQUIRED()
 ENDIF()
 
-
-#
-# GCC 4.8 (and possibly older) have a regression that prevents our "trick"
-# to allow multiplication of Tensor objects with std::complex<T> and
-# scalars U with different types T and U from working. In this case a
-# specialization is needed. See also base/product_type_02.cc and
-# base/product_type_03.cc
-#
-# - Matthias Maier, 2015
-#
-
-IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
-    CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9" )
-  SET(DEAL_II_GCC_COMPLEX_CONV_BUG TRUE)
-ENDIF()
index cf7f55f4671edb1e95a0f884d27a8e3c8794d62a..72863f63b24505d1fad826780260a9e98968d332 100644 (file)
@@ -70,7 +70,6 @@
 #cmakedefine DEAL_II_BIND_NO_CONST_OP_PARENTHESES
 #cmakedefine DEAL_II_CONSTEXPR_BUG
 #cmakedefine DEAL_II_ICC_SFINAE_BUG
-#cmakedefine DEAL_II_GCC_COMPLEX_CONV_BUG
 
 
 /***********************************************************************
index 15d2754898b85ed2db93a55edc956122abcc6feb..1f75f7a7da1c0e7bd3b0cfe31374acde911c0e07 100644 (file)
@@ -1378,22 +1378,6 @@ operator * (const Tensor<rank,dim,Number> &t,
 }
 
 
-#ifdef DEAL_II_GCC_COMPLEX_CONV_BUG
-template <int dim, typename Number, typename OtherNumber>
-inline
-Tensor<1,dim,typename ProductType<Number, typename EnableIfScalar<OtherNumber>::type>::type>
-operator * (const Tensor<1,dim,Number> &t,
-            const OtherNumber           factor)
-{
-  typedef typename ProductType<Number,OtherNumber>::type product_type;
-  Tensor<1,dim,product_type> tt;
-  for (unsigned int d=0; d<dim; ++d)
-    tt[d] = product_type(t[d]) * product_type(factor);
-  return tt;
-}
-#endif
-
-
 /**
  * Multiplication of a tensor of general rank with a scalar number from the
  * left.

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.