OpenFPM  5.2.0
Project that contain the implementation of distributed structures
vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base > Class Template Reference

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_subset
 
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. More...
 
void update ()
 Update the subset indexes.
 
DecompositiongetDecomposition ()
 Get the decomposition. More...
 
const DecompositiongetDecomposition () const
 Get the decomposition. More...
 
size_t size_local () const
 return the local size of vector_dist_ws More...
 
size_t size_local_subset () const
 return the local size of the vector More...
 
auto getPos (size_t vec_key) -> decltype(vd.getPos(vec_key))
 Get the position of an element. More...
 
auto getPos (size_t vec_key) const -> decltype(vd.getPos(vec_key))
 Get the position of an element. More...
 
auto getPosSubset (size_t vec_key) -> decltype(vd.getPos(vec_key))
 Get the position of an element. More...
 
auto getPosSubset (size_t vec_key) const -> decltype(vd.getPos(vec_key))
 Get the position of an element. More...
 
template<unsigned int ... prp>
void hostToDeviceProp ()
 Move the memory from the device to host memory. More...
 
void hostToDevicePos ()
 Move the memory from the device to host memory. More...
 
template<unsigned int id>
auto getProp (size_t vec_key) -> decltype(vd.template getProp< id >(vec_key))
 Get the property of an element. More...
 
template<unsigned int id>
auto getProp (size_t vec_key) const -> decltype(vd.template getProp< id >(vec_key))
 Get the property of an element. More...
 
template<unsigned int id>
auto getPropSubset (size_t vec_key) -> decltype(vd.template getProp< id >(vec_key))
 Get the property of an element. More...
 
template<unsigned int id>
auto getPropSubset (size_t vec_key) const -> decltype(vd.template getProp< id >(vec_key))
 Get the property of an element. More...
 
vector_dist_iterator_subset getDomainIterator () const
 Get an iterator that traverse the particles in the domain. More...
 
template<typename CellL = CellList<dim, St, 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. More...
 
template<unsigned int opt = VL_NON_SYMMETRIC, typename VerletList_type = VerletList<dim,St,opt,Mem_fast<>,shift<dim,St>,typename std::remove_reference<decltype(vd.getPosVector())>::type>>
VerletList_type getVerlet (St r_cut, bool no_se3=false)
 Construct a Verlet List from the stored particles. More...
 
template<unsigned int opt, typename Mem_type , typename vPos_type >
void updateVerlet (VerletList< dim, St, opt, Mem_type, shift< dim, St >, vPos_type > &verletList, St r_cut, bool no_se3=false)
 Update an existing Verlet List. More...
 
bool isSubset () const
 Indicate that this class is not a subset. More...
 
template<typename CellL = CellList<dim, St, 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. More...
 
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. More...
 

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
 

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.

Member Function Documentation

◆ 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<dim, St, 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 422 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<dim, St, 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 530 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 402 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.

◆ 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 ( size_t  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
vector_dist_wsvec_key element
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 ( size_t  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
vector_dist_wsvec_key element
Returns
the position of the element in space

Definition at line 281 of file vector_dist_subset.hpp.

◆ getPosSubset() [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 >::getPosSubset ( size_t  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
vector_dist_subsetvec_key element
Returns
the position of the element in space

Definition at line 295 of file vector_dist_subset.hpp.

◆ getPosSubset() [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 >::getPosSubset ( size_t  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
vector_dist_subsetvec_key element
Returns
the position of the element in space

Definition at line 309 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 ( size_t  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
vector_dist_wsvec_key vector 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 ( size_t  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
vector_dist_wsvec_key vector element
Returns
return the selected property of the vector element

Definition at line 360 of file vector_dist_subset.hpp.

◆ getPropSubset() [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 >::getPropSubset ( size_t  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
vector_dist_subsetvec_key vector element
Returns
return the selected property of the vector element

Definition at line 375 of file vector_dist_subset.hpp.

◆ getPropSubset() [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 >::getPropSubset ( size_t  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
vector_dist_subsetvec_key vector element
Returns
return the selected property of the vector element

Definition at line 390 of file vector_dist_subset.hpp.

◆ getVerlet()

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 opt = VL_NON_SYMMETRIC, typename VerletList_type = VerletList<dim,St,opt,Mem_fast<>,shift<dim,St>,typename std::remove_reference<decltype(vd.getPosVector())>::type>>
VerletList_type vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::getVerlet ( St  r_cut,
bool  no_se3 = false 
)
inline

Construct a Verlet List from the stored particles.

Template Parameters
optVerlet List option flag
VerletList_typeVerlet List type to construct
Parameters
r_cutinteration radius, or size of each cell
no_se3avoid SE_CLASS3 checking
Returns
the Verlet List

Definition at line 451 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 330 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 320 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 508 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 596 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 vector_dist_ws

Returns
local size

Definition at line 241 of file vector_dist_subset.hpp.

◆ size_local_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>
size_t vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::size_local_subset ( ) const
inline

return the local size of the vector

Returns
local size

Definition at line 251 of file vector_dist_subset.hpp.

◆ updateVerlet()

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 opt, typename Mem_type , typename vPos_type >
void vector_dist_subset< dim, St, prop, Decomposition, Memory, layout_base >::updateVerlet ( VerletList< dim, St, opt, Mem_type, shift< dim, St >, vPos_type > &  verletList,
St  r_cut,
bool  no_se3 = false 
)
inline

Update an existing Verlet List.

Template Parameters
optVerlet List option flag
Mem_typeMemory type of the Verlet List
vPose_typePosition vector type of the Verlet List
Parameters
verletListVelet List to update
r_cutinteration radius, or size of each cell
Returns
the Verlet List

Definition at line 492 of file vector_dist_subset.hpp.


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