OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking > Class Template Reference

Detailed Description

template<unsigned int dim, typename T, typename S, typename grid_lin, typename layout, template< typename > class layout_base, typename chunking>
class sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >

Definition at line 381 of file SparseGrid.hpp.

Public Types

typedef int yes_i_am_grid
 it define that this data-structure is a grid
 
typedef grid_key_dx< dim > base_key
 base_key for the grid
 
typedef T value_type
 
typedef grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > sub_grid_iterator_type
 sub-grid iterator type
 
typedef aggregate_bfv< chunk_def > background_type
 Background type.
 
typedef layout_base< T > memory_traits
 
typedef chunking chunking_type
 
typedef grid_lin linearizer_type
 

Public Member Functions

 sgrid_cpu ()
 Trivial constructor.
 
 sgrid_cpu (const sgrid_cpu &g) THROW
 create a sparse grid from another grid
 
 sgrid_cpu (const sgrid_cpu &&g) THROW
 create a sparse grid from another grid
 
 sgrid_cpu (const size_t(&sz)[dim])
 Constructor for sparse grid.
 
template<unsigned int p>
void setBackgroundValue (const typename boost::mpl::at< typename T::type, boost::mpl::int_< p > >::type &val)
 Set the background value for the property p.
 
sparse_grid_bck_value< typename std::remove_reference< decltype(chunks.get(0))>::type > getBackgroundValue ()
 Get the background value.
 
template<unsigned int ... prp, typename S2 , typename header_type , typename ite_type , typename context_type >
void unpack_with_headers (ExtPreAlloc< S2 > &mem, ite_type &sub_it, header_type &headers, int ih, Unpack_stat &ps, context_type &context, rem_copy_opt opt=rem_copy_opt::NONE_OPT)
 
auto getBackgroundValueAggr () -> decltype(chunks.get(0))
 Get the background value.
 
auto insert_o (const grid_key_dx< dim > &v1, size_t &ele_id) -> decltype(chunks.get_o(0))
 Insert a full element (with all properties)
 
template<unsigned int p, typename r_type = decltype(get_selector< typename boost::mpl::at<typename T::type,boost::mpl::int_<p>>::type >::template get<p>(chunks,0,0))>
r_type insert (const grid_key_dx< dim > &v1)
 Get the reference of the selected element.
 
template<unsigned int p, typename r_type = decltype(get_selector< typename boost::mpl::at<typename T::type,boost::mpl::int_<p>>::type >::template get<p>(chunks,0,0))>
r_type insert (const grid_key_sparse_lin_dx &v1)
 Get the reference of the selected element.
 
template<unsigned int p>
auto get (const grid_key_dx< dim > &v1) const -> decltype(get_selector< typename boost::mpl::at< typename T::type, boost::mpl::int_< p > >::type >::template get_const< p >(chunks, 0, 0))
 Get the reference of the selected element.
 
template<unsigned int p>
auto get (const grid_key_dx< dim > &v1) -> decltype(get_selector< typename boost::mpl::at< typename T::type, boost::mpl::int_< p > >::type >::template get_const< p >(chunks, 0, 0))
 Get the reference of the selected element.
 
bool existPoint (const grid_key_dx< dim > &v1) const
 Check if the point exist.
 
template<unsigned int p>
auto get (const grid_key_sparse_lin_dx &v1) -> decltype(chunks.template get< p >(0)[0])
 Get the reference of the selected element.
 
auto getBlock (const grid_key_sparse_lin_dx &v1) const -> decltype(chunks.get(0))
 Get the reference of the selected block.
 
unsigned char getFlag (const grid_key_dx< dim > &v1) const
 Get the point flag (in this case it always return 0)
 
grid_key_sparse_dx_iterator< dim, chunking::size::value > getIterator (size_t opt=0) const
 Return a Domain iterator.
 
grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > getIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop, size_t opt=0) const
 Return an iterator over a sub-grid.
 
template<unsigned int stencil_size = 0>
grid_key_sparse_dx_iterator_block_sub< dim, stencil_size, self, chunking > getBlockIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop)
 Return an iterator over a sub-grid.
 
const grid_lin & getGrid () const
 Return the internal grid information.
 
void remove (const grid_key_dx< dim > &v1)
 Remove the point.
 
void remove_no_flush (const grid_key_dx< dim > &v1)
 Remove the point but do not flush the remove.
 
template<typename stencil_type >
void expandAndTagBoundaries (grid_key_dx< dim > &start, grid_key_dx< dim > &stop)
 Expand and tag boundaries.
 
void flush_remove ()
 Remove the point.
 
void resize (const size_t(&sz)[dim])
 Resize the grid.
 
void packReset ()
 Reset the pack calculation.
 
template<int ... prp, typename context_type >
void packCalculate (size_t &req, const context_type &context)
 Calculate the size of the information to pack.
 
template<int ... prp>
void packRequest (size_t &req) const
 Insert an allocation request.
 
void copyRemoveReset ()
 Reset the queue to remove and copy section of grids.
 
template<int ... prp>
void packRequest (grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > &sub_it, size_t &req) const
 Insert an allocation request.
 
template<int ... prp>
void pack (ExtPreAlloc< S > &mem, grid_key_sparse_dx_iterator_sub< dims, chunking::size::value > &sub_it, Pack_stat &sts)
 Pack the object into the memory given an iterator.
 
void removeAddUnpackReset ()
 In this case it does nothing.
 
void resetFlush ()
 It does nothing.
 
template<unsigned int ... prp, typename context_type >
void removeAddUnpackFinalize (const context_type &ctx, int opt)
 In this case it does nothing.
 
template<unsigned int ... prp, typename context_type >
void removeCopyToFinalize (const context_type &ctx, int opt)
 In this case it does nothing.
 
bool isSkipLabellingPossible ()
 This function check if keep geometry is possible for this grid.
 
template<int ... prp>
void packFinalize (ExtPreAlloc< S > &mem, Pack_stat &sts, int opt, bool is_pack_remote)
 Pack finalize Finalize the pack of this object. In this case it does nothing.
 
template<int ... prp>
void pack (ExtPreAlloc< S > &mem, Pack_stat &sts) const
 Pack the object into the memory given an iterator.
 
void setMemory ()
 It does materially nothing.
 
size_t size () const
 
size_t size_all () const
 
void remove (Box< dim, long int > &section_to_delete)
 Remove all the points in this region.
 
void copy_to (const self &grid_src, const Box< dim, size_t > &box_src, const Box< dim, size_t > &box_dst)
 
template<template< typename, typename > class op, unsigned int ... prp>
void copy_to_op (const self &grid_src, const Box< dim, size_t > &box_src, const Box< dim, size_t > &box_dst)
 
size_t getChunk (grid_key_dx< dim > &v1, bool &exist)
 Give a grid point it return the chunk containing that point. In case the point does not exist it return the background chunk.
 
grid_key_dx< dim > getChunkPos (size_t chunk_id)
 Get the position of a chunk.
 
template<unsigned int prop_src, unsigned int prop_dst, unsigned int stencil_size, unsigned int N, typename lambda_f , typename ... ArgsT>
void conv (int(&stencil)[N][dim], grid_key_dx< 3 > start, grid_key_dx< 3 > stop, lambda_f func, ArgsT ... args)
 apply a convolution using the stencil N
 
template<unsigned int prop_src, unsigned int prop_dst, unsigned int stencil_size, typename lambda_f , typename ... ArgsT>
void conv_cross (grid_key_dx< 3 > start, grid_key_dx< 3 > stop, lambda_f func, ArgsT ... args)
 apply a convolution from start to stop point using the function func and arguments args
 
template<unsigned int stencil_size, typename prop_type , typename lambda_f , typename ... ArgsT>
void conv_cross_ids (grid_key_dx< 3 > start, grid_key_dx< 3 > stop, lambda_f func, ArgsT ... args)
 apply a convolution from start to stop point using the function func and arguments args
 
template<unsigned int prop_src1, unsigned int prop_src2, unsigned int prop_dst1, unsigned int prop_dst2, unsigned int stencil_size, unsigned int N, typename lambda_f , typename ... ArgsT>
void conv2 (int(&stencil)[N][dim], grid_key_dx< 3 > start, grid_key_dx< 3 > stop, lambda_f func, ArgsT ... args)
 apply a convolution using the stencil N
 
template<unsigned int prop_src1, unsigned int prop_src2, unsigned int prop_dst1, unsigned int prop_dst2, unsigned int stencil_size, typename lambda_f , typename ... ArgsT>
void conv_cross2 (grid_key_dx< 3 > start, grid_key_dx< 3 > stop, lambda_f func, ArgsT ... args)
 apply a convolution using the stencil N
 
template<unsigned int ... prp, typename S2 , typename context_type >
void unpack (ExtPreAlloc< S2 > &mem, grid_key_sparse_dx_iterator_sub< dims, chunking::size::value > &sub_it, Unpack_stat &ps, context_type &context, rem_copy_opt opt)
 unpack the sub-grid object
 
template<unsigned int ... prp, typename S2 >
void unpack (ExtPreAlloc< S2 > &mem, Unpack_stat &ps)
 unpack the sub-grid object
 
template<template< typename, typename > class op, typename S2 , unsigned int ... prp>
void unpack_with_op (ExtPreAlloc< S2 > &mem, grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > &sub2, Unpack_stat &ps)
 unpack the sub-grid object applying an operation
 
void convert_key (grid_key_dx< dim > &key_out, const grid_key_sparse_lin_dx &key_in) const
 Here we convert the linearized sparse key into the grid_key_dx.
 
sgrid_cpuoperator= (const sgrid_cpu &sg)
 copy an sparse grid
 
void reorder ()
 Reorder based on index.
 
sgrid_cpuoperator= (sgrid_cpu &&sg)
 copy an sparse grid
 
size_t size_inserted ()
 Get the number of inserted points.
 
void clear ()
 delete all the points
 
void internal_clear_cache ()
 This is an internal function to clear the cache.
 
openfpm::vector< cheader< dim > > & private_get_header_inf ()
 return the header section of the blocks
 
openfpm::vector< mheader< chunking::size::value > > & private_get_header_mask ()
 return the header section of the blocks
 
openfpm::vector< int > & private_get_nnlist ()
 return the NN list for each block
 
openfpm::vector< aggregate_bfv< chunk_def >, S, layout_base > & private_get_data ()
 return the data of the blocks
 
const openfpm::vector< cheader< dim > > & private_get_header_inf () const
 return the header section of the blocks
 
const openfpm::vector< mheader< chunking::size::value > > & private_get_header_mask () const
 return the header section of the blocks
 
const openfpm::vector< aggregate_bfv< chunk_def > > & private_get_data () const
 return the data of the blocks
 
void consistency ()
 This function check the consistency of the sparse grid.
 

Static Public Member Functions

template<typename pointers_type , typename headers_type , typename result_type , unsigned int ... prp>
static void unpack_headers (pointers_type &pointers, headers_type &headers, result_type &result, int n_slot)
 Stub does not do anything.
 
static constexpr bool isCompressed ()
 This is a multiresolution sparse grid so is a compressed format.
 
static bool is_unpack_header_supported ()
 Indicate that unpacking the header is supported.
 
template<int ... prp>
static size_t packMem (size_t n, size_t e)
 Calculate the memory size required to pack n elements.
 
template<typename stencil = no_stencil>
static grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > type_of_subiterator ()
 This is a meta-function return which type of sub iterator a grid produce.
 
static grid_key_sparse_dx_iterator< dim, chunking::size::value > type_of_iterator ()
 This is a meta-function return which type of sub iterator a grid produce.
 
static bool pack ()
 
static bool packRequest ()
 
static bool packMem ()
 

Static Public Attributes

static constexpr unsigned int dims = dim
 expose the dimansionality as a static const
 

Private Types

typedef v_transform_two_v2< Ft_chunk, boost::mpl::int_< chunking::size::value >, typenameT::type >::type chunk_def
 
typedef sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking > self
 background values
 

Private Member Functions

void find_active_chunk_from_point (const grid_key_dx< dim > &v1, size_t &active_cnk, short int &sub_id)
 Given a key return the chunk than contain that key, in case that chunk does not exist return the key of the background chunk.
 
template<unsigned int n_ele>
void remove_from_chunk (size_t sub_id, int &nele, unsigned char(&mask)[n_ele])
 Remove.
 
void reconstruct_map ()
 reconstruct the map
 
void remove_empty ()
 Eliminate empty chunks.
 
void add_on_cache (size_t lin_id, size_t active_cnk) const
 add on cache
 
void clear_cache ()
 reset the cache
 
void set_g_shift_from_size (const size_t(&sz)[dim], grid_lin &g_sm_shift)
 set the grid shift from size
 
void init ()
 initialize
 
void find_active_chunk (const grid_key_dx< dim > &kh, size_t &active_cnk, bool &exist) const
 Given a key return the chunk than contain that key, in case that chunk does not exist return the key of the background chunk.
 
void pre_get (const grid_key_dx< dim > &v1, size_t &active_cnk, size_t &sub_id, bool &exist) const
 
bool pre_insert (const grid_key_dx< dim > &v1, size_t &active_cnk, size_t &sub_id)
 Before insert data you have to do this.
 
void remove_point (const grid_key_dx< dim > &v1)
 

Private Attributes

size_t cache_pnt
 cache pointer
 
long int cache [SGRID_CACHE]
 cache
 
long int cached_id [SGRID_CACHE]
 cached id
 
tsl::hopscotch_map< size_t, size_t > map
 Map to convert from grid coordinates to chunk.
 
openfpm::vector< cheader< dim >, S > header_inf
 indicate which element in the chunk are really filled
 
openfpm::vector< mheader< chunking::size::value >, S > header_mask
 
openfpm::vector< aggregate_bfv< chunk_def >, S, layout_base > chunks
 vector of chunks
 
grid_lin g_sm
 grid size information
 
grid_lin g_sm_shift
 grid size information with shift
 
grid_key_dx< dim > pos_chunk [chunking::size::value]
 conversion position in the chunks
 
size_t sz_cnk [dim]
 size of the chunk
 
openfpm::vector< size_t > empty_v
 
bool findNN
 bool that indicate if the NNlist is filled
 
openfpm::vector< int > NNlist
 for each chunk store the neighborhood chunks
 

Member Typedef Documentation

◆ background_type

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef aggregate_bfv<chunk_def> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::background_type

Background type.

Definition at line 838 of file SparseGrid.hpp.

◆ base_key

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef grid_key_dx<dim> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::base_key

base_key for the grid

Definition at line 825 of file SparseGrid.hpp.

◆ chunk_def

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef v_transform_two_v2<Ft_chunk,boost::mpl::int_<chunking::size::value>,typenameT::type>::type sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::chunk_def
private

Definition at line 401 of file SparseGrid.hpp.

◆ chunking_type

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef chunking sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::chunking_type

Definition at line 842 of file SparseGrid.hpp.

◆ linearizer_type

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef grid_lin sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::linearizer_type

Definition at line 844 of file SparseGrid.hpp.

◆ memory_traits

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef layout_base<T> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::memory_traits

Definition at line 840 of file SparseGrid.hpp.

◆ self

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef sgrid_cpu<dim,T,S,grid_lin,layout,layout_base,chunking> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::self
private

background values

Definition at line 406 of file SparseGrid.hpp.

◆ sub_grid_iterator_type

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef grid_key_sparse_dx_iterator_sub<dim, chunking::size::value> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::sub_grid_iterator_type

sub-grid iterator type

Definition at line 835 of file SparseGrid.hpp.

◆ value_type

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef T sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::value_type

value that the grid store The object type the grid is storing

Definition at line 832 of file SparseGrid.hpp.

◆ yes_i_am_grid

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
typedef int sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::yes_i_am_grid

it define that this data-structure is a grid

Definition at line 822 of file SparseGrid.hpp.

Constructor & Destructor Documentation

◆ sgrid_cpu() [1/4]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::sgrid_cpu ( )
inline

Trivial constructor.

Definition at line 850 of file SparseGrid.hpp.

◆ sgrid_cpu() [2/4]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::sgrid_cpu ( const sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking > &  g)
inline

create a sparse grid from another grid

Parameters
gthe grid to copy

Definition at line 861 of file SparseGrid.hpp.

◆ sgrid_cpu() [3/4]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::sgrid_cpu ( const sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking > &&  g)
inline

create a sparse grid from another grid

Parameters
gthe grid to copy

Definition at line 871 of file SparseGrid.hpp.

◆ sgrid_cpu() [4/4]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::sgrid_cpu ( const size_t(&)  sz[dim])
inline

Constructor for sparse grid.

Parameters
szsize in each direction of the sparse grid

Definition at line 881 of file SparseGrid.hpp.

Member Function Documentation

◆ add_on_cache()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::add_on_cache ( size_t  lin_id,
size_t  active_cnk 
) const
inlineprivate

add on cache

Parameters
lin_idlinearized id
active_cnkactive chunk

Definition at line 536 of file SparseGrid.hpp.

◆ clear()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::clear ( )
inline

delete all the points

Definition at line 2506 of file SparseGrid.hpp.

◆ clear_cache()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::clear_cache ( )
inlineprivate

reset the cache

Definition at line 549 of file SparseGrid.hpp.

◆ consistency()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::consistency ( )
inline

This function check the consistency of the sparse grid.

Definition at line 2667 of file SparseGrid.hpp.

◆ conv()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int prop_src, unsigned int prop_dst, unsigned int stencil_size, unsigned int N, typename lambda_f , typename ... ArgsT>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::conv ( int(&)  stencil[N][dim],
grid_key_dx< 3 >  start,
grid_key_dx< 3 >  stop,
lambda_f  func,
ArgsT ...  args 
)
inline

apply a convolution using the stencil N

Definition at line 2029 of file SparseGrid.hpp.

◆ conv2()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int prop_src1, unsigned int prop_src2, unsigned int prop_dst1, unsigned int prop_dst2, unsigned int stencil_size, unsigned int N, typename lambda_f , typename ... ArgsT>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::conv2 ( int(&)  stencil[N][dim],
grid_key_dx< 3 >  start,
grid_key_dx< 3 >  stop,
lambda_f  func,
ArgsT ...  args 
)
inline

apply a convolution using the stencil N

Definition at line 2093 of file SparseGrid.hpp.

◆ conv_cross()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int prop_src, unsigned int prop_dst, unsigned int stencil_size, typename lambda_f , typename ... ArgsT>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::conv_cross ( grid_key_dx< 3 >  start,
grid_key_dx< 3 >  stop,
lambda_f  func,
ArgsT ...  args 
)
inline

apply a convolution from start to stop point using the function func and arguments args

Parameters
startpoint
stoppoint
funclambda function
argsarguments to pass

Definition at line 2050 of file SparseGrid.hpp.

◆ conv_cross2()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int prop_src1, unsigned int prop_src2, unsigned int prop_dst1, unsigned int prop_dst2, unsigned int stencil_size, typename lambda_f , typename ... ArgsT>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::conv_cross2 ( grid_key_dx< 3 >  start,
grid_key_dx< 3 >  stop,
lambda_f  func,
ArgsT ...  args 
)
inline

apply a convolution using the stencil N

Definition at line 2110 of file SparseGrid.hpp.

◆ conv_cross_ids()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int stencil_size, typename prop_type , typename lambda_f , typename ... ArgsT>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::conv_cross_ids ( grid_key_dx< 3 >  start,
grid_key_dx< 3 >  stop,
lambda_f  func,
ArgsT ...  args 
)
inline

apply a convolution from start to stop point using the function func and arguments args

Parameters
startpoint
stoppoint
funclambda function
argsarguments to pass

Definition at line 2071 of file SparseGrid.hpp.

◆ convert_key()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::convert_key ( grid_key_dx< dim > &  key_out,
const grid_key_sparse_lin_dx key_in 
) const
inline

Here we convert the linearized sparse key into the grid_key_dx.

Parameters
key_outoutput key
key_ininput key

Definition at line 2342 of file SparseGrid.hpp.

◆ copy_to()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::copy_to ( const self grid_src,
const Box< dim, size_t > &  box_src,
const Box< dim, size_t > &  box_dst 
)
inline

Definition at line 1917 of file SparseGrid.hpp.

◆ copy_to_op()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<template< typename, typename > class op, unsigned int ... prp>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::copy_to_op ( const self grid_src,
const Box< dim, size_t > &  box_src,
const Box< dim, size_t > &  box_dst 
)
inline

Definition at line 1967 of file SparseGrid.hpp.

◆ copyRemoveReset()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::copyRemoveReset ( )
inline

Reset the queue to remove and copy section of grids.

Note
for this particular implementation it does nothing

Definition at line 1466 of file SparseGrid.hpp.

◆ existPoint()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::existPoint ( const grid_key_dx< dim > &  v1) const
inline

Check if the point exist.

Parameters
v1grid_key that identify the element in the grid
Returns
the true if the point exist

Definition at line 1089 of file SparseGrid.hpp.

◆ expandAndTagBoundaries()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<typename stencil_type >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::expandAndTagBoundaries ( grid_key_dx< dim > &  start,
grid_key_dx< dim > &  stop 
)
inline

Expand and tag boundaries.

Parameters
stencil_typetype of boundaries
startstarting point where we tag the boundaries
stoppoint where we tag the boundaries

Definition at line 1225 of file SparseGrid.hpp.

◆ find_active_chunk()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::find_active_chunk ( const grid_key_dx< dim > &  kh,
size_t &  active_cnk,
bool &  exist 
) const
inlineprivate

Given a key return the chunk than contain that key, in case that chunk does not exist return the key of the background chunk.

Parameters
v1point to search
returnactive_chunk
returnindex inside the chunk

Definition at line 648 of file SparseGrid.hpp.

◆ find_active_chunk_from_point()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::find_active_chunk_from_point ( const grid_key_dx< dim > &  v1,
size_t &  active_cnk,
short int &  sub_id 
)
inlineprivate

Given a key return the chunk than contain that key, in case that chunk does not exist return the key of the background chunk.

Parameters
v1point to search
returnactive_chunk
returnindex inside the chunk

Definition at line 439 of file SparseGrid.hpp.

◆ flush_remove()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::flush_remove ( )
inline

Remove the point.

Parameters
v1element to remove

Definition at line 1235 of file SparseGrid.hpp.

◆ get() [1/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int p>
auto sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::get ( const grid_key_dx< dim > &  v1) -> decltype(get_selector< typename boost::mpl::at<typename T::type,boost::mpl::int_<p>>::type >::template get_const<p>(chunks,0,0))
inline

Get the reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 1061 of file SparseGrid.hpp.

◆ get() [2/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int p>
auto sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::get ( const grid_key_dx< dim > &  v1) const -> decltype(get_selector< typename boost::mpl::at<typename T::type,boost::mpl::int_<p>>::type >::template get_const<p>(chunks,0,0))
inline

Get the reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 1025 of file SparseGrid.hpp.

◆ get() [3/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int p>
auto sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::get ( const grid_key_sparse_lin_dx v1) -> decltype(chunks.template get<p>(0)[0])
inline

Get the reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 1117 of file SparseGrid.hpp.

◆ getBackgroundValue()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
sparse_grid_bck_value< typename std::remove_reference< decltype(chunks.get(0))>::type > sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getBackgroundValue ( )
inline

Get the background value.

Returns
background value

Definition at line 914 of file SparseGrid.hpp.

◆ getBackgroundValueAggr()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
auto sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getBackgroundValueAggr ( ) -> decltype(chunks.get(0))
inline

Get the background value.

Returns
background value

Definition at line 944 of file SparseGrid.hpp.

◆ getBlock()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
auto sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getBlock ( const grid_key_sparse_lin_dx v1) const -> decltype(chunks.get(0))
inline

Get the reference of the selected block.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 1129 of file SparseGrid.hpp.

◆ getBlockIterator()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int stencil_size = 0>
grid_key_sparse_dx_iterator_block_sub< dim, stencil_size, self, chunking > sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getBlockIterator ( const grid_key_dx< dim > &  start,
const grid_key_dx< dim > &  stop 
)
inline

Return an iterator over a sub-grid.

Template Parameters
stencilsize
Parameters
startpoint
stoppoint
Returns
an iterator over sub-grid blocks

Definition at line 1179 of file SparseGrid.hpp.

◆ getChunk()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
size_t sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getChunk ( grid_key_dx< dim > &  v1,
bool &  exist 
)
inline

Give a grid point it return the chunk containing that point. In case the point does not exist it return the background chunk.

Parameters
v1key
existreturn true if the chunk exist
Returns
the chunk containing that point

Definition at line 1997 of file SparseGrid.hpp.

◆ getChunkPos()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
grid_key_dx< dim > sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getChunkPos ( size_t  chunk_id)
inline

Get the position of a chunk.

Parameters
chunk_id
Returns
the position of the chunk

Definition at line 2013 of file SparseGrid.hpp.

◆ getFlag()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
unsigned char sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getFlag ( const grid_key_dx< dim > &  v1) const
inline

Get the point flag (in this case it always return 0)

Parameters
v1grid_key that identify the element in the grid
Returns
0

Definition at line 1141 of file SparseGrid.hpp.

◆ getGrid()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
const grid_lin & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getGrid ( ) const
inline

Return the internal grid information.

Return the internal grid information

Returns
the internal grid

Definition at line 1191 of file SparseGrid.hpp.

◆ getIterator() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getIterator ( const grid_key_dx< dim > &  start,
const grid_key_dx< dim > &  stop,
size_t  opt = 0 
) const
inline

Return an iterator over a sub-grid.

Returns
return an iterator over a sub-grid

Definition at line 1163 of file SparseGrid.hpp.

◆ getIterator() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
grid_key_sparse_dx_iterator< dim, chunking::size::value > sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::getIterator ( size_t  opt = 0) const
inline

Return a Domain iterator.

Returns
return the domain iterator

Definition at line 1152 of file SparseGrid.hpp.

◆ init()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::init ( )
inlineprivate

initialize

Definition at line 584 of file SparseGrid.hpp.

◆ insert() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int p, typename r_type = decltype(get_selector< typename boost::mpl::at<typename T::type,boost::mpl::int_<p>>::type >::template get<p>(chunks,0,0))>
r_type sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::insert ( const grid_key_dx< dim > &  v1)
inline

Get the reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 981 of file SparseGrid.hpp.

◆ insert() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int p, typename r_type = decltype(get_selector< typename boost::mpl::at<typename T::type,boost::mpl::int_<p>>::type >::template get<p>(chunks,0,0))>
r_type sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::insert ( const grid_key_sparse_lin_dx v1)
inline

Get the reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 999 of file SparseGrid.hpp.

◆ insert_o()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
auto sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::insert_o ( const grid_key_dx< dim > &  v1,
size_t &  ele_id 
) -> decltype(chunks.get_o(0))
inline

Insert a full element (with all properties)

Parameters
v1where you want to insert the element

Definition at line 964 of file SparseGrid.hpp.

◆ internal_clear_cache()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::internal_clear_cache ( )
inline

This is an internal function to clear the cache.

Definition at line 2521 of file SparseGrid.hpp.

◆ is_unpack_header_supported()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
static bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::is_unpack_header_supported ( )
inlinestatic

Indicate that unpacking the header is supported.

Returns
false

Definition at line 1050 of file SparseGrid.hpp.

◆ isCompressed()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
static constexpr bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::isCompressed ( )
inlinestaticconstexpr

This is a multiresolution sparse grid so is a compressed format.

Returns
true

Definition at line 954 of file SparseGrid.hpp.

◆ isSkipLabellingPossible()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::isSkipLabellingPossible ( )
inline

This function check if keep geometry is possible for this grid.

Returns
false it does not exist this feature on this type of grids

Definition at line 1749 of file SparseGrid.hpp.

◆ operator=() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
sgrid_cpu & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::operator= ( const sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking > &  sg)
inline

copy an sparse grid

Parameters
tmpsparse grdi to copy

Map to convert from grid coordinates to chunk

Definition at line 2358 of file SparseGrid.hpp.

◆ operator=() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
sgrid_cpu & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::operator= ( sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking > &&  sg)
inline

copy an sparse grid

Parameters
tmpsparse grdi to copy

Map to convert from grid coordinates to chunk

Definition at line 2460 of file SparseGrid.hpp.

◆ pack() [1/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
static bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::pack ( )
inlinestatic

Definition at line 2578 of file SparseGrid.hpp.

◆ pack() [2/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<int ... prp>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::pack ( ExtPreAlloc< S > &  mem,
grid_key_sparse_dx_iterator_sub< dims, chunking::size::value > &  sub_it,
Pack_stat sts 
)
inline

Pack the object into the memory given an iterator.

Template Parameters
prpproperties to pack
Parameters
mempreallocated memory where to pack the objects
sub_itsub grid iterator ( or the elements in the grid to pack )
stspack statistic

Definition at line 1580 of file SparseGrid.hpp.

◆ pack() [3/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<int ... prp>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::pack ( ExtPreAlloc< S > &  mem,
Pack_stat sts 
) const
inline

Pack the object into the memory given an iterator.

Template Parameters
prpproperties to pack
Parameters
mempreallocated memory where to pack the objects
sub_itsub grid iterator ( or the elements in the grid to pack )
stspack statistic

Definition at line 1776 of file SparseGrid.hpp.

◆ packCalculate()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<int ... prp, typename context_type >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::packCalculate ( size_t &  req,
const context_type &  context 
)
inline

Calculate the size of the information to pack.

\in this case it does nothing

Parameters
reqoutput size
contextgpu contect

Definition at line 1400 of file SparseGrid.hpp.

◆ packFinalize()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<int ... prp>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::packFinalize ( ExtPreAlloc< S > &  mem,
Pack_stat sts,
int  opt,
bool  is_pack_remote 
)
inline

Pack finalize Finalize the pack of this object. In this case it does nothing.

Template Parameters
prpproperties to pack
Parameters
mempreallocated memory where to pack the objects
stspack statistic
optoptions
is_pack_remoteindicate this pack is remote

Definition at line 1764 of file SparseGrid.hpp.

◆ packMem() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
static bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::packMem ( )
inlinestatic

Definition at line 2588 of file SparseGrid.hpp.

◆ packMem() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<int ... prp>
static size_t sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::packMem ( size_t  n,
size_t  e 
)
inlinestatic

Calculate the memory size required to pack n elements.

Calculate the total size required to store n-elements in a vector

Parameters
nnumber of elements
eunused
Returns
the size of the allocation number e

Definition at line 1373 of file SparseGrid.hpp.

◆ packRequest() [1/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
static bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::packRequest ( )
inlinestatic

Definition at line 2583 of file SparseGrid.hpp.

◆ packRequest() [2/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<int ... prp>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::packRequest ( grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > &  sub_it,
size_t &  req 
) const
inline

Insert an allocation request.

Template Parameters
prpset of properties to pack
Parameters
subsub-grid to pack
vectorof requests

Definition at line 1480 of file SparseGrid.hpp.

◆ packRequest() [3/3]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<int ... prp>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::packRequest ( size_t &  req) const
inline

Insert an allocation request.

Template Parameters
prpset of properties to pack
Parameters
subsub-grid iterator
vectorof requests

Definition at line 1413 of file SparseGrid.hpp.

◆ packReset()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::packReset ( )
inline

Reset the pack calculation.

Note
in this case it does nothing

Definition at line 1388 of file SparseGrid.hpp.

◆ pre_get()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::pre_get ( const grid_key_dx< dim > &  v1,
size_t &  active_cnk,
size_t &  sub_id,
bool &  exist 
) const
inlineprivate

Given a key v1 in coordinates it calculate the chunk position and the position in the chunk

Parameters
v1coordinates
chunkposition
sub_idelement id

Definition at line 693 of file SparseGrid.hpp.

◆ pre_insert()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::pre_insert ( const grid_key_dx< dim > &  v1,
size_t &  active_cnk,
size_t &  sub_id 
)
inlineprivate

Before insert data you have to do this.

Parameters
v1grid key where you want to insert data
active_cnkoutput which chunk is competent for this data
sub_idelement inside the chunk

Definition at line 713 of file SparseGrid.hpp.

◆ private_get_data() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector< aggregate_bfv< chunk_def >, S, layout_base > & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::private_get_data ( )
inline

return the data of the blocks

Returns
the data of the blocks

Definition at line 2628 of file SparseGrid.hpp.

◆ private_get_data() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
const openfpm::vector< aggregate_bfv< chunk_def > > & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::private_get_data ( ) const
inline

return the data of the blocks

Returns
the data of the blocks

Definition at line 2658 of file SparseGrid.hpp.

◆ private_get_header_inf() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector< cheader< dim > > & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::private_get_header_inf ( )
inline

return the header section of the blocks

Returns
the header data section of the chunks stored

Definition at line 2598 of file SparseGrid.hpp.

◆ private_get_header_inf() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
const openfpm::vector< cheader< dim > > & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::private_get_header_inf ( ) const
inline

return the header section of the blocks

Returns
the header data section of the chunks stored

Definition at line 2638 of file SparseGrid.hpp.

◆ private_get_header_mask() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector< mheader< chunking::size::value > > & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::private_get_header_mask ( )
inline

return the header section of the blocks

Returns
the header data section of the chunks stored

Definition at line 2608 of file SparseGrid.hpp.

◆ private_get_header_mask() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
const openfpm::vector< mheader< chunking::size::value > > & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::private_get_header_mask ( ) const
inline

return the header section of the blocks

Returns
the header data section of the chunks stored

Definition at line 2648 of file SparseGrid.hpp.

◆ private_get_nnlist()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector< int > & sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::private_get_nnlist ( )
inline

return the NN list for each block

Returns
the NN list for each block

Definition at line 2618 of file SparseGrid.hpp.

◆ reconstruct_map()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::reconstruct_map ( )
inlineprivate

reconstruct the map

Definition at line 471 of file SparseGrid.hpp.

◆ remove() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::remove ( Box< dim, long int > &  section_to_delete)
inline

Remove all the points in this region.

Parameters
box_srcbox to kill the points

Definition at line 1859 of file SparseGrid.hpp.

◆ remove() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::remove ( const grid_key_dx< dim > &  v1)
inline

Remove the point.

Parameters
v1element to remove

Definition at line 1201 of file SparseGrid.hpp.

◆ remove_empty()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::remove_empty ( )
inlineprivate

Eliminate empty chunks.

Warning
Because this operation is time consuming it perform the operation once we reach a critical size in the list of the empty chunks

Definition at line 496 of file SparseGrid.hpp.

◆ remove_from_chunk()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int n_ele>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::remove_from_chunk ( size_t  sub_id,
int &  nele,
unsigned char(&)  mask[n_ele] 
)
inlineprivate

Remove.

Definition at line 457 of file SparseGrid.hpp.

◆ remove_no_flush()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::remove_no_flush ( const grid_key_dx< dim > &  v1)
inline

Remove the point but do not flush the remove.

Parameters
v1element to remove

Definition at line 1212 of file SparseGrid.hpp.

◆ remove_point()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::remove_point ( const grid_key_dx< dim > &  v1)
inlineprivate

Definition at line 791 of file SparseGrid.hpp.

◆ removeAddUnpackFinalize()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int ... prp, typename context_type >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::removeAddUnpackFinalize ( const context_type &  ctx,
int  opt 
)
inline

In this case it does nothing.

Note
this function exist to respect the interface to work as distributed
Parameters
ctxcontext

Definition at line 1729 of file SparseGrid.hpp.

◆ removeAddUnpackReset()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::removeAddUnpackReset ( )
inline

In this case it does nothing.

Note
this function exist to respect the interface to work as distributed

Definition at line 1711 of file SparseGrid.hpp.

◆ removeCopyToFinalize()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int ... prp, typename context_type >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::removeCopyToFinalize ( const context_type &  ctx,
int  opt 
)
inline

In this case it does nothing.

Note
this function exist to respect the interface to work as distributed
Parameters
ctxcontext

Definition at line 1741 of file SparseGrid.hpp.

◆ reorder()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::reorder ( )
inline

Reorder based on index.

Definition at line 2394 of file SparseGrid.hpp.

◆ resetFlush()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::resetFlush ( )
inline

It does nothing.

Definition at line 1718 of file SparseGrid.hpp.

◆ resize()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::resize ( const size_t(&)  sz[dim])
inline

Resize the grid.

The old information is retained on the new grid if the new grid is bigger. When smaller the data are cropped

Parameters
szreference to an array of dimension dim

Definition at line 1248 of file SparseGrid.hpp.

◆ set_g_shift_from_size()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::set_g_shift_from_size ( const size_t(&)  sz[dim],
grid_lin &  g_sm_shift 
)
inlineprivate

set the grid shift from size

Parameters
szsize of the grid
g_sm_shiftchunks grid size

Definition at line 562 of file SparseGrid.hpp.

◆ setBackgroundValue()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int p>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::setBackgroundValue ( const typename boost::mpl::at< typename T::type, boost::mpl::int_< p > >::type &  val)
inline

Set the background value for the property p.

Returns
background value

Definition at line 899 of file SparseGrid.hpp.

◆ setMemory()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::setMemory ( )
inline

It does materially nothing.

Definition at line 1819 of file SparseGrid.hpp.

◆ size()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
size_t sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::size ( ) const
inline

\number of element inserted

Warning
this function is not as fast as the size in other structures
Returns
the total number of elements inserted

Definition at line 1830 of file SparseGrid.hpp.

◆ size_all()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
size_t sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::size_all ( ) const
inline

\number of element inserted

Warning
this function is not as fast as the size in other structures
Returns
the total number of elements inserted

Definition at line 1849 of file SparseGrid.hpp.

◆ size_inserted()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
size_t sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::size_inserted ( )
inline

Get the number of inserted points.

Returns
the number of inserted points

Definition at line 2497 of file SparseGrid.hpp.

◆ type_of_iterator()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
static grid_key_sparse_dx_iterator< dim, chunking::size::value > sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::type_of_iterator ( )
inlinestatic

This is a meta-function return which type of sub iterator a grid produce.

Returns
the type of the sub-grid iterator

Definition at line 2331 of file SparseGrid.hpp.

◆ type_of_subiterator()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<typename stencil = no_stencil>
static grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::type_of_subiterator ( )
inlinestatic

This is a meta-function return which type of sub iterator a grid produce.

Returns
the type of the sub-grid iterator

Definition at line 2320 of file SparseGrid.hpp.

◆ unpack() [1/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int ... prp, typename S2 , typename context_type >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::unpack ( ExtPreAlloc< S2 > &  mem,
grid_key_sparse_dx_iterator_sub< dims, chunking::size::value > &  sub_it,
Unpack_stat ps,
context_type &  context,
rem_copy_opt  opt 
)
inline

unpack the sub-grid object

Template Parameters
prpproperties to unpack
Parameters
mempreallocated memory from where to unpack the object
subsub-grid iterator
objobject where to unpack

Definition at line 2132 of file SparseGrid.hpp.

◆ unpack() [2/2]

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int ... prp, typename S2 >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::unpack ( ExtPreAlloc< S2 > &  mem,
Unpack_stat ps 
)
inline

unpack the sub-grid object

Template Parameters
prpproperties to unpack
Parameters
mempreallocated memory from where to unpack the object
subsub-grid iterator
objobject where to unpack

Definition at line 2202 of file SparseGrid.hpp.

◆ unpack_headers()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<typename pointers_type , typename headers_type , typename result_type , unsigned int ... prp>
static void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::unpack_headers ( pointers_type &  pointers,
headers_type &  headers,
result_type &  result,
int  n_slot 
)
inlinestatic

Stub does not do anything.

Definition at line 926 of file SparseGrid.hpp.

◆ unpack_with_headers()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<unsigned int ... prp, typename S2 , typename header_type , typename ite_type , typename context_type >
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::unpack_with_headers ( ExtPreAlloc< S2 > &  mem,
ite_type &  sub_it,
header_type &  headers,
int  ih,
Unpack_stat ps,
context_type &  context,
rem_copy_opt  opt = rem_copy_opt::NONE_OPT 
)
inline

Definition at line 930 of file SparseGrid.hpp.

◆ unpack_with_op()

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
template<template< typename, typename > class op, typename S2 , unsigned int ... prp>
void sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::unpack_with_op ( ExtPreAlloc< S2 > &  mem,
grid_key_sparse_dx_iterator_sub< dim, chunking::size::value > &  sub2,
Unpack_stat ps 
)
inline

unpack the sub-grid object applying an operation

Template Parameters
opoperation
prpproperties to unpack
Parameters
mempreallocated memory from where to unpack the object
subsub-grid iterator
objobject where to unpack

Definition at line 2246 of file SparseGrid.hpp.

Field Documentation

◆ cache

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
long int sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::cache[SGRID_CACHE]
mutableprivate

cache

Definition at line 387 of file SparseGrid.hpp.

◆ cache_pnt

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
size_t sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::cache_pnt
mutableprivate

cache pointer

Definition at line 384 of file SparseGrid.hpp.

◆ cached_id

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
long int sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::cached_id[SGRID_CACHE]
mutableprivate

cached id

Definition at line 390 of file SparseGrid.hpp.

◆ chunks

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector<aggregate_bfv<chunk_def>,S,layout_base > sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::chunks
private

vector of chunks

Definition at line 409 of file SparseGrid.hpp.

◆ dims

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
constexpr unsigned int sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::dims = dim
staticconstexpr

expose the dimansionality as a static const

Definition at line 828 of file SparseGrid.hpp.

◆ empty_v

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector<size_t> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::empty_v
private

Definition at line 423 of file SparseGrid.hpp.

◆ findNN

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
bool sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::findNN
private

bool that indicate if the NNlist is filled

Definition at line 426 of file SparseGrid.hpp.

◆ g_sm

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
grid_lin sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::g_sm
private

grid size information

Definition at line 412 of file SparseGrid.hpp.

◆ g_sm_shift

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
grid_lin sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::g_sm_shift
private

grid size information with shift

Definition at line 415 of file SparseGrid.hpp.

◆ header_inf

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector<cheader<dim>,S> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::header_inf
private

indicate which element in the chunk are really filled

Definition at line 396 of file SparseGrid.hpp.

◆ header_mask

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector<mheader<chunking::size::value>,S> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::header_mask
private

Definition at line 398 of file SparseGrid.hpp.

◆ map

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
tsl::hopscotch_map<size_t, size_t> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::map
private

Map to convert from grid coordinates to chunk.

Definition at line 393 of file SparseGrid.hpp.

◆ NNlist

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
openfpm::vector<int> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::NNlist
private

for each chunk store the neighborhood chunks

Definition at line 429 of file SparseGrid.hpp.

◆ pos_chunk

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
grid_key_dx<dim> sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::pos_chunk[chunking::size::value]
private

conversion position in the chunks

Definition at line 418 of file SparseGrid.hpp.

◆ sz_cnk

template<unsigned int dim, typename T , typename S , typename grid_lin , typename layout , template< typename > class layout_base, typename chunking >
size_t sgrid_cpu< dim, T, S, grid_lin, layout, layout_base, chunking >::sz_cnk[dim]
private

size of the chunk

Definition at line 421 of file SparseGrid.hpp.


The documentation for this class was generated from the following file: