Nektar++
|
#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 |
Definition at line 69 of file NekVector.hpp.
typedef const DataType* Nektar::NekVector< DataType >::const_iterator |
Definition at line 154 of file NekVector.hpp.
typedef DataType* Nektar::NekVector< DataType >::iterator |
Definition at line 150 of file NekVector.hpp.
Nektar::NekVector< DataType >::NekVector | ( | ) |
Creates an empty vector.
Definition at line 44 of file NekVector.cpp.
|
explicit |
Creates a vector of given size. The elements are not initialized.
Definition at line 52 of file NekVector.cpp.
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 60 of file NekVector.cpp.
References Nektar::Array< OneD, DataType >::get(), Nektar::NekVector< DataType >::m_data, and Nektar::NekVector< DataType >::m_size.
|
explicit |
Definition at line 69 of file NekVector.cpp.
References ASSERTL0, Nektar::Array< OneD, DataType >::begin(), CellMLToNektar.pycml::copy(), ErrorUtil::efatal, Nektar::NekVector< DataType >::m_data, Nektar::NekVector< DataType >::m_size, and NEKERROR.
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 90 of file NekVector.cpp.
References Nektar::NekVector< DataType >::m_data, Nektar::NekVector< DataType >::x(), Nektar::NekVector< DataType >::y(), and Nektar::NekVector< DataType >::z().
Nektar::NekVector< DataType >::NekVector | ( | const NekVector< DataType > & | rhs | ) |
Definition at line 103 of file NekVector.cpp.
References Nektar::NekVector< DataType >::begin(), CellMLToNektar.pycml::copy(), Nektar::eCopy, Nektar::NekVector< DataType >::end(), Nektar::Array< OneD, DataType >::get(), Nektar::NekVector< DataType >::m_data, Nektar::NekVector< DataType >::m_size, and Nektar::NekVector< DataType >::m_wrapperType.
Nektar::NekVector< DataType >::NekVector | ( | unsigned int | size, |
const DataType *const | ptr | ||
) |
Definition at line 116 of file NekVector.cpp.
|
explicit |
Definition at line 124 of file NekVector.cpp.
References Nektar::CopyArray(), Nektar::eCopy, Nektar::NekVector< DataType >::m_data, and Nektar::NekVector< DataType >::m_size.
Nektar::NekVector< DataType >::NekVector | ( | unsigned int | size, |
Array< OneD, DataType > & | ptr, | ||
PointerWrapper | h = eCopy |
||
) |
Definition at line 137 of file NekVector.cpp.
References ASSERTL0, Nektar::Array< OneD, DataType >::begin(), CellMLToNektar.pycml::copy(), Nektar::eCopy, Nektar::NekVector< DataType >::m_data, and Nektar::Array< OneD, const DataType >::num_elements().
Nektar::NekVector< DataType >::NekVector | ( | unsigned int | size, |
const Array< OneD, const DataType > & | ptr, | ||
PointerWrapper | h = eCopy |
||
) |
Definition at line 167 of file NekVector.cpp.
References ASSERTL0, Nektar::Array< OneD, const DataType >::begin(), Nektar::Array< OneD, DataType >::begin(), CellMLToNektar.pycml::copy(), Nektar::eCopy, Nektar::NekVector< DataType >::m_data, and Nektar::Array< OneD, const DataType >::num_elements().
Nektar::NekVector< DataType >::~NekVector | ( | ) |
Definition at line 184 of file NekVector.cpp.
|
private |
Definition at line 154 of file NekVector.cpp.
References Nektar::CopyArray(), Nektar::eCopy, Nektar::NekVector< DataType >::m_data, and Nektar::NekVector< DataType >::m_size.
std::string Nektar::NekVector< DataType >::AsString | ( | ) | const |
NekVector< DataType >::iterator Nektar::NekVector< DataType >::begin | ( | ) |
Definition at line 242 of file NekVector.cpp.
Referenced by Nektar::DiagonalBlockFullScalMatrixMultiply(), Nektar::DiagonalBlockMatrixMultiply(), Nektar::L1Norm(), Nektar::L2Norm(), Nektar::NekVector< DataType >::NekVector(), Nektar::NekVector< DataType >::operator=(), and Nektar::operator==().
NekVector< DataType >::const_iterator Nektar::NekVector< DataType >::begin | ( | ) | const |
Definition at line 248 of file NekVector.cpp.
NekVector< DataType > Nektar::NekVector< DataType >::Cross | ( | const NekVector< DataType > & | rhs | ) | const |
Definition at line 385 of file NekVector.cpp.
References Nektar::Cross().
DataType Nektar::NekVector< DataType >::Dot | ( | const NekVector< DataType > & | rhs | ) | const |
Definition at line 382 of file NekVector.cpp.
References Nektar::Dot().
NekVector< DataType >::iterator Nektar::NekVector< DataType >::end | ( | ) |
Definition at line 245 of file NekVector.cpp.
Referenced by Nektar::DiagonalBlockFullScalMatrixMultiply(), Nektar::DiagonalBlockMatrixMultiply(), Nektar::L1Norm(), Nektar::L2Norm(), Nektar::NekVector< DataType >::NekVector(), Nektar::NekVector< DataType >::operator=(), and Nektar::operator==().
NekVector< DataType >::const_iterator Nektar::NekVector< DataType >::end | ( | ) | const |
Definition at line 251 of file NekVector.cpp.
|
protected |
Definition at line 407 of file NekVector.cpp.
unsigned int Nektar::NekVector< DataType >::GetDimension | ( | ) | const |
Returns the number of dimensions for the point.
Definition at line 212 of file NekVector.cpp.
Referenced by Nektar::Add(), Nektar::AddEqual(), Nektar::AddEqualNegatedLhs(), Nektar::AddNegatedLhs(), Nektar::AsString(), Nektar::Cross(), Nektar::Divide(), Nektar::DivideEqual(), Nektar::Dot(), Nektar::FullBlockMatrixMultiply(), Nektar::InfinityNorm(), Nektar::Magnitude(), Nektar::Multiply(), Nektar::MultiplyEqual(), Nektar::MultiplyInvertedLhs(), Nektar::Negate(), Nektar::NegateInPlace(), Nektar::NekVector< DataType >::operator=(), Nektar::operator==(), DBUtils::Output1DArray(), Nektar::MultiRegions::GlobalLinSysIterative::Set_Rhs_Magnitude(), Nektar::Subtract(), Nektar::SubtractEqual(), Nektar::SubtractEqualNegatedLhs(), and Nektar::SubtractNegatedLhs().
Array< OneD, DataType > & Nektar::NekVector< DataType >::GetPtr | ( | ) |
Definition at line 230 of file NekVector.cpp.
Referenced by Nektar::MultiRegions::AssemblyMap::AssembleBnd(), Nektar::LibUtilities::NodalTriElec::CalculateWeights(), Nektar::LibUtilities::NodalTriEvenlySpaced::CalculateWeights(), Nektar::LibUtilities::NodalTriFekete::CalculateWeights(), Nektar::LibUtilities::NodalPrismElec::CalculateWeights(), Nektar::LibUtilities::NodalTetElec::CalculateWeights(), Nektar::LibUtilities::NodalTetEvenlySpaced::CalculateWeights(), Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculateWeights(), Nektar::MultiRegions::DisContField3D::EvaluateHDGPostProcessing(), Nektar::MultiRegions::DisContField2D::EvaluateHDGPostProcessing(), Nektar::MultiRegions::AssemblyMap::GlobalToLocalBnd(), Nektar::MultiRegions::AssemblyMap::LocalBndToGlobal(), Nektar::StdRegions::ToArray(), Nektar::MultiRegions::AssemblyMap::UniversalAssembleBnd(), Nektar::MultiRegions::AssemblyMapCG::v_Assemble(), Nektar::MultiRegions::GlobalLinSysPETScStaticCond::v_DoMatrixMultiply(), Nektar::SpatialDomains::SegGeom::v_FillGeom(), Nektar::MultiRegions::AssemblyMapCG::v_GlobalToLocal(), Nektar::MultiRegions::AssemblyMapCG::v_LocalToGlobal(), Nektar::MultiRegions::GlobalLinSysStaticCond::v_Solve(), Nektar::MultiRegions::AssemblyMapDG::v_UniversalAssemble(), and Nektar::MultiRegions::AssemblyMapCG::v_UniversalAssemble().
const Array< OneD, const DataType > & Nektar::NekVector< DataType >::GetPtr | ( | ) | const |
Definition at line 239 of file NekVector.cpp.
DataType * Nektar::NekVector< DataType >::GetRawPtr | ( | ) |
Definition at line 224 of file NekVector.cpp.
Referenced by Nektar::Add(), Nektar::AddEqual(), Nektar::AddEqualNegatedLhs(), Nektar::AddNegatedLhs(), Nektar::DiagonalBlockFullScalMatrixMultiply(), Nektar::DiagonalBlockMatrixMultiply(), Nektar::Divide(), Nektar::DivideEqual(), Nektar::FullBlockMatrixMultiply(), Nektar::Multiply(), Nektar::MultiplyEqual(), Nektar::MultiplyInvertedLhs(), Nektar::NegateInPlace(), Nektar::Subtract(), Nektar::SubtractEqual(), Nektar::SubtractEqualNegatedLhs(), and Nektar::SubtractNegatedLhs().
const DataType * Nektar::NekVector< DataType >::GetRawPtr | ( | ) | const |
Definition at line 233 of file NekVector.cpp.
unsigned int Nektar::NekVector< DataType >::GetRows | ( | ) | const |
Definition at line 218 of file NekVector.cpp.
Referenced by Nektar::AsString(), Nektar::LibUtilities::NodalTriElec::CalculateWeights(), Nektar::LibUtilities::NodalPrismElec::CalculateWeights(), Nektar::LibUtilities::NodalTriEvenlySpaced::CalculateWeights(), Nektar::LibUtilities::NodalTriFekete::CalculateWeights(), Nektar::LibUtilities::NodalTetElec::CalculateWeights(), Nektar::LibUtilities::NodalTetEvenlySpaced::CalculateWeights(), Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculateWeights(), Nektar::DiagonalBlockFullScalMatrixMultiply(), Nektar::DiagonalBlockMatrixMultiply(), Nektar::StdRegions::GetSize(), Nektar::Multiply(), and Nektar::StdRegions::VectorToString().
PointerWrapper Nektar::NekVector< DataType >::GetWrapperType | ( | ) | const |
Definition at line 404 of file NekVector.cpp.
DataType Nektar::NekVector< DataType >::InfinityNorm | ( | ) | const |
Definition at line 401 of file NekVector.cpp.
References Nektar::InfinityNorm().
DataType Nektar::NekVector< DataType >::L1Norm | ( | ) | const |
DataType Nektar::NekVector< DataType >::L2Norm | ( | ) | const |
DataType Nektar::NekVector< DataType >::Magnitude | ( | ) | const |
Definition at line 379 of file NekVector.cpp.
References Nektar::Magnitude().
Referenced by Nektar::Normalize().
void Nektar::NekVector< DataType >::Normalize | ( | ) |
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::operator() | ( | unsigned int | i | ) |
Returns i^{th} element.
i | The element to return. |
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 254 of file NekVector.cpp.
References ASSERTL1.
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::operator() | ( | unsigned int | i | ) | const |
Definition at line 340 of file NekVector.cpp.
References ASSERTL1.
NekVector< DataType > & Nektar::NekVector< DataType >::operator*= | ( | typename boost::call_traits< DataType >::const_reference | rhs | ) |
Definition at line 323 of file NekVector.cpp.
References Nektar::MultiplyEqual().
NekVector< DataType > & Nektar::NekVector< DataType >::operator+= | ( | const NekVector< DataType > & | rhs | ) |
Definition at line 309 of file NekVector.cpp.
References Nektar::AddEqual().
NekVector< DataType > Nektar::NekVector< DataType >::operator- | ( | ) | const |
Definition at line 375 of file NekVector.cpp.
References Nektar::Negate().
NekVector< DataType > & Nektar::NekVector< DataType >::operator-= | ( | const NekVector< DataType > & | rhs | ) |
Definition at line 316 of file NekVector.cpp.
References Nektar::SubtractEqual().
NekVector< DataType > & Nektar::NekVector< DataType >::operator/= | ( | typename boost::call_traits< DataType >::const_reference | rhs | ) |
Definition at line 330 of file NekVector.cpp.
References Nektar::DivideEqual().
NekVector< DataType > & Nektar::NekVector< DataType >::operator= | ( | const NekVector< DataType > & | rhs | ) |
Definition at line 187 of file NekVector.cpp.
References ASSERTL0, Nektar::NekVector< DataType >::begin(), CellMLToNektar.pycml::copy(), Nektar::eCopy, Nektar::NekVector< DataType >::end(), Nektar::eWrapper, and Nektar::NekVector< DataType >::GetDimension().
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::operator[] | ( | unsigned int | i | ) |
Definition at line 261 of file NekVector.cpp.
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::operator[] | ( | unsigned int | i | ) | const |
Definition at line 347 of file NekVector.cpp.
|
protected |
Definition at line 419 of file NekVector.cpp.
|
protected |
Definition at line 416 of file NekVector.cpp.
|
protected |
Definition at line 410 of file NekVector.cpp.
|
protected |
void Nektar::NekVector< DataType >::SetX | ( | typename boost::call_traits< DataType >::const_reference | val | ) |
Definition at line 288 of file NekVector.cpp.
References ASSERTL1.
void Nektar::NekVector< DataType >::SetY | ( | typename boost::call_traits< DataType >::const_reference | val | ) |
Definition at line 295 of file NekVector.cpp.
References ASSERTL1.
void Nektar::NekVector< DataType >::SetZ | ( | typename boost::call_traits< DataType >::const_reference | val | ) |
Definition at line 302 of file NekVector.cpp.
References ASSERTL1.
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::x | ( | ) |
Definition at line 267 of file NekVector.cpp.
References ASSERTL1.
Referenced by Nektar::Cross(), and Nektar::NekVector< DataType >::NekVector().
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::x | ( | ) | const |
Definition at line 353 of file NekVector.cpp.
References ASSERTL1.
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::y | ( | ) |
Definition at line 274 of file NekVector.cpp.
References ASSERTL1.
Referenced by Nektar::Cross(), and Nektar::NekVector< DataType >::NekVector().
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::y | ( | ) | const |
Definition at line 360 of file NekVector.cpp.
References ASSERTL1.
boost::call_traits< DataType >::reference Nektar::NekVector< DataType >::z | ( | ) |
Definition at line 281 of file NekVector.cpp.
References ASSERTL1.
Referenced by Nektar::Cross(), and Nektar::NekVector< DataType >::NekVector().
boost::call_traits< DataType >::const_reference Nektar::NekVector< DataType >::z | ( | ) | const |
Definition at line 367 of file NekVector.cpp.
References ASSERTL1.
|
private |
Definition at line 241 of file NekVector.hpp.
Referenced by Nektar::NekVector< DataType >::NekVector().
|
private |
Definition at line 240 of file NekVector.hpp.
Referenced by Nektar::NekVector< DataType >::NekVector().
|
private |
Definition at line 242 of file NekVector.hpp.
Referenced by Nektar::NekVector< DataType >::NekVector().