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

VectorSingle< T, MemorySpace > Class Template Reference
Inheritance diagram for VectorSingle< T, MemorySpace >:
[legend]

## Public Types

using | VectorType = VectorSingle< T, MemorySpace >
using | VectorTypeHost = VectorSingle< T, HostSpace >
using | iterator = T *
using | const_iterator = const T *
using | reference = T &
using | const_reference = const T &
using | value_type = T
using | pointer = T *
using | const_pointer = const T *
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

| TypeInfoTemplateNV111 ("VectorSingle", T, memoerySpaceName())
| Type info. More...
| VectorSingle ()
| Empty vector. More...
| VectorSingle (const word &name)
| Empty vector with a name (capacity = 2) More...
| VectorSingle (const word &name, uint32 n)
| Vector with name and size n. More...
| VectorSingle (const word &name, uint32 n, const T &val)
| Vector with name, size and value. More...
| VectorSingle (const word &name, uint32 cap, uint32 n, RESERVE)
| Vector with name, size (n) and reserved capacity. More...
| VectorSingle (const word &name, const std::vector< T > &src)
| Construct with a name and form std::vector (host memory) More...
| VectorSingle (const word &name, const std::vector< T > &src, uint32 cap)
| Construct with a name and form std::vector (host memory) and with a desired capacity. More...
| VectorSingle (const VectorSingle &src)
| Copy construct (performs deep copy) More...
| VectorSingle (const word &name, const VectorSingle &src)
| Copy construct with a new name (perform deep copy) More...
| VectorSingle (const word &name, const ViewType1D< T, MemorySpace > &src)
| Copy construct with a new name (perform deep copy) More...
VectorSingle & | operator= (const VectorSingle &rhs)
| Copy assignment (perform deep copy from rhs to *this) More...
| VectorSingle (VectorSingle &&)=default
| Move construct. More...
VectorSingle & | operator= (VectorSingle &&)=default
| Move assignment. More...
| ~VectorSingle ()
| Descructor This may not destroy the underlying memory, sice view is shared_ptr and maybe referenced by another object too More...
INLINE_FUNCTION_H uniquePtr< VectorSingle > | clone () const
| Clone as a uniquePtr (perform deep copy) More...
INLINE_FUNCTION_H VectorType & | VectorField ()
| Return *this. More...
const INLINE_FUNCTION_H VectorType & | VectorField () const
| Return *this. More...
INLINE_FUNCTION_H auto & | deviceViewAll ()
| Device view range [0,capcity) More...
const INLINE_FUNCTION_H auto & | deviceViewAll () const
| Device view range [0,capcity) More...
INLINE_FUNCTION_H auto | deviceView () const
| Device view range [0, size) More...
INLINE_FUNCTION_H auto | hostViewAll () const
| Return a view accessible on Host in range [0,capacity) More...
INLINE_FUNCTION_H auto | hostView () const
| Return a view accessible on Host in range [0,size) More...
INLINE_FUNCTION_H word | name () const
| Name of the vector. More...
INLINE_FUNCTION_H uint32 | size () const
| Size of the vector. More...
INLINE_FUNCTION_H uint32 | capacity () const
INLINE_FUNCTION_H bool | empty () const
| If vector is empty. More...
INLINE_FUNCTION_H void | reserve (uint32 cap)
| Reserve capacity for vector Preserve the content. More...
INLINE_FUNCTION_H void | reallocate (uint32 cap)
| Reallocate memory to new cap and set size to 0. More...
INLINE_FUNCTION_H void | reallocate (uint32 cap, uint32 newSize)
| Reallocate memory to new cap and set size to newSize. More...
INLINE_FUNCTION_H void | resize (uint32 n)
| Resize the vector and preserve the content. More...
INLINE_FUNCTION_H void | resize (uint32 n, const T &val)
| Resize the vector and assign the value to it. More...
INLINE_FUNCTION_H void | clear ()
| Clear the vector, but keep the allocated memory unchanged. More...
INLINE_FUNCTION_H void | fill (const T &val)
| Fill the range [0,size) with val. More...
INLINE_FUNCTION_H void | fill (rangeU32 r, const T &val)
INLINE_FUNCTION_H void | assign (size_t n, const T &val)
| Change size of the vector and assign val to vector and. More...
INLINE_FUNCTION_H void | assign (const std::vector< T > &src, uint32 cap)
| Assign source vector with specified capacity. More...
INLINE_FUNCTION_H void | assign (const std::vector< T > &src)
| Assign source vector. More...
INLINE_FUNCTION_H void | assignFromHost (const VectorTypeHost &src)
| Assign source vector from host side. More...
INLINE_FUNCTION_H void | assign (const VectorType &src, bool srcCapacity=true)
template<typename MSpace >
INLINE_FUNCTION_H void | assignFromDevice (const VectorSingle< T, MSpace > &src, bool srcCapacity=true)
INLINE_FUNCTION_H void | append (const ViewType1D< T, MemorySpace > &appVec)
INLINE_FUNCTION_H void | append (const std::vector< T > &appVec)
INLINE_FUNCTION_H void | append (const VectorType &appVec)
INLINE_FUNCTION_H auto | getSpan ()
INLINE_FUNCTION_H auto | getSpan () const
INLINE_FUNCTION_H bool | insertSetElement (const uint32IndexContainer &indices, const T &val)
INLINE_FUNCTION_H bool | insertSetElement (const uint32IndexContainer &indices, const std::vector< T > &vals)
INLINE_FUNCTION_H bool | insertSetElement (const uint32IndexContainer &indices, const ViewType1D< T, memory_space > vals)
INLINE_FUNCTION_H bool | reorderItems (const uint32IndexContainer &indices)
template<bool Enable = true>
INLINE_FUNCTION_H std::enable_if_t< isHostAccessible_ &&Enable, void > | push_back (const T &val)
| push a new element at the end (host call only) resize if necessary and works on host accessible vector. More...
INLINE_FUNCTION_H pointer | data ()
INLINE_FUNCTION_H const_pointer | data () const
template<bool Enable = true>
INLINE_FUNCTION_H std::enable_if_t< isHostAccessible_ &&Enable, iterator > | begin ()
| Return begin iterator. It works when devices is host accessible. More...
template<bool Enable = true>
INLINE_FUNCTION_H std::enable_if_t< isHostAccessible_ &&Enable, const_iterator > | begin () const
| Return begin iterator. it works when host is accessible. More...
template<bool Enable = true>
INLINE_FUNCTION_H std::enable_if_t< isHostAccessible_ &&Enable, iterator > | end ()
| Return end iterator. it works when host is accessible. More...
template<bool Enable = true>
INLINE_FUNCTION_H std::enable_if_t< isHostAccessible_ &&Enable, const_iterator > | end () const
| Return end iterator. it works when host is accessible. More...
template<bool Enable = true>
INLINE_FUNCTION_H std::enable_if_t< isHostAccessible_ &&Enable, reference > | operator[] (size_t i)
| Return reference to element i. it works when host is accessible. More...
template<bool Enable = true>
INLINE_FUNCTION_H std::enable_if_t< isHostAccessible_ &&Enable, const_reference > | operator[] (size_t i) const
| Return reference to element i. it works when host is accessible. More...
FUNCTION_H bool | read (iIstream &is)
| Read vector from stream. More...
FUNCTION_H bool | read (iIstream &is, const IOPattern &iop)
| Read vector from stream. More...
FUNCTION_H bool | write (iOstream &os, const IOPattern &iop) const
| Write the vector to os. More...
FUNCTION_H bool | write (iOstream &os) const
template<typename HostMask >
FUNCTION_H bool | write (iOstream &os, const IOPattern &iop, const HostMask &mask) const

## Static Public Member Functions

static constexpr const char * | memoerySpaceName ()
| Name of the memory space. More...

## Private Member Functions

INLINE_FUNCTION_H uint32 | changeSize (uint32 n, bool withInit=false)
| Change size to n and preserve the conetent if realloc occurs More...
INLINE_FUNCTION_H uint32 | changeCapacitySize (uint32 actualCap, uint32 n, bool withInit=false)
| Change the size and capacity of Vector. More...
INLINE_FUNCTION_H void | changeCapacity (uint32 actualCap, bool withInit=false)
INLINE_FUNCTION_H uint32 | reallocateCapacitySize (uint32 cap, uint32 s)
INLINE_FUNCTION_H uint32 | setSize (uint32 n)

## Static Private Member Functions

static INLINE_FUNCTION_H uint32 | evalCapacity (uint32 n)
| Evaluate capacity based on the input size. More...

## Private Attributes

uint32 | size_ = 0
| Size of the vector. More...
viewType | view_
| view of the vector More...

## Static Private Attributes

static constexpr bool | isHostAccessible_ = isHostAccessible<execution_space>()
| Is the memory of this vector accessible from Host. More...
static constexpr bool | isDeviceAccessible_ = isDeviceAccessible<execution_space>()
| Is the memory of this vector accessiple from Divce. More...
static constexpr bool | isTriviallyCopyable_ = std::is_trivially_copyable_v<T>

## Detailed Description

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

Definition at line 44 of file VectorSingle.hpp.

## Member Typedef Documentation

## VectorType

using VectorType = VectorSingle<T, MemorySpace>

Definition at line 50 of file VectorSingle.hpp.

## VectorTypeHost

using VectorTypeHost = VectorSingle<T, HostSpace>

Definition at line 52 of file VectorSingle.hpp.

## iterator

using iterator = T*

Definition at line 54 of file VectorSingle.hpp.

## const_iterator

using const_iterator = const T*

Definition at line 56 of file VectorSingle.hpp.

## reference

using reference = T&

Definition at line 58 of file VectorSingle.hpp.

## const_reference

using const_reference = const T&

Definition at line 60 of file VectorSingle.hpp.

## value_type

using value_type = T

Definition at line 62 of file VectorSingle.hpp.

## pointer

using pointer = T*

Definition at line 64 of file VectorSingle.hpp.

## const_pointer

using const_pointer = const T*

Definition at line 66 of file VectorSingle.hpp.

## viewType

using viewType = ViewType1D<T, MemorySpace>

Definition at line 70 of file VectorSingle.hpp.

## device_type

using device_type = typename viewType::device_type

Definition at line 72 of file VectorSingle.hpp.

## memory_space

using memory_space = typename viewType::memory_space

Definition at line 74 of file VectorSingle.hpp.

## execution_space

using execution_space = typename viewType::execution_space

Definition at line 76 of file VectorSingle.hpp.

## Constructor & Destructor Documentation

## VectorSingle() [1/11]

VectorSingle

Empty vector.

Definition at line 95 of file VectorSingle.cpp.

## VectorSingle() [2/11]

VectorSingle | ( | const word & | name | ) |

explicit

Empty vector with a name (capacity = 2)

Definition at line 101 of file VectorSingle.cpp.

## VectorSingle() [3/11]

VectorSingle | ( | const word & | name,
|  | uint32 | n
| ) |  |

Vector with name and size n.

Definition at line 109 of file VectorSingle.cpp.

## VectorSingle() [4/11]

VectorSingle | ( | const word & | name,
|  | uint32 | n,
|  | const T & | val
| ) |  |

Vector with name, size and value.

Definition at line 120 of file VectorSingle.cpp.

## VectorSingle() [5/11]

VectorSingle | ( | const word & | name,
|  | uint32 | cap,
|  | uint32 | n,
|  | RESERVE |
| ) |  |

Vector with name, size (n) and reserved capacity.

Definition at line 133 of file VectorSingle.cpp.

## VectorSingle() [6/11]

VectorSingle | ( | const word & | name,
|  | const std::vector< T > & | src
| ) |  |

Construct with a name and form std::vector (host memory)

Definition at line 146 of file VectorSingle.cpp.

## VectorSingle() [7/11]

VectorSingle | ( | const word & | name,
|  | const std::vector< T > & | src,
|  | uint32 | cap
| ) |  |

Construct with a name and form std::vector (host memory) and with a desired capacity.

Definition at line 158 of file VectorSingle.cpp.

## VectorSingle() [8/11]

VectorSingle | ( | const VectorSingle< T, MemorySpace > & | src | ) |

Copy construct (performs deep copy)

Definition at line 171 of file VectorSingle.cpp.

## VectorSingle() [9/11]

VectorSingle | ( | const word & | name,
|  | const VectorSingle< T, MemorySpace > & | src
| ) |  |

Copy construct with a new name (perform deep copy)

Definition at line 180 of file VectorSingle.cpp.

## VectorSingle() [10/11]

VectorSingle | ( | const word & | name,
|  | const ViewType1D< T, MemorySpace > & | src
| ) |  |

Copy construct with a new name (perform deep copy)

Definition at line 192 of file VectorSingle.cpp.

## VectorSingle() [11/11]

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

default

Move construct.

## ~VectorSingle()

~VectorSingle

Descructor This may not destroy the underlying memory, sice view is shared_ptr and maybe referenced by another object too

Definition at line 216 of file VectorSingle.cpp.

## Member Function Documentation

## evalCapacity()

static INLINE_FUNCTION_H uint32 evalCapacity | ( | uint32 | n | ) |

inlinestaticprivate

Evaluate capacity based on the input size.

Definition at line 104 of file VectorSingle.hpp.

## changeSize()

INLINE_FUNCTION_H pFlow::uint32 changeSize | ( | uint32 | n,
|  | bool | withInit = `false`
| ) |  |

private

Change size to n and preserve the conetent if realloc occurs

Definition at line 24 of file VectorSingle.cpp.

Referenced by VectorSingle< uint32, HostSpace >::push_back().

Here is the caller graph for this function:

## changeCapacitySize()

INLINE_FUNCTION_H pFlow::uint32 changeCapacitySize | ( | uint32 | actualCap,
|  | uint32 | n,
|  | bool | withInit = `false`
| ) |  |

private

Change the size and capacity of Vector.

Definition at line 40 of file VectorSingle.cpp.

## changeCapacity()

INLINE_FUNCTION_H void changeCapacity | ( | uint32 | actualCap,
|  | bool | withInit = `false`
| ) |  |

private

Definition at line 53 of file VectorSingle.cpp.

## reallocateCapacitySize()

INLINE_FUNCTION_H pFlow::uint32 reallocateCapacitySize | ( | uint32 | cap,
|  | uint32 | s
| ) |  |

private

Definition at line 73 of file VectorSingle.cpp.

## setSize()

INLINE_FUNCTION_H pFlow::uint32 setSize | ( | uint32 | n | ) |

private

Definition at line 84 of file VectorSingle.cpp.

## TypeInfoTemplateNV111()

TypeInfoTemplateNV111 | ( | "VectorSingle< T, MemorySpace >" | ,
|  | T | ,
|  | memoerySpaceName() |
| ) |  |

Type info.

## operator=() [1/2]

pFlow::VectorSingle< T, MemorySpace > & operator= | ( | const VectorSingle< T, MemorySpace > & | rhs | ) |

Copy assignment (perform deep copy from rhs to *this)

Definition at line 204 of file VectorSingle.cpp.

Referenced by Field< uint32x3 >::operator=().

Here is the caller graph for this function:

## operator=() [2/2]

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

default

Move assignment.

## clone()

INLINE_FUNCTION_H pFlow::uniquePtr< pFlow::VectorSingle< T, MemorySpace > > clone

Clone as a uniquePtr (perform deep copy)

Definition at line 225 of file VectorSingle.cpp.

## VectorField() [1/2]

const INLINE_FUNCTION_H pFlow::VectorSingle< T, MemorySpace > & VectorField

Return *this.

Definition at line 234 of file VectorSingle.cpp.

## VectorField() [2/2]

const INLINE_FUNCTION_H VectorType& VectorField | ( |  | ) | const

Return *this.

## deviceViewAll() [1/2]

INLINE_FUNCTION_H auto & deviceViewAll

Device view range [0,capcity)

Definition at line 249 of file VectorSingle.cpp.

Referenced by boundaryReflective::afterIteration(), boundaryPeriodic::beforeIteration(), boundaryExit::beforeIteration(), pFlow::triSurfaceKernels::calculateArea(), pFlow::triSurfaceKernels::calculateNormals(), ContactSearch< searchMethod >::ContactSearch(), pFlow::count(), pFlow::boundaryBaseKernels::createRemoveKeepIndices(), pFlow::boundaryBaseKernels::createRemoveKeepLists(), internalField< realx3, void >::deviceViewAll(), triSurfaceField< uint32 >::deviceViewAll(), triSurface::getTriangleAccessor(), MotionModel< rotatingAxisMotion, rotatingAxis >::impl_getModelInterface(), AdamsMoulton3::intAll(), AdamsMoulton4::intAll(), AdamsMoulton5::intAll(), AdamsBashforth3::intAll(), AdamsBashforth4::intAll(), AdamsBashforth5::intAll(), AdamsMoulton3::intRange(), AdamsMoulton4::intRange(), AdamsMoulton5::intRange(), AdamsBashforth3::intRange(), AdamsBashforth4::intRange(), AdamsBashforth5::intRange(), boundaryBase::markInNegativeSide(), pFlow::max(), pFlow::min(), AdamsMoulton3::predictAll(), AdamsMoulton4::predictAll(), AdamsMoulton5::predictAll(), AdamsMoulton3::predictRange(), AdamsMoulton4::predictRange(), and AdamsMoulton5::predictRange().

Here is the caller graph for this function:

## deviceViewAll() [2/2]

const INLINE_FUNCTION_H auto& deviceViewAll | ( |  | ) | const

Device view range [0,capcity)

## deviceView()

INLINE_FUNCTION_H auto deviceView

Device view range [0, size)

Definition at line 263 of file VectorSingle.cpp.

Referenced by VectorSingle< uint32, HostSpace >::append(), VectorSingle< uint32, HostSpace >::assign(), VectorSingle< uint32, HostSpace >::assignFromDevice(), internalPoints::changePointsFlagPosition(), grainInteraction< contactForceModel, geometryMotionModel, contactListType >::createGrainInteraction(), sphereInteraction< contactForceModel, geometryMotionModel, contactListType >::createSphereInteraction(), internalPoints::deletePoints(), internalField< realx3, void >::deviceView(), triSurfaceField< uint32 >::deviceView(), grainParticles::initializeParticles(), sphereParticles::initializeParticles(), internalPoints::insertPointsOnly(), pFlow::intAllActive(), pFlow::intScattered(), internalPoints::pointPositionDevice(), and VectorSingle< uint32, HostSpace >::VectorSingle().

Here is the caller graph for this function:

## hostViewAll()

INLINE_FUNCTION_H auto hostViewAll

Return a view accessible on Host in range [0,capacity)

Definition at line 272 of file VectorSingle.cpp.

## hostView()

INLINE_FUNCTION_H auto hostView

Return a view accessible on Host in range [0,size)

Definition at line 281 of file VectorSingle.cpp.

Referenced by internalField< realx3, void >::activeValuesHost(), VectorSingle< uint32, HostSpace >::assignFromHost(), internalField< realx3, void >::hostView(), triSurfaceField< uint32 >::hostView(), internalPoints::pointPositionHost(), selectBox::selectAllPointsInBox(), and VectorSingle< uint32, HostSpace >::write().

Here is the caller graph for this function:

## name()

INLINE_FUNCTION_H pFlow::word name

Name of the vector.

Definition at line 290 of file VectorSingle.cpp.

Referenced by Field< uint32x3 >::name().

Here is the caller graph for this function:

## size()

INLINE_FUNCTION_H pFlow::uint32 size

Size of the vector.

Definition at line 297 of file VectorSingle.cpp.

Referenced by VectorSingle< uint32, HostSpace >::append(), VectorSingle< uint32, HostSpace >::assign(), VectorSingle< uint32, HostSpace >::assignFromDevice(), VectorSingle< uint32, HostSpace >::assignFromHost(), pFlow::triSurfaceKernels::calculateArea(), pFlow::triSurfaceKernels::calculateNormals(), pFlow::count(), pFlow::boundaryBaseKernels::createRemoveKeepIndices(), boundaryBase::empty(), triSurface::getTriangleAccessor(), internalPoints::insertPointsOnly(), pFlow::max(), pFlow::min(), triSurface::numPoints(), VectorSingle< uint32, HostSpace >::operator=(), boundaryBase::removeIndices(), triSurfaceField< uint32 >::size(), internalField< realx3, void >::size(), triSurface::size(), boundaryBase::size(), and boundaryBase::transferPointsToMirror().

Here is the caller graph for this function:

## capacity()

INLINE_FUNCTION_H pFlow::uint32 capacity

Definition at line 304 of file VectorSingle.cpp.

Referenced by VectorSingle< uint32, HostSpace >::assign(), VectorSingle< uint32, HostSpace >::assignFromDevice(), VectorSingle< uint32, HostSpace >::assignFromHost(), triSurfaceField< uint32 >::capacity(), internalField< realx3, void >::capacity(), triSurface::capacity(), and boundaryBase::capacity().

Here is the caller graph for this function:

## empty()

INLINE_FUNCTION_H bool empty

If vector is empty.

Definition at line 311 of file VectorSingle.cpp.

Referenced by internalPoints::deletePoints().

Here is the caller graph for this function:

## reserve()

INLINE_FUNCTION_H void reserve | ( | uint32 | cap | ) |

Reserve capacity for vector Preserve the content.

Definition at line 318 of file VectorSingle.cpp.

## reallocate() [1/2]

INLINE_FUNCTION_H void reallocate | ( | uint32 | cap | ) |

Reallocate memory to new cap and set size to 0.

Definition at line 326 of file VectorSingle.cpp.

Referenced by pFlow::boundaryBaseKernels::createRemoveKeepIndices(), pFlow::boundaryBaseKernels::createRemoveKeepLists(), and boundaryBase::markInNegativeSide().

Here is the caller graph for this function:

## reallocate() [2/2]

INLINE_FUNCTION_H void reallocate | ( | uint32 | cap,
|  | uint32 | newSize
| ) |  |

Reallocate memory to new cap and set size to newSize.

Do not preserve the content

Definition at line 334 of file VectorSingle.cpp.

## resize() [1/2]

INLINE_FUNCTION_H void resize | ( | uint32 | n | ) |

Resize the vector and preserve the content.

Definition at line 344 of file VectorSingle.cpp.

Referenced by pFlow::boundaryBaseKernels::createRemoveKeepIndices(), and boundaryBase::setSize().

Here is the caller graph for this function:

## resize() [2/2]

INLINE_FUNCTION_H void resize | ( | uint32 | n,
|  | const T & | val
| ) |  |

Resize the vector and assign the value to it.

Definition at line 351 of file VectorSingle.cpp.

## clear()

INLINE_FUNCTION_H void clear

Clear the vector, but keep the allocated memory unchanged.

Definition at line 358 of file VectorSingle.cpp.

Referenced by triSurface::clear(), and pFlow::boundaryBaseKernels::createRemoveKeepIndices().

Here is the caller graph for this function:

## fill() [1/2]

INLINE_FUNCTION_H void fill | ( | const T & | val | ) |

Fill the range [0,size) with val.

Definition at line 365 of file VectorSingle.cpp.

Referenced by boundaryReflective::afterIteration(), boundaryPeriodic::beforeIteration(), boundaryExit::beforeIteration(), Field< uint32x3 >::Field(), and boundaryBase::markInNegativeSide().

Here is the caller graph for this function:

## fill() [2/2]

INLINE_FUNCTION_H void fill | ( | rangeU32 | r,
|  | const T & | val
| ) |  |

Definition at line 374 of file VectorSingle.cpp.

## assign() [1/4]

INLINE_FUNCTION_H void assign | ( | size_t | n,
|  | const T & | val
| ) |  |

Change size of the vector and assign val to vector and.

Definition at line 386 of file VectorSingle.cpp.

Referenced by triSurfaceField< uint32 >::assign(), VectorSingle< word, HostSpace >::assign(), and VectorSingle< uint32, HostSpace >::read().

Here is the caller graph for this function:

## assign() [2/4]

INLINE_FUNCTION_H void assign | ( | const std::vector< T > & | src,
|  | uint32 | cap
| ) |  |

Assign source vector with specified capacity.

The size of *this becomes the size of src.

Definition at line 406 of file VectorSingle.cpp.

## assign() [3/4]

INLINE_FUNCTION_H void assign | ( | const std::vector< T > & | src | ) |

Assign source vector.

The size of *this becomes the size of src. The capacity of *this becomes the capacity of src.

Definition at line 433 of file VectorSingle.cpp.

## assignFromHost()

INLINE_FUNCTION_H void assignFromHost | ( | const VectorTypeHost & | src | ) |

Assign source vector from host side.

The size of *this becomes the size of src. The capacity of *this becomes the capacity of src.

Definition at line 442 of file VectorSingle.cpp.

## assign() [4/4]

INLINE_FUNCTION_H void assign | ( | const VectorType & | src,
|  | bool | srcCapacity = `true`
| ) |  |

Definition at line 463 of file VectorSingle.cpp.

## assignFromDevice()

INLINE_FUNCTION_H void assignFromDevice | ( | const VectorSingle< T, MSpace > & | src,
|  | bool | srcCapacity = `true`
| ) |  |

Definition at line 487 of file VectorSingle.cpp.

Referenced by boundaryBase::syncLists().

Here is the caller graph for this function:

## append() [1/3]

INLINE_FUNCTION_H void append | ( | const ViewType1D< T, MemorySpace > & | appVec | ) |

Definition at line 506 of file VectorSingle.cpp.

## append() [2/3]

INLINE_FUNCTION_H void append | ( | const std::vector< T > & | appVec | ) |

Definition at line 527 of file VectorSingle.cpp.

## append() [3/3]

INLINE_FUNCTION_H void append | ( | const VectorType & | appVec | ) |

Definition at line 548 of file VectorSingle.cpp.

## getSpan() [1/2]

INLINE_FUNCTION_H auto getSpan

Definition at line 569 of file VectorSingle.cpp.

Referenced by triSurface::append(), and pointField< pFlow::VectorSingle, pFlow::AB3History >::readPointField().

Here is the caller graph for this function:

## getSpan() [2/2]

INLINE_FUNCTION_H auto getSpan | ( |  | ) | const

## insertSetElement() [1/3]

INLINE_FUNCTION_H bool insertSetElement | ( | const uint32IndexContainer & | indices,
|  | const T & | val
| ) |  |

Definition at line 583 of file VectorSingle.cpp.

Referenced by internalField< realx3, void >::insertSetElement().

Here is the caller graph for this function:

## insertSetElement() [2/3]

INLINE_FUNCTION_H bool insertSetElement | ( | const uint32IndexContainer & | indices,
|  | const std::vector< T > & | vals
| ) |  |

Definition at line 634 of file VectorSingle.cpp.

## insertSetElement() [3/3]

INLINE_FUNCTION_H bool insertSetElement | ( | const uint32IndexContainer & | indices,
|  | const ViewType1D< T, memory_space > | vals
| ) |  |

Definition at line 687 of file VectorSingle.cpp.

## reorderItems()

INLINE_FUNCTION_H bool reorderItems | ( | const uint32IndexContainer & | indices | ) |

Definition at line 738 of file VectorSingle.cpp.

## push_back()

INLINE_FUNCTION_H std::enable_if_t<isHostAccessible_ && Enable, void> push_back | ( | const T & | val | ) |

inline

push a new element at the end (host call only) resize if necessary and works on host accessible vector.

Definition at line 328 of file VectorSingle.hpp.

## data() [1/2]

INLINE_FUNCTION_H pointer data | ( |  | ) |

inline

Definition at line 335 of file VectorSingle.hpp.

Referenced by VectorSingle< uint32, HostSpace >::begin(), VectorSingle< uint32, HostSpace >::end(), and VectorSingle< uint32, HostSpace >::push_back().

Here is the caller graph for this function:

## data() [2/2]

INLINE_FUNCTION_H const_pointer data | ( |  | ) | const

inline

Definition at line 340 of file VectorSingle.hpp.

## begin() [1/2]

INLINE_FUNCTION_H std::enable_if_t<isHostAccessible_ && Enable,iterator> begin | ( |  | ) |

inline

Return begin iterator. It works when devices is host accessible.

Definition at line 348 of file VectorSingle.hpp.

## begin() [2/2]

INLINE_FUNCTION_H std::enable_if_t<isHostAccessible_ && Enable,const_iterator> begin | ( |  | ) | const

inline

Return begin iterator. it works when host is accessible.

Definition at line 356 of file VectorSingle.hpp.

## end() [1/2]

INLINE_FUNCTION_H std::enable_if_t<isHostAccessible_ && Enable,iterator> end | ( |  | ) |

inline

Return end iterator. it works when host is accessible.

Definition at line 365 of file VectorSingle.hpp.

Referenced by VectorSingle< uint32, HostSpace >::write().

Here is the caller graph for this function:

## end() [2/2]

INLINE_FUNCTION_H std::enable_if_t<isHostAccessible_ && Enable,const_iterator> end | ( |  | ) | const

inline

Return end iterator. it works when host is accessible.

Definition at line 374 of file VectorSingle.hpp.

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

INLINE_FUNCTION_H std::enable_if_t<isHostAccessible_ && Enable,reference> operator[] | ( | size_t | i | ) |

inline

Return reference to element i. it works when host is accessible.

Definition at line 382 of file VectorSingle.hpp.

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

INLINE_FUNCTION_H std::enable_if_t<isHostAccessible_ && Enable,const_reference> operator[] | ( | size_t | i | ) | const

inline

Return reference to element i. it works when host is accessible.

Definition at line 390 of file VectorSingle.hpp.

## read() [1/2]

FUNCTION_H bool read | ( | iIstream & | is | ) |

inline

Read vector from stream.

Definition at line 398 of file VectorSingle.hpp.

Referenced by pFlow::operator>>().

Here is the caller graph for this function:

## read() [2/2]

FUNCTION_H bool read | ( | iIstream & | is,
|  | const IOPattern & | iop
| ) |  |

inline

Read vector from stream.

Definition at line 410 of file VectorSingle.hpp.

## write() [1/3]

FUNCTION_H bool write | ( | iOstream & | os,
|  | const IOPattern & | iop
| ) |  | const

inline

Write the vector to os.

Definition at line 421 of file VectorSingle.hpp.

Referenced by pFlow::operator<<().

Here is the caller graph for this function:

## write() [2/3]

FUNCTION_H bool write | ( | iOstream & | os | ) | const

inline

Definition at line 431 of file VectorSingle.hpp.

## write() [3/3]

FUNCTION_H bool write | ( | iOstream & | os,
|  | const IOPattern & | iop,
|  | const HostMask & | mask
| ) |  | const

inline

Definition at line 442 of file VectorSingle.hpp.

## memoerySpaceName()

static constexpr const char* memoerySpaceName | ( |  | ) |

inlinestaticconstexpr

Name of the memory space.

Definition at line 469 of file VectorSingle.hpp.

## Member Data Documentation

## size_

uint32 size_ = 0

private

Size of the vector.

Definition at line 83 of file VectorSingle.hpp.

Referenced by VectorSingle< uint32, HostSpace >::end(), and VectorSingle< uint32, HostSpace >::push_back().

## view_

viewType view_

private

view of the vector

Definition at line 86 of file VectorSingle.hpp.

Referenced by VectorSingle< uint32, HostSpace >::data(), VectorSingle< uint32, HostSpace >::operator=(), and VectorSingle< uint32, HostSpace >::operator[]().

## isHostAccessible_

constexpr bool isHostAccessible_ = isHostAccessible<execution_space>()

staticconstexprprivate

Is the memory of this vector accessible from Host.

Definition at line 92 of file VectorSingle.hpp.

## isDeviceAccessible_

constexpr bool isDeviceAccessible_ = isDeviceAccessible<execution_space>()

staticconstexprprivate

Is the memory of this vector accessiple from Divce.

Definition at line 96 of file VectorSingle.hpp.

## isTriviallyCopyable_

constexpr bool isTriviallyCopyable_ = std::is_trivially_copyable_v<T>

staticconstexprprivate

Definition at line 99 of file VectorSingle.hpp.

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

- src/phasicFlow/containers/VectorHD/VectorSingle.hpp
- src/phasicFlow/containers/VectorHD/VectorSingle.cpp