Nektar++
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Nektar::NekVector< DataType > Class Template Reference

#include <NekVector.hpp>

Public Types

typedef DataType * iterator
 
typedef const DataType * const_iterator
 

Public Member Functions

 NekVector ()
 Creates an empty vector. More...
 
 NekVector (unsigned int size)
 Creates a vector of given size. The elements are not initialized. More...
 
 NekVector (unsigned int size, typename boost::call_traits< DataType >::const_reference a)
 Creates a vector with given size and initial value. More...
 
 NekVector (const std::string &vectorValues)
 
 NekVector (typename boost::call_traits< DataType >::const_reference x, typename boost::call_traits< DataType >::const_reference y, typename boost::call_traits< DataType >::const_reference z)
 
 NekVector (const NekVector< DataType > &rhs)
 
 NekVector (unsigned int size, const DataType *const ptr)
 
 NekVector (const Array< OneD, DataType > &ptr, PointerWrapper h=eCopy)
 
 NekVector (unsigned int size, Array< OneD, DataType > &ptr, PointerWrapper h=eCopy)
 
 NekVector (unsigned int size, const Array< OneD, const DataType > &ptr, PointerWrapper h=eCopy)
 
 ~NekVector ()
 
NekVector< DataType > & operator= (const NekVector< DataType > &rhs)
 
unsigned int GetDimension () const
 Returns the number of dimensions for the point. More...
 
unsigned int GetRows () const
 
DataType * GetRawPtr ()
 
Array< OneD, DataType > & GetPtr ()
 
const DataType * GetRawPtr () const
 
const Array< OneD, const DataType > & GetPtr () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
boost::call_traits< DataType >::reference operator() (unsigned int i)
 Returns i^{th} element. More...
 
boost::call_traits< DataType >::reference operator[] (unsigned int i)
 
boost::call_traits< DataType >::reference x ()
 
boost::call_traits< DataType >::reference y ()
 
boost::call_traits< DataType >::reference z ()
 
void SetX (typename boost::call_traits< DataType >::const_reference val)
 
void SetY (typename boost::call_traits< DataType >::const_reference val)
 
void SetZ (typename boost::call_traits< DataType >::const_reference val)
 
NekVector< DataType > & operator+= (const NekVector< DataType > &rhs)
 
NekVector< DataType > & operator-= (const NekVector< DataType > &rhs)
 
NekVector< DataType > & operator*= (typename boost::call_traits< DataType >::const_reference rhs)
 
NekVector< DataType > & operator/= (typename boost::call_traits< DataType >::const_reference rhs)
 
void Normalize ()
 
boost::call_traits< DataType >::const_reference operator() (unsigned int i) const
 
boost::call_traits< DataType >::const_reference operator[] (unsigned int i) const
 
boost::call_traits< DataType >::const_reference x () const
 
boost::call_traits< DataType >::const_reference y () const
 
boost::call_traits< DataType >::const_reference z () const
 
NekVector< DataType > operator- () const
 
DataType Magnitude () const
 
DataType Dot (const NekVector< DataType > &rhs) const
 
NekVector< DataType > Cross (const NekVector< DataType > &rhs) const
 
std::string AsString () const
 
DataType L1Norm () const
 
DataType L2Norm () const
 
DataType InfinityNorm () const
 
PointerWrapper GetWrapperType () const
 

Protected Member Functions

Array< OneD, DataType > & GetData ()
 
void SetSize (unsigned int s)
 
void SetWrapperType (PointerWrapper p)
 
void SetData (const Array< OneD, DataType > &newData)
 
void Resize (unsigned int newSize)
 

Private Member Functions

 NekVector (const Array< OneD, const DataType > &ptr, PointerWrapper h)
 

Private Attributes

unsigned int m_size
 
Array< OneD, DataType > m_data
 
PointerWrapper m_wrapperType
 

Detailed Description

template<typename DataType>
class Nektar::NekVector< DataType >

Definition at line 55 of file NekVector.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename DataType >
typedef const DataType* Nektar::NekVector< DataType >::const_iterator

Definition at line 113 of file NekVector.hpp.

◆ iterator

template<typename DataType >
typedef DataType* Nektar::NekVector< DataType >::iterator

Definition at line 109 of file NekVector.hpp.

Constructor & Destructor Documentation

◆ NekVector() [1/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector

Creates an empty vector.

Definition at line 41 of file NekVector.cpp.

42{
43}
unsigned int m_size
Definition: NekVector.hpp:204
Array< OneD, DataType > m_data
Definition: NekVector.hpp:205
PointerWrapper m_wrapperType
Definition: NekVector.hpp:206

◆ NekVector() [2/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( unsigned int  size)
explicit

Creates a vector of given size. The elements are not initialized.

Definition at line 46 of file NekVector.cpp.

47 : m_size(size), m_data(size), m_wrapperType(eCopy)
48{
49}

◆ NekVector() [3/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( unsigned int  size,
typename boost::call_traits< DataType >::const_reference  a 
)

Creates a vector with given size and initial value.

Definition at line 52 of file NekVector.cpp.

54 : m_size(size), m_data(size), m_wrapperType(eCopy)
55{
56 std::fill_n(m_data.get(), m_size, a);
57}

References Nektar::Array< OneD, DataType >::get(), Nektar::NekVector< DataType >::m_data, and Nektar::NekVector< DataType >::m_size.

◆ NekVector() [4/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( const std::string &  vectorValues)
explicit

Definition at line 60 of file NekVector.cpp.

62{
63 try
64 {
65 std::vector<DataType> values = FromString<DataType>(vectorValues);
66 m_size = values.size();
67 m_data = Array<OneD, DataType>(m_size);
68 std::copy(values.begin(), values.end(), m_data.begin());
69
70 ASSERTL0(m_size > 0, "Error converting string values to vector");
71 }
72 catch (std::runtime_error &e)
73 {
74 NEKERROR(ErrorUtil::efatal, e.what());
75 }
76}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202
Array< OneD, constDataType >::const_iterator begin() const
def copy(self)
Definition: pycml.py:2663

◆ NekVector() [5/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( typename boost::call_traits< DataType >::const_reference  x,
typename boost::call_traits< DataType >::const_reference  y,
typename boost::call_traits< DataType >::const_reference  z 
)

Definition at line 79 of file NekVector.cpp.

84{
85 m_data[0] = x;
86 m_data[1] = y;
87 m_data[2] = z;
88}
boost::call_traits< DataType >::reference x()
Definition: NekVector.cpp:275
boost::call_traits< DataType >::reference y()
Definition: NekVector.cpp:282
boost::call_traits< DataType >::reference z()
Definition: NekVector.cpp:289

◆ NekVector() [6/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( const NekVector< DataType > &  rhs)

Definition at line 91 of file NekVector.cpp.

92 : m_size(rhs.GetDimension()), m_data(rhs.m_data),
93 m_wrapperType(rhs.m_wrapperType)
94{
95 if (m_wrapperType == eCopy)
96 {
97 m_data = Array<OneD, DataType>(m_size);
98 std::copy(rhs.begin(), rhs.end(), m_data.get());
99 }
100}

◆ NekVector() [7/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( unsigned int  size,
const DataType *const  ptr 
)

Definition at line 103 of file NekVector.cpp.

104 : m_size(size), m_data(size, ptr), m_wrapperType(eCopy)
105{
106}

◆ NekVector() [8/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( const Array< OneD, DataType > &  ptr,
PointerWrapper  h = eCopy 
)
explicit

Definition at line 109 of file NekVector.cpp.

111 : m_size(ptr.size()), m_data(ptr), m_wrapperType(h)
112{
113 if (h == eCopy)
114 {
115 m_data = Array<OneD, DataType>(m_size);
116 CopyArray(ptr, m_data);
117 }
118}
void CopyArray(const Array< OneD, ConstDataType > &source, Array< OneD, DataType > &dest)

◆ NekVector() [9/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( unsigned int  size,
Array< OneD, DataType > &  ptr,
PointerWrapper  h = eCopy 
)

Definition at line 121 of file NekVector.cpp.

123 : m_size(size), m_data(ptr), m_wrapperType(h)
124{
125 if (h == eCopy)
126 {
127 ASSERTL0(size <= ptr.size(),
128 "Attempting to populate a vector of size " +
129 std::to_string(size) +
130 " but the incoming array only has " +
131 std::to_string(ptr.size()) + " elements.");
132
133 m_data = Array<OneD, DataType>(size);
134 std::copy(ptr.begin(), ptr.begin() + size, m_data.begin());
135 }
136}

References Nektar::eCopy.

◆ NekVector() [10/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( unsigned int  size,
const Array< OneD, const DataType > &  ptr,
PointerWrapper  h = eCopy 
)

Definition at line 151 of file NekVector.cpp.

154 : m_size(size), m_data(ptr), m_wrapperType(h)
155{
156 if (h == eCopy)
157 {
158 ASSERTL0(size <= ptr.size(),
159 "Attempting to populate a vector of size " +
160 std::to_string(size) +
161 " but the incoming array only has " +
162 std::to_string(ptr.size()) + " elements.");
163
164 m_data = Array<OneD, DataType>(size);
165 std::copy(ptr.begin(), ptr.begin() + size, m_data.begin());
166 }
167}

◆ ~NekVector()

template<typename DataType >
Nektar::NekVector< DataType >::~NekVector

Definition at line 169 of file NekVector.cpp.

170{
171}

◆ NekVector() [11/11]

template<typename DataType >
Nektar::NekVector< DataType >::NekVector ( const Array< OneD, const DataType > &  ptr,
PointerWrapper  h 
)
private

Definition at line 139 of file NekVector.cpp.

141 : m_size(ptr.size()), m_data(ptr), m_wrapperType(h)
142{
143 if (h == eCopy)
144 {
145 m_data = Array<OneD, DataType>(m_size);
146 CopyArray(ptr, m_data);
147 }
148}

Member Function Documentation

◆ AsString()

template<typename DataType >
std::string Nektar::NekVector< DataType >::AsString

Definition at line 420 of file NekVector.cpp.

421{
422 return Nektar::AsString(*this);
423}
std::string AsString(const NekVector< DataType > &v)
Definition: NekVector.cpp:1266

References Nektar::AsString().

Referenced by Nektar::operator<<().

◆ begin() [1/2]

template<typename DataType >
NekVector< DataType >::iterator Nektar::NekVector< DataType >::begin

◆ begin() [2/2]

template<typename DataType >
NekVector< DataType >::const_iterator Nektar::NekVector< DataType >::begin

Definition at line 247 of file NekVector.cpp.

248{
249 return GetRawPtr();
250}

◆ Cross()

template<typename DataType >
NekVector< DataType > Nektar::NekVector< DataType >::Cross ( const NekVector< DataType > &  rhs) const

Definition at line 414 of file NekVector.cpp.

416{
417 return Nektar::Cross(*this, rhs);
418}
NekVector< DataType > Cross(const NekVector< DataType > &lhs, const NekVector< DataType > &rhs)
Definition: NekVector.cpp:1246

References Nektar::Cross().

◆ Dot()

template<typename DataType >
DataType Nektar::NekVector< DataType >::Dot ( const NekVector< DataType > &  rhs) const

Definition at line 408 of file NekVector.cpp.

409{
410 return Nektar::Dot(*this, rhs);
411}
DataType Dot(const NekVector< DataType > &lhs, const NekVector< DataType > &rhs)
Definition: NekVector.cpp:1193

References Nektar::Dot().

◆ end() [1/2]

template<typename DataType >
NekVector< DataType >::iterator Nektar::NekVector< DataType >::end

Definition at line 241 of file NekVector.cpp.

242{
243 return GetRawPtr() + this->GetDimension();
244}
unsigned int GetDimension() const
Returns the number of dimensions for the point.
Definition: NekVector.cpp:201

Referenced by Nektar::UnitTests::BOOST_AUTO_TEST_CASE(), Nektar::DiagonalBlockFullScalMatrixMultiply(), Nektar::DiagonalBlockMatrixMultiply(), Nektar::L1Norm(), Nektar::L2Norm(), and Nektar::operator==().

◆ end() [2/2]

template<typename DataType >
NekVector< DataType >::const_iterator Nektar::NekVector< DataType >::end

Definition at line 253 of file NekVector.cpp.

254{
255 return GetRawPtr() + GetDimension();
256}

◆ GetData()

template<typename DataType >
Array< OneD, DataType > & Nektar::NekVector< DataType >::GetData
protected

Definition at line 448 of file NekVector.cpp.

449{
450 return m_data;
451}

◆ GetDimension()

template<typename DataType >
unsigned int Nektar::NekVector< DataType >::GetDimension

◆ GetPtr() [1/2]

template<typename DataType >
Array< OneD, DataType > & Nektar::NekVector< DataType >::GetPtr

◆ GetPtr() [2/2]

template<typename DataType >
const Array< OneD, const DataType > & Nektar::NekVector< DataType >::GetPtr

Definition at line 229 of file NekVector.cpp.

230{
231 return m_data;
232}

◆ GetRawPtr() [1/2]

template<typename DataType >
DataType * Nektar::NekVector< DataType >::GetRawPtr

◆ GetRawPtr() [2/2]

template<typename DataType >
const DataType * Nektar::NekVector< DataType >::GetRawPtr

Definition at line 223 of file NekVector.cpp.

224{
225 return m_data.get();
226}

◆ GetRows()

template<typename DataType >
unsigned int Nektar::NekVector< DataType >::GetRows

◆ GetWrapperType()

template<typename DataType >
PointerWrapper Nektar::NekVector< DataType >::GetWrapperType

Definition at line 442 of file NekVector.cpp.

443{
444 return m_wrapperType;
445}

◆ InfinityNorm()

template<typename DataType >
DataType Nektar::NekVector< DataType >::InfinityNorm

Definition at line 436 of file NekVector.cpp.

437{
438 return Nektar::InfinityNorm(*this);
439}
DataType InfinityNorm(const NekVector< DataType > &v)
Definition: NekVector.cpp:1125

References Nektar::InfinityNorm().

Referenced by Nektar::UnitTests::BOOST_AUTO_TEST_CASE().

◆ L1Norm()

template<typename DataType >
DataType Nektar::NekVector< DataType >::L1Norm

Definition at line 426 of file NekVector.cpp.

427{
428 return Nektar::L1Norm(*this);
429}
DataType L1Norm(const NekVector< DataType > &v)
Definition: NekVector.cpp:1089

References Nektar::L1Norm().

Referenced by Nektar::UnitTests::BOOST_AUTO_TEST_CASE().

◆ L2Norm()

template<typename DataType >
DataType Nektar::NekVector< DataType >::L2Norm

Definition at line 431 of file NekVector.cpp.

432{
433 return Nektar::L2Norm(*this);
434}
DataType L2Norm(const NekVector< DataType > &v)
Definition: NekVector.cpp:1107

References Nektar::L2Norm().

Referenced by Nektar::UnitTests::BOOST_AUTO_TEST_CASE().

◆ Magnitude()

template<typename DataType >
DataType Nektar::NekVector< DataType >::Magnitude

Definition at line 402 of file NekVector.cpp.

403{
404 return Nektar::Magnitude(*this);
405}
DataType Magnitude(const NekVector< DataType > &v)
Definition: NekVector.cpp:1174

References Nektar::Magnitude().

Referenced by Nektar::Normalize().

◆ Normalize()

template<typename DataType >
void Nektar::NekVector< DataType >::Normalize

Definition at line 351 of file NekVector.cpp.

352{
353 return Nektar::Normalize(*this);
354}
void Normalize(NekVector< DataType > &v)
Definition: NekVector.cpp:1214

References Nektar::Normalize().

Referenced by Nektar::SpatialDomains::Movement::ReadZones().

◆ operator()() [1/2]

template<typename DataType >
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::operator() ( unsigned int  i)

Returns i^{th} element.

Parameters
iThe element to return.
Precondition
i < dim
Returns
A reference to the i^{th} element.

Retrieves the i^{th} element. Since it returns a reference you may assign a new value (i.e., p(2) = 3.2;)

This operator performs range checking.

Definition at line 260 of file NekVector.cpp.

261{
262 ASSERTL1(i < this->GetDimension(),
263 "Invalid access to m_data via parenthesis operator");
264 return this->GetData()[i];
265}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242

References ASSERTL1.

◆ operator()() [2/2]

template<typename DataType >
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::operator() ( unsigned int  i) const

Definition at line 358 of file NekVector.cpp.

359{
361 "Invalid access to m_data via parenthesis operator");
362 return m_data[i];
363}

References ASSERTL1.

◆ operator*=()

template<typename DataType >
NekVector< DataType > & Nektar::NekVector< DataType >::operator*= ( typename boost::call_traits< DataType >::const_reference  rhs)

Definition at line 336 of file NekVector.cpp.

338{
339 MultiplyEqual(*this, rhs);
340 return *this;
341}
const NekSingle void MultiplyEqual(NekMatrix< LhsDataType, StandardMatrixTag > &lhs, typename boost::call_traits< LhsDataType >::const_reference rhs)

References Nektar::MultiplyEqual().

◆ operator+=()

template<typename DataType >
NekVector< DataType > & Nektar::NekVector< DataType >::operator+= ( const NekVector< DataType > &  rhs)

Definition at line 320 of file NekVector.cpp.

322{
323 AddEqual(*this, rhs);
324 return *this;
325}
SNekMat void AddEqual(NekMatrix< DataType, StandardMatrixTag > &result, const NekMatrix< RhsDataType, RhsMatrixType > &rhs)

References Nektar::AddEqual().

◆ operator-()

template<typename DataType >
NekVector< DataType > Nektar::NekVector< DataType >::operator-

Definition at line 397 of file NekVector.cpp.

398{
399 return Negate(*this);
400}
NekVector< DataType > Negate(const NekVector< DataType > &v)
Definition: NekVector.cpp:1143

References Nektar::Negate().

◆ operator-=()

template<typename DataType >
NekVector< DataType > & Nektar::NekVector< DataType >::operator-= ( const NekVector< DataType > &  rhs)

Definition at line 328 of file NekVector.cpp.

330{
331 SubtractEqual(*this, rhs);
332 return *this;
333}
SNekMat SNekMat void SubtractEqual(NekMatrix< DataType, StandardMatrixTag > &result, const NekMatrix< RhsDataType, RhsMatrixType > &rhs)

References Nektar::SubtractEqual().

◆ operator/=()

template<typename DataType >
NekVector< DataType > & Nektar::NekVector< DataType >::operator/= ( typename boost::call_traits< DataType >::const_reference  rhs)

Definition at line 344 of file NekVector.cpp.

346{
347 DivideEqual(*this, rhs);
348 return *this;
349}
void DivideEqual(NekVector< ResultDataType > &result, const NekDouble &rhs)
Definition: NekVector.cpp:711

References Nektar::DivideEqual().

◆ operator=()

template<typename DataType >
NekVector< DataType > & Nektar::NekVector< DataType >::operator= ( const NekVector< DataType > &  rhs)

Definition at line 174 of file NekVector.cpp.

176{
177 if (m_wrapperType == eCopy)
178 {
179 // If the current vector is a copy, then regardless of the rhs type
180 // we just copy over the values, resizing if needed.
181 if (GetDimension() != rhs.GetDimension())
182 {
183 m_size = rhs.GetDimension();
184 m_data = Array<OneD, DataType>(m_size);
185 }
186 }
187 else if (m_wrapperType == eWrapper)
188 {
189 // If the current vector is wrapped, then just copy over the top,
190 // but the sizes of the two vectors must be the same.
191 ASSERTL0(
192 GetDimension() == rhs.GetDimension(),
193 "Wrapped NekVectors must have the same dimension in operator=");
194 }
195
196 std::copy(rhs.begin(), rhs.end(), m_data.get());
197 return *this;
198}

◆ operator[]() [1/2]

template<typename DataType >
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::operator[] ( unsigned int  i)

Definition at line 269 of file NekVector.cpp.

270{
271 return this->GetData()[i];
272}

◆ operator[]() [2/2]

template<typename DataType >
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::operator[] ( unsigned int  i) const

Definition at line 367 of file NekVector.cpp.

368{
369 return m_data[i];
370}

◆ Resize()

template<typename DataType >
void Nektar::NekVector< DataType >::Resize ( unsigned int  newSize)
protected

Definition at line 471 of file NekVector.cpp.

472{
473 if (m_data.size() < newSize)
474 {
475 m_data = Array<OneD, DataType>(newSize);
476 }
477 m_size = newSize;
478}
size_type size() const
Returns the array's size.

◆ SetData()

template<typename DataType >
void Nektar::NekVector< DataType >::SetData ( const Array< OneD, DataType > &  newData)
protected

Definition at line 465 of file NekVector.cpp.

466{
467 m_data = newData;
468}

◆ SetSize()

template<typename DataType >
void Nektar::NekVector< DataType >::SetSize ( unsigned int  s)
protected

Definition at line 453 of file NekVector.cpp.

454{
455 m_size = s;
456}

◆ SetWrapperType()

template<typename DataType >
void Nektar::NekVector< DataType >::SetWrapperType ( PointerWrapper  p)
protected

◆ SetX()

template<typename DataType >
void Nektar::NekVector< DataType >::SetX ( typename boost::call_traits< DataType >::const_reference  val)

Definition at line 296 of file NekVector.cpp.

298{
299 ASSERTL1(this->GetDimension() >= 1, "Invalid use of NekVector::SetX");
300 this->GetData()[0] = val;
301}

References ASSERTL1.

◆ SetY()

template<typename DataType >
void Nektar::NekVector< DataType >::SetY ( typename boost::call_traits< DataType >::const_reference  val)

Definition at line 304 of file NekVector.cpp.

306{
307 ASSERTL1(this->GetDimension() >= 2, "Invalid use of NekVector::SetX");
308 this->GetData()[1] = val;
309}

References ASSERTL1.

◆ SetZ()

template<typename DataType >
void Nektar::NekVector< DataType >::SetZ ( typename boost::call_traits< DataType >::const_reference  val)

Definition at line 312 of file NekVector.cpp.

314{
315 ASSERTL1(this->GetDimension() >= 3, "Invalid use of NekVector::SetX");
316 this->GetData()[2] = val;
317}

References ASSERTL1.

◆ x() [1/2]

template<typename DataType >
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::x

Definition at line 275 of file NekVector.cpp.

276{
277 ASSERTL1(this->GetDimension() >= 1, "Invalid use of NekVector::x");
278 return (*this)(0);
279}

References ASSERTL1.

Referenced by Nektar::UnitTests::BOOST_AUTO_TEST_CASE(), and Nektar::Cross().

◆ x() [2/2]

template<typename DataType >
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::x

Definition at line 373 of file NekVector.cpp.

375{
376 ASSERTL1(GetDimension() >= 1, "Invalid use of NekVector::x");
377 return (*this)(0);
378}

References ASSERTL1.

◆ y() [1/2]

template<typename DataType >
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::y

Definition at line 282 of file NekVector.cpp.

283{
284 ASSERTL1(this->GetDimension() >= 2, "Invalid use of NekVector::y");
285 return (*this)(1);
286}

References ASSERTL1.

Referenced by Nektar::UnitTests::BOOST_AUTO_TEST_CASE(), and Nektar::Cross().

◆ y() [2/2]

template<typename DataType >
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::y

Definition at line 381 of file NekVector.cpp.

383{
384 ASSERTL1(GetDimension() >= 2, "Invalid use of NekVector::y");
385 return (*this)(1);
386}

References ASSERTL1.

◆ z() [1/2]

template<typename DataType >
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::z

Definition at line 289 of file NekVector.cpp.

290{
291 ASSERTL1(this->GetDimension() >= 3, "Invalid use of NekVector::z");
292 return (*this)(2);
293}

References ASSERTL1.

Referenced by Nektar::UnitTests::BOOST_AUTO_TEST_CASE(), and Nektar::Cross().

◆ z() [2/2]

template<typename DataType >
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::z

Definition at line 389 of file NekVector.cpp.

391{
392 ASSERTL1(GetDimension() >= 3, "Invalid use of NekVector::z");
393 return (*this)(2);
394}

References ASSERTL1.

Member Data Documentation

◆ m_data

template<typename DataType >
Array<OneD, DataType> Nektar::NekVector< DataType >::m_data
private

Definition at line 205 of file NekVector.hpp.

Referenced by Nektar::NekVector< DataType >::NekVector().

◆ m_size

template<typename DataType >
unsigned int Nektar::NekVector< DataType >::m_size
private

Definition at line 204 of file NekVector.hpp.

Referenced by Nektar::NekVector< DataType >::NekVector().

◆ m_wrapperType

template<typename DataType >
PointerWrapper Nektar::NekVector< DataType >::m_wrapperType
private

Definition at line 206 of file NekVector.hpp.