OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
grid_base_impl< dim, T, S, layout_, layout_base > Class Template Reference

Implementation of a N-dimensional grid. More...

Detailed Description

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
class grid_base_impl< dim, T, S, layout_, layout_base >

Implementation of a N-dimensional grid.

Template Parameters
dimdimansionality of the grid
Ttype store by the grid
SMemory pool from where to take the memory
layout_memory layout
layout_baselayout memory meta-function (the meta-function used to construct layout_)

Definition at line 26 of file grid_base_implementation.hpp.

#include <grid_base_implementation.hpp>

Data Structures

struct  pack_simple_cond
 
struct  pack_simple_cond< true, prp...>
 
struct  unpack_simple_cond
 
struct  unpack_simple_cond< true, prp...>
 

Public Types

typedef layout_ layout_type
 memory layout
 
typedef grid_key_dx< dim > access_key
 Access key.
 
typedef T::type T_type
 boost::vector that describe the data type
 
typedef int yes_i_am_grid
 it define that it is a grid
 
typedef memory_traits_lin
< typename T::type >::type 
memory_lin
 Definition of the layout.
 
typedef encapc< dim, T, layoutcontainer
 Object container for T, it is the return type of get_o it return a object type trough.
 
typedef T value_type
 The object type the grid is storing.
 

Public Member Functions

template<int... prp>
void packRequest (size_t &req) const
 Insert an allocation request into the vector. More...
 
template<int... prp>
void pack (ExtPreAlloc< S > &mem, Pack_stat &sts) const
 pack a grid selecting the properties to pack More...
 
template<int... prp>
void unpack (ExtPreAlloc< S > &mem, Unpack_stat &ps)
 unpack a grid More...
 
template<int... prp>
void pack (ExtPreAlloc< S > &mem, grid_key_dx_iterator_sub< dims > &sub_it, Pack_stat &sts)
 Pack the object into the memory given an iterator. More...
 
template<int... prp>
void packRequest (grid_key_dx_iterator_sub< dims > &sub, size_t &req)
 Insert an allocation request. More...
 
template<unsigned int... prp>
void unpack (ExtPreAlloc< S > &mem, grid_key_dx_iterator_sub< dims > &sub_it, Unpack_stat &ps)
 unpack the sub-grid object More...
 
 grid_base_impl () THROW
 Default constructor.
 
 grid_base_impl (const grid_base_impl &g) THROW
 create a grid from another grid More...
 
 grid_base_impl (const size_t &sz) THROW
 create a grid of size sz on each direction More...
 
 grid_base_impl (const size_t(&sz)[dim]) THROW
 Constructor. More...
 
 ~grid_base_impl () THROW
 Destructor.
 
grid_base_impl< dim, T, S,
layout, layout_base > & 
operator= (const grid_base_impl< dim, T, S, layout, layout_base > &g)
 It copy a grid. More...
 
grid_base_impl< dim, T, S,
layout, layout_base > & 
operator= (grid_base_impl< dim, T, S, layout, layout_base > &&g)
 It copy a grid. More...
 
bool operator== (const grid_base_impl< dim, T, S, layout, layout_base > &g)
 Compare two grids. More...
 
grid_base_impl< dim, T, S,
layout, layout_base > 
duplicate () const THROW
 create a duplicated version of the grid More...
 
const grid_sm< dim, T > & getGrid () const
 Return the internal grid information. More...
 
void setMemory ()
 Create the object that provide memory. More...
 
void setMemory (S &m)
 Get the object that provide memory. More...
 
void * getPointer ()
 Return a plain pointer to the internal data. More...
 
const void * getPointer () const
 Return a plain pointer to the internal data. More...
 
template<unsigned int p, typename r_type = decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get(data_,g1,grid_key_dx<dim>()))>
r_type get (const grid_key_dx< dim > &v1)
 Get the reference of the selected element. More...
 
template<unsigned int p, typename r_type = decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get(data_,g1,grid_key_dx<dim>()))>
const r_type get (const grid_key_dx< dim > &v1) const
 Get the const reference of the selected element. More...
 
template<unsigned int p, typename r_type = decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get_lin(data_,g1,0))>
r_type get (const size_t lin_id)
 Get the reference of the selected element. More...
 
template<unsigned int p, typename r_type = decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get_lin(data_,g1,0))>
const r_type get (size_t lin_id) const
 Get the const reference of the selected element. More...
 
encapc< dim, T, layoutget_o (const grid_key_dx< dim > &v1)
 Get the of the selected element as a boost::fusion::vector. More...
 
const encapc< dim, T, layoutget_o (const grid_key_dx< dim > &v1) const
 Get the of the selected element as a boost::fusion::vector. More...
 
encapc< dim, T, layoutget_o (size_t v1)
 Get the of the selected element as a boost::fusion::vector. More...
 
const encapc< dim, T, layoutget_o (size_t v1) const
 Get the of the selected element as a boost::fusion::vector. More...
 
void fill (unsigned char fl)
 Fill the memory with the selected byte. More...
 
void resize (const size_t(&sz)[dim])
 Resize the space. More...
 
void remove (size_t key)
 Remove one element valid only on 1D. More...
 
void swap (grid_base_impl< dim, T, S, layout, layout_base > &grid)
 It move the allocated object from one grid to another. More...
 
void swap (grid_base_impl< dim, T, S, layout, layout_base > &&grid)
 It move the allocated object from one grid to another. More...
 
template<typename Memory >
void set (grid_key_dx< dim > dx, const encapc< 1, T, Memory > &obj)
 set an element of the grid More...
 
void set (grid_key_dx< dim > dx, const T &obj)
 set an element of the grid More...
 
void set (const grid_key_dx< dim > &key1, const grid_base_impl< dim, T, S, layout, layout_base > &g, const grid_key_dx< dim > &key2)
 Set an element of the grid from another element of another grid. More...
 
void set (const size_t key1, const grid_base_impl< dim, T, S, layout, layout_base > &g, const size_t key2)
 Set an element of the grid from another element of another grid. More...
 
template<typename Mem >
void set (const grid_key_dx< dim > &key1, const grid_base_impl< dim, T, Mem, layout, layout_base > &g, const grid_key_dx< dim > &key2)
 Set an element of the grid from another element of another grid. More...
 
size_t size () const
 return the size of the grid More...
 
grid_key_dx_iterator_sub< dim > getSubIterator (grid_key_dx< dim > &start, grid_key_dx< dim > &stop) const
 Return a sub-grid iterator. More...
 
grid_key_dx_iterator_sub< dim > getSubIterator (size_t m)
 Return a sub-grid iterator. More...
 
grid_key_dx_iterator< dim > getIterator () const
 Return a grid iterator. More...
 
template<unsigned int Np>
grid_key_dx_iterator< dim,
stencil_offset_compute< dim,
Np > > 
getIteratorStencil (const grid_key_dx< dim >(&stencil_pnt)[Np]) const
 Return a grid iterator. More...
 
grid_key_dx_iterator_sub< dim > getIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop) const
 Return a grid iterator over all points included between start and stop point. More...
 
long int who ()
 It return the id of structure in the allocation list. More...
 

Static Public Member Functions

static bool pack ()
 
static bool packRequest ()
 
static bool packMem ()
 
template<int... prp>
static size_t packMem (size_t n, size_t e)
 Calculate the memory size required to pack n elements. More...
 

Static Public Attributes

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

Protected Attributes

layout data_
 Memory layout specification + memory chunk pointer.
 
grid_sm< dim, T > g1
 This is a structure that store all information related to the grid and how indexes are linearized.
 

Private Types

typedef layout_ layout
 memory layout
 

Private Attributes

bool is_mem_init = false
 Is the memory initialized.
 
bool isExternal
 The memory allocator is not internally created.
 

Constructor & Destructor Documentation

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_base_impl< dim, T, S, layout_, layout_base >::grid_base_impl ( const grid_base_impl< dim, T, S, layout_, layout_base > &  g)
inline

create a grid from another grid

Parameters
gthe grid to copy

Definition at line 190 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_base_impl< dim, T, S, layout_, layout_base >::grid_base_impl ( const size_t &  sz)
inline

create a grid of size sz on each direction

Parameters
szsize of the grid on each dimensions

Definition at line 201 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_base_impl< dim, T, S, layout_, layout_base >::grid_base_impl ( const size_t(&)  sz[dim])
inline

Constructor.

It construct a grid of specified size

Parameters
szarray that indicate the size of the grid in each dimension

Definition at line 217 of file grid_base_implementation.hpp.

Member Function Documentation

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_base_impl<dim,T,S,layout,layout_base> grid_base_impl< dim, T, S, layout_, layout_base >::duplicate ( ) const
inline

create a duplicated version of the grid

Returns
a duplicated version of the grid

Create a completely new grid with sz

Set the allocator and allocate the memory

1-D copy (This case is simple we use raw memory copy because is the fastest option)

N-D copy

create a source grid iterator

Definition at line 305 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::fill ( unsigned char  fl)
inline

Fill the memory with the selected byte.

Warning
It is a low level memory operation it ignore any type and semantic safety
Parameters
flbyte pattern to fill

Definition at line 621 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<unsigned int p, typename r_type = decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get(data_,g1,grid_key_dx<dim>()))>
r_type grid_base_impl< dim, T, S, layout_, layout_base >::get ( 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 450 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<unsigned int p, typename r_type = decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get(data_,g1,grid_key_dx<dim>()))>
const r_type grid_base_impl< dim, T, S, layout_, layout_base >::get ( const grid_key_dx< dim > &  v1) const
inline

Get the const reference of the selected element.

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

Definition at line 470 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<unsigned int p, typename r_type = decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get_lin(data_,g1,0))>
r_type grid_base_impl< dim, T, S, layout_, layout_base >::get ( const size_t  lin_id)
inline

Get the reference of the selected element.

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

Definition at line 490 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<unsigned int p, typename r_type = decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get_lin(data_,g1,0))>
const r_type grid_base_impl< dim, T, S, layout_, layout_base >::get ( size_t  lin_id) const
inline

Get the const reference of the selected element.

Parameters
lin_idlinearized element that identify the element in the grid
Returns
the const reference of the element

Definition at line 509 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
encapc<dim,T,layout> grid_base_impl< dim, T, S, layout_, layout_base >::get_o ( const grid_key_dx< dim > &  v1)
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1grid_key that identify the element in the grid
See Also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 533 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
const encapc<dim,T,layout> grid_base_impl< dim, T, S, layout_, layout_base >::get_o ( const grid_key_dx< dim > &  v1) const
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1grid_key that identify the element in the grid
See Also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 556 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
encapc<dim,T,layout> grid_base_impl< dim, T, S, layout_, layout_base >::get_o ( size_t  v1)
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1linearized id that identify the element in the grid
See Also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 579 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
const encapc<dim,T,layout> grid_base_impl< dim, T, S, layout_, layout_base >::get_o ( size_t  v1) const
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1linearized id that identify the element in the grid
See Also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 602 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
const grid_sm<dim,T>& grid_base_impl< dim, T, S, layout_, layout_base >::getGrid ( ) const
inline

Return the internal grid information.

Return the internal grid information

Returns
the internal grid

Definition at line 351 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_key_dx_iterator<dim> grid_base_impl< dim, T, S, layout_, layout_base >::getIterator ( ) const
inline

Return a grid iterator.

Return a grid iterator, to iterate through the grid

Returns
a grid iterator

Definition at line 946 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_key_dx_iterator_sub<dim> grid_base_impl< dim, T, S, layout_, layout_base >::getIterator ( const grid_key_dx< dim > &  start,
const grid_key_dx< dim > &  stop 
) const
inline

Return a grid iterator over all points included between start and stop point.

Return a grid iterator over all the point with the exception of the ghost part

Parameters
startpoint
stoppoint
Returns
a sub-grid iterator

Definition at line 982 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<unsigned int Np>
grid_key_dx_iterator<dim,stencil_offset_compute<dim,Np> > grid_base_impl< dim, T, S, layout_, layout_base >::getIteratorStencil ( const grid_key_dx< dim >(&)  stencil_pnt[Np]) const
inline

Return a grid iterator.

Return a grid iterator, to iterate through the grid with stencil calculation

Returns
a grid iterator with stencil calculation

Definition at line 963 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void* grid_base_impl< dim, T, S, layout_, layout_base >::getPointer ( )
inline

Return a plain pointer to the internal data.

Return a plain pointer to the internal data

Returns
plain data pointer

Definition at line 413 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
const void* grid_base_impl< dim, T, S, layout_, layout_base >::getPointer ( ) const
inline

Return a plain pointer to the internal data.

Return a plain pointer to the internal data

Returns
plain data pointer

Definition at line 432 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_key_dx_iterator_sub<dim> grid_base_impl< dim, T, S, layout_, layout_base >::getSubIterator ( grid_key_dx< dim > &  start,
grid_key_dx< dim > &  stop 
) const
inline

Return a sub-grid iterator.

Return a sub-grid iterator, to iterate through the grid

Parameters
startstart point
stopstop point
Returns
a sub-grid iterator

Definition at line 914 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_key_dx_iterator_sub<dim> grid_base_impl< dim, T, S, layout_, layout_base >::getSubIterator ( size_t  m)
inline

Return a sub-grid iterator.

Return a sub-grid iterator, to iterate through the grid

Parameters
mMargin
Returns
a sub-grid iterator

Definition at line 931 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_base_impl<dim,T,S,layout,layout_base>& grid_base_impl< dim, T, S, layout_, layout_base >::operator= ( const grid_base_impl< dim, T, S, layout, layout_base > &  g)
inline

It copy a grid.

Parameters
ggrid to copy
Returns
itself

Definition at line 242 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
grid_base_impl<dim,T,S,layout,layout_base>& grid_base_impl< dim, T, S, layout_, layout_base >::operator= ( grid_base_impl< dim, T, S, layout, layout_base > &&  g)
inline

It copy a grid.

Parameters
ggrid to copy
Returns
itself

Definition at line 260 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
bool grid_base_impl< dim, T, S, layout_, layout_base >::operator== ( const grid_base_impl< dim, T, S, layout, layout_base > &  g)
inline

Compare two grids.

Parameters
ggrid to check
Returns
true if they match

Definition at line 279 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
static bool grid_base_impl< dim, T, S, layout_, layout_base >::pack ( )
inlinestatic

This file contains the implemetation of packer and unpacker for grid Created on: July 8, 2016 Author: Yaroslav Zaluzhnyi

Definition at line 10 of file grid_base_implementation.hpp.

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

pack a grid selecting the properties to pack

Parameters
mempreallocated memory where to pack the grid
stspack-stat info

Definition at line 269 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<int... prp>
void grid_base_impl< dim, T, S, layout_, layout_base >::pack ( ExtPreAlloc< S > &  mem,
grid_key_dx_iterator_sub< dims > &  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 351 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<int... prp>
static size_t grid_base_impl< dim, T, S, layout_, layout_base >::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 460 of file grid_base_implementation.hpp.

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

Insert an allocation request into the vector.

Template Parameters
prplist of properties
Parameters
vvector of allocation sequence

Definition at line 233 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<int... prp>
void grid_base_impl< dim, T, S, layout_, layout_base >::packRequest ( grid_key_dx_iterator_sub< dims > &  sub,
size_t &  req 
)
inline

Insert an allocation request.

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

Definition at line 396 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::remove ( size_t  key)
inline

Remove one element valid only on 1D.

Parameters
keyelement to remove

Definition at line 705 of file grid_base_implementation.hpp.

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

Resize the space.

Resize the space to a new grid, the element are retained on the new grid, if the new grid is bigger the new element are now initialized, if is smaller the data are cropped

Parameters
szreference to an array of dimension dim

Create a completely new grid with sz

Set the allocator and allocate the memory

N-D copy

create a source grid iterator

Definition at line 638 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<typename Memory >
void grid_base_impl< dim, T, S, layout_, layout_base >::set ( grid_key_dx< dim >  dx,
const encapc< 1, T, Memory > &  obj 
)
inline

set an element of the grid

set an element of the grid

Parameters
dxis the grid key or the position to set
objvalue to set

Definition at line 781 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::set ( grid_key_dx< dim >  dx,
const T &  obj 
)
inline

set an element of the grid

set an element of the grid

Parameters
dxis the grid key or the position to set
objvalue to set

Definition at line 807 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::set ( const grid_key_dx< dim > &  key1,
const grid_base_impl< dim, T, S, layout, layout_base > &  g,
const grid_key_dx< dim > &  key2 
)
inline

Set an element of the grid from another element of another grid.

Parameters
key1element of the grid to set
gsource grid
key2element of the source grid to copy

Definition at line 829 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::set ( const size_t  key1,
const grid_base_impl< dim, T, S, layout, layout_base > &  g,
const size_t  key2 
)
inline

Set an element of the grid from another element of another grid.

Parameters
key1element of the grid to set
gsource grid
key2element of the source grid to copy

Definition at line 853 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<typename Mem >
void grid_base_impl< dim, T, S, layout_, layout_base >::set ( const grid_key_dx< dim > &  key1,
const grid_base_impl< dim, T, Mem, layout, layout_base > &  g,
const grid_key_dx< dim > &  key2 
)
inline

Set an element of the grid from another element of another grid.

Parameters
key1element of the grid to set
gsource grid
key2element of the source grid to copy

Definition at line 877 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::setMemory ( )
inline

Create the object that provide memory.

Create the object that provide memory

Template Parameters
Smemory type to allocate

Definition at line 367 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::setMemory ( S &  m)
inline

Get the object that provide memory.

An external allocator is useful with allocator like PreAllocHeapMem to have contiguous in memory vectors. Or to force the system to retain memory

Template Parameters
Smemory type
Parameters
mexternal memory allocator

Is external

Create and set the memory allocator

Allocate the memory and create the reppresentation

Definition at line 388 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
size_t grid_base_impl< dim, T, S, layout_, layout_base >::size ( ) const
inline

return the size of the grid

Returns
Return the size of the grid

Definition at line 896 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::swap ( grid_base_impl< dim, T, S, layout, layout_base > &  grid)
inline

It move the allocated object from one grid to another.

It move the allocated object from one grid to another, after this call the argument grid is no longer valid

Parameters
gridto move/copy

Definition at line 733 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
void grid_base_impl< dim, T, S, layout_, layout_base >::swap ( grid_base_impl< dim, T, S, layout, layout_base > &&  grid)
inline

It move the allocated object from one grid to another.

It move the allocated object from one grid to another, after this call the argument grid is no longer valid

Parameters
gridto move/copy

Definition at line 764 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<int... prp>
void grid_base_impl< dim, T, S, layout_, layout_base >::unpack ( ExtPreAlloc< S > &  mem,
Unpack_stat ps 
)
inline

unpack a grid

Parameters
mempreallocated memory from where to unpack the grid
psunpack-stat info

Definition at line 304 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
template<unsigned int... prp>
void grid_base_impl< dim, T, S, layout_, layout_base >::unpack ( ExtPreAlloc< S > &  mem,
grid_key_dx_iterator_sub< dims > &  sub_it,
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 417 of file grid_base_implementation.hpp.

template<unsigned int dim, typename T, typename S, typename layout_, template< typename > class layout_base>
long int grid_base_impl< dim, T, S, layout_, layout_base >::who ( )
inline

It return the id of structure in the allocation list.

See Also
print_alloc and SE_CLASS2
Returns
the id

Definition at line 1000 of file grid_base_implementation.hpp.


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