Reference documentation for deal.II version Git ede8f93e86 2020-12-03 14:59:20 -0700
\(\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 
#define AssertThrow(cond, exc)
Definition: exceptions.h:1576
SymmetricTensorEigenvectorMethod
std::array< std::pair< adouble, Tensor< 1, 1, adouble > >, 1 > eigenvectors(const SymmetricTensor< 2, 1, adouble > &, const SymmetricTensorEigenvectorMethod)
static ::ExceptionBase & ExcADOLCAdvancedBranching()
std::array< adouble, 1 > eigenvalues(const SymmetricTensor< 2, 1, adouble > &)
static ::SymmetricTensor< 4, 3, adouble > value(const ::SymmetricTensor< 4, 3, adouble > &)
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:372
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:371