Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_CommonArrayFactories.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_COMMON_ARRAY_FACTORIES_HPP
12 #define PANZER_COMMON_ARRAY_FACTORIES_HPP
13 
14 #include "Kokkos_DynRankView.hpp"
15 #include "Phalanx_MDField.hpp"
16 
17 #include <string>
18 
19 //
20 // This file contains several common array factories
21 // useful for build arrays through the BasisValues and
22 // IntegrationValues classes. In particular these objects
23 // are used in the <code>setupArrays</code> functions.
24 // Because these class are used as a template argument the
25 // types and names used are very specific to the BasisValues
26 // interface.
27 //
28 
29 namespace panzer {
30 
37  public:
38  template <typename Scalar,typename T0>
39  Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0) const;
40  template <typename Scalar,typename T0,typename T1>
41  Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0,int d1) const;
42  template <typename Scalar,typename T0,typename T1,typename T2>
43  Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0,int d1,int d2) const;
44  template <typename Scalar,typename T0,typename T1,typename T2,typename T3>
45  Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0,int d1,int d2,int d3) const;
46  template <typename Scalar,typename T0,typename T1,typename T2,typename T3,typename T4>
47  Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0,int d1,int d2,int d3,int d4) const;
48  };
49 
55  public:
60  : prefix_(""), allocArray_(false), ddims_(1,0) {}
61 
66  MDFieldArrayFactory(const std::string & prefix,bool allocArray=false)
67  : prefix_(prefix),allocArray_(allocArray), ddims_(1,0) {}
68 
73  MDFieldArrayFactory(const std::string & prefix,
74  const std::vector<PHX::index_size_type> & ddims,
75  bool allocArray=false)
76  : prefix_(prefix),allocArray_(allocArray), ddims_(ddims) {}
77 
78 
79  template <typename Scalar,typename T0>
80  PHX::MDField<Scalar> buildArray(const std::string & str,int d0) const;
81  template <typename Scalar,typename T0,typename T1>
82  PHX::MDField<Scalar> buildArray(const std::string & str,int d0,int d1) const;
83  template <typename Scalar,typename T0,typename T1,typename T2>
84  PHX::MDField<Scalar> buildArray(const std::string & str,int d0,int d1,int d2) const;
85  template <typename Scalar,typename T0,typename T1,typename T2,typename T3>
86  PHX::MDField<Scalar> buildArray(const std::string & str,int d0,int d1,int d2,int d3) const;
87  template <typename Scalar,typename T0,typename T1,typename T2,typename T3,typename T4>
88  PHX::MDField<Scalar> buildArray(const std::string & str,int d0,int d1,int d2,int d3,int d4) const;
89 
90  template <typename Scalar,typename T0>
91  PHX::MDField<Scalar,T0> buildStaticArray(const std::string & str,int d0) const;
92  template <typename Scalar,typename T0,typename T1>
93  PHX::MDField<Scalar,T0,T1> buildStaticArray(const std::string & str,int d0,int d1) const;
94  template <typename Scalar,typename T0,typename T1,typename T2>
95  PHX::MDField<Scalar,T0,T1,T2> buildStaticArray(const std::string & str,int d0,int d1,int d2) const;
96  template <typename Scalar,typename T0,typename T1,typename T2,typename T3>
97  PHX::MDField<Scalar,T0,T1,T2,T3> buildStaticArray(const std::string & str,int d0,int d1,int d2,int d3) const;
98  template <typename Scalar,typename T0,typename T1,typename T2,typename T3,typename T4>
99  PHX::MDField<Scalar,T0,T1,T2,T3,T4> buildStaticArray(const std::string & str,int d0,int d1,int d2,int d3,int d4) const;
100 
101  private:
102  std::string prefix_;
104  std::vector<PHX::index_size_type> ddims_;
105  };
106 
107 } // namespace panzer
108 
110 
111 #endif
std::vector< PHX::index_size_type > ddims_
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
Kokkos::DynRankView< Scalar, PHX::Device > buildArray(const std::string &str, int d0) const
MDFieldArrayFactory(const std::string &prefix, bool allocArray=false)
PHX::MDField< Scalar > buildArray(const std::string &str, int d0) const
MDFieldArrayFactory(const std::string &prefix, const std::vector< PHX::index_size_type > &ddims, bool allocArray=false)