deal.II version GIT relicensing-2647-gce4370862c 2025-02-15 16:00:00+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
24#ifdef DEAL_II_WITH_ADOLC
25# include <adolc/adouble.h>
26# include <adolc/adtl.h>
27#endif
28
29
31
32#ifdef DEAL_II_WITH_ADOLC
33# ifdef DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING
34
35// Specializations of the above functions for taped ADOL-C numbers
36// when the advanced branching feature is activated.
37// We could copy-paste all of these functions and add the appropriate
38// conditional assignments (see the ADOL-C manual, section 1.8).
39// However, some of the conditions are quite complicated (with possibly
40// no 1-1 correspondence for the operations along each branch) so this
41// needs some careful attention. For the sake of simplicity and until
42// this can be rigourously checked, at this point in time we simply
43// disable these functions.
44namespace internal
45{
46 namespace SymmetricTensorImplementation
47 {
48 template <>
49 struct Inverse<4, 3, adouble>
50 {
51 static ::SymmetricTensor<4, 3, adouble>
52 value(const ::SymmetricTensor<4, 3, adouble> & /*t*/)
53 {
55 return ::SymmetricTensor<4, 3, adouble>();
56 }
57 };
58 } // namespace SymmetricTensorImplementation
59} // namespace internal
60
61template <>
62std::array<adouble, 1>
64{
66 return std::array<adouble, 1>();
67}
68
69
70
71template <>
72std::array<adouble, 2>
74{
76 return std::array<adouble, 2>();
77}
78
79
80
81template <>
82std::array<adouble, 3>
84{
86 return std::array<adouble, 3>();
87}
88
89
90
91template <>
92std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>
94 const SymmetricTensorEigenvectorMethod /*method*/)
95{
97 return std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>();
98}
99
100
101
102template <>
103std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>
105 const SymmetricTensorEigenvectorMethod /*method*/)
106{
108 return std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>();
109}
110
111
112
113template <>
114std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>
116 const SymmetricTensorEigenvectorMethod /*method*/)
117{
119 return std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>();
120}
121
122# else
123
124template std::array<adouble, 1>
126
127template std::array<adouble, 2>
129
130template std::array<adouble, 3>
132
133template std::array<std::pair<adouble, Tensor<1, 1, adouble>>, 1>
136
137template std::array<std::pair<adouble, Tensor<1, 2, adouble>>, 2>
140
141template std::array<std::pair<adouble, Tensor<1, 3, adouble>>, 3>
144# endif
145
146template std::array<adtl::adouble, 1>
148
149template std::array<adtl::adouble, 2>
151
152template std::array<adtl::adouble, 3>
154
155template std::array<std::pair<adtl::adouble, Tensor<1, 1, adtl::adouble>>, 1>
158
159template std::array<std::pair<adtl::adouble, Tensor<1, 2, adtl::adouble>>, 2>
162
163template std::array<std::pair<adtl::adouble, Tensor<1, 3, adtl::adouble>>, 3>
166#endif
167
168// explicit instantiations
169#include "base/symmetric_tensor.inst"
170
171
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:518
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:519
#define AssertThrow(cond, exc)
static ::ExceptionBase & ExcADOLCAdvancedBranching()
static ::SymmetricTensor< 4, 3, adouble > value(const ::SymmetricTensor< 4, 3, adouble > &)
template std::array< std::pair< adtl::adouble, Tensor< 1, 3, adtl::adouble > >, 3 > eigenvectors< 3, adtl::adouble >(const SymmetricTensor< 2, 3, adtl::adouble > &, const SymmetricTensorEigenvectorMethod)
std::array< std::pair< adouble, Tensor< 1, 1, adouble > >, 1 > eigenvectors< 1, adouble >(const SymmetricTensor< 2, 1, adouble > &, const SymmetricTensorEigenvectorMethod)
std::array< adouble, 1 > eigenvalues(const SymmetricTensor< 2, 1, adouble > &)
template std::array< std::pair< adtl::adouble, Tensor< 1, 1, adtl::adouble > >, 1 > eigenvectors< 1, adtl::adouble >(const SymmetricTensor< 2, 1, adtl::adouble > &, const SymmetricTensorEigenvectorMethod)
std::array< std::pair< adouble, Tensor< 1, 3, adouble > >, 3 > eigenvectors< 3, adouble >(const SymmetricTensor< 2, 3, adouble > &, const SymmetricTensorEigenvectorMethod)
template std::array< std::pair< adtl::adouble, Tensor< 1, 2, adtl::adouble > >, 2 > eigenvectors< 2, adtl::adouble >(const SymmetricTensor< 2, 2, adtl::adouble > &, const SymmetricTensorEigenvectorMethod)
std::array< std::pair< adouble, Tensor< 1, 2, adouble > >, 2 > eigenvectors< 2, adouble >(const SymmetricTensor< 2, 2, adouble > &, const SymmetricTensorEigenvectorMethod)
SymmetricTensorEigenvectorMethod