# PhasicFlow: scatteredFieldAccess< T, MemorySpace > Class Template Reference
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

scatteredFieldAccess< T, MemorySpace > Class Template Reference

## Public Types

using | viewType = ViewType1D< T, MemorySpace >
using | device_type = typename viewType::device_type
using | memory_space = typename viewType::memory_space
using | execution_space = typename viewType::execution_space

## Public Member Functions

| scatteredFieldAccess ()
| scatteredFieldAccess (uint32 sz, const ViewType1D< uint32, memory_space > &ind, const ViewType1D< T, memory_space > &fVals)
| scatteredFieldAccess (const scatteredFieldAccess &)=default
| scatteredFieldAccess (scatteredFieldAccess &&)=default
scatteredFieldAccess & | operator= (const scatteredFieldAccess &)=default
scatteredFieldAccess & | operator= (scatteredFieldAccess &&)=default
| ~scatteredFieldAccess ()=default
INLINE_FUNCTION_HD T & | operator() (uint32 i)
const INLINE_FUNCTION_HD T & | operator() (uint32 i) const
INLINE_FUNCTION_HD T & | operator[] (uint32 i)
const INLINE_FUNCTION_HD T & | operator[] (uint32 i) const
const INLINE_FUNCTION_HD viewType & | field () const
INLINE_FUNCTION_HD viewType & | field ()
auto & | indices ()
const auto & | indices () const
INLINE_FUNCTION_HD uint32 | index (uint32 i) const
INLINE_FUNCTION_HD uint32 | size () const
INLINE_FUNCTION_HD bool | empty () const
T | getFirstCopy () const
T | getLastCopy () const

## Private Attributes

uint32 | size_ = 0
ViewType1D< uint32, memory_space > | indices_
viewType | fieldVals_

## Detailed Description

### template<typename T, typename MemorySpace = void>
class pFlow::scatteredFieldAccess< T, MemorySpace >

Definition at line 32 of file scatteredFieldAccess.hpp.

## Member Typedef Documentation

## viewType

using viewType = ViewType1D<T, MemorySpace>

Definition at line 36 of file scatteredFieldAccess.hpp.

## device_type

using device_type = typename viewType::device_type

Definition at line 38 of file scatteredFieldAccess.hpp.

## memory_space

using memory_space = typename viewType::memory_space

Definition at line 40 of file scatteredFieldAccess.hpp.

## execution_space

using execution_space = typename viewType::execution_space

Definition at line 42 of file scatteredFieldAccess.hpp.

## Constructor & Destructor Documentation

## scatteredFieldAccess() [1/4]

scatteredFieldAccess | ( |  | ) |

inline

Definition at line 54 of file scatteredFieldAccess.hpp.

## scatteredFieldAccess() [2/4]

scatteredFieldAccess | ( | uint32 | sz,
|  | const ViewType1D< uint32, memory_space > & | ind,
|  | const ViewType1D< T, memory_space > & | fVals
| ) |  |

inline

Definition at line 59 of file scatteredFieldAccess.hpp.

## scatteredFieldAccess() [3/4]

scatteredFieldAccess | ( | const scatteredFieldAccess< T, MemorySpace > & |  | ) |

default

## scatteredFieldAccess() [4/4]

scatteredFieldAccess | ( | scatteredFieldAccess< T, MemorySpace > && |  | ) |

default

## ~scatteredFieldAccess()

~scatteredFieldAccess | ( |  | ) |

default

## Member Function Documentation

## operator=() [1/2]

scatteredFieldAccess& operator= | ( | const scatteredFieldAccess< T, MemorySpace > & |  | ) |

default

## operator=() [2/2]

scatteredFieldAccess& operator= | ( | scatteredFieldAccess< T, MemorySpace > && |  | ) |

default

## operator()() [1/2]

INLINE_FUNCTION_HD T& operator() | ( | uint32 | i | ) |

inline

Definition at line 82 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::fieldVals_, and scatteredFieldAccess< T, MemorySpace >::indices_.

## operator()() [2/2]

const INLINE_FUNCTION_HD T& operator() | ( | uint32 | i | ) | const

inline

Definition at line 88 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::fieldVals_, and scatteredFieldAccess< T, MemorySpace >::indices_.

## operator[]() [1/2]

INLINE_FUNCTION_HD T& operator[] | ( | uint32 | i | ) |

inline

Definition at line 94 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::fieldVals_, and scatteredFieldAccess< T, MemorySpace >::indices_.

## operator[]() [2/2]

const INLINE_FUNCTION_HD T& operator[] | ( | uint32 | i | ) | const

inline

Definition at line 100 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::fieldVals_, and scatteredFieldAccess< T, MemorySpace >::indices_.

## field() [1/2]

const INLINE_FUNCTION_HD viewType& field | ( |  | ) | const

inline

Definition at line 106 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::fieldVals_.

Referenced by pFlow::periodicBoundarySIKernels::grainGrainInteraction(), and pFlow::periodicBoundarySIKernels::sphereSphereInteraction().

Here is the caller graph for this function:

## field() [2/2]

INLINE_FUNCTION_HD viewType& field | ( |  | ) |

inline

Definition at line 112 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::fieldVals_.

## indices() [1/2]

auto& indices | ( |  | ) |

inline

Definition at line 117 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::indices_.

## indices() [2/2]

const auto& indices | ( |  | ) | const

inline

Definition at line 122 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::indices_.

## index()

INLINE_FUNCTION_HD uint32 index | ( | uint32 | i | ) | const

inline

Definition at line 128 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::indices_.

Referenced by pFlow::periodicBoundarySIKernels::grainGrainInteraction(), and pFlow::periodicBoundarySIKernels::sphereSphereInteraction().

Here is the caller graph for this function:

## size()

INLINE_FUNCTION_HD uint32 size | ( |  | ) | const

inline

Definition at line 134 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::size_.

Referenced by pFlow::pweBndryContactSearchKernels::broadSearchPP(), ppwBndryContactSearch::buildList(), pFlow::pweBndryContactSearchKernels::buildNextHead(), pointFlag< DefaultHostExecutionSpace >::deletePoints(), wallBoundaryContactSearch::findPairsElementRangeCount(), and scatteredFieldAccess< T, MemorySpace >::getLastCopy().

Here is the caller graph for this function:

## empty()

INLINE_FUNCTION_HD bool empty | ( |  | ) | const

inline

Definition at line 140 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::size_.

Referenced by pFlow::pweBndryContactSearchKernels::broadSearchPP(), ppwBndryContactSearch::buildList(), pFlow::pweBndryContactSearchKernels::buildNextHead(), pointFlag< DefaultHostExecutionSpace >::deletePoints(), wallBoundaryContactSearch::findPairsElementRangeCount(), and scatteredFieldAccess< T, MemorySpace >::getLastCopy().

Here is the caller graph for this function:

## getFirstCopy()

T getFirstCopy | ( |  | ) | const

inline

Definition at line 145 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::fieldVals_, pFlow::getNth(), scatteredFieldAccess< T, MemorySpace >::indices_, and n.

Here is the call graph for this function:

## getLastCopy()

T getLastCopy | ( |  | ) | const

inline

Definition at line 153 of file scatteredFieldAccess.hpp.

References scatteredFieldAccess< T, MemorySpace >::empty(), scatteredFieldAccess< T, MemorySpace >::fieldVals_, pFlow::getNth(), scatteredFieldAccess< T, MemorySpace >::indices_, n, and scatteredFieldAccess< T, MemorySpace >::size().

Here is the call graph for this function:

## Member Data Documentation

## size_

uint32 size_ = 0

private

Definition at line 46 of file scatteredFieldAccess.hpp.

Referenced by scatteredFieldAccess< T, MemorySpace >::empty(), and scatteredFieldAccess< T, MemorySpace >::size().

## indices_

ViewType1D<uint32, memory_space> indices_

private

Definition at line 48 of file scatteredFieldAccess.hpp.

Referenced by scatteredFieldAccess< T, MemorySpace >::getFirstCopy(), scatteredFieldAccess< T, MemorySpace >::getLastCopy(), scatteredFieldAccess< T, MemorySpace >::index(), scatteredFieldAccess< T, MemorySpace >::indices(), scatteredFieldAccess< T, MemorySpace >::operator()(), and scatteredFieldAccess< T, MemorySpace >::operator[]().

## fieldVals_

viewType fieldVals_

private

Definition at line 50 of file scatteredFieldAccess.hpp.

Referenced by scatteredFieldAccess< T, MemorySpace >::field(), scatteredFieldAccess< T, MemorySpace >::getFirstCopy(), scatteredFieldAccess< T, MemorySpace >::getLastCopy(), scatteredFieldAccess< T, MemorySpace >::operator()(), and scatteredFieldAccess< T, MemorySpace >::operator[]().

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

- src/phasicFlow/structuredData/boundaries/boundaryBase/scatteredFieldAccess.hpp