Reference documentation for deal.II version GIT relicensing-233-g802318d791 2024-03-28 20:20:02+00:00
\(\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// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2005 - 2019 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#include <deal.II/base/config.h>
16
17// Required for instantiation of template functions
19#include <deal.II/base/symmetric_tensor.templates.h>
20
23
25#ifdef DEAL_II_WITH_ADOLC
26# ifdef DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING
27
28// Specializations of the above functions for taped ADOL-C numbers
29// when the advanced branching feature is activated.
30// We could copy-paste all of these functions and add the appropriate
31// conditional assignments (see the ADOL-C manual, section 1.8).
32// However, some of the conditions are quite complicated (with possibly
33// no 1-1 correspondence for the operations along each branch) so this
34// needs some careful attention. For the sake of simplicity and until
35// this can be rigourously checked, at this point in time we simply
36// disable these functions.
37namespace internal
38{
39 namespace SymmetricTensorImplementation
40 {
41 template <>
42 struct Inverse<4, 3, adouble>
43 {
44 static ::SymmetricTensor<4, 3, adouble>
45 value(const ::SymmetricTensor<4, 3, adouble> & /*t*/)
46 {
48 return ::SymmetricTensor<4, 3, adouble>();
49 }
50 };
51 } // namespace SymmetricTensorImplementation
52} // namespace internal
53
54template <>
55std::array<adouble, 1>
57{
59 return std::array<adouble, 1>();
60}
61
62
63
64template <>
65std::array<adouble, 2>
67{
69 return std::array<adouble, 2>();
70}
71
72
73
74template <>
75std::array<adouble, 3>
77{
79 return std::array<adouble, 3>();
80}
81
82
83
84template <>
85std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>
87 const SymmetricTensorEigenvectorMethod /*method*/)
88{
90 return std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>();
91}
92
93
94
95template <>
96std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>
98 const SymmetricTensorEigenvectorMethod /*method*/)
99{
101 return std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>();
102}
103
104
105
106template <>
107std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>
109 const SymmetricTensorEigenvectorMethod /*method*/)
110{
112 return std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>();
113}
114
115# else
116
117template std::array<adouble, 1>
119
120template std::array<adouble, 2>
122
123template std::array<adouble, 3>
125
126template std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>
129
130template std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>
133
134template std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>
137# endif
138
139template std::array<adtl::adouble, 1>
141
142template std::array<adtl::adouble, 2>
144
145template std::array<adtl::adouble, 3>
147
148template std::array<std::pair<adtl::adouble, Tensor<1, 1, adtl::adouble>>, 1>
151
152template std::array<std::pair<adtl::adouble, Tensor<1, 2, adtl::adouble>>, 2>
155
156template std::array<std::pair<adtl::adouble, Tensor<1, 3, adtl::adouble>>, 3>
159#endif
160
161// explicit instantiations
162#include "symmetric_tensor.inst"
163
164
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
#define AssertThrow(cond, exc)
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