From 63360a6f6eb11be9ab763721ef993d40c0f2c05f Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 3 Jun 2016 16:48:16 -0500 Subject: [PATCH] Explicitly instantiate Tensor<...> and its members. --- doc/news/changes.h | 9 ++++++++ source/base/CMakeLists.txt | 4 +++- source/base/tensor.cc | 24 ++++++++++++++++++++++ source/base/tensor.inst.in | 42 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 source/base/tensor.cc create mode 100644 source/base/tensor.inst.in diff --git a/doc/news/changes.h b/doc/news/changes.h index 350a1001ad..d4d02ab212 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -269,6 +269,15 @@ inconvenience this causes.
    +
  1. Fixed: The Tensor class was not explicitly instantiated. This did + not matter in almost all contexts because its members are all defined + as @p inline in the header file. The only cases where it matters if one + (or the compiler) were to take the address of one of the static member + variables. +
    + (Wolfgang Bangerth, 2016/06/03) +
  2. +
  3. New: Return value std::vector vertex_mapping for the DoFTools::make_vertex_patches() function, including the optional inversion of the vertex mapping. diff --git a/source/base/CMakeLists.txt b/source/base/CMakeLists.txt index 9df7b72fb6..2f13d89d0c 100644 --- a/source/base/CMakeLists.txt +++ b/source/base/CMakeLists.txt @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2015 by the deal.II authors +## Copyright (C) 2012 - 2016 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -66,6 +66,7 @@ SET(_src tensor_product_polynomials_bubbles.cc tensor_product_polynomials_const.cc thread_management.cc + tensor.cc timer.cc time_stepping.cc utilities.cc @@ -77,6 +78,7 @@ SET(_inst function_time.inst.in mpi.inst.in polynomials_rannacher_turek.inst.in + tensor.inst.in tensor_function.inst.in time_stepping.inst.in ) diff --git a/source/base/tensor.cc b/source/base/tensor.cc new file mode 100644 index 0000000000..d38444b940 --- /dev/null +++ b/source/base/tensor.cc @@ -0,0 +1,24 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2016 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + +#include + +DEAL_II_NAMESPACE_OPEN + + +#include "tensor.inst" + + +DEAL_II_NAMESPACE_CLOSE diff --git a/source/base/tensor.inst.in b/source/base/tensor.inst.in new file mode 100644 index 0000000000..9860554b47 --- /dev/null +++ b/source/base/tensor.inst.in @@ -0,0 +1,42 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2016 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +for (rank : RANKS; deal_II_dimension : DIMENSIONS; number : REAL_SCALARS) +{ + template + class Tensor; +} + + +for (deal_II_dimension : DIMENSIONS; number : REAL_SCALARS) +{ + template + class Tensor<0,deal_II_dimension,number>; +} + + +for (rank : RANKS; deal_II_dimension : DIMENSIONS; number : COMPLEX_SCALARS) +{ + template + class Tensor; +} + + +for (deal_II_dimension : DIMENSIONS; number : COMPLEX_SCALARS) +{ + template + class Tensor<0,deal_II_dimension,number>; +} -- 2.39.5