deal.II version GIT relicensing-2167-g9622207b8f 2024-11-21 12:40: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
adolc_math.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2017 - 2022 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#ifndef dealii_differentiation_ad_adolc_math_h
16#define dealii_differentiation_ad_adolc_math_h
17
18#include <deal.II/base/config.h>
19
20#ifdef DEAL_II_WITH_ADOLC
21
22# include <adolc/adouble.h> // Taped double
23# include <adolc/adtl.h> // Tapeless double
24# include <adolc/internal/adolc_settings.h>
25# include <adolc/internal/adubfunc.h> // Taped double math functions
26
27
28# ifndef DOXYGEN
29
35# ifdef DEAL_II_ADOLC_WITH_ATRIG_ERF
36inline adouble
37erfc(const adouble &x)
38{
39 // Make things work with AD types
40 using std::erf;
41 return 1.0 - erf(x);
42}
43
48inline adtl::adouble
49erfc(const adtl::adouble &x)
50{
51 // Make things work with AD types
52 using std::erf;
53 return 1.0 - erf(x);
54}
55# endif
56
57
61inline adouble
62abs(const adouble &x)
63{
64 return fabs(static_cast<const badouble &>(x));
65}
66
70inline adtl::adouble
71abs(const adtl::adouble &x)
72{
73 return adtl::fabs(x);
74}
75
77# endif // DOXYGEN
78
79#endif // DEAL_II_WITH_ADOLC
80
81#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
Expression fabs(const Expression &x)
Expression erfc(const Expression &x)
Expression erf(const Expression &x)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)