OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid > Class Template Reference

Implementation of the staggered grid. More...

Detailed Description

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
class staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >

Implementation of the staggered grid.

Parameters
dimDimensionality of the staggered grid
eleelements object on each dimensional objects, must be a stag_elements
        +--#--+--#--+--#--+--#--+--#--+--#--+
        |     |     |     |     |     |     |
        #  *  #  *  #  *  #  *  #  *  #  *  #
        |     |     |     |     |     |     |
        +--#--+--#--+--#--+--#--+--#--+--#--+
        |     |     |     |     |     |     |
        #  *  #  *  #  *  #  *  #  *  #  *  #
        |     |     |     |     |     |     |
        +--#--+--#--+--#--+--#--+--#--+--#--+
        |     |     |     |     |     |     |
        #  *  #  *  #  *  #  *  #  *  #  *  #
        |     |     |     |     |     |     |
        +--#--+--#--+--#--+--#--+--#--+--#--+
        |     |     |     |     |     |     |
        #  *  #  *  #  *  #  *  #  *  #  *  #
        |     |     |     |     |     |     |
        +--#--+--#--+--#--+--#--+--#--+--#--+
        |     |     |     |     |     |     |
        #  *  #  *  #  *  #  *  #  *  #  *  #
        |     |     |     |     |     |     |
        +--#--+--#--+--#--+--#--+--#--+--#--+
    In the case of a 2D staggered grid we have 3 (in general dim+1 ) elements

    + = vertex
    # = edge
      = volume

    ele = stag_ele<scalar<float>,Point_test<float>,scalar<float>>

    It place a scalar on (*) an object Point_test<float> on (#) and an object scalar<float> on (+)

Definition at line 63 of file staggered_dist_grid.hpp.

#include <staggered_dist_grid.hpp>

+ Inheritance diagram for staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >:

Public Types

typedef T value_type
 Properties for each grid point.
 
typedef grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::decomposition decomposition
 
- Public Types inherited from grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >
typedef device_grid d_grid
 Which kind of grid the structure store.
 
typedef Decomposition decomposition
 Decomposition used.
 
typedef T value_type
 value_type
 
typedef St stype
 Type of space.
 
typedef Memory memory_type
 Type of Memory.
 
typedef device_grid device_grid_type
 Type of device grid.
 

Public Member Functions

template<typename H >
 staggered_grid_dist (const grid_dist_id< dim, St, H, typename Decomposition::base_type, Memory, grid_cpu< dim, H > > &g, const Ghost< dim, long int > &gh, Box< dim, size_t > ext)
 This constructor is special, it construct an expanded grid that perfectly overlap with the previous.
 
 staggered_grid_dist (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, St > &ghost)
 Constructor.
 
 staggered_grid_dist (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, long int > &ghost)
 Constructor.
 
 staggered_grid_dist (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, long int > &g, const periodicity< dim > &p)
 
 staggered_grid_dist (const Decomposition &dec, const size_t(&g_sz)[dim], const Ghost< dim, long int > &g)
 
 staggered_grid_dist (const Decomposition &dec, const size_t(&g_sz)[dim], const Ghost< dim, St > &ghost)
 
template<unsigned int p>
void setStagPosition (openfpm::vector< comb< dim > > &cmb)
 set the staggered positions of the properties
 
void setDefaultStagPosition ()
 It set all the properties defined to be staggered on the default location.
 
template<typename Grid_dst , unsigned int ... pos>
bool to_normal (Grid_dst &g_dst, const Padding< dim > &pd, const long int(&start)[dim], const long int(&stop)[dim])
 Copy the staggered grid into a normal one.
 
const openfpm::vector (&getStagPositions())[T
 Get the staggered positions.
 
void write (std::string str)
 Write a vtk file with the information of the staggered grid.
 
bool is_staggered_prop (size_t prp)
 Return if the properties is a staggered property or not.
 
bool is_staggered () const
 Return if the grid is staggered.
 
- Public Member Functions inherited from grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >
const Box< dim, St > getDomain () const
 Get the domain where the grid is defined.
 
Point< dim, St > getOffset (size_t i)
 Get the point where it start the origin of the grid of the sub-domain i.
 
St spacing (size_t i) const
 Get the spacing of the grid in direction i.
 
size_t size () const
 Return the total number of points in the grid.
 
void setBackgroundValue (T &bv)
 set the background value
 
template<unsigned int p>
void setBackgroundValue (const typename boost::mpl::at< typename T::type, boost::mpl::int_< p > >::type &bv)
 set the background value
 
size_t size_local_inserted () const
 Return the local total number of points inserted in the grid.
 
size_t size (size_t i) const
 Return the total number of points in the grid.
 
 grid_dist_id (const grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > &g)
 Copy constructor.
 
template<typename H >
 grid_dist_id (const grid_dist_id< dim, St, H, typename Decomposition::base_type, Memory, grid_cpu< dim, H > > &g, const Ghost< dim, long int > &gh, Box< dim, size_t > ext)
 This constructor is special, it construct an expanded grid that perfectly overlap with the previous.
 
template<typename Decomposition2 >
 grid_dist_id (const Decomposition2 &dec, const size_t(&g_sz)[dim], const Ghost< dim, St > &ghost)
 
 grid_dist_id (Decomposition &&dec, const size_t(&g_sz)[dim], const Ghost< dim, St > &ghost)
 
 grid_dist_id (const Decomposition &dec, const size_t(&g_sz)[dim], const Ghost< dim, long int > &g)
 
template<typename Decomposition2 >
 grid_dist_id (const Decomposition2 &dec, const size_t(&g_sz)[dim], const Ghost< dim, long int > &g)
 
 grid_dist_id (Decomposition &&dec, const size_t(&g_sz)[dim], const Ghost< dim, long int > &g)
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, St > &g, size_t opt=0)
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, long int > &g, size_t opt=0)
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, St > &g, const periodicity< dim > &p, size_t opt=0)
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, long int > &g, const periodicity< dim > &p, size_t opt=0, const grid_sm< dim, void > &g_dec=grid_sm< dim, void >())
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, long int > &g, const periodicity< dim > &p, openfpm::vector< Box< dim, long int > > &bx_def)
 It construct a grid on the full domain restricted to the set of boxes specified.
 
const grid_sm< dim, T > & getGridInfo () const
 Get an object containing the grid informations.
 
const grid_sm< dim, void > & getGridInfoVoid () const
 Get an object containing the grid informations without type.
 
DecompositiongetDecomposition ()
 Get the object that store the information about the decomposition.
 
const DecompositiongetDecomposition () const
 Get the object that store the information about the decomposition.
 
const CellDecomposer_sm< dim, St, shift< dim, St > > & getCellDecomposer () const
 Return the cell decomposer.
 
bool isInside (const grid_key_dx< dim > &gk) const
 Check that the global grid key is inside the grid domain.
 
size_t getLocalDomainSize () const
 Get the total number of grid points for the calling processor.
 
size_t getLocalDomainWithGhostSize () const
 Get the total number of grid points with ghost for the calling processor.
 
const openfpm::vector< GBoxes< device_grid::dims > > & getLocalGridsInfo () const
 It return the informations about the local grids.
 
void getGlobalGridsInfo (openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext_global) const
 It gathers the information about local grids for all of the processors.
 
grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_subiterator()), FREE > getOldDomainIterator () const
 It return an iterator that span the full grid domain (each processor span its local domain)
 
grid_dist_id_iterator_dec< DecompositiongetGridIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop)
 
grid_dist_id_iterator_dec< Decomposition, true > getGridGhostIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop)
 
grid_dist_id_iterator_dec< DecompositiongetGridIterator ()
 
grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_subiterator()), FREE > getDomainIterator () const
 It return an iterator that span the full grid domain (each processor span its local domain)
 
template<unsigned int Np>
grid_dist_iterator< dim, device_grid, decltype(device_grid::template type_of_subiterator< stencil_offset_compute< dim, Np > >()), FREE, stencil_offset_compute< dim, Np > > getDomainIteratorStencil (const grid_key_dx< dim >(&stencil_pnt)[Np]) const
 It return an iterator that span the full grid domain (each processor span its local domain)
 
grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_iterator()), FIXED > getDomainGhostIterator () const
 It return an iterator that span the grid domain + ghost part.
 
grid_dist_iterator_sub< dim, device_gridgetSubDomainIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop) const
 It return an iterator that span the grid domain only in the specified part.
 
grid_dist_iterator_sub< dim, device_gridgetSubDomainIterator (const long int(&start)[dim], const long int(&stop)[dim]) const
 It return an iterator that span the grid domain only in the specified part.
 
 ~grid_dist_id ()
 Destructor.
 
VclustergetVC ()
 Get the Virtual Cluster machine.
 
void removeUnusedBuffers ()
 Eliminate many internal temporary buffer you can use this between flushes if you get some out of memory.
 
bool is_staggered () const
 Indicate that this grid is not staggered.
 
template<typename bg_key >
void remove (const grid_dist_key_dx< dim, bg_key > &v1)
 remove an element in the grid
 
template<typename bg_key >
void remove_no_flush (const grid_dist_key_dx< dim, bg_key > &v1)
 remove an element in the grid
 
template<typename ... v_reduce>
void flush (flush_type opt=flush_type::FLUSH_ON_HOST)
 
void flush_remove ()
 remove an element in the grid
 
template<unsigned int p, typename bg_key >
auto insert (const grid_dist_key_dx< dim, bg_key > &v1) -> decltype(loc_grid.get(v1.getSub()).template insert< p >(v1.getKey()))
 insert an element in the grid
 
template<unsigned int p, typename bg_key >
auto insertFlush (const grid_dist_key_dx< dim, bg_key > &v1) -> decltype(loc_grid.get(v1.getSub()).template insertFlush< p >(v1.getKey()))
 insert an element in the grid
 
template<typename bg_key >
auto insertFlush (const grid_dist_key_dx< dim, bg_key > &v1) -> decltype(loc_grid.get(v1.getSub()).template insertFlush(v1.getKey()))
 insert an element in the grid
 
template<unsigned int p, typename bg_key >
auto get (const grid_dist_key_dx< dim, bg_key > &v1) const -> typename std::add_lvalue_reference< decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))>::type
 Get the reference of the selected element.
 
template<unsigned int p, typename bg_key >
auto get (const grid_dist_key_dx< dim, bg_key > &v1) -> decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))
 Get the reference of the selected element.
 
template<unsigned int p = 0>
auto get (const grid_dist_g_dx< device_grid > &v1) const -> decltype(v1.getSub() ->template get< p >(v1.getKey()))
 Get the reference of the selected element.
 
template<unsigned int p = 0>
auto get (const grid_dist_g_dx< device_grid > &v1) -> decltype(v1.getSub() ->template get< p >(v1.getKey()))
 Get the reference of the selected element.
 
template<unsigned int p = 0>
auto get (const grid_dist_lin_dx &v1) const -> decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))
 Get the reference of the selected element.
 
template<unsigned int p = 0>
auto get (const grid_dist_lin_dx &v1) -> decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))
 Get the reference of the selected element.
 
template<typename bg_key >
Point< dim, St > getPos (const grid_dist_key_dx< dim, bg_key > &v1)
 Get the reference of the selected element.
 
template<typename bg_key >
bool existPoint (const grid_dist_key_dx< dim, bg_key > &v1) const
 Check if the point exist.
 
template<unsigned int p = 0, typename bgkey >
auto getProp (const grid_dist_key_dx< dim, bgkey > &v1) const -> decltype(this->template get< p >(v1))
 Get the reference of the selected element.
 
template<unsigned int p = 0, typename bgkey >
auto getProp (const grid_dist_key_dx< dim, bgkey > &v1) -> decltype(this->template get< p >(v1))
 Get the reference of the selected element.
 
template<int... prp>
void ghost_get (size_t opt=0)
 It synchronize the ghost parts.
 
template<template< typename, typename > class op, int... prp>
void ghost_put ()
 It synchronize the ghost parts.
 
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > & copy (grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > &g, bool use_memcpy=true)
 Copy the give grid into this grid.
 
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > & copy_sparse (grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > &g, bool use_memcpy=true)
 Copy the give grid into this grid.
 
Point< dim, St > getSpacing ()
 Get the spacing on each dimension.
 
grid_key_dx< dim > getGKey (const grid_dist_key_dx< dim > &k) const
 Convert a g_dist_key_dx into a global key.
 
template<typename Model >
void addComputationCosts (Model md=Model(), size_t ts=1)
 Add the computation cost on the decomposition using a resolution function.
 
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 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_b (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 stencil_size, typename v_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 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, unsigned int N, typename lambda_f , typename ... ArgsT>
void conv2 (int(&stencil)[N][dim], grid_key_dx< dim > start, grid_key_dx< dim > 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 conv2 (grid_key_dx< dim > start, grid_key_dx< dim > stop, lambda_f func, ArgsT ... args)
 apply a convolution on 2 property on GPU
 
template<unsigned int prop_src1, unsigned int prop_dst1, unsigned int stencil_size, typename lambda_f , typename ... ArgsT>
void conv (grid_key_dx< dim > start, grid_key_dx< dim > stop, lambda_f func, ArgsT ... args)
 apply a convolution on GPU
 
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 conv2_b (grid_key_dx< dim > start, grid_key_dx< dim > stop, lambda_f func, ArgsT ... args)
 apply a convolution on 2 property on GPU
 
template<unsigned int prop_src1, unsigned int prop_src2, unsigned int prop_src3, unsigned int prop_dst1, unsigned int prop_dst2, unsigned int prop_dst3, unsigned int stencil_size, typename lambda_f , typename ... ArgsT>
void conv3_b (grid_key_dx< dim > start, grid_key_dx< dim > stop, lambda_f func, ArgsT ... args)
 apply a convolution on 2 property on GPU
 
template<typename NNtype >
void findNeighbours ()
 
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
 
bool write (std::string output, size_t opt=VTK_WRITER|FORMAT_BINARY)
 Write the distributed grid information.
 
bool write_debug (std::string output)
 Write all grids indigually.
 
bool write_frame (std::string output, size_t i, size_t opt=VTK_WRITER|FORMAT_ASCII)
 Write the distributed grid information.
 
device_gridget_loc_grid (size_t i)
 Get the i sub-domain grid.
 
const device_gridget_loc_grid (size_t i) const
 Get the i sub-domain grid.
 
grid_key_dx_iterator_sub< dim, no_stencilget_loc_grid_iterator (size_t i)
 Get the i sub-domain grid.
 
template<unsigned int Np>
grid_key_dx_iterator_sub< dim, stencil_offset_compute< dim, Np >, typename device_grid::linearizer_type > get_loc_grid_iterator_stencil (size_t i, const grid_key_dx< dim >(&stencil_pnt)[Np])
 Get the i sub-domain grid.
 
size_t getN_loc_grid () const
 Return the number of local grid.
 
long int who ()
 It return the id of structure in the allocation list.
 
void debugPrint ()
 It print the internal ghost boxes and external ghost boxes in global unit.
 
void setPropNames (const openfpm::vector< std::string > &names)
 Set the properties names.
 
const openfpm::vector< std::string > & getPropNames ()
 Set the properties names.
 
void clear ()
 It delete all the points.
 
void construct_link (self &grid_up, self &grid_dw)
 construct link between levels
 
void construct_link_dw (self &grid_dw, openfpm::vector< offset_mv< dim > > &mvof)
 construct link between current and the level down
 
void construct_link_up (self &grid_up, openfpm::vector< offset_mv< dim > > &mvof)
 construct link between current and the level up
 
template<typename stencil_type >
void tagBoundaries ()
 construct link between current and the level up
 
void map (size_t opt=0)
 It move all the grid parts that do not belong to the local processor to the respective processor.
 
void save (const std::string &filename) const
 Save the grid state on HDF5.
 
void load (const std::string &filename)
 Reload the grid from HDF5 file.
 
const openfpm::vector< i_lbox_grid< dim > > & get_loc_ig_box ()
 Get the internal local ghost box.
 
const openfpm::vector< i_lbox_grid< dim > > & get_ig_box ()
 Get the internal ghost box.
 
void print_stats ()
 
void clear_stats ()
 
- Public Member Functions inherited from grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid >
void grids_reconstruct (openfpm::vector< openfpm::vector< aggregate< device_grid, SpaceBox< dim, long int > > > > &m_oGrid_recv, openfpm::vector< device_grid > &loc_grid, openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext, CellDecomposer_sm< dim, St, shift< dim, St > > &cd_sm)
 Reconstruct the local grids.
 
template<typename lambda_t >
void labelIntersectionGridsProcessor_and_pack (Decomposition &dec, CellDecomposer_sm< dim, St, shift< dim, St > > &cd_sm, openfpm::vector< device_grid > &loc_grid_old, openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext, openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext_old, openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext_global, size_t p_id_cur, lambda_t f)
 Label intersection grids for mappings.
 
template<int ... prp>
void unpack_buffer_to_local_grid (openfpm::vector< device_grid > &loc_grid, openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext, ExtPreAlloc< Memory > &send_buffer, size_t sz)
 Unpack.
 
template<int ... prp>
void map_ (Decomposition &dec, CellDecomposer_sm< dim, St, shift< dim, St > > &cd_sm, openfpm::vector< device_grid > &loc_grid, openfpm::vector< device_grid > &loc_grid_old, openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext, openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext_old, openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext_global, size_t opt)
 Moves all the grids that does not belong to the local processor to the respective processor.
 
template<int... prp>
void ghost_get_ (const openfpm::vector< ip_box_grid< dim > > &ig_box, const openfpm::vector< ep_box_grid< dim > > &eg_box, const openfpm::vector< i_lbox_grid< dim > > &loc_ig_box, const openfpm::vector< e_lbox_grid< dim > > &loc_eg_box, const openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext, const openfpm::vector< e_box_multi< dim > > &eb_gid_list, bool use_bx_def, openfpm::vector< device_grid > &loc_grid, const grid_sm< dim, void > &ginfo, std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box, size_t opt)
 It fill the ghost part of the grids.
 
template<template< typename, typename > class op, int... prp>
void ghost_put_ (Decomposition &dec, const openfpm::vector< ip_box_grid< dim > > &ig_box, const openfpm::vector< ep_box_grid< dim > > &eg_box, const openfpm::vector< i_lbox_grid< dim > > &loc_ig_box, const openfpm::vector< e_lbox_grid< dim > > &loc_eg_box, const openfpm::vector< GBoxes< device_grid::dims > > &gdb_ext, openfpm::vector< device_grid > &loc_grid, openfpm::vector< std::unordered_map< size_t, size_t > > &g_id_to_internal_ghost_box)
 It merge the information in the ghost with the real information.
 
 grid_dist_id_comm ()
 Constructor.
 
 grid_dist_id_comm (const grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid > &gc)
 Copy constructor.
 

Static Public Attributes

static const unsigned int dims = dim
 Number of dimensions.
 
- Static Public Attributes inherited from grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >
static const unsigned int dims = dim
 Number of dimensions.
 

Private Attributes

openfpm::vector< comb< dim > > c_prp [T::max_prop_real]
 position of the properties in the grid cell
 

Friends

class stag_create_and_add_grid< dim, staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >, St >
 

Additional Inherited Members

- Static Public Member Functions inherited from grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >
template<typename stencil = no_stencil>
static grid_dist_iterator_sub< dim, device_gridtype_of_subiterator ()
 This is a meta-function return which type of sub iterator a grid produce.
 
- Protected Member Functions inherited from grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >
Box< dim, size_t > getDomain (size_t i)
 Given a local sub-domain i with a local grid Domain + ghost return the part of the local grid that is domain.
 
void setDecompositionGranularity (size_t n_sub)
 Set the minimum number of sub-domain per processor.
 
void reset_ghost_structures ()
 
- Static Protected Member Functions inherited from grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >
static Ghost< dim, St > convert_ghost (const Ghost< dim, long int > &gd, const CellDecomposer_sm< dim, St, shift< dim, St > > &cd_sm)
 Convert a ghost from grid point units into continus space.
 

Member Typedef Documentation

◆ decomposition

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
typedef grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>::decomposition staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::decomposition

Definition at line 73 of file staggered_dist_grid.hpp.

◆ value_type

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
typedef T staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::value_type

Properties for each grid point.

Definition at line 71 of file staggered_dist_grid.hpp.

Constructor & Destructor Documentation

◆ staggered_grid_dist() [1/6]

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<typename H >
staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::staggered_grid_dist ( const grid_dist_id< dim, St, H, typename Decomposition::base_type, Memory, grid_cpu< dim, H > > &  g,
const Ghost< dim, long int > &  gh,
Box< dim, size_t >  ext 
)
inline

This constructor is special, it construct an expanded grid that perfectly overlap with the previous.

The key-word here is "perfectly overlap". Using the default constructor you could create something similar, but because of rounding-off error it can happen that it is not perfectly overlapping

Parameters
gprevious grid
ghGhost part in grid units
extextension of the grid (must be positive on every direction)

Definition at line 88 of file staggered_dist_grid.hpp.

◆ staggered_grid_dist() [2/6]

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::staggered_grid_dist ( const size_t(&)  g_sz[dim],
const Box< dim, St > &  domain,
const Ghost< dim, St > &  ghost 
)
inline

Constructor.

Parameters
g_szsize of the staggered grid
domaindomain
ghostpart

Definition at line 103 of file staggered_dist_grid.hpp.

◆ staggered_grid_dist() [3/6]

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::staggered_grid_dist ( const size_t(&)  g_sz[dim],
const Box< dim, St > &  domain,
const Ghost< dim, long int > &  ghost 
)
inline

Constructor.

Parameters
g_szsize of the staggered grid
domaindomain
ghostpart

Definition at line 117 of file staggered_dist_grid.hpp.

◆ staggered_grid_dist() [4/6]

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::staggered_grid_dist ( const size_t(&)  g_sz[dim],
const Box< dim, St > &  domain,
const Ghost< dim, long int > &  g,
const periodicity< dim > &  p 
)
inline

It construct a grid of a specified size, defined on a specified Box space, having a specified ghost size and periodicity

Parameters
g_szgrid size on each dimension
domainBox that contain the grid
gGhost part of the domain (given in grid units)
pperiodicity
Warning
In very rare case the ghost part can be one point bigger than the one specified

Definition at line 133 of file staggered_dist_grid.hpp.

◆ staggered_grid_dist() [5/6]

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::staggered_grid_dist ( const Decomposition dec,
const size_t(&)  g_sz[dim],
const Ghost< dim, long int > &  g 
)
inline

It constructs a grid of a specified size, defined on a specified Box space, forcing to follow a specified decomposition, and having a specified ghost size

Parameters
decDecomposition
g_szgrid size on each dimension
gGhost part (given in grid units)
Warning
In very rare case the ghost part can be one point bigger than the one specified

Definition at line 148 of file staggered_dist_grid.hpp.

◆ staggered_grid_dist() [6/6]

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::staggered_grid_dist ( const Decomposition dec,
const size_t(&)  g_sz[dim],
const Ghost< dim, St > &  ghost 
)
inline

It constructs a grid of a specified size, defined on a specified Box space, forcing to follow a specified decomposition and with a specified ghost size

Parameters
decDecomposition
g_szgrid size on each dimension
ghostGhost part

Definition at line 160 of file staggered_dist_grid.hpp.

Member Function Documentation

◆ is_staggered()

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
bool staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::is_staggered ( ) const
inline

Return if the grid is staggered.

Returns
true

Definition at line 293 of file staggered_dist_grid.hpp.

◆ is_staggered_prop()

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
bool staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::is_staggered_prop ( size_t  prp)
inline

Return if the properties is a staggered property or not.

Parameters
prpproperty to check
Returns
true if the property is staggered

Definition at line 283 of file staggered_dist_grid.hpp.

◆ openfpm::vector()

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::openfpm::vector ( getStagPositions())
inline

Get the staggered positions.

Returns
for each property it contain a vector that specify where in the cell grid the properties live

Definition at line 259 of file staggered_dist_grid.hpp.

◆ setDefaultStagPosition()

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::setDefaultStagPosition ( )
inline

It set all the properties defined to be staggered on the default location.

Definition at line 185 of file staggered_dist_grid.hpp.

◆ setStagPosition()

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p>
void staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::setStagPosition ( openfpm::vector< comb< dim > > &  cmb)
inline

set the staggered positions of the properties

Template Parameters
propertyp
Parameters
cmba vector containing for each component the position in the cell-grid

Definition at line 173 of file staggered_dist_grid.hpp.

◆ to_normal()

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<typename Grid_dst , unsigned int ... pos>
bool staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::to_normal ( Grid_dst &  g_dst,
const Padding< dim > &  pd,
const long int(&)  start[dim],
const long int(&)  stop[dim] 
)
inline

Copy the staggered grid into a normal one.

Template Parameters
Grid_dsttype of the destination Grid
posdestination grid properties to fill
Parameters
g_dstdestination grid
pdpadding of the grid compared to the destination grid
startstarting point
stopstop point

Definition at line 206 of file staggered_dist_grid.hpp.

◆ write()

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::write ( std::string  str)
inline

Write a vtk file with the information of the staggered grid.

Parameters
strvtk output file

Definition at line 269 of file staggered_dist_grid.hpp.

Friends And Related Symbol Documentation

◆ stag_create_and_add_grid< dim, staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >, St >

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
friend class stag_create_and_add_grid< dim, staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >, St >
friend

Definition at line 293 of file staggered_dist_grid.hpp.

Field Documentation

◆ c_prp

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
openfpm::vector<comb<dim> > staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::c_prp[T::max_prop_real]
private

position of the properties in the grid cell

Definition at line 66 of file staggered_dist_grid.hpp.

◆ dims

template<unsigned int dim, typename St , typename T , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const unsigned int staggered_grid_dist< dim, St, T, Decomposition, Memory, device_grid >::dims = dim
static

Number of dimensions.

Definition at line 76 of file staggered_dist_grid.hpp.


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