deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+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
adolc_math.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2017 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_differentiation_ad_adolc_math_h
14#define dealii_differentiation_ad_adolc_math_h
15
16#include <deal.II/base/config.h>
17
18#ifdef DEAL_II_WITH_ADOLC
19
20# include <adolc/adouble.h> // Taped double
21# include <adolc/adtl.h> // Tapeless double
22# include <adolc/internal/adolc_settings.h>
23# include <adolc/internal/adubfunc.h> // Taped double math functions
24
25# include <cmath>
26
27#endif // DEAL_II_WITH_ADOLC
28
30
31#ifdef DEAL_II_WITH_ADOLC
32# ifndef DOXYGEN
37# ifdef DEAL_II_ADOLC_WITH_ATRIG_ERF
38inline adouble
39erfc(const adouble &x)
40{
41 // Make things work with AD types
42 using std::erf;
43 return 1.0 - erf(x);
44}
45
50inline adtl::adouble
51erfc(const adtl::adouble &x)
52{
53 // Make things work with AD types
54 using std::erf;
55 return 1.0 - erf(x);
56}
57# endif
58
59
63inline adouble
64abs(const adouble &x)
65{
66 return fabs(static_cast<const badouble &>(x));
67}
68
72inline adtl::adouble
73abs(const adtl::adouble &x)
74{
75 return adtl::fabs(x);
76}
77
78# endif // DOXYGEN
79
80#endif // DEAL_II_WITH_ADOLC
81
83
84#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
Expression fabs(const Expression &x)
Expression erfc(const Expression &x)
Expression erf(const Expression &x)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)