Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ZeroSensitivities.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Panzer: A partial differential equation assembly
4 // engine for strongly coupled complex multiphysics systems
5 //
6 // Copyright 2011 NTESS and the Panzer contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10 
11 #ifndef PANZER_ZERO_SENSITIVITIES_HPP
12 #define PANZER_ZERO_SENSITIVITIES_HPP
13 
14 #include <iostream>
15 #include "Panzer_Traits.hpp" // for scalar types
16 #include "Kokkos_Core.hpp"
17 
18 namespace panzer {
19 
21  // template<typename ScalarT>
22  // void zeroSensitivities(ScalarT& s);
23 
25  KOKKOS_INLINE_FUNCTION
27 
29  KOKKOS_INLINE_FUNCTION
31  {
32  s.zero();
33  }
34 
36 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
37  KOKKOS_INLINE_FUNCTION
39  {
40  s.val().zero(); // is this right...? What does zero sensitivities mean here?
41  s.zero();
42  }
43 #endif
44 
46  /*
47  template<typename S, unsigned l, unsigned s, typename b>
48  inline
49  void
50  zeroSensitivities(Sacado::Fad::ViewFad<S,l,s,b> v)
51  {
52  v.zero();
53  }
54  */
55  template <typename T>
56  KOKKOS_INLINE_FUNCTION
57  typename Sacado::mpl::enable_if< Sacado::IsView<T> >::type
59  //std::cout << "zeroSensitivities - ViewFad" << std::endl;
60  x.zero();
61  }
62 
63 }
64 
65 #endif
KOKKOS_INLINE_FUNCTION void zeroSensitivities(panzer::Traits::RealType &)
Zero out AD types so that we can drop sensitivity contributions.
PANZER_FADTYPE FadType
Sacado::Fad::DFad< Sacado::Fad::SFad< RealType, 1 > > HessianType