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

AMR Adaptive Multi Resolution Grid. More...

Detailed Description

template<unsigned int dim, typename St, typename T, typename Decomposition, typename Memory, typename device_grid>
class grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >

AMR Adaptive Multi Resolution Grid.

Template Parameters
dimDimensionality
Sttype of space
Twhat each point of the grid store
Decompositiontype of decomposition

Definition at line 133 of file grid_dist_amr.hpp.

#include <grid_dist_amr.hpp>

Public Member Functions

 grid_dist_amr (const Box< dim, St > &domain, const Ghost< dim, long int > &g)
 Constructor.
 
 grid_dist_amr (const Box< dim, St > &domain, const Ghost< dim, long int > &g, periodicity< dim > &bc)
 Constructor.
 
void initLevels (const Decomposition &dec, size_t n_lvl, const size_t(&g_sz)[dim])
 Initialize the amr grid.
 
template<typename TT >
void initLevels (const Decomposition_encap< Decomposition, TT > &dec, size_t n_lvl, const size_t(&g_sz)[dim])
 Initialize the amr grid.
 
void recalculate_mvoff ()
 Recalculate the offset array for the moveLvlUp and moveLvlDw.
 
void initLevels (size_t n_lvl, const size_t(&g_sz)[dim], size_t opt=0)
 Initialize the amr grid.
 
template<typename Model >
void addComputationCosts (Model md=Model(), size_t ts=1)
 Add the computation cost on the decomposition using a resolution function.
 
Decomposition_encap< Decomposition, decltype(gd_array)> getDecomposition ()
 Get the object that store the information about the decomposition.
 
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > & getLevel (size_t lvl)
 Get the underlying grid level.
 
grid_dist_amr_key_iterator< dim, device_grid, decltype(grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::type_of_subiterator()), decltype(grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::type_of_subiterator()) > getDomainIteratorCells ()
 
grid_dist_iterator_sub< dim, device_gridgetDomainIteratorCells (size_t lvl)
 
auto getGridGhostIterator (size_t lvl) -> decltype(gd_array.get(lvl).getGridGhostIterator(grid_key_dx< dim >(), grid_key_dx< dim >()))
 Get an iterator to the grid.
 
auto getGridIterator (size_t lvl) -> decltype(gd_array.get(lvl).getGridIterator())
 Get an iterator to the grid.
 
auto getGridIterator (size_t lvl, grid_key_dx< dim > &start, grid_key_dx< dim > &stop) -> decltype(gd_array.get(lvl).getGridIterator(start, stop))
 Get an iterator to the grid.
 
auto getGridIteratorCells (size_t lvl) -> decltype(gd_array.get(lvl).getGridIterator())
 Get an iterator to the grid.
 
grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_subiterator()), FREE > getDomainIterator (size_t lvl) const
 return an iterator over the level lvl
 
grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_iterator()), FIXED > getDomainGhostIterator (size_t lvl) const
 return an iterator over the level lvl
 
grid_dist_amr_key_iterator< dim, device_grid, decltype(device_grid::type_of_subiterator())> getDomainIterator ()
 Get domain iterator.
 
grid_dist_amr_key_iterator< dim, device_grid, decltype(device_grid::type_of_iterator()), grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_iterator()), FIXED > > getDomainGhostIterator ()
 Get domain iterator.
 
template<unsigned int p>
auto get (const grid_dist_amr_key< dim > &v1) const -> decltype(gd_array.get(v1.getLvl()).template get< p >(v1.getKey()))
 Get the reference of the selected element.
 
template<unsigned int p>
auto get (const grid_dist_amr_key< dim > &v1) -> decltype(gd_array.get(v1.getLvl()).template get< p >(v1.getKey()))
 Get the reference of the selected element.
 
template<unsigned int p>
auto get (size_t lvl, const grid_dist_key_dx< dim > &v1) const -> decltype(gd_array.get(lvl).template get< p >(v1))
 Get the reference of the selected element.
 
template<unsigned int p>
auto get (size_t lvl, const grid_dist_key_dx< dim > &v1) -> decltype(gd_array.get(lvl).template get< p >(v1))
 Get the reference of the selected element.
 
template<unsigned int p>
auto insert (const grid_dist_amr_key< dim > &v1) -> decltype(gd_array.get(v1.getLvl()).template insert< p >(v1.getKey()))
 Get the reference of the selected element.
 
template<unsigned int p>
auto insert (size_t lvl, const grid_dist_key_dx< dim > &v1) -> decltype(gd_array.get(lvl).template insert< p >(v1))
 Get the reference of the selected element.
 
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > & getDistGrid (size_t lvl)
 Get the internal distributed grid.
 
void remove (const grid_dist_amr_key< dim > &v1)
 Remove a grid point (this function make sense only in case of sparse grid)
 
void remove (size_t lvl, const grid_dist_key_dx< dim > &v1)
 Remove a grid point (this function make sense only in case of sparse grid)
 
void construct_level_connections ()
 construct level connections for padding particles
 
template<typename stencil_type >
void tagBoundaries ()
 construct level connections for padding particles
 
template<int... prp>
void ghost_get (size_t opt=0)
 It synchronize the ghost parts.
 
void map (size_t opt=0)
 It move all the grid parts that do not belong to the local processor to the respective processor.
 
template<template< typename, typename > class op, int... prp>
void ghost_put ()
 Apply the ghost put.
 
size_t size_inserted (size_t lvl)
 Return the number of inserted points on a particular level.
 
void setBackgroundValue (T &bv)
 set the background value
 
void clear ()
 delete all the points in the grid
 
const grid_sm< dim, void > & getGridInfoVoid (size_t lvl) const
 Get an object containing the grid informations for a specific level.
 
size_t getNLvl ()
 Return the maximum number of levels in the AMR struct.
 
void moveLvlDw (grid_dist_amr_key< dim > &key)
 Move down (to finer level) the key.
 
grid_dist_key_dx< dim > moveDw (int lvl, const grid_dist_key_dx< dim > &key)
 Move down (to finer level) the key.
 
grid_dist_amr_key< dim > getAMRKey (size_t lvl, grid_dist_key_dx< dim > key)
 From a distributed key it return a AMR key that contain also the grid level.
 
void moveLvlUp (grid_dist_amr_key< dim > &key)
 Move up (to coarser level) the key.
 
grid_dist_key_dx< dim > moveUp (int lvl, const grid_dist_key_dx< dim > &key)
 Move up (to coarser level) the key.
 
grid_key_dx< dim > getGKey (const grid_dist_amr_key< dim > &v1)
 Get the position on the grid in global coordinates.
 
grid_key_dx< dim > getGKey (int lvl, const grid_dist_key_dx< dim > &v1)
 Get the position on the grid in global coordinates.
 
Point< dim, St > getPos (const grid_dist_amr_key< dim > &v1)
 Get the the position of the point.
 
Point< dim, St > getPos (int lvl, const grid_dist_key_dx< dim > &v1)
 Get the the position of the point.
 
Point< dim, St > getSpacing (size_t lvl)
 return the spacing for the grid in the level lvl
 
bool existPoint (const grid_dist_amr_key< dim > &v1)
 
bool existPoint (int lvl, const grid_dist_key_dx< dim > &v1)
 
bool write (std::string output, size_t opt=VTK_WRITER|FORMAT_ASCII)
 Write on vtk file.
 

Private Types

typedef decltype(device_grid::type_of_subiterator()) device_sub_it
 Type of structure sub-grid iterator.
 
typedef decltype(device_grid::type_of_iterator()) device_it
 Type of structure for the grid iterator.
 

Private Member Functions

void initialize_other (size_t n_lvl, size_t(&g_sz_lvl)[dim])
 Initialize the others levels.
 

Private Attributes

Box< dim, St > domain
 Simulation domain.
 
Ghost< dim, long int > g_int
 Ghost integer.
 
periodicity< dim > bc
 Boundary conditions of the structure.
 
openfpm::vector< grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >, HeapMemory, memory_traits_lin, openfpm::grow_policy_identity, STD_VECTOR > gd_array
 array of grids
 
openfpm::vector< grid_dist_iterator< dim, device_grid, device_sub_it, FREE > > git
 Domain iterator for each distributed grid.
 
openfpm::vector< grid_dist_iterator< dim, device_grid, device_it, FIXED > > git_g
 Domain and ghost iterator for each distributed grid.
 
openfpm::vector< grid_dist_iterator_sub< dim, device_grid > > git_sub
 Iterator for each distributed grid.
 
openfpm::vector< openfpm::vector< offset_mv< dim > > > mv_off
 Moving offsets.
 
bck
 background level
 

Member Typedef Documentation

◆ device_it

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
typedef decltype(device_grid::type_of_iterator()) grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::device_it
private

Type of structure for the grid iterator.

Definition at line 155 of file grid_dist_amr.hpp.

◆ device_sub_it

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
typedef decltype(device_grid::type_of_subiterator()) grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::device_sub_it
private

Type of structure sub-grid iterator.

Definition at line 152 of file grid_dist_amr.hpp.

Constructor & Destructor Documentation

◆ grid_dist_amr() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::grid_dist_amr ( const Box< dim, St > &  domain,
const Ghost< dim, long int > &  g 
)
inline

Constructor.

Parameters
domainSimulation domain
gghost extension

Definition at line 210 of file grid_dist_amr.hpp.

◆ grid_dist_amr() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::grid_dist_amr ( const Box< dim, St > &  domain,
const Ghost< dim, long int > &  g,
periodicity< dim > &  bc 
)
inline

Constructor.

Parameters
domainSimulation domain
gghost extension
bcboundary conditions

Definition at line 226 of file grid_dist_amr.hpp.

Member Function Documentation

◆ addComputationCosts()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<typename Model >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::addComputationCosts ( Model  md = Model(),
size_t  ts = 1 
)
inline

Add the computation cost on the decomposition using a resolution function.

Parameters
mdModel to use
tsIt is an optional parameter approximately should be the number of ghost get between two rebalancing at first decomposition this number can be ignored (default = 1) because not used

Definition at line 351 of file grid_dist_amr.hpp.

◆ clear()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::clear ( )
inline

delete all the points in the grid

In case of sparse grid in delete all the inserted points, in case of dense it does nothing

Definition at line 825 of file grid_dist_amr.hpp.

◆ construct_level_connections()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::construct_level_connections ( )
inline

construct level connections for padding particles

Definition at line 722 of file grid_dist_amr.hpp.

◆ existPoint() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
bool grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::existPoint ( const grid_dist_amr_key< dim > &  v1)
inline

Definition at line 1034 of file grid_dist_amr.hpp.

◆ existPoint() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
bool grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::existPoint ( int  lvl,
const grid_dist_key_dx< dim > &  v1 
)
inline

Definition at line 1044 of file grid_dist_amr.hpp.

◆ get() [1/4]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<unsigned int p>
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::get ( const grid_dist_amr_key< dim > &  v1) -> decltype(gd_array.get(v1.getLvl()).template get<p>(v1.getKey()))
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 593 of file grid_dist_amr.hpp.

◆ get() [2/4]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<unsigned int p>
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::get ( const grid_dist_amr_key< dim > &  v1) const -> decltype(gd_array.get(v1.getLvl()).template get<p>(v1.getKey()))
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 577 of file grid_dist_amr.hpp.

◆ get() [3/4]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<unsigned int p>
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::get ( size_t  lvl,
const grid_dist_key_dx< dim > &  v1 
) -> decltype(gd_array.get(lvl).template get<p>(v1))
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 626 of file grid_dist_amr.hpp.

◆ get() [4/4]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<unsigned int p>
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::get ( size_t  lvl,
const grid_dist_key_dx< dim > &  v1 
) const -> decltype(gd_array.get(lvl).template get<p>(v1))
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 610 of file grid_dist_amr.hpp.

◆ getAMRKey()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_amr_key< dim > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getAMRKey ( size_t  lvl,
grid_dist_key_dx< dim >  key 
)
inline

From a distributed key it return a AMR key that contain also the grid level.

Parameters
lvllevel
keydistributed key

Definition at line 911 of file grid_dist_amr.hpp.

◆ getDecomposition()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
Decomposition_encap< Decomposition, decltype(gd_array)> grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getDecomposition ( )
inline

Get the object that store the information about the decomposition.

Returns
the decomposition object

Definition at line 361 of file grid_dist_amr.hpp.

◆ getDistGrid()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > & grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getDistGrid ( size_t  lvl)
inline

Get the internal distributed grid.

Parameters
lvllevel
Returns
the internal distributed grid

Definition at line 683 of file grid_dist_amr.hpp.

◆ getDomainGhostIterator() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_amr_key_iterator< dim, device_grid, decltype(device_grid::type_of_iterator()), grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_iterator()), FIXED > > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getDomainGhostIterator ( )
inline

Get domain iterator.

Returns
an iterator over all the grid levels

Definition at line 556 of file grid_dist_amr.hpp.

◆ getDomainGhostIterator() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_iterator()), FIXED > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getDomainGhostIterator ( size_t  lvl) const
inline

return an iterator over the level lvl

Parameters
lvllevel
Returns
an iterator over the level lvl selected

Definition at line 526 of file grid_dist_amr.hpp.

◆ getDomainIterator() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_amr_key_iterator< dim, device_grid, decltype(device_grid::type_of_subiterator())> grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getDomainIterator ( )
inline

Get domain iterator.

Returns
an iterator over all the grid levels

Definition at line 537 of file grid_dist_amr.hpp.

◆ getDomainIterator() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_iterator< dim, device_grid, decltype(device_grid::type_of_subiterator()), FREE > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getDomainIterator ( size_t  lvl) const
inline

return an iterator over the level lvl

Parameters
lvllevel
Returns
an iterator over the level lvl selected

Definition at line 511 of file grid_dist_amr.hpp.

◆ getDomainIteratorCells() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_amr_key_iterator< dim, device_grid, decltype(grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::type_of_subiterator()), decltype(grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::type_of_subiterator()) > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getDomainIteratorCells ( )
inline

Definition at line 384 of file grid_dist_amr.hpp.

◆ getDomainIteratorCells() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_iterator_sub< dim, device_grid > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getDomainIteratorCells ( size_t  lvl)
inline

Definition at line 410 of file grid_dist_amr.hpp.

◆ getGKey() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_key_dx< dim > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getGKey ( const grid_dist_amr_key< dim > &  v1)
inline

Get the position on the grid in global coordinates.

Parameters
v1amr key
Returns
the position in global coordinates

Definition at line 975 of file grid_dist_amr.hpp.

◆ getGKey() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_key_dx< dim > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getGKey ( int  lvl,
const grid_dist_key_dx< dim > &  v1 
)
inline

Get the position on the grid in global coordinates.

Parameters
lvllevel
v1point in the level
Returns
the position in global coordinates

Definition at line 988 of file grid_dist_amr.hpp.

◆ getGridGhostIterator()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getGridGhostIterator ( size_t  lvl) -> decltype(gd_array.get(lvl).getGridGhostIterator(grid_key_dx<dim>(),grid_key_dx<dim>()))
inline

Get an iterator to the grid.

Returns
an iterator to the grid

Definition at line 432 of file grid_dist_amr.hpp.

◆ getGridInfoVoid()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
const grid_sm< dim, void > & grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getGridInfoVoid ( size_t  lvl) const
inline

Get an object containing the grid informations for a specific level.

Parameters
lvllevel
Returns
an information object about this grid

Definition at line 838 of file grid_dist_amr.hpp.

◆ getGridIterator() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getGridIterator ( size_t  lvl) -> decltype(gd_array.get(lvl).getGridIterator())
inline

Get an iterator to the grid.

Returns
an iterator to the grid

Definition at line 451 of file grid_dist_amr.hpp.

◆ getGridIterator() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getGridIterator ( size_t  lvl,
grid_key_dx< dim > &  start,
grid_key_dx< dim > &  stop 
) -> decltype(gd_array.get(lvl).getGridIterator(start,stop))
inline

Get an iterator to the grid.

Returns
an iterator to the grid

Definition at line 461 of file grid_dist_amr.hpp.

◆ getGridIteratorCells()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getGridIteratorCells ( size_t  lvl) -> decltype(gd_array.get(lvl).getGridIterator())
inline

Get an iterator to the grid.

Returns
an iterator to the grid

Definition at line 485 of file grid_dist_amr.hpp.

◆ getLevel()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > & grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getLevel ( size_t  lvl)
inline

Get the underlying grid level.

Parameters
lvllevel
Returns
the grid level

Definition at line 375 of file grid_dist_amr.hpp.

◆ getNLvl()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
size_t grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getNLvl ( )
inline

Return the maximum number of levels in the AMR struct.

Returns
the number of levels

Definition at line 848 of file grid_dist_amr.hpp.

◆ getPos() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
Point< dim, St > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getPos ( const grid_dist_amr_key< dim > &  v1)
inline

Get the the position of the point.

Parameters
v1AMR point
Returns
the position in global coordinates

Definition at line 1000 of file grid_dist_amr.hpp.

◆ getPos() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
Point< dim, St > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getPos ( int  lvl,
const grid_dist_key_dx< dim > &  v1 
)
inline

Get the the position of the point.

Parameters
v1AMR point
Returns
the position in global coordinates

Definition at line 1012 of file grid_dist_amr.hpp.

◆ getSpacing()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
Point< dim, St > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::getSpacing ( size_t  lvl)
inline

return the spacing for the grid in the level lvl

Parameters
lvllevel
Returns
return the spacing

Definition at line 1024 of file grid_dist_amr.hpp.

◆ ghost_get()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<int... prp>
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::ghost_get ( size_t  opt = 0)
inline

It synchronize the ghost parts.

Template Parameters
prp...Properties to synchronize

Definition at line 761 of file grid_dist_amr.hpp.

◆ ghost_put()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<template< typename, typename > class op, int... prp>
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::ghost_put ( )
inline

Apply the ghost put.

Template Parameters
prp...Properties to apply ghost put

Definition at line 787 of file grid_dist_amr.hpp.

◆ initialize_other()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::initialize_other ( size_t  n_lvl,
size_t(&)  g_sz_lvl[dim] 
)
inlineprivate

Initialize the others levels.

Parameters
n_grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>lvlnumber of levels
g_sz_lvlgrid size on each level

Definition at line 178 of file grid_dist_amr.hpp.

◆ initLevels() [1/3]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::initLevels ( const Decomposition dec,
size_t  n_lvl,
const size_t(&)  g_sz[dim] 
)
inline

Initialize the amr grid.

Parameters
decDecomposition (this parameter is useful in case we want to constrain the AMR to an external decomposition)
n_lvlmaximum number of levels (0 mean no additional levels)
g_szcoarsest grid size on each direction

Definition at line 238 of file grid_dist_amr.hpp.

◆ initLevels() [2/3]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<typename TT >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::initLevels ( const Decomposition_encap< Decomposition, TT > &  dec,
size_t  n_lvl,
const size_t(&)  g_sz[dim] 
)
inline

Initialize the amr grid.

Parameters
decDecomposition (this parameter is useful in case we want to constrain the AMR to an external decomposition)
n_lvlmaximum number of levels (0 mean no additional levels)
g_szcoarsest grid size on each direction

Definition at line 259 of file grid_dist_amr.hpp.

◆ initLevels() [3/3]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::initLevels ( size_t  n_lvl,
const size_t(&)  g_sz[dim],
size_t  opt = 0 
)
inline

Initialize the amr grid.

Parameters
n_lvlmaximum number of levels (0 mean no additional levels)
g_szcoarsest grid size on each direction
optoptions

Definition at line 330 of file grid_dist_amr.hpp.

◆ insert() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<unsigned int p>
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::insert ( const grid_dist_amr_key< dim > &  v1) -> decltype(gd_array.get(v1.getLvl()).template insert<p>(v1.getKey()))
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 646 of file grid_dist_amr.hpp.

◆ insert() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<unsigned int p>
auto grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::insert ( size_t  lvl,
const grid_dist_key_dx< dim > &  v1 
) -> decltype(gd_array.get(lvl).template insert<p>(v1))
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 665 of file grid_dist_amr.hpp.

◆ map()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::map ( size_t  opt = 0)
inline

It move all the grid parts that do not belong to the local processor to the respective processor.

Definition at line 772 of file grid_dist_amr.hpp.

◆ moveDw()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_key_dx< dim > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::moveDw ( int  lvl,
const grid_dist_key_dx< dim > &  key 
)
inline

Move down (to finer level) the key.

Parameters
lvllevel
keymulti-resolution AMR key

Definition at line 884 of file grid_dist_amr.hpp.

◆ moveLvlDw()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::moveLvlDw ( grid_dist_amr_key< dim > &  key)
inline

Move down (to finer level) the key.

Parameters
keymulti-resolution AMR key

Definition at line 858 of file grid_dist_amr.hpp.

◆ moveLvlUp()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::moveLvlUp ( grid_dist_amr_key< dim > &  key)
inline

Move up (to coarser level) the key.

Parameters
keymulti-resolution AMR key

Definition at line 921 of file grid_dist_amr.hpp.

◆ moveUp()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
grid_dist_key_dx< dim > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::moveUp ( int  lvl,
const grid_dist_key_dx< dim > &  key 
)
inline

Move up (to coarser level) the key.

Parameters
lvllevel
keymulti-resolution AMR key

Definition at line 947 of file grid_dist_amr.hpp.

◆ recalculate_mvoff()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::recalculate_mvoff ( )
inline

Recalculate the offset array for the moveLvlUp and moveLvlDw.

Definition at line 269 of file grid_dist_amr.hpp.

◆ remove() [1/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::remove ( const grid_dist_amr_key< dim > &  v1)
inline

Remove a grid point (this function make sense only in case of sparse grid)

Parameters
v1grid_key that identify the element in the AMR grid to eleminate

Definition at line 696 of file grid_dist_amr.hpp.

◆ remove() [2/2]

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::remove ( size_t  lvl,
const grid_dist_key_dx< dim > &  v1 
)
inline

Remove a grid point (this function make sense only in case of sparse grid)

Parameters
v1grid_key that identify the element in the AMR grid to eleminate

Definition at line 710 of file grid_dist_amr.hpp.

◆ setBackgroundValue()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::setBackgroundValue ( T &  bv)
inline

set the background value

You can use this function make sense in case of sparse in case of dense it does nothing

Definition at line 811 of file grid_dist_amr.hpp.

◆ size_inserted()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
size_t grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::size_inserted ( size_t  lvl)
inline

Return the number of inserted points on a particular level.

Returns
the number of inserted points

Definition at line 800 of file grid_dist_amr.hpp.

◆ tagBoundaries()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
template<typename stencil_type >
void grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::tagBoundaries ( )
inline

construct level connections for padding particles

Template Parameters
stencil_typetype of stencil

Definition at line 746 of file grid_dist_amr.hpp.

◆ write()

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
bool grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::write ( std::string  output,
size_t  opt = VTK_WRITER | FORMAT_ASCII 
)
inline

Write on vtk file.

Parameters
outputfilename output

Definition at line 1055 of file grid_dist_amr.hpp.

Field Documentation

◆ bc

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
periodicity<dim> grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::bc
private

Boundary conditions of the structure.

Definition at line 142 of file grid_dist_amr.hpp.

◆ bck

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
T grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::bck
private

background level

Definition at line 170 of file grid_dist_amr.hpp.

◆ domain

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
Box<dim,St> grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::domain
private

Simulation domain.

Definition at line 136 of file grid_dist_amr.hpp.

◆ g_int

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
Ghost<dim,long int> grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::g_int
private

Ghost integer.

Definition at line 139 of file grid_dist_amr.hpp.

◆ gd_array

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
openfpm::vector<grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>, HeapMemory, memory_traits_lin, openfpm::grow_policy_identity,STD_VECTOR> grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::gd_array
private

array of grids

Definition at line 149 of file grid_dist_amr.hpp.

◆ git

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
openfpm::vector<grid_dist_iterator<dim,device_grid,device_sub_it,FREE> > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::git
private

Domain iterator for each distributed grid.

Definition at line 158 of file grid_dist_amr.hpp.

◆ git_g

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
openfpm::vector<grid_dist_iterator<dim,device_grid,device_it,FIXED> > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::git_g
private

Domain and ghost iterator for each distributed grid.

Definition at line 161 of file grid_dist_amr.hpp.

◆ git_sub

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
openfpm::vector<grid_dist_iterator_sub<dim,device_grid> > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::git_sub
private

Iterator for each distributed grid.

Definition at line 164 of file grid_dist_amr.hpp.

◆ mv_off

template<unsigned int dim, typename St , typename T , typename Decomposition , typename Memory , typename device_grid >
openfpm::vector<openfpm::vector<offset_mv<dim> > > grid_dist_amr< dim, St, T, AMR_IMPL_TRIVIAL, Decomposition, Memory, device_grid >::mv_off
private

Moving offsets.

Definition at line 167 of file grid_dist_amr.hpp.


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