Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
symmetric_tensor.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2019 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #include <deal.II/base/config.h>
17 
18 // Required for instantiation of template functions
20 #include <deal.II/base/symmetric_tensor.templates.h>
21 
24 
26 #ifdef DEAL_II_WITH_ADOLC
27 # ifdef DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING
28 
29 // Specializations of the above functions for taped ADOL-C numbers
30 // when the advanced branching feature is activated.
31 // We could copy-paste all of these functions and add the appropriate
32 // conditional assignments (see the ADOL-C manual, section 1.8).
33 // However, some of the conditions are quite complicated (with possibly
34 // no 1-1 correspondence for the operations along each branch) so this
35 // needs some careful attention. For the sake of simplicity and until
36 // this can be rigourously checked, at this point in time we simply
37 // disable these functions.
38 namespace internal
39 {
40  namespace SymmetricTensorImplementation
41  {
42  template <>
43  struct Inverse<4, 3, adouble>
44  {
45  static ::SymmetricTensor<4, 3, adouble>
46  value(const ::SymmetricTensor<4, 3, adouble> & /*t*/)
47  {
49  return ::SymmetricTensor<4, 3, adouble>();
50  }
51  };
52  } // namespace SymmetricTensorImplementation
53 } // namespace internal
54 
55 template <>
56 std::array<adouble, 1>
58 {
60  return std::array<adouble, 1>();
61 }
62 
63 
64 
65 template <>
66 std::array<adouble, 2>
68 {
70  return std::array<adouble, 2>();
71 }
72 
73 
74 
75 template <>
76 std::array<adouble, 3>
78 {
80  return std::array<adouble, 3>();
81 }
82 
83 
84 
85 template <>
86 std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>
88  const SymmetricTensorEigenvectorMethod /*method*/)
89 {
91  return std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>();
92 }
93 
94 
95 
96 template <>
97 std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>
99  const SymmetricTensorEigenvectorMethod /*method*/)
100 {
102  return std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>();
103 }
104 
105 
106 
107 template <>
108 std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>
110  const SymmetricTensorEigenvectorMethod /*method*/)
111 {
113  return std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>();
114 }
115 
116 # else
117 
118 template std::array<adouble, 1>
120 
121 template std::array<adouble, 2>
123 
124 template std::array<adouble, 3>
126 
127 template std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>
130 
131 template std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>
134 
135 template std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>
138 # endif
139 
140 template std::array<adtl::adouble, 1>
142 
143 template std::array<adtl::adouble, 2>
145 
146 template std::array<adtl::adouble, 3>
148 
149 template std::array<std::pair<adtl::adouble, Tensor<1, 1, adtl::adouble>>, 1>
152 
153 template std::array<std::pair<adtl::adouble, Tensor<1, 2, adtl::adouble>>, 2>
156 
157 template std::array<std::pair<adtl::adouble, Tensor<1, 3, adtl::adouble>>, 3>
160 #endif
161 
162 // explicit instantiations
163 #include "symmetric_tensor.inst"
164 
165 
SymmetricTensor
Definition: symmetric_tensor.h:611
SymmetricTensor::eigenvectors
std::array< std::pair< Number, Tensor< 1, dim, Number > >, std::integral_constant< int, dim >::value > eigenvectors(const SymmetricTensor< 2, dim, Number > &T, const SymmetricTensorEigenvectorMethod method=SymmetricTensorEigenvectorMethod::ql_implicit_shifts)
sacado_product_types.h
ExcADOLCAdvancedBranching
static ::ExceptionBase & ExcADOLCAdvancedBranching()
internal::SymmetricTensorImplementation::Inverse
Definition: symmetric_tensor.h:130
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
SymmetricTensorEigenvectorMethod
SymmetricTensorEigenvectorMethod
Definition: symmetric_tensor.h:3131
symmetric_tensor.h
SymmetricTensor::eigenvalues
std::array< Number, 1 > eigenvalues(const SymmetricTensor< 2, 1, Number > &T)
config.h
internal
Definition: aligned_vector.h:369
adolc_product_types.h
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
internal::SymmetricTensorImplementation::Inverse< 4, 3, adouble >::value
static ::SymmetricTensor< 4, 3, adouble > value(const ::SymmetricTensor< 4, 3, adouble > &)
Definition: symmetric_tensor.cc:46
AssertThrow
#define AssertThrow(cond, exc)
Definition: exceptions.h:1531