VectorT< T > Struct Template Reference

AMR-Wind API: amr_wind::vs::VectorT< T > Struct Template Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches

#include <vector.H>

Inheritance diagram for amr_wind::vs::VectorT< T >:
[legend]

Public Types

using size_type = int
 
using value_type = T
 
using reference = T&
 
using iterator = T*
 
using const_iterator = const T*
 
using Traits = DTraits<T>
 
using VType = VectorT<T>
 

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT ()=default
 Construct a default vector, all components set to zero.
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT (const T &x, const T &y, const T &z)
 
 ~VectorT ()=default
 
 VectorT (const VectorT &)=default
 
 VectorT (VectorT &&)=default
 
VectorToperator= (const VectorT &) &=default
 
VectorToperator= (const VectorT &) &&=delete
 
VectorToperator= (VectorT &&) &=default
 
VectorToperator= (VectorT &&) &&=delete
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > & normalize ()
 Normalize the vector to unit vector.
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > sqrt (const VectorT &)
 Sqrt of each component.
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > unit () const
 Return the unit vector parallel to this vector.
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & x () &noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & y () &noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & z () &noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & x () const &noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & y () const &noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & z () const &noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > operator- () const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > operator*= (const T val)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > operator*= (const VectorT< T > &valvec)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > operator/= (const T val)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & operator[] (size_type pos) &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & operator[] (size_type pos) const &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * data () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * data () const noexcept
 
iterator begin () noexcept
 
iterator end () noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
size_type size () const noexcept
 

Static Public Member Functions

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > zero ()
 Zero vector.
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > one ()
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > ihat (const T &x=Traits::one())
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > jhat (const T &y=Traits::one())
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > khat (const T &z=Traits::one())
 

Public Attributes

amrex::GpuArray< T, 3 > vv = {Traits::zero(), Traits::zero(), Traits::zero()}
 

Static Public Attributes

static constexpr int ncomp = 3
 Number of components.
 

Detailed Description

template<typename T>
struct amr_wind::vs::VectorT< T >

Vector in 3D space

Member Typedef Documentation

◆ const_iterator

template<typename T >
using amr_wind::vs::VectorT< T >::const_iterator = const T*

◆ iterator

template<typename T >
using amr_wind::vs::VectorT< T >::iterator = T*

◆ reference

template<typename T >
using amr_wind::vs::VectorT< T >::reference = T&

◆ size_type

template<typename T >
using amr_wind::vs::VectorT< T >::size_type = int

◆ Traits

template<typename T >
using amr_wind::vs::VectorT< T >::Traits = DTraits<T>

◆ value_type

template<typename T >
using amr_wind::vs::VectorT< T >::value_type = T

◆ VType

template<typename T >
using amr_wind::vs::VectorT< T >::VType = VectorT<T>

Constructor & Destructor Documentation

◆ VectorT() [1/4]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amr_wind::vs::VectorT< T >::VectorT ( )
default

Construct a default vector, all components set to zero.

◆ VectorT() [2/4]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amr_wind::vs::VectorT< T >::VectorT ( const T & x,
const T & y,
const T & z )
inline

New vector given the three components

◆ ~VectorT()

template<typename T >
amr_wind::vs::VectorT< T >::~VectorT ( )
default

◆ VectorT() [3/4]

template<typename T >
amr_wind::vs::VectorT< T >::VectorT ( const VectorT< T > & )
default

◆ VectorT() [4/4]

template<typename T >
amr_wind::vs::VectorT< T >::VectorT ( VectorT< T > && )
default

Member Function Documentation

◆ begin()

template<typename T >
iterator amr_wind::vs::VectorT< T >::begin ( )
inlinenoexcept

◆ cbegin()

template<typename T >
const_iterator amr_wind::vs::VectorT< T >::cbegin ( ) const
inlinenoexcept

◆ cend()

template<typename T >
const_iterator amr_wind::vs::VectorT< T >::cend ( ) const
inlinenoexcept

◆ data() [1/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * amr_wind::vs::VectorT< T >::data ( ) const
inlinenoexcept

◆ data() [2/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * amr_wind::vs::VectorT< T >::data ( )
inlinenoexcept

◆ end()

template<typename T >
iterator amr_wind::vs::VectorT< T >::end ( )
inlinenoexcept

◆ ihat()

template<typename T >
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > amr_wind::vs::VectorT< T >::ihat ( const T & x = Traits::one())
inlinestaticconstexpr

Vector along x-axis

Parameters
xMagnitude of vector

◆ jhat()

template<typename T >
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > amr_wind::vs::VectorT< T >::jhat ( const T & y = Traits::one())
inlinestaticconstexpr

Vector along y-axis

Parameters
yMagnitude of vector

◆ khat()

template<typename T >
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > amr_wind::vs::VectorT< T >::khat ( const T & z = Traits::one())
inlinestaticconstexpr

Vector along z-axis

Parameters
zMagnitude of vector

◆ normalize()

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > & amr_wind::vs::VectorT< T >::normalize ( )

Normalize the vector to unit vector.

◆ one()

template<typename T >
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > amr_wind::vs::VectorT< T >::one ( )
inlinestaticconstexpr

◆ operator*=() [1/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > amr_wind::vs::VectorT< T >::operator*= ( const T val)

◆ operator*=() [2/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > amr_wind::vs::VectorT< T >::operator*= ( const VectorT< T > & valvec)

◆ operator-()

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > amr_wind::vs::VectorT< T >::operator- ( ) const

◆ operator/=()

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > amr_wind::vs::VectorT< T >::operator/= ( const T val)

◆ operator=() [1/4]

template<typename T >
VectorT & amr_wind::vs::VectorT< T >::operator= ( const VectorT< T > & ) &&
delete

◆ operator=() [2/4]

template<typename T >
VectorT & amr_wind::vs::VectorT< T >::operator= ( const VectorT< T > & ) &
default

◆ operator=() [3/4]

template<typename T >
VectorT & amr_wind::vs::VectorT< T >::operator= ( VectorT< T > && ) &&
delete

◆ operator=() [4/4]

template<typename T >
VectorT & amr_wind::vs::VectorT< T >::operator= ( VectorT< T > && ) &
default

◆ operator[]() [1/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & amr_wind::vs::VectorT< T >::operator[] ( size_type pos) &
inline

◆ operator[]() [2/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & amr_wind::vs::VectorT< T >::operator[] ( size_type pos) const &
inline

◆ size()

template<typename T >
size_type amr_wind::vs::VectorT< T >::size ( ) const
inlinenoexcept

◆ sqrt()

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > amr_wind::vs::VectorT< T >::sqrt ( const VectorT< T > & )

Sqrt of each component.

◆ unit()

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE VectorT< T > amr_wind::vs::VectorT< T >::unit ( ) const
inline

Return the unit vector parallel to this vector.

◆ x() [1/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & amr_wind::vs::VectorT< T >::x ( ) &
inlinenoexcept

◆ x() [2/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & amr_wind::vs::VectorT< T >::x ( ) const &
inlinenoexcept

◆ y() [1/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & amr_wind::vs::VectorT< T >::y ( ) &
inlinenoexcept

◆ y() [2/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & amr_wind::vs::VectorT< T >::y ( ) const &
inlinenoexcept

◆ z() [1/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & amr_wind::vs::VectorT< T >::z ( ) &
inlinenoexcept

◆ z() [2/2]

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & amr_wind::vs::VectorT< T >::z ( ) const &
inlinenoexcept

◆ zero()

template<typename T >
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr VectorT< T > amr_wind::vs::VectorT< T >::zero ( )
inlinestaticconstexpr

Zero vector.

Member Data Documentation

◆ ncomp

template<typename T >
int amr_wind::vs::VectorT< T >::ncomp = 3
staticconstexpr

Number of components.

◆ vv

template<typename T >
amrex::GpuArray<T, 3> amr_wind::vs::VectorT< T >::vv = {Traits::zero(), Traits::zero(), Traits::zero()}

The documentation for this struct was generated from the following files:
  • /home/runner/work/amr-wind/amr-wind/amr-wind/core/vs/vector.H
  • /home/runner/work/amr-wind/amr-wind/amr-wind/core/vs/vectorI.H