OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::cpu::simd::FieldPtr< T, D > Class Template Reference

SIMD-specific pointer to a pack of rows of a D-dimensional field. More...

#include <operator.h>

+ Inheritance diagram for olb::cpu::simd::FieldPtr< T, D >:
+ Collaboration diagram for olb::cpu::simd::FieldPtr< T, D >:

Public Member Functions

 FieldPtr (ColumnVector< Column< T >, D > &columns, std::size_t index)
 
 FieldPtr (FieldPtr< T, D > &&rhs)
 
const Pack< T > * getComponentPointer (unsigned iDim) const
 
Pack< T > * getComponentPointer (unsigned iDim)
 
template<typename U , typename IMPL >
FieldPtr< T, D > & operator= (const GenericVector< U, D, IMPL > &rhs)
 
- Public Member Functions inherited from olb::ScalarVector< Pack< T >, D, FieldPtr< T, D > >
constexpr ScalarVector ()=default
 
 ScalarVector (const ScalarVector &)=delete
 
 ScalarVector (ScalarVector &&)=delete
 
- Public Member Functions inherited from olb::GenericVector< T, D, FieldPtr< T, D > >
constexpr GenericVector ()=default
 
 GenericVector (const GenericVector &)=delete
 
 GenericVector (GenericVector &&)=delete
 
GenericVectoroperator= (GenericVector &&rhs)=delete
 
constexpr FieldPtr< T, D > & operator= (const GenericVector< T, D, IMPL_ > &rhs) any_platform
 
constexpr const T & operator[] (unsigned iDim) const any_platform
 
constexpr T & operator[] (unsigned iDim) any_platform
 
constexpr FieldPtr< T, D > & operator+= (const GenericVector< U, D, IMPL_ > &rhs) any_platform
 
constexpr meta::enable_if_arithmetic_t< U, FieldPtr< T, D > & > operator+= (const U &rhs) any_platform
 
constexpr FieldPtr< T, D > & operator-= (const GenericVector< T, D, IMPL_ > &rhs) any_platform
 
constexpr meta::enable_if_arithmetic_t< U, FieldPtr< T, D > & > operator-= (const U &rhs) any_platform
 
constexpr FieldPtr< T, D > & operator*= (const GenericVector< U, D, IMPL_ > &rhs) any_platform
 
constexpr meta::enable_if_arithmetic_t< U, FieldPtr< T, D > & > operator*= (const U &rhs) any_platform
 
constexpr meta::enable_if_arithmetic_t< U, FieldPtr< T, D > & > operator/= (const U &rhs) any_platform
 
constexpr bool operator== (const GenericVector< T, D, IMPL_ > &rhs) const any_platform
 
constexpr bool operator!= (const GenericVector< T, D, IMPL_ > &rhs) const any_platform
 
constexpr bool operator!= (T rhs) const any_platform
 

Additional Inherited Members

- Public Types inherited from olb::ScalarVector< Pack< T >, D, FieldPtr< T, D > >
using type
 
- Public Types inherited from olb::GenericVector< T, D, FieldPtr< T, D > >
using value_type
 
- Static Public Member Functions inherited from olb::GenericVector< T, D, FieldPtr< T, D > >
static constexpr unsigned size ()
 
- Static Public Attributes inherited from olb::GenericVector< T, D, FieldPtr< T, D > >
static constexpr unsigned d
 

Detailed Description

template<typename T, unsigned D>
class olb::cpu::simd::FieldPtr< T, D >

SIMD-specific pointer to a pack of rows of a D-dimensional field.

Definition at line 57 of file operator.h.

Constructor & Destructor Documentation

◆ FieldPtr() [1/2]

template<typename T , unsigned D>
olb::cpu::simd::FieldPtr< T, D >::FieldPtr ( ColumnVector< Column< T >, D > & columns,
std::size_t index )
inline

Definition at line 69 of file operator.h.

69 :
70 _data(columns),
71 _index(index) {
72 meta::call_n_times<D>([&](unsigned iD) {
73 _packs[iD] = &_data[iD][_index];
74 });
75 }
void call_n_times(F &&f, std::index_sequence< INDICES... >)
Call F for each index (exlicitly unrolled loop)
Definition meta.h:519

References olb::meta::call_n_times().

+ Here is the call graph for this function:

◆ FieldPtr() [2/2]

template<typename T , unsigned D>
olb::cpu::simd::FieldPtr< T, D >::FieldPtr ( FieldPtr< T, D > && rhs)
inline

Definition at line 77 of file operator.h.

77 :
78 _data(rhs._data),
79 _index(rhs._index),
80 _packs(rhs._packs) { }

Member Function Documentation

◆ getComponentPointer() [1/2]

template<typename T , unsigned D>
Pack< T > * olb::cpu::simd::FieldPtr< T, D >::getComponentPointer ( unsigned iDim)
inline

Definition at line 87 of file operator.h.

88 {
89 return &_packs[iDim];
90 }

◆ getComponentPointer() [2/2]

template<typename T , unsigned D>
const Pack< T > * olb::cpu::simd::FieldPtr< T, D >::getComponentPointer ( unsigned iDim) const
inline

Definition at line 82 of file operator.h.

83 {
84 return &_packs[iDim];
85 }

◆ operator=()

template<typename T , unsigned D>
template<typename U , typename IMPL >
FieldPtr< T, D > & olb::cpu::simd::FieldPtr< T, D >::operator= ( const GenericVector< U, D, IMPL > & rhs)
inline

Definition at line 93 of file operator.h.

94 {
95 for (unsigned iDim=0; iDim < D; ++iDim) {
96 this->operator[](iDim) = rhs[iDim];
97 }
98 return *this;
99 }
constexpr const T & operator[](unsigned iDim) const any_platform

References olb::GenericVector< T, D, FieldPtr< T, D > >::operator[]().

+ Here is the call graph for this function:

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