G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsCoDiPack.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 // Enable implicit conversion and disable compiler warnings
17 #define CODI_ImplicitConversion true
18 #define CODI_ImplicitConversionWarning false
19 #include <codi.hpp>
20 
21 #include <gsCore/gsTemplateTools.h>
22 
23 #ifdef GISMO_BUILD_LIB
24 #ifdef gsCoDiPack_EXPORTS
25 #undef EXTERN_CLASS_TEMPLATE
26 #define EXTERN_CLASS_TEMPLATE CLASS_TEMPLATE_INST
27 #endif
28 
29 namespace codi {
30 template<class T>
31 using codi_real = std::conditional<ExpressionTraits::IsExpression<T>::value, GISMO_COEFF_TYPE, T>;
32 
33 // General forward AD type: RealForwardGen<real_t>
34 EXTERN_CLASS_TEMPLATE
35 ActiveType<ForwardEvaluation<real_t, real_t> >;
36 
37 // General vector forward AD type: RealForwardVec<real_t, 4>
38 EXTERN_CLASS_TEMPLATE
39 ActiveType<ForwardEvaluation<real_t, Direction<real_t, 4> > >;
40 
41 // General reverse AD type: RealReverseGen<real_t>
42 // Jacobian taping approach with linear index handling.
43 EXTERN_CLASS_TEMPLATE
44 ActiveType<JacobianLinearTape<JacobianTapeTypes<real_t, real_t,
45  LinearIndexManager<index_t>,
46  DefaultChunkedData> > >;
47 
48 // General vector reverse AD type: RealReverseVec<real_t, 4>
49 // Jacobian taping approach with linear index handling.
50 EXTERN_CLASS_TEMPLATE
51 ActiveType<JacobianLinearTape<JacobianTapeTypes<real_t, Direction<real_t, 4>,
52  LinearIndexManager<index_t>,
53  DefaultChunkedData> > >;
54 
55 // General unchecked reverse AD type: RealReverseUncheckedGen<real_t>
56 // Requires preallocation of data. See DataManagementTapeInterface.
57 // Jacobian taping approach with linear index handling.
58 EXTERN_CLASS_TEMPLATE
59 ActiveType<JacobianLinearTape<JacobianTapeTypes<real_t, real_t,
60  LinearIndexManager<index_t>,
61  DefaultBlockData> > >;
62 
63 // General reverse AD type: RealReverseIndexGen<real_t>
64 // Jacobian taping approach with reuse index handling.
65 EXTERN_CLASS_TEMPLATE
66 ActiveType<JacobianReuseTape<JacobianTapeTypes<real_t, real_t,
67  MultiUseIndexManager<index_t>,
68  DefaultChunkedData> > >;
69 
70 // General reverse AD type: RealReversePrimalGen<real_t>
71 // Primal value taping approach with linear index handling.
72 EXTERN_CLASS_TEMPLATE
73 ActiveType<PrimalValueLinearTape<
74  PrimalValueTapeTypes<real_t, real_t,
75  LinearIndexManager<index_t>,
76  InnerStatementEvaluator, DefaultChunkedData> > >;
77 
78 // General reverse AD type: RealReversePrimalIndexGen<real_t>
79 // Primal value taping approach with reuse index handling.
80 EXTERN_CLASS_TEMPLATE
81 ActiveType<PrimalValueReuseTape<
82  PrimalValueTapeTypes<real_t, real_t,
83  MultiUseIndexManager<index_t>,
84  InnerStatementEvaluator, DefaultChunkedData> > >;
85 
86 } // namespace codi
87 #endif
#define GISMO_COEFF_TYPE
Definition: gsConfig.h:26
Utilities related to template programming.