1 #ifndef GUESS_TABLE_HPP
2 #define GUESS_TABLE_HPP
4 extern "C" void init_guess_table_from_cpp(
int n,
int list_len,
int* nguess_2,
double* grid_guess_min,
double* grid_guess_max,
double* grid_inv_guess_d,
int* list,
int* xtable,
int* count);
13 View<int*,CLayout,Device>
list;
15 View<int**,CLayout,Device>
count;
20 template<
class Device2>
41 GuessTable(
const RZBounds& bounds_in,
const View<RZPair*,CLayout,Device>& gx,
const View<Vertex*,CLayout,Device>& nodes,
int guess_table_size)
42 :
n(guess_table_size),
55 int ntriangle = nodes.size();
56 int nnode = gx.size();
63 double grid_guess_max[2];
65 double grid_guess_min[2];
70 double grid_inv_guess_d[2];
71 grid_inv_guess_d[0] =
inv_d1; grid_inv_guess_d[1] =
inv_d2;
73 View<int**, HostType> guess_xtable_tmp(
NoInit(
"guess_xtable_tmp"),
n,
n);
74 View<int**, HostType> guess_count_tmp(
NoInit(
"guess_count_tmp"),
n,
n);
77 init_guess_xtable_fort( nguess_2, grid_guess_max, grid_guess_min, grid_inv_guess_d, &ntriangle, &nnode, gx.data(),
78 nodes.data(), guess_xtable_tmp.data(), guess_count_tmp.data(), &list_len);
81 View<int*, HostType> guess_list_tmp(
NoInit(
"guess_list_tmp"),list_len);
83 init_guess_list_fort( nguess_2, grid_guess_max, grid_guess_min, grid_inv_guess_d, &ntriangle, &nnode, gx.data(),
84 nodes.data(), guess_list_tmp.data(), guess_xtable_tmp.data(), guess_count_tmp.data(),&list_len);
87 list = View<int*,CLayout,Device>(
"guess_list", list_len);
89 Kokkos::deep_copy(
xtable, guess_xtable_tmp);
90 Kokkos::deep_copy(
count, guess_count_tmp);
91 Kokkos::deep_copy(list, guess_list_tmp);
94 #ifndef NO_FORTRAN_MODULES
void init_guess_table_from_cpp(int n, int list_len, int *nguess_2, double *grid_guess_min, double *grid_guess_max, double *grid_inv_guess_d, int *list, int *xtable, int *count)
bool is_rank_zero()
Definition: globals.hpp:27
double inv_d1
Definition: guess_table.hpp:11
void mirror_copy(T1 &view_dest, const T2 &view_src)
Definition: my_mirror_view.hpp:122
Definition: rz_bounds.hpp:4
void init_guess_xtable_fort(int *nguess_2, double *grid_guess_max, double *grid_guess_min, double *grid_inv_guess_d, int *ntriangle, int *nnodes, const RZPair *grid_x, Vertex *grid_nd, int *guess_xtable, int *guess_count, int *guess_list_len_in)
View< int **, CLayout, Device > count
Definition: guess_table.hpp:15
GuessTable()
Definition: guess_table.hpp:17
RZBounds bounds
Definition: guess_table.hpp:10
GuessTable(const RZBounds &bounds_in, const View< RZPair *, CLayout, Device > &gx, const View< Vertex *, CLayout, Device > &nodes, int guess_table_size)
Definition: guess_table.hpp:41
Definition: guess_table.hpp:8
int n
Definition: guess_table.hpp:9
double max_z
Definition: rz_bounds.hpp:8
double min_r
Definition: rz_bounds.hpp:5
double inv_d2
Definition: guess_table.hpp:12
void init_guess_list_fort(int *nguess_2, double *grid_guess_max, double *grid_guess_min, double *grid_inv_guess_d, int *ntriangle, int *nnodes, const RZPair *grid_x, Vertex *grid_nd, int *guess_list, int *guess_xtable, int *guess_count, int *guess_list_len_in)
View< T *, CLayout, Device > my_mirror_view(const View< T *, CLayout, Device > &view, Device nd)
Definition: my_mirror_view.hpp:14
GuessTable< Device2 > mirror() const
Definition: guess_table.hpp:21
View< int *, CLayout, Device > list
Definition: guess_table.hpp:13
double min_z
Definition: rz_bounds.hpp:7
View< int **, CLayout, Device > xtable
Definition: guess_table.hpp:14
Kokkos::ViewAllocateWithoutInitializing NoInit
Definition: space_settings.hpp:69
double max_r
Definition: rz_bounds.hpp:6