www.mooseframework.org
DualReal.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "libmesh/libmesh_common.h"
13 #include "libmesh/compare_types.h"
14 
15 namespace MetaPhysicL
16 {
17 template <typename, typename>
18 class DualNumber;
19 template <std::size_t, typename>
21 }
22 
23 using libMesh::Real;
26 
27 #define AD_MAX_DOFS_PER_ELEM 50
28 
30 
31 #ifndef LIBMESH_DUAL_NUMBER_COMPARE_TYPES
32 
33 namespace libMesh
34 {
35 template <typename T, typename T2, typename D>
36 struct CompareTypes<T, DualNumber<T2, D>>
37 {
39  typename D::template rebind<typename CompareTypes<T, T2>::supertype>::other>
41 };
42 template <typename T, typename D, typename T2>
43 struct CompareTypes<DualNumber<T, D>, T2>
44 {
46  typename D::template rebind<typename CompareTypes<T, T2>::supertype>::other>
48 };
49 template <typename T, typename D, typename T2, typename D2>
50 struct CompareTypes<DualNumber<T, D>, DualNumber<T2, D2>>
51 {
53  typename D::template rebind<typename CompareTypes<T, T2>::supertype>::other>
55 };
56 template <typename T, typename D>
57 struct CompareTypes<DualNumber<T, D>, DualNumber<T, D>>
58 {
60 };
61 template <typename T, typename D>
62 struct ScalarTraits<DualNumber<T, D>>
63 {
64  static const bool value = ScalarTraits<T>::value;
65 };
66 }
67 
68 #endif
DualNumber< Real, NumberArray< AD_MAX_DOFS_PER_ELEM, Real > > DualReal
Definition: DualReal.h:29
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
DualNumber< typename CompareTypes< T, T2 >::supertype, typename D::template rebind< typename CompareTypes< T, T2 >::supertype >::other > supertype
Definition: DualReal.h:54
DualNumber< typename CompareTypes< T, T2 >::supertype, typename D::template rebind< typename CompareTypes< T, T2 >::supertype >::other > supertype
Definition: DualReal.h:40
DualNumber< typename CompareTypes< T, T2 >::supertype, typename D::template rebind< typename CompareTypes< T, T2 >::supertype >::other > supertype
Definition: DualReal.h:47