Reference documentation for deal.II version 9.4.1
\(\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\}}\)
Loading...
Searching...
No Matches
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.
38namespace 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
55template <>
56std::array<adouble, 1>
58{
60 return std::array<adouble, 1>();
61}
62
63
64
65template <>
66std::array<adouble, 2>
68{
70 return std::array<adouble, 2>();
71}
72
73
74
75template <>
76std::array<adouble, 3>
78{
80 return std::array<adouble, 3>();
81}
82
83
84
85template <>
86std::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
96template <>
97std::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
107template <>
108std::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
118template std::array<adouble, 1>
120
121template std::array<adouble, 2>
123
124template std::array<adouble, 3>
126
127template std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>
130
131template std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>
134
135template std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>
138# endif
139
140template std::array<adtl::adouble, 1>
142
143template std::array<adtl::adouble, 2>
145
146template std::array<adtl::adouble, 3>
148
149template std::array<std::pair<adtl::adouble, Tensor<1, 1, adtl::adouble>>, 1>
152
153template std::array<std::pair<adtl::adouble, Tensor<1, 2, adtl::adouble>>, 2>
156
157template 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 DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
#define AssertThrow(cond, exc)
Definition: exceptions.h:1583
static ::ExceptionBase & ExcADOLCAdvancedBranching()
static ::SymmetricTensor< 4, 3, adouble > value(const ::SymmetricTensor< 4, 3, adouble > &)
std::array< std::pair< adouble, Tensor< 1, 1, adouble > >, 1 > eigenvectors(const SymmetricTensor< 2, 1, adouble > &, const SymmetricTensorEigenvectorMethod)
std::array< adouble, 1 > eigenvalues(const SymmetricTensor< 2, 1, adouble > &)
SymmetricTensorEigenvectorMethod