1#ifndef GRID_DIST_KEY_DX_HPP
2#define GRID_DIST_KEY_DX_HPP
4#include "Grid/map_grid.hpp"
5template<
unsigned int dim,
typename base_key = gr
id_key_dx<dim>>
8template<
bool impl,
typename gr
id_key_base,
unsigned int dim>
14 key.set_d(i,key.get(i) + s);
19template<
typename gr
id_key_base,
unsigned int dim>
25 std::cout << __FILE__ <<
":" << __LINE__ <<
" Error move a key is not supported"
26 " directly acting on the grid key, please use the move function from the grid method" << std::endl;
42template<
unsigned int dim,
typename base_key>
151 for (
size_t i = 0 ; i < dim ; i++)
152 key.set_d(i,
key.get(i) + c[i]);
176 std::stringstream str;
178 str <<
"sub_domain=" <<
g_c <<
" ";
180 for (
size_t i = 0 ; i < dim ; i++)
181 str <<
"x[" << i <<
"]=" <<
key.get(i) <<
" ";
284 std::stringstream str;
286 str <<
"sub_domain=" <<
g_c <<
" ";
287 str <<
"lin_id=" <<
key <<
" ";
300template<
typename device_gr
id>
382 std::stringstream str;
384 str <<
"sub_domain=" <<
dg <<
" ";
385 str <<
"lin_id=" <<
key <<
" ";
Distributed linearized key.
size_t & getKeyRef()
Get the reference key.
device_grid * getSub() const
return the sub-domain grid
size_t getKey() const
Get the key.
grid_dist_g_dx(device_grid *dg, size_t key)
Constructor.
device_grid * dg
grid list counter
std::string to_string()
convert the key to string
size_t key
Local grid iterator.
grid_dist_g_dx()
Constructor.
Grid key for a distributed grid.
grid_dist_key_dx< dim, base_key > move(size_t i, int s) const
Create a new key moving the old one.
std::string to_string()
convert the key to string
size_t g_c
grid list counter
size_t getSub() const
Get the local grid.
base_key getKey() const
Get the key.
grid_dist_key_dx< dim > move(const comb< dim > &c) const
Create a new key moving the old one.
grid_dist_key_dx()
Constructor.
grid_dist_key_dx(int g_c, const base_key &key)
Constructor set the sub-domain grid and the position in local coordinates.
base_key key
Local grid iterator.
void setSub(size_t sub)
Set the local grid.
const base_key & getKeyRef() const
Get the reference key.
base_key & getKeyRef()
Get the reference key.
Distributed linearized key.
size_t getSub() const
Get the local grid.
std::string to_string()
convert the key to string
size_t & getKeyRef()
Get the reference key.
size_t key
Local grid iterator.
grid_dist_lin_dx()
Constructor.
size_t g_c
grid list counter
grid_dist_lin_dx(int g_c, size_t key)
Constructor set the sub-domain grid and the position in local coordinates.
size_t getKey() const
Get the key.
void setSub(size_t sub)
Set the local grid.
grid_key_dx is the key to access any element in the grid
void zero()
Set to zero the key.
Position of the element of dimension d in the hyper-cube of dimension dim.