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

Detailed Description

template<unsigned int dim, typename St, typename prop, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
class vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >

Definition at line 83 of file vector_dist_subset.hpp.

Public Types

typedef ivector_dist::value_type value_type
 property object
 
typedef ivector_dist::Decomposition_type Decomposition_type
 
typedef ivector_dist::CellList_type CellList_type
 
typedef ivector_dist::stype stype
 space type
 
typedef int yes_i_am_vector_dist
 
typedef std::integral_constant< bool, true > is_it_a_subset
 Subset detection.
 

Public Member Functions

 vector_dist_subset (vector_dist_ws< dim, St, prop, Decomposition, Memory, layout_base > &vd, int sub_id)
 
void ghost_get_subset ()
 
openfpm::vector< aggregate< int > > & getIds ()
 Return the ids.
 
void update ()
 Update the subset indexes.
 
DecompositiongetDecomposition ()
 Get the decomposition.
 
const DecompositiongetDecomposition () const
 Get the decomposition.
 
size_t size_local () const
 return the local size of the vector
 
size_t size_local_orig () const
 return the local size of the original vector
 
auto getPos (vect_dist_key_dx vec_key) -> decltype(vd.getPos(vec_key))
 Get the position of an element.
 
auto getPos (vect_dist_key_dx vec_key) const -> decltype(vd.getPos(vec_key))
 Get the position of an element.
 
template<unsigned int ... prp>
void hostToDeviceProp ()
 Move the memory from the device to host memory.
 
void hostToDevicePos ()
 Move the memory from the device to host memory.
 
auto getPosOrig (vect_dist_key_dx vec_key) -> decltype(vd.getPos(vec_key))
 Get the position of an element.
 
auto getPosOrig (vect_dist_key_dx vec_key) const -> decltype(vd.getPos(vec_key))
 Get the position of an element.
 
template<unsigned int id>
auto getProp (vect_dist_key_dx vec_key) -> decltype(vd.template getProp< id >(vec_key))
 Get the property of an element.
 
template<unsigned int id>
auto getProp (vect_dist_key_dx vec_key) const -> decltype(vd.template getProp< id >(vec_key))
 Get the property of an element.
 
vect_dist_key_dx getOriginKey (vect_dist_key_dx vec_key)
 
vector_dist_iterator_subset getDomainIterator () const
 Get an iterator that traverse the particles in the domain.
 
template<typename CellL = CellList_gen<dim, St, Process_keys_lin, Mem_fast<>, shift<dim, St>, typename std::remove_reference<decltype(vd.getPosVector())>::type >>
CellL getCellList (St r_cut, bool no_se3=false)
 Construct a cell list starting from the stored particles.
 
bool isSubset () const
 Indicate that this class is not a subset.
 
template<typename CellL = CellList_gen<dim, St, Process_keys_lin, Mem_fast<>, shift<dim, St> >>
CellL getCellList (St r_cut, const Ghost< dim, St > &enlarge, bool no_se3=false)
 Construct a cell list starting from the stored particles.
 
vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base > & operator= (const vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base > &v)
 Operator= for distributed vector.
 

Static Public Attributes

static const unsigned int dims = ivector_dist::dims
 dimensions of space
 

Private Types

typedef vector_dist_ws< dim, St, prop, Decomposition, Memory, layout_base > ivector_dist
 
typedef boost::mpl::int_< AggregateAppend< int, prop >::type::max_prop-1 > flag_prop
 

Private Member Functions

void check_gm ()
 

Private Attributes

ivector_distvd
 
openfpm::vector< aggregate< int > > pid
 
size_t sub_id
 

Member Typedef Documentation

◆ CellList_type

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
typedef ivector_dist::CellList_type vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::CellList_type

Definition at line 119 of file vector_dist_subset.hpp.

◆ Decomposition_type

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
typedef ivector_dist::Decomposition_type vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::Decomposition_type

Definition at line 117 of file vector_dist_subset.hpp.

◆ flag_prop

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
typedef boost::mpl::int_<AggregateAppend<int,prop>::type::max_prop-1> vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::flag_prop
private

Definition at line 87 of file vector_dist_subset.hpp.

◆ is_it_a_subset

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
typedef std::integral_constant<bool,true> vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::is_it_a_subset

Subset detection.

Definition at line 131 of file vector_dist_subset.hpp.

◆ ivector_dist

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
typedef vector_dist_ws<dim,St,prop,Decomposition,Memory,layout_base> vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::ivector_dist
private

Definition at line 85 of file vector_dist_subset.hpp.

◆ stype

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
typedef ivector_dist::stype vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::stype

space type

Definition at line 122 of file vector_dist_subset.hpp.

◆ value_type

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
typedef ivector_dist::value_type vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::value_type

property object

Definition at line 115 of file vector_dist_subset.hpp.

◆ yes_i_am_vector_dist

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
typedef int vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::yes_i_am_vector_dist

Definition at line 128 of file vector_dist_subset.hpp.

Constructor & Destructor Documentation

◆ vector_dist_subset()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::vector_dist_subset ( vector_dist_ws< dim, St, prop, Decomposition, Memory, layout_base > &  vd,
int  sub_id 
)
inline

Definition at line 133 of file vector_dist_subset.hpp.

Member Function Documentation

◆ check_gm()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
void vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::check_gm ( )
inlineprivate

Definition at line 99 of file vector_dist_subset.hpp.

◆ getCellList() [1/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
template<typename CellL = CellList_gen<dim, St, Process_keys_lin, Mem_fast<>, shift<dim, St>, typename std::remove_reference<decltype(vd.getPosVector())>::type >>
CellL vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getCellList ( St  r_cut,
bool  no_se3 = false 
)
inline

Construct a cell list starting from the stored particles.

Template Parameters
CellLCellList type to construct
Parameters
r_cutinteration radius, or size of each cell
no_se3avoid SE_CLASS3 checking
Returns
the Cell list

Definition at line 398 of file vector_dist_subset.hpp.

◆ getCellList() [2/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
template<typename CellL = CellList_gen<dim, St, Process_keys_lin, Mem_fast<>, shift<dim, St> >>
CellL vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getCellList ( St  r_cut,
const Ghost< dim, St > &  enlarge,
bool  no_se3 = false 
)
inline

Construct a cell list starting from the stored particles.

It differ from the get getCellList for an additional parameter, in case the domain + ghost is not big enough to contain additional padding particles, a Cell list with bigger space can be created (padding particles in general are particles added by the user out of the domains)

Template Parameters
CellLCellList type to construct
Parameters
r_cutinteration radius, or size of each cell
enlargeIn case of padding particles the cell list must be enlarged, like a ghost this parameter say how much must be enlarged
no_se3avoid se_class3 cheking default false
Returns
the CellList

Definition at line 439 of file vector_dist_subset.hpp.

◆ getDecomposition() [1/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
Decomposition & vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getDecomposition ( )
inline

Get the decomposition.

Returns

Definition at line 221 of file vector_dist_subset.hpp.

◆ getDecomposition() [2/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
const Decomposition & vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getDecomposition ( ) const
inline

Get the decomposition.

Returns

Definition at line 231 of file vector_dist_subset.hpp.

◆ getDomainIterator()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
vector_dist_iterator_subset vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getDomainIterator ( ) const
inline

Get an iterator that traverse the particles in the domain.

Returns
an iterator

Definition at line 378 of file vector_dist_subset.hpp.

◆ getIds()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
openfpm::vector< aggregate< int > > & vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getIds ( )
inline

Return the ids.

Returns
the ids of the subset

Definition at line 170 of file vector_dist_subset.hpp.

◆ getOriginKey()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
vect_dist_key_dx vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getOriginKey ( vect_dist_key_dx  vec_key)
inline

Definition at line 366 of file vector_dist_subset.hpp.

◆ getPos() [1/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
auto vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getPos ( vect_dist_key_dx  vec_key) -> decltype(vd.getPos(vec_key))
inline

Get the position of an element.

see the vector_dist iterator usage to get an element key

Parameters
vec_keyelement
Returns
the position of the element in space

Definition at line 267 of file vector_dist_subset.hpp.

◆ getPos() [2/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
auto vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getPos ( vect_dist_key_dx  vec_key) const -> decltype(vd.getPos(vec_key))
inline

Get the position of an element.

see the vector_dist iterator usage to get an element key

Parameters
vec_keyelement
Returns
the position of the element in space

Definition at line 281 of file vector_dist_subset.hpp.

◆ getPosOrig() [1/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
auto vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getPosOrig ( vect_dist_key_dx  vec_key) -> decltype(vd.getPos(vec_key))
inline

Get the position of an element.

see the vector_dist iterator usage to get an element key

Parameters
vec_keyelement
Returns
the position of the element in space

Definition at line 316 of file vector_dist_subset.hpp.

◆ getPosOrig() [2/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
auto vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getPosOrig ( vect_dist_key_dx  vec_key) const -> decltype(vd.getPos(vec_key))
inline

Get the position of an element.

see the vector_dist iterator usage to get an element key

Parameters
vec_keyelement
Returns
the position of the element in space

Definition at line 330 of file vector_dist_subset.hpp.

◆ getProp() [1/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
template<unsigned int id>
auto vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getProp ( vect_dist_key_dx  vec_key) -> decltype(vd.template getProp<id>(vec_key))
inline

Get the property of an element.

see the vector_dist iterator usage to get an element key

Template Parameters
idproperty id
Parameters
vec_keyvector element
Returns
return the selected property of the vector element

Definition at line 345 of file vector_dist_subset.hpp.

◆ getProp() [2/2]

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
template<unsigned int id>
auto vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getProp ( vect_dist_key_dx  vec_key) const -> decltype(vd.template getProp<id>(vec_key))
inline

Get the property of an element.

see the vector_dist iterator usage to get an element key

Template Parameters
idproperty id
Parameters
vec_keyvector element
Returns
return the selected property of the vector element

Definition at line 360 of file vector_dist_subset.hpp.

◆ ghost_get_subset()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
void vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::ghost_get_subset ( )
inline

Definition at line 160 of file vector_dist_subset.hpp.

◆ hostToDevicePos()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
void vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::hostToDevicePos ( )
inline

Move the memory from the device to host memory.

Template Parameters
propertyto move use POS_PROP for position property

Definition at line 302 of file vector_dist_subset.hpp.

◆ hostToDeviceProp()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
template<unsigned int ... prp>
void vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::hostToDeviceProp ( )
inline

Move the memory from the device to host memory.

Template Parameters
propertyto move use POS_PROP for position property

Definition at line 292 of file vector_dist_subset.hpp.

◆ isSubset()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
bool vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::isSubset ( ) const
inline

Indicate that this class is not a subset.

Returns
false

Definition at line 417 of file vector_dist_subset.hpp.

◆ operator=()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base > & vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::operator= ( const vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base > &  v)
inline

Operator= for distributed vector.

Parameters
vvector to copy
Returns
itself

Definition at line 505 of file vector_dist_subset.hpp.

◆ size_local()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
size_t vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::size_local ( ) const
inline

return the local size of the vector

Returns
local size

Definition at line 241 of file vector_dist_subset.hpp.

◆ size_local_orig()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
size_t vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::size_local_orig ( ) const
inline

return the local size of the original vector

Returns
local size

Definition at line 251 of file vector_dist_subset.hpp.

◆ update()

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
void vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::update ( )
inline

Update the subset indexes.

Definition at line 188 of file vector_dist_subset.hpp.

Field Documentation

◆ dims

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
const unsigned int vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::dims = ivector_dist::dims
static

dimensions of space

Definition at line 125 of file vector_dist_subset.hpp.

◆ pid

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
openfpm::vector<aggregate<int> > vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::pid
private

Definition at line 91 of file vector_dist_subset.hpp.

◆ sub_id

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
size_t vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::sub_id
private

Definition at line 93 of file vector_dist_subset.hpp.

◆ vd

template<unsigned int dim, typename St , typename prop , typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, template< typename > class layout_base = memory_traits_lin>
ivector_dist& vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::vd
private

Definition at line 89 of file vector_dist_subset.hpp.


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