Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_CommonArrayFactories.hpp
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// Panzer: A partial differential equation assembly
5// engine for strongly coupled complex multiphysics systems
6// Copyright (2011) Sandia Corporation
7//
8// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9// the U.S. Government retains certain rights in this software.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
39// Eric C. Cyr (eccyr@sandia.gov)
40// ***********************************************************************
41// @HEADER
42
43#ifndef PANZER_COMMON_ARRAY_FACTORIES_HPP
44#define PANZER_COMMON_ARRAY_FACTORIES_HPP
45
46#include "Kokkos_DynRankView.hpp"
47#include "Phalanx_MDField.hpp"
48
49#include <string>
50
51//
52// This file contains several common array factories
53// useful for build arrays through the BasisValues and
54// IntegrationValues classes. In particular these objects
55// are used in the <code>setupArrays</code> functions.
56// Because these class are used as a template argument the
57// types and names used are very specific to the BasisValues
58// interface.
59//
60
61namespace panzer {
62
69 public:
70 template <typename Scalar,typename T0>
71 Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0) const;
72 template <typename Scalar,typename T0,typename T1>
73 Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0,int d1) const;
74 template <typename Scalar,typename T0,typename T1,typename T2>
75 Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0,int d1,int d2) const;
76 template <typename Scalar,typename T0,typename T1,typename T2,typename T3>
77 Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0,int d1,int d2,int d3) const;
78 template <typename Scalar,typename T0,typename T1,typename T2,typename T3,typename T4>
79 Kokkos::DynRankView<Scalar,PHX::Device> buildArray(const std::string & str,int d0,int d1,int d2,int d3,int d4) const;
80 };
81
87 public:
92 : prefix_(""), allocArray_(false), ddims_(1,0) {}
93
98 MDFieldArrayFactory(const std::string & prefix,bool allocArray=false)
99 : prefix_(prefix),allocArray_(allocArray), ddims_(1,0) {}
100
105 MDFieldArrayFactory(const std::string & prefix,
106 const std::vector<PHX::index_size_type> & ddims,
107 bool allocArray=false)
108 : prefix_(prefix),allocArray_(allocArray), ddims_(ddims) {}
109
110
111 template <typename Scalar,typename T0>
112 PHX::MDField<Scalar> buildArray(const std::string & str,int d0) const;
113 template <typename Scalar,typename T0,typename T1>
114 PHX::MDField<Scalar> buildArray(const std::string & str,int d0,int d1) const;
115 template <typename Scalar,typename T0,typename T1,typename T2>
116 PHX::MDField<Scalar> buildArray(const std::string & str,int d0,int d1,int d2) const;
117 template <typename Scalar,typename T0,typename T1,typename T2,typename T3>
118 PHX::MDField<Scalar> buildArray(const std::string & str,int d0,int d1,int d2,int d3) const;
119 template <typename Scalar,typename T0,typename T1,typename T2,typename T3,typename T4>
120 PHX::MDField<Scalar> buildArray(const std::string & str,int d0,int d1,int d2,int d3,int d4) const;
121
122 template <typename Scalar,typename T0>
123 PHX::MDField<Scalar,T0> buildStaticArray(const std::string & str,int d0) const;
124 template <typename Scalar,typename T0,typename T1>
125 PHX::MDField<Scalar,T0,T1> buildStaticArray(const std::string & str,int d0,int d1) const;
126 template <typename Scalar,typename T0,typename T1,typename T2>
127 PHX::MDField<Scalar,T0,T1,T2> buildStaticArray(const std::string & str,int d0,int d1,int d2) const;
128 template <typename Scalar,typename T0,typename T1,typename T2,typename T3>
129 PHX::MDField<Scalar,T0,T1,T2,T3> buildStaticArray(const std::string & str,int d0,int d1,int d2,int d3) const;
130 template <typename Scalar,typename T0,typename T1,typename T2,typename T3,typename T4>
131 PHX::MDField<Scalar,T0,T1,T2,T3,T4> buildStaticArray(const std::string & str,int d0,int d1,int d2,int d3,int d4) const;
132
133 private:
134 std::string prefix_;
136 std::vector<PHX::index_size_type> ddims_;
137 };
138
139} // namespace panzer
140
142
143#endif
Kokkos::DynRankView< Scalar, PHX::Device > buildArray(const std::string &str, int d0) const
std::vector< PHX::index_size_type > ddims_
MDFieldArrayFactory(const std::string &prefix, bool allocArray=false)
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
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)