1 /* ----------------------------------------------------------------------
2    SPARTA - Stochastic PArallel Rarefied-gas Time-accurate Analyzer
3    http://sparta.sandia.gov
4    Steve Plimpton, sjplimp@sandia.gov, Michael Gallis, magalli@sandia.gov
5    Sandia National Laboratories
6 
7    Copyright (2014) Sandia Corporation.  Under the terms of Contract
8    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
9    certain rights in this software.  This software is distributed under
10    the GNU General Public License.
11 
12    See the README file in the top-level SPARTA directory.
13 ------------------------------------------------------------------------- */
14 
15 #ifdef FIX_CLASS
16 
17 FixStyle(ave/grid/kk,FixAveGridKokkos)
18 
19 #else
20 
21 #ifndef LMP_FIX_AVE_GRID_KOKKOS_H
22 #define LMP_FIX_AVE_GRID_KOKKOS_H
23 
24 #include "fix_ave_grid.h"
25 #include "kokkos_type.h"
26 #include "kokkos_base.h"
27 
28 namespace SPARTA_NS {
29 
30 struct TagFixAveGrid_Zero_group_vector{};
31 struct TagFixAveGrid_Zero_group_array{};
32 struct TagFixAveGrid_Zero_tally{};
33 struct TagFixAveGrid_Add_ctally{};
34 struct TagFixAveGrid_Add_compute_vector{};
35 struct TagFixAveGrid_Add_compute_array{};
36 struct TagFixAveGrid_Add_fix_vector{};
37 struct TagFixAveGrid_Add_fix_array{};
38 struct TagFixAveGrid_Norm_vector_grid{};
39 struct TagFixAveGrid_Norm_array_grid{};
40 
41 class FixAveGridKokkos : public FixAveGrid, public KokkosBase {
42  public:
43   FixAveGridKokkos(class SPARTA *, int, char **);
44   ~FixAveGridKokkos();
45   void init();
46   void setup();
47   void end_of_step();
48 
49   KOKKOS_INLINE_FUNCTION
50   void operator()(TagFixAveGrid_Zero_group_vector, const int&) const;
51 
52   KOKKOS_INLINE_FUNCTION
53   void operator()(TagFixAveGrid_Zero_group_array, const int&) const;
54 
55   KOKKOS_INLINE_FUNCTION
56   void operator()(TagFixAveGrid_Zero_tally, const int&) const;
57 
58   KOKKOS_INLINE_FUNCTION
59   void operator()(TagFixAveGrid_Add_ctally, const int&) const;
60 
61   KOKKOS_INLINE_FUNCTION
62   void operator()(TagFixAveGrid_Add_compute_vector, const int&) const;
63 
64   KOKKOS_INLINE_FUNCTION
65   void operator()(TagFixAveGrid_Add_compute_array, const int&) const;
66 
67   KOKKOS_INLINE_FUNCTION
68   void operator()(TagFixAveGrid_Add_fix_vector, const int&) const;
69 
70   KOKKOS_INLINE_FUNCTION
71   void operator()(TagFixAveGrid_Add_fix_array, const int&) const;
72 
73   KOKKOS_INLINE_FUNCTION
74   void operator()(TagFixAveGrid_Norm_vector_grid, const int&) const;
75 
76   KOKKOS_INLINE_FUNCTION
77   void operator()(TagFixAveGrid_Norm_array_grid, const int&) const;
78 
79   DAT::tdual_float_1d k_vector_grid;
80 
81   DAT::tdual_float_2d_lr k_array_grid;
82 
83  private:
84   DAT::tdual_float_2d_lr k_tally;
85   DAT::t_float_2d_lr d_tally;
86 
87   DAT::t_float_2d_lr d_ctally;
88 
89   DAT::t_float_1d d_compute_vector;
90   DAT::t_float_2d_lr d_compute_array;
91 
92   DAT::t_float_1d d_fix_vector;
93   DAT::t_float_2d_lr d_fix_array;
94 
95   t_cinfo_1d d_cinfo;
96 
97   DAT::tdual_float_1d k_numap;
98   DAT::t_float_1d d_numap;
99 
100   DAT::tdual_float_2d k_umap,k_uomap;
101   DAT::t_float_2d d_umap,d_uomap;
102 
103   int j,k,kk,jm1,m,ntally;
104 
105   void grow_percell(int);
106 };
107 
108 }
109 
110 #endif
111 #endif
112 
113 /* ERROR/WARNING messages:
114 
115 E: Illegal ... command
116 
117 Self-explanatory.  Check the input script syntax and compare to the
118 documentation for the command.  You can use -echo screen as a
119 command-line option when running SPARTA to see the offending line.
120 
121 E: Compute ID for fix ave/grid does not exist
122 
123 Self-explanatory.
124 
125 E: Fix ID for fix ave/grid does not exist
126 
127 Self-explanatory.
128 
129 E: Fix ave/grid compute does not calculate per-grid values
130 
131 Self-explanatory.
132 
133 E: Fix ave/grid compute does not calculate a per-grid vector
134 
135 Self-explanatory.
136 
137 E: Fix ave/grid compute does not calculate a per-grid array
138 
139 Self-explanatory.
140 
141 E: Fix ave/grid compute array is accessed out-of-range
142 
143 Self-explanatory.
144 
145 E: Fix ave/grid fix does not calculate per-grid values
146 
147 Self-explanatory.
148 
149 E: Fix ave/grid fix does not calculate a per-grid vector
150 
151 Self-explanatory.
152 
153 E: Fix ave/grid fix does not calculate a per-grid array
154 
155 Self-explanatory.
156 
157 E: Fix ave/grid fix array is accessed out-of-range
158 
159 Self-explanatory.
160 
161 E: Fix for fix ave/grid not computed at compatible time
162 
163 Fixes generate values on specific timesteps.  Fix ave/grid is
164 requesting a value on a non-allowed timestep.
165 
166 E: Variable name for fix ave/grid does not exist
167 
168 Self-explanatory.
169 
170 E: Fix ave/grid variable is not grid-style variable
171 
172 Self-explanatory.
173 
174 */
175