# PhasicFlow: bitsetHD< blockType, 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.

bitsetHD< blockType, MemorySpace > Class Template Reference

## Public Types

using | BlockType = blockType
using | blockViewType = Kokkos::View< BlockType *, Kokkos::LayoutLeft, MemorySpace >
using | deviceType = typename blockViewType::device_type
using | memory_space = typename blockViewType::memory_space
using | execution_space = typename blockViewType::execution_space

## Public Member Functions

| bitsetHD (const word &name, int32 numBits)
| bitsetHD (const bitsetHD &)=default
| bitsetHD (bitsetHD &&)=default
bitsetHD & | operator= (const bitsetHD &)=default
bitsetHD & | operator= (bitsetHD &&)=default
void | set ()
void | reset ()
void | clear ()
INLINE_FUNCTION_HD void | set (int32 pos) const
INLINE_FUNCTION_HD void | unset (int32 pos) const
INLINE_FUNCTION_HD void | reset (int32 pos) const
INLINE_FUNCTION_HD void | flip (int32 pos) const
INLINE_FUNCTION_HD bool | isSet (int32 pos) const
INLINE_FUNCTION_HD bool | isUnset (int32 pos) const
INLINE_FUNCTION_HD bool | isSetReset (int32 pos) const
INLINE_FUNCTION_HD int32 | numBlocks () const
INLINE_FUNCTION_HD int32 | numBits () const
INLINE_FUNCTION_HD int32 | size () const
INLINE_FUNCTION_HD int32 | capacity () const
INLINE_FUNCTION_H void | realloc (int32 numBits)

## Static Protected Member Functions

static INLINE_FUNCTION_HD int32 | blockIndex (int32 pos)
static INLINE_FUNCTION_HD BlockType | bitIndex (int32 pos)
static INLINE_FUNCTION_HD BlockType | blockMask (int32 pos)
static INLINE_FUNCTION_HD int32 | calculateBlockSize (int32 numBits)

## Protected Attributes

int32 | numBlocks_
int32 | numBits_
blockViewType | blocks_

## Static Protected Attributes

const static int32 | bitsPerBlock_ = std::numeric_limits<BlockType>::digits
const static int32 | blockMask_ = bitsPerBlock_ - 1

## Detailed Description

### template<typename blockType, typename MemorySpace = void>
class pFlow::bitsetHD< blockType, MemorySpace >

Definition at line 37 of file bitsetHD.hpp.

## Member Typedef Documentation

## BlockType

using BlockType = blockType

Definition at line 41 of file bitsetHD.hpp.

## blockViewType

using blockViewType = Kokkos::View<BlockType*, Kokkos::LayoutLeft, MemorySpace>

Definition at line 43 of file bitsetHD.hpp.

## deviceType

using deviceType = typename blockViewType::device_type

Definition at line 45 of file bitsetHD.hpp.

## memory_space

using memory_space = typename blockViewType::memory_space

Definition at line 47 of file bitsetHD.hpp.

## execution_space

using execution_space = typename blockViewType::execution_space

Definition at line 49 of file bitsetHD.hpp.

## Constructor & Destructor Documentation

## bitsetHD() [1/3]

bitsetHD | ( | const word & | name,
|  | int32 | numBits
| ) |  |

inline

Definition at line 93 of file bitsetHD.hpp.

## bitsetHD() [2/3]

bitsetHD | ( | const bitsetHD< blockType, MemorySpace > & |  | ) |

default

## bitsetHD() [3/3]

bitsetHD | ( | bitsetHD< blockType, MemorySpace > && |  | ) |

default

## Member Function Documentation

## blockIndex()

static INLINE_FUNCTION_HD int32 blockIndex | ( | int32 | pos | ) |

inlinestaticprotected

Definition at line 66 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::bitsPerBlock_.

Referenced by bitsetHD< blockType, MemorySpace >::flip(), bitsetHD< blockType, MemorySpace >::isSet(), bitsetHD< blockType, MemorySpace >::isSetReset(), bitsetHD< blockType, MemorySpace >::set(), and bitsetHD< blockType, MemorySpace >::unset().

Here is the caller graph for this function:

## bitIndex()

static INLINE_FUNCTION_HD BlockType bitIndex | ( | int32 | pos | ) |

inlinestaticprotected

Definition at line 72 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::bitsPerBlock_.

## blockMask()

static INLINE_FUNCTION_HD BlockType blockMask | ( | int32 | pos | ) |

inlinestaticprotected

Definition at line 78 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blockMask_.

Referenced by bitsetHD< blockType, MemorySpace >::flip(), bitsetHD< blockType, MemorySpace >::isSet(), bitsetHD< blockType, MemorySpace >::isSetReset(), bitsetHD< blockType, MemorySpace >::set(), and bitsetHD< blockType, MemorySpace >::unset().

Here is the caller graph for this function:

## calculateBlockSize()

static INLINE_FUNCTION_HD int32 calculateBlockSize | ( | int32 | numBits | ) |

inlinestaticprotected

Definition at line 84 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::bitsPerBlock_, and bitsetHD< blockType, MemorySpace >::numBits().

Referenced by bitsetHD< blockType, MemorySpace >::realloc().

Here is the call graph for this function:
Here is the caller graph for this function:

## operator=() [1/2]

bitsetHD& operator= | ( | const bitsetHD< blockType, MemorySpace > & |  | ) |

default

## operator=() [2/2]

bitsetHD& operator= | ( | bitsetHD< blockType, MemorySpace > && |  | ) |

default

## set() [1/2]

void set | ( |  | ) |

inline

Definition at line 110 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blocks_.

## reset() [1/2]

void reset | ( |  | ) |

inline

Definition at line 115 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blocks_.

## clear()

void clear | ( |  | ) |

inline

Definition at line 120 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blocks_.

## set() [2/2]

INLINE_FUNCTION_HD void set | ( | int32 | pos | ) | const

inline

Definition at line 126 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blockIndex(), bitsetHD< blockType, MemorySpace >::blockMask(), and bitsetHD< blockType, MemorySpace >::blocks_.

Here is the call graph for this function:

## unset()

INLINE_FUNCTION_HD void unset | ( | int32 | pos | ) | const

inline

Definition at line 133 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blockIndex(), bitsetHD< blockType, MemorySpace >::blockMask(), and bitsetHD< blockType, MemorySpace >::blocks_.

Referenced by bitsetHD< blockType, MemorySpace >::reset().

Here is the call graph for this function:
Here is the caller graph for this function:

## reset() [2/2]

INLINE_FUNCTION_HD void reset | ( | int32 | pos | ) | const

inline

Definition at line 140 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::unset().

Here is the call graph for this function:

## flip()

INLINE_FUNCTION_HD void flip | ( | int32 | pos | ) | const

inline

Definition at line 146 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blockIndex(), bitsetHD< blockType, MemorySpace >::blockMask(), and bitsetHD< blockType, MemorySpace >::blocks_.

Here is the call graph for this function:

## isSet()

INLINE_FUNCTION_HD bool isSet | ( | int32 | pos | ) | const

inline

Definition at line 153 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blockIndex(), bitsetHD< blockType, MemorySpace >::blockMask(), and bitsetHD< blockType, MemorySpace >::blocks_.

Referenced by bitsetHD< blockType, MemorySpace >::isUnset().

Here is the call graph for this function:
Here is the caller graph for this function:

## isUnset()

INLINE_FUNCTION_HD bool isUnset | ( | int32 | pos | ) | const

inline

Definition at line 160 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::isSet().

Here is the call graph for this function:

## isSetReset()

INLINE_FUNCTION_HD bool isSetReset | ( | int32 | pos | ) | const

inline

Definition at line 166 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blockIndex(), bitsetHD< blockType, MemorySpace >::blockMask(), and bitsetHD< blockType, MemorySpace >::blocks_.

Here is the call graph for this function:

## numBlocks()

INLINE_FUNCTION_HD int32 numBlocks | ( |  | ) | const

inline

Definition at line 176 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::numBlocks_.

## numBits()

INLINE_FUNCTION_HD int32 numBits | ( |  | ) | const

inline

Definition at line 182 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::numBits_.

Referenced by bitsetHD< blockType, MemorySpace >::calculateBlockSize(), and bitsetHD< blockType, MemorySpace >::realloc().

Here is the caller graph for this function:

## size()

INLINE_FUNCTION_HD int32 size | ( |  | ) | const

inline

Definition at line 188 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::numBits_.

## capacity()

INLINE_FUNCTION_HD int32 capacity | ( |  | ) | const

inline

Definition at line 194 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::bitsPerBlock_, and bitsetHD< blockType, MemorySpace >::numBlocks_.

## realloc()

INLINE_FUNCTION_H void realloc | ( | int32 | numBits | ) |

inline

Definition at line 200 of file bitsetHD.hpp.

References bitsetHD< blockType, MemorySpace >::blocks_, bitsetHD< blockType, MemorySpace >::calculateBlockSize(), bitsetHD< blockType, MemorySpace >::numBits(), bitsetHD< blockType, MemorySpace >::numBits_, and bitsetHD< blockType, MemorySpace >::numBlocks_.

Here is the call graph for this function:

## Member Data Documentation

## numBlocks_

int32 numBlocks_

protected

Definition at line 53 of file bitsetHD.hpp.

Referenced by bitsetHD< blockType, MemorySpace >::capacity(), bitsetHD< blockType, MemorySpace >::numBlocks(), and bitsetHD< blockType, MemorySpace >::realloc().

## numBits_

int32 numBits_

protected

Definition at line 55 of file bitsetHD.hpp.

Referenced by bitsetHD< blockType, MemorySpace >::numBits(), bitsetHD< blockType, MemorySpace >::realloc(), and bitsetHD< blockType, MemorySpace >::size().

## blocks_

blockViewType blocks_

protected

Definition at line 57 of file bitsetHD.hpp.

Referenced by bitsetHD< blockType, MemorySpace >::clear(), bitsetHD< blockType, MemorySpace >::flip(), bitsetHD< blockType, MemorySpace >::isSet(), bitsetHD< blockType, MemorySpace >::isSetReset(), bitsetHD< blockType, MemorySpace >::realloc(), bitsetHD< blockType, MemorySpace >::reset(), bitsetHD< blockType, MemorySpace >::set(), and bitsetHD< blockType, MemorySpace >::unset().

## bitsPerBlock_

const static int32 bitsPerBlock_ = std::numeric_limits<BlockType>::digits

inlinestaticprotected

Definition at line 60 of file bitsetHD.hpp.

Referenced by bitsetHD< blockType, MemorySpace >::bitIndex(), bitsetHD< blockType, MemorySpace >::blockIndex(), bitsetHD< blockType, MemorySpace >::calculateBlockSize(), and bitsetHD< blockType, MemorySpace >::capacity().

## blockMask_

const static int32 blockMask_ = bitsPerBlock_ - 1

inlinestaticprotected

Definition at line 63 of file bitsetHD.hpp.

Referenced by bitsetHD< blockType, MemorySpace >::blockMask().

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

- src/phasicFlow/containers/bitsetHD/bitsetHD.hpp