Reference documentation for deal.II version 9.5.0
\(\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// Copyright (C) 2016 - 2022 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#ifndef dealii_differentiation_ad_adolc_math_h
17#define dealii_differentiation_ad_adolc_math_h
18
19#include <deal.II/base/config.h>
20
21#ifdef DEAL_II_WITH_ADOLC
22
23# include <adolc/adouble.h> // Taped double
24# include <adolc/adtl.h> // Tapeless double
25# include <adolc/internal/adolc_settings.h>
26# include <adolc/internal/adubfunc.h> // Taped double math functions
27
28
29# ifndef DOXYGEN
30
36# ifdef DEAL_II_ADOLC_WITH_ATRIG_ERF
37inline adouble
38erfc(const adouble &x)
39{
40 // Make things work with AD types
41 using std::erf;
42 return 1.0 - erf(x);
43}
44
49inline adtl::adouble
50erfc(const adtl::adouble &x)
51{
52 // Make things work with AD types
53 using std::erf;
54 return 1.0 - erf(x);
55}
56# endif
57
58
62inline adouble
63abs(const adouble &x)
64{
65 return fabs(static_cast<const badouble &>(x));
66}
67
71inline adtl::adouble
72abs(const adtl::adouble &x)
73{
74 return adtl::fabs(x);
75}
76
78# endif // DOXYGEN
79
80#endif // DEAL_II_WITH_ADOLC
81
82#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
Expression fabs(const Expression &x)
Expression erfc(const Expression &x)
Expression erf(const Expression &x)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)