opm-simulators
Loading...
Searching...
No Matches
Opm::gpuistl::MiniVector< T, Dimension > Class Template Reference

#include <MiniVector.hpp>

Public Types

using value_type = T
 Element type.
using size_type = std::size_t
 Index/size type.
using reference = value_type&
 Mutable element reference.
using const_reference = const value_type&
 Immutable element reference.
using iterator = typename std::array<T, Dimension>::iterator
 Mutable iterator.
using const_iterator = typename std::array<T, Dimension>::const_iterator
 Immutable iterator.

Public Member Functions

OPM_HOST_DEVICE constexpr MiniVector () noexcept(std::is_nothrow_default_constructible< value_type >::value)=default
 Default‑constructs the MiniVector; elements are value‑initialized.
OPM_HOST_DEVICE constexpr MiniVector (const value_type &value)
 Uniform‑value constructor.
 MiniVector (const Dune::FieldVector< T, Dimension > &fv)
 Conversion constructor from Dune::FieldVector.
OPM_HOST_DEVICE MiniVector (std::initializer_list< value_type > init)
 Initializer‑list constructor.
OPM_HOST_DEVICE constexpr reference operator[] (size_type idx) noexcept
OPM_HOST_DEVICE constexpr const_reference operator[] (size_type idx) const noexcept
OPM_HOST_DEVICE reference at (size_type idx)
 Safe element access with bounds checking (throws on host).
OPM_HOST_DEVICE const_reference at (size_type idx) const
 Safe element access with bounds checking (throws on host).
OPM_HOST_DEVICE constexpr iterator begin () noexcept
OPM_HOST_DEVICE constexpr const_iterator begin () const noexcept
OPM_HOST_DEVICE constexpr const_iterator cbegin () const noexcept
OPM_HOST_DEVICE constexpr iterator end () noexcept
OPM_HOST_DEVICE constexpr const_iterator end () const noexcept
OPM_HOST_DEVICE constexpr const_iterator cend () const noexcept
OPM_HOST_DEVICE constexpr void fill (const value_type &value)
 Fill every component with the supplied value.
OPM_HOST_DEVICE bool operator== (const MiniVector &other) const noexcept
OPM_HOST_DEVICE bool operator!= (const MiniVector &other) const noexcept
OPM_HOST_DEVICE MiniVectoroperator= (const value_type &value)
OPM_HOST_DEVICE MiniVector operator+ (const value_type &value) const
OPM_HOST_DEVICE MiniVectoroperator+= (const MiniVector &other)
OPM_HOST_DEVICE MiniVector operator+ (const MiniVector &other) const
OPM_HOST_DEVICE MiniVector operator- (const MiniVector &other) const
OPM_HOST_DEVICE MiniVectoroperator-= (const MiniVector &other)
OPM_HOST_DEVICE MiniVectoroperator*= (const value_type &value)

Static Public Member Functions

static OPM_HOST_DEVICE constexpr size_type size () noexcept

Detailed Description

template<class T, int Dimension>
class Opm::gpuistl::MiniVector< T, Dimension >
Template Parameters
TElement type (must be trivially copyable for use on the GPU).
DimensionCompile‑time dimension (must be strictly positive).

Constructor & Destructor Documentation

◆ MiniVector() [1/3]

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr Opm::gpuistl::MiniVector< T, Dimension >::MiniVector ( const value_type & value)
inlineexplicitconstexpr

Uniform‑value constructor.

Parameters
valueValue used to initialize all components.

◆ MiniVector() [2/3]

template<class T, int Dimension>
Opm::gpuistl::MiniVector< T, Dimension >::MiniVector ( const Dune::FieldVector< T, Dimension > & fv)
inlineexplicit

Conversion constructor from Dune::FieldVector.

Parameters
fvSource FieldVector (must have dimension Dimension).

◆ MiniVector() [3/3]

template<class T, int Dimension>
OPM_HOST_DEVICE Opm::gpuistl::MiniVector< T, Dimension >::MiniVector ( std::initializer_list< value_type > init)
inline

Initializer‑list constructor.

Enables natural brace initialization:

Parameters
initList containing exactly Dimension elements.
Exceptions
std::runtime_errorif init.size() != Dimension (host only).

Member Function Documentation

◆ at() [1/2]

template<class T, int Dimension>
OPM_HOST_DEVICE reference Opm::gpuistl::MiniVector< T, Dimension >::at ( size_type idx)
inline

Safe element access with bounds checking (throws on host).

Exceptions
std::out_of_rangeif idx >= Dimension (host only).

◆ at() [2/2]

template<class T, int Dimension>
OPM_HOST_DEVICE const_reference Opm::gpuistl::MiniVector< T, Dimension >::at ( size_type idx) const
inline

Safe element access with bounds checking (throws on host).

Exceptions
std::out_of_rangeif idx >= Dimension (host only).

◆ begin() [1/2]

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr const_iterator Opm::gpuistl::MiniVector< T, Dimension >::begin ( ) const
inlineconstexprnoexcept
Returns
Const iterator to first element.

◆ begin() [2/2]

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr iterator Opm::gpuistl::MiniVector< T, Dimension >::begin ( )
inlineconstexprnoexcept
Returns
Iterator to first element (mutable).

◆ cbegin()

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr const_iterator Opm::gpuistl::MiniVector< T, Dimension >::cbegin ( ) const
inlineconstexprnoexcept
Returns
Const iterator to first element.

◆ cend()

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr const_iterator Opm::gpuistl::MiniVector< T, Dimension >::cend ( ) const
inlineconstexprnoexcept
Returns
Const one‑past‑the‑last iterator.

◆ end() [1/2]

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr const_iterator Opm::gpuistl::MiniVector< T, Dimension >::end ( ) const
inlineconstexprnoexcept
Returns
Const one‑past‑the‑last iterator.

◆ end() [2/2]

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr iterator Opm::gpuistl::MiniVector< T, Dimension >::end ( )
inlineconstexprnoexcept
Returns
One‑past‑the‑last iterator (mutable).

◆ fill()

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr void Opm::gpuistl::MiniVector< T, Dimension >::fill ( const value_type & value)
inlineconstexpr

Fill every component with the supplied value.

Parameters
valueThe value to assign to each element.

◆ operator!=()

template<class T, int Dimension>
OPM_HOST_DEVICE bool Opm::gpuistl::MiniVector< T, Dimension >::operator!= ( const MiniVector< T, Dimension > & other) const
inlinenoexcept
Returns
true if any component differs.

◆ operator*=()

template<class T, int Dimension>
OPM_HOST_DEVICE MiniVector & Opm::gpuistl::MiniVector< T, Dimension >::operator*= ( const value_type & value)
inline
Returns
Reference to this vector after element‑wise multiplication with 'other'

◆ operator=()

template<class T, int Dimension>
OPM_HOST_DEVICE MiniVector & Opm::gpuistl::MiniVector< T, Dimension >::operator= ( const value_type & value)
inline
Returns
Reference to this vector after every element is assigned to 'value'

◆ operator==()

template<class T, int Dimension>
OPM_HOST_DEVICE bool Opm::gpuistl::MiniVector< T, Dimension >::operator== ( const MiniVector< T, Dimension > & other) const
inlinenoexcept
Returns
true if all components compare equal.

◆ operator[]() [1/2]

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr const_reference Opm::gpuistl::MiniVector< T, Dimension >::operator[] ( size_type idx) const
inlineconstexprnoexcept
Returns
Immutable reference to element idx (no bounds check).

◆ operator[]() [2/2]

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr reference Opm::gpuistl::MiniVector< T, Dimension >::operator[] ( size_type idx)
inlineconstexprnoexcept
Returns
Mutable reference to element idx (no bounds check).

◆ size()

template<class T, int Dimension>
OPM_HOST_DEVICE constexpr size_type Opm::gpuistl::MiniVector< T, Dimension >::size ( )
inlinestaticconstexprnoexcept
Returns
The fixed dimension of the MiniVector (compile‑time constant).

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