# PhasicFlow: pointFlag< ExecutionSpace > 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.

pointFlag< ExecutionSpace > Class Template Reference
Inheritance diagram for pointFlag< ExecutionSpace >:
[legend]
Collaboration diagram for pointFlag< ExecutionSpace >:
[legend]

## Public Member Functions

| pointFlag ()=default
| pointFlag (uint32 capacity, uint32 start, uint32 end)
| pointFlag (viewType flags, uint32 numActive, rangeU32 activeRange, bool isAllActive)
| pointFlag (const pointFlag &)=default
pointFlag & | operator= (const pointFlag &)=default
| pointFlag (pointFlag &&)=default
pointFlag & | operator= (pointFlag &&)=default
| ~pointFlag ()=default
INLINE_FUNCTION_HD bool | isAllActive () const
const INLINE_FUNCTION_HD auto & | activeRange () const
INLINE_FUNCTION_HD uint32 | capacity () const
INLINE_FUNCTION_HD auto | numActive () const
INLINE_FUNCTION_HD auto | leftSize () const
INLINE_FUNCTION_HD auto | rightSize () const
INLINE_FUNCTION_HD auto | bottomSize () const
INLINE_FUNCTION_HD auto | topSize () const
INLINE_FUNCTION_HD auto | rearSize () const
INLINE_FUNCTION_HD auto | frontSize () const
INLINE_FUNCTION_HD bool | operator() (uint32 i) const
INLINE_FUNCTION_HD bool | isActive (uint32 i) const
INLINE_FUNCTION_HD bool | isBoundary (uint8 flg) const
INLINE_FUNCTION_HD bool | isLeft (uint8 flg) const
INLINE_FUNCTION_HD bool | isRight (uint8 flg) const
INLINE_FUNCTION_HD bool | isBottom (uint8 flg) const
INLINE_FUNCTION_HD bool | isTop (uint8 flg) const
INLINE_FUNCTION_HD bool | isRear (uint8 flg) const
INLINE_FUNCTION_HD bool | isFront (uint8 flg) const
template<typename ExeSpace >
pointFlag< ExeSpace > | clone () const
ViewType1D< uint32, memory_space > | getActivePoints ()
ViewType1D< uint32, memory_space > | getEmptyPoints (uint32 numToGet) const
uint32 | markOutOfBoxDelete (const box &validBox, ViewType1D< realx3, memory_space > points)
| Loop over the active points and mark those out of the box and return number of deleted points. More...
uint32 | addInternalPoints (const ViewType1D< uint32, memory_space > &points)
bool | deletePoints (scatteredFieldAccess< uint32, memory_space > points)
bool | deletePoints (ViewType1D< uint32, memory_space > points)
bool | changeFlags (ViewType1D< uint32, memory_space > changePoints, uint32 boundaryIndex)
uint32 | markPointRegions (domain dm, ViewType1D< realx3, memory_space > points, real leftLength, real rightLength, real bottomLength, real topLength, real rearLength, real frontLength)
| mark points based on their position in the domain. More...
void | fillNeighborsLists (ViewType1D< uint32, memory_space > leftList, ViewType1D< uint32, memory_space > rightList, ViewType1D< uint32, memory_space > bottomList, ViewType1D< uint32, memory_space > topList, ViewType1D< uint32, memory_space > rearList, ViewType1D< uint32, memory_space > frontList)
| fill the lists for boundary faces. More...
uint32 | markDelete (const plane &pln, ViewType1D< realx3, memory_space > points, ViewType1D< uint32, memory_space > indices, ViewType1D< uint32, memory_space > onOff)
uint32 | changeCapacity (uint32 reqEmptySpots)

## Protected Member Functions

uint8 | getBoundaryFlag (uint32 index) const
void | resetFlags (uint32 cap, uint32 start, uint32 end)

## Protected Attributes

viewType | flags_
uint32 | numActive_ = 0
rangeU32 | activeRange_ = {0,0}
bool | isAllActive_ = false
uint32 | nLeft_ = 0
uint32 | nRight_ = 0
uint32 | nBottom_ = 0
uint32 | nTop_ = 0
uint32 | nRear_ = 0
uint32 | nFront_ = 0

## Private Types

enum | Flag : uint8 { DELETED = 1, INTERNAL = 2, LEFT = 4, RIGHT = 8, BOTTOM = 16, TOP = 32, REAR = 64, FRONT = 128 }
using | execution_space = ExecutionSpace
using | memory_space = typename execution_space::memory_space
using | viewType = ViewType1D< uint8, memory_space >
using | device_type = typename viewType::device_type
using | rPolicy = Kokkos::RangePolicy< execution_space, Kokkos::IndexType< uint32 > >

## Friends

class | internalPoints

## Detailed Description

### template<typename ExecutionSpace>
class pFlow::pointFlag< ExecutionSpace >

Definition at line 32 of file pointFlag.hpp.

## Member Typedef Documentation

## execution_space

using execution_space = ExecutionSpace

private

Definition at line 46 of file pointFlag.hpp.

## memory_space

using memory_space = typename execution_space::memory_space

private

Definition at line 48 of file pointFlag.hpp.

## viewType

using viewType = ViewType1D<uint8, memory_space>

private

Definition at line 50 of file pointFlag.hpp.

## device_type

using device_type = typename viewType::device_type

private

Definition at line 52 of file pointFlag.hpp.

## rPolicy

using rPolicy = Kokkos::RangePolicy< execution_space, Kokkos::IndexType<uint32> >

private

Definition at line 56 of file pointFlag.hpp.

## Member Enumeration Documentation

## Flag

enum Flag : uint8

private

Enumerator
DELETED |
INTERNAL |
LEFT |
RIGHT |
BOTTOM |
TOP |
REAR |
FRONT |

Definition at line 34 of file pointFlag.hpp.

## Constructor & Destructor Documentation

## pointFlag() [1/5]

pointFlag | ( |  | ) |

default

## pointFlag() [2/5]

pointFlag | ( | uint32 | capacity,
|  | uint32 | start,
|  | uint32 | end
| ) |  |

inline

Definition at line 139 of file pointFlag.hpp.

## pointFlag() [3/5]

pointFlag | ( | viewType | flags,
|  | uint32 | numActive,
|  | rangeU32 | activeRange,
|  | bool | isAllActive
| ) |  |

inline

Definition at line 150 of file pointFlag.hpp.

## pointFlag() [4/5]

pointFlag | ( | const pointFlag< ExecutionSpace > & |  | ) |

default

## pointFlag() [5/5]

pointFlag | ( | pointFlag< ExecutionSpace > && |  | ) |

default

## ~pointFlag()

~pointFlag | ( |  | ) |

default

## Member Function Documentation

## getBoundaryFlag()

uint8 getBoundaryFlag | ( | uint32 | index | ) | const

inlineprotected

Definition at line 84 of file pointFlag.hpp.

## resetFlags()

void resetFlags | ( | uint32 | cap,
|  | uint32 | start,
|  | uint32 | end
| ) |  |

inlineprotected

Definition at line 113 of file pointFlag.hpp.

## operator=() [1/2]

pointFlag& operator= | ( | const pointFlag< ExecutionSpace > & |  | ) |

default

## operator=() [2/2]

pointFlag& operator= | ( | pointFlag< ExecutionSpace > && |  | ) |

default

## isAllActive()

INLINE_FUNCTION_HD bool isAllActive | ( |  | ) | const

inline

Definition at line 173 of file pointFlag.hpp.

Referenced by pFlow::sphereParticlesKernels::acceleration(), pFlow::grainParticlesKernels::acceleration(), pFlow::mapperNBSKernels::buildLists(), pFlow::mapperNBSKernels::buildListsReduce(), and internalPoints::isAllActive().

Here is the caller graph for this function:

## activeRange()

const INLINE_FUNCTION_HD auto& activeRange | ( |  | ) | const

inline

Definition at line 179 of file pointFlag.hpp.

Referenced by pFlow::sphereParticlesKernels::acceleration(), pFlow::grainParticlesKernels::acceleration(), internalPoints::activeRange(), pFlow::sphereParticlesKernels::addMassDiamInertiaProp(), pFlow::grainParticlesKernels::addMassDiamInertiaProp(), cellMapper::build(), mapperNBS::build(), pFlow::mapperNBSKernels::buildLists(), pFlow::mapperNBSKernels::buildListsReduce(), cellMapper::cellMapper(), pFlow::fillSequence(), pFlow::mapperNBSKernels::findPointExtends(), pFlow::getSortedIndices(), pFlow::AB2Kernels::intScattered(), mapperNBS::mapperNBS(), pFlow::max(), pFlow::min(), and pFlow::minMax().

Here is the caller graph for this function:

## capacity()

INLINE_FUNCTION_HD uint32 capacity | ( |  | ) | const

inline

Definition at line 185 of file pointFlag.hpp.

Referenced by internalPoints::capacity(), pointFlag< DefaultHostExecutionSpace >::pointFlag(), and pointFlag< DefaultHostExecutionSpace >::resetFlags().

Here is the caller graph for this function:

## numActive()

INLINE_FUNCTION_HD auto numActive | ( |  | ) | const

inline

Definition at line 191 of file pointFlag.hpp.

Referenced by pFlow::mapperNBSKernels::findPointExtends(), pFlow::getSortedIndices(), and internalPoints::numActive().

Here is the caller graph for this function:

## leftSize()

INLINE_FUNCTION_HD auto leftSize | ( |  | ) | const

inline

Definition at line 197 of file pointFlag.hpp.

## rightSize()

INLINE_FUNCTION_HD auto rightSize | ( |  | ) | const

inline

Definition at line 203 of file pointFlag.hpp.

## bottomSize()

INLINE_FUNCTION_HD auto bottomSize | ( |  | ) | const

inline

Definition at line 209 of file pointFlag.hpp.

## topSize()

INLINE_FUNCTION_HD auto topSize | ( |  | ) | const

inline

Definition at line 215 of file pointFlag.hpp.

## rearSize()

INLINE_FUNCTION_HD auto rearSize | ( |  | ) | const

inline

Definition at line 221 of file pointFlag.hpp.

## frontSize()

INLINE_FUNCTION_HD auto frontSize | ( |  | ) | const

inline

Definition at line 227 of file pointFlag.hpp.

## operator()()

INLINE_FUNCTION_HD bool operator() | ( | uint32 | i | ) | const

inline

Definition at line 234 of file pointFlag.hpp.

## isActive()

INLINE_FUNCTION_HD bool isActive | ( | uint32 | i | ) | const

inline

Definition at line 240 of file pointFlag.hpp.

Referenced by pFlow::getSortedIndices(), and pointFlag< DefaultHostExecutionSpace >::operator()().

Here is the caller graph for this function:

## isBoundary()

INLINE_FUNCTION_HD bool isBoundary | ( | uint8 | flg | ) | const

inline

Definition at line 247 of file pointFlag.hpp.

## isLeft()

INLINE_FUNCTION_HD bool isLeft | ( | uint8 | flg | ) | const

inline

Definition at line 254 of file pointFlag.hpp.

## isRight()

INLINE_FUNCTION_HD bool isRight | ( | uint8 | flg | ) | const

inline

Definition at line 260 of file pointFlag.hpp.

## isBottom()

INLINE_FUNCTION_HD bool isBottom | ( | uint8 | flg | ) | const

inline

Definition at line 267 of file pointFlag.hpp.

## isTop()

INLINE_FUNCTION_HD bool isTop | ( | uint8 | flg | ) | const

inline

Definition at line 273 of file pointFlag.hpp.

## isRear()

INLINE_FUNCTION_HD bool isRear | ( | uint8 | flg | ) | const

inline

Definition at line 279 of file pointFlag.hpp.

## isFront()

INLINE_FUNCTION_HD bool isFront | ( | uint8 | flg | ) | const

inline

Definition at line 285 of file pointFlag.hpp.

## clone()

pointFlag<ExeSpace> clone | ( |  | ) | const

inline

Definition at line 291 of file pointFlag.hpp.

Referenced by internalPoints::syncPFlag().

Here is the caller graph for this function:

## getActivePoints()

pFlow::ViewType1D< pFlow::uint32, typename pFlow::pointFlag< ExecutionSpace >::memory_space > getActivePoints

Definition at line 25 of file pointFlagKernels.hpp.

## getEmptyPoints()

pFlow::ViewType1D< pFlow::uint32, typename pFlow::pointFlag< ExecutionSpace >::memory_space > getEmptyPoints | ( | uint32 | numToGet | ) | const

Definition at line 55 of file pointFlagKernels.hpp.

## markOutOfBoxDelete()

pFlow::uint32 markOutOfBoxDelete | ( | const box & | validBox,
|  | ViewType1D< realx3, memory_space > | points
| ) |  |

Loop over the active points and mark those out of the box and return number of deleted points.

Parameters

  validBox | the box whose inside is valid
  points | list of all points

Returns
  number of deleted points

Definition at line 102 of file pointFlagKernels.hpp.

## addInternalPoints()

pFlow::uint32 addInternalPoints | ( | const ViewType1D< uint32, memory_space > & | points | ) |

Definition at line 174 of file pointFlagKernels.hpp.

## deletePoints() [1/2]

bool deletePoints | ( | scatteredFieldAccess< uint32, memory_space > | points | ) |

Definition at line 221 of file pointFlagKernels.hpp.

## deletePoints() [2/2]

bool deletePoints | ( | ViewType1D< uint32, memory_space > | points | ) |

Definition at line 263 of file pointFlagKernels.hpp.

## changeFlags()

bool changeFlags | ( | ViewType1D< uint32, memory_space > | changePoints,
|  | uint32 | boundaryIndex
| ) |  |

Definition at line 308 of file pointFlagKernels.hpp.

## markPointRegions()

pFlow::uint32 markPointRegions | ( | domain | dm,
|  | ViewType1D< realx3, memory_space > | points,
|  | real | leftLength,
|  | real | rightLength,
|  | real | bottomLength,
|  | real | topLength,
|  | real | rearLength,
|  | real | frontLength
| ) |  |

mark points based on their position in the domain.

This should be the first method to be called when updating boundaries (step 1 of 2).

Parameters

  dm | the domain for which particles are tested
  points | list of points
  leftLength | neighbor length of the left face
  rightLength | neighbor length of the right face
  bottomLength | neighbor length of the bottom face
  topLength | neighbor length of the top face
  rearLength | neighbor length of the rear face
  frontLength | neighbor length of the front face

Returns
  number of deleted points

Definition at line 330 of file pointFlagKernels.hpp.

## fillNeighborsLists()

void fillNeighborsLists | ( | ViewType1D< uint32, memory_space > | leftList,
|  | ViewType1D< uint32, memory_space > | rightList,
|  | ViewType1D< uint32, memory_space > | bottomList,
|  | ViewType1D< uint32, memory_space > | topList,
|  | ViewType1D< uint32, memory_space > | rearList,
|  | ViewType1D< uint32, memory_space > | frontList
| ) |  |

fill the lists for boundary faces.

Lists keep the index of particles in the neighborhood of the faces. This mehtod is called after markPointRegions (step 2 of 2).

Parameters

  leftList | neighbor list of the left face
  rightList | neighbor list of the right face
  bottomList | neighbor list of the bottom face
  topList | neighbor list of the top face
  rearList | neighbor list of the rear face
  frontList | neighbor list of the front face

Definition at line 467 of file pointFlagKernels.hpp.

## markDelete()

pFlow::uint32 markDelete | ( | const plane & | pln,
|  | ViewType1D< realx3, memory_space > | points,
|  | ViewType1D< uint32, memory_space > | indices,
|  | ViewType1D< uint32, memory_space > | onOff
| ) |  |

Definition at line 510 of file pointFlagKernels.hpp.

## changeCapacity()

pFlow::uint32 changeCapacity | ( | uint32 | reqEmptySpots | ) |

Definition at line 582 of file pointFlagKernels.hpp.

## Friends And Related Function Documentation

## internalPoints

friend class internalPoints

friend

Definition at line 60 of file pointFlag.hpp.

## Member Data Documentation

## flags_

viewType flags_

protected

Definition at line 62 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::capacity(), pointFlag< DefaultHostExecutionSpace >::clone(), pointFlag< DefaultHostExecutionSpace >::isActive(), pointFlag< DefaultHostExecutionSpace >::pointFlag(), and pointFlag< DefaultHostExecutionSpace >::resetFlags().

## numActive_

uint32 numActive_ = 0

protected

Definition at line 64 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::clone(), pointFlag< DefaultHostExecutionSpace >::numActive(), and pointFlag< DefaultHostExecutionSpace >::resetFlags().

## activeRange_

rangeU32 activeRange_ = {0,0}

protected

Definition at line 66 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::activeRange(), pointFlag< DefaultHostExecutionSpace >::clone(), pointFlag< DefaultHostExecutionSpace >::pointFlag(), pointFlag< DefaultHostExecutionSpace >::resetFlags(), and internalPoints::size().

## isAllActive_

bool isAllActive_ = false

protected

Definition at line 68 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::clone(), pointFlag< DefaultHostExecutionSpace >::isAllActive(), and pointFlag< DefaultHostExecutionSpace >::resetFlags().

## nLeft_

uint32 nLeft_ = 0

protected

Definition at line 70 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::leftSize(), and pointFlag< DefaultHostExecutionSpace >::resetFlags().

## nRight_

uint32 nRight_ = 0

protected

Definition at line 72 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::resetFlags(), and pointFlag< DefaultHostExecutionSpace >::rightSize().

## nBottom_

uint32 nBottom_ = 0

protected

Definition at line 74 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::bottomSize(), and pointFlag< DefaultHostExecutionSpace >::resetFlags().

## nTop_

uint32 nTop_ = 0

protected

Definition at line 76 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::resetFlags(), and pointFlag< DefaultHostExecutionSpace >::topSize().

## nRear_

uint32 nRear_ = 0

protected

Definition at line 78 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::rearSize(), and pointFlag< DefaultHostExecutionSpace >::resetFlags().

## nFront_

uint32 nFront_ = 0

protected

Definition at line 80 of file pointFlag.hpp.

Referenced by pointFlag< DefaultHostExecutionSpace >::frontSize(), and pointFlag< DefaultHostExecutionSpace >::resetFlags().

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

- src/phasicFlow/structuredData/pointStructure/internalPoints/pointFlag.hpp
- src/phasicFlow/structuredData/pointStructure/internalPoints/pointFlagKernels.hpp