OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
vectorHelpers.h File Reference
#include <assert.h>
#include <vector>
#include <string>
#include <sstream>
#include <limits>
#include "io/ostreamManager.h"
#include "utilities/omath.h"
#include "core/vector.h"
#include "aDiff.h"
+ Include dependency graph for vectorHelpers.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  olb::util::ContainerCreator< C >
 Creates a container of type C. More...
 
struct  olb::util::ContainerCreator< std::vector< T > >
 
struct  olb::util::ContainerCreator< std::array< T, SIZE > >
 
struct  olb::util::ContainerCreator< Vector< T, SIZE > >
 

Namespaces

namespace  olb
 Top level namespace for all of OpenLB.
 
namespace  olb::util
 

Typedefs

template<typename S >
using olb::util::StdVector = std::vector<S,std::allocator<S>>
 

Functions

template<class T , unsigned DIM>
ADf< T, DIM > olb::util::sqrt (const ADf< T, DIM > &a)
 
template<typename T >
bool olb::util::nearZero (T a)
 return true if a is close to zero
 
template<typename T >
bool olb::util::nearZero (T a, T epsilon)
 
template<typename T , typename U = T, typename W = T>
bool olb::util::approxEqual (T a, U b, W epsilon)
 
template<typename T , typename U = T>
bool olb::util::approxEqual (T a, U b)
 
template<class T >
void olb::util::copyN (T c[], const T a[], const unsigned dim) any_platform
 
template<class S , class T >
void olb::util::copyN (S c[], const T a[], const unsigned dim) any_platform
 
template<class T >
void olb::util::copy3 (T c[], const T a[])
 
template<typename T >
std::vector< T > olb::util::fromVector3 (const Vector< T, 3 > &vec)
 
template<typename T >
std::vector< T > olb::util::fromVector2 (const Vector< T, 2 > &vec)
 
template<typename T >
olb::util::norm (const std::vector< T > &a)
 l2 norm of a vector of arbitrary length
 
template<typename T >
olb::util::norm2 (const std::vector< T > &a)
 l2 norm to the power of 2 of a vector of arbitrary length
 
template<typename T >
olb::util::dotProduct3D (const Vector< T, 3 > &a, const Vector< T, 3 > &b)
 dot product, only valid in 3d
 
template<typename T >
olb::util::dotProduct2D (const Vector< T, 2 > &a, const Vector< T, 2 > &b)
 dot product, only valid in 2d
 
template<typename T , unsigned D>
olb::util::dotProduct (const Vector< T, D > &a, const Vector< T, D > &b)
 dot product
 
template<typename T , unsigned D>
Vector< T, D > olb::util::normalize (const Vector< T, D > &a)
 
template<typename T >
std::vector< T > olb::util::normalize (const std::vector< T > &a)
 returns a normalized vector, works for arbitrary lengths
 
template<typename T , unsigned Size>
Vector< T, Size > olb::util::floor (const Vector< T, Size > &a)
 applies floor to each component of a vector
 
template<typename T , unsigned Size>
Vector< T, Size > olb::util::ceil (const Vector< T, Size > &a)
 applies ceil to each component of a vector
 
template<typename T , typename S , unsigned Size>
Vector< T, Size > olb::util::fmod (const Vector< T, Size > &a, S b)
 applies fmod to each component of a vector
 
template<typename T , unsigned Size>
olb::util::average (const Vector< T, Size > &a)
 computes the average of all elements
 
template<typename T , unsigned Size>
olb::util::max_element (const Vector< T, Size > &a)
 finds maximum element of all elements
 
template<typename T , unsigned Size>
olb::util::min_element (const Vector< T, Size > &a)
 finds minimum element of all elements
 
template<typename T , unsigned Size>
unsigned olb::util::maxElementPos (const Vector< T, Size > &a)
 finds position of maximum element of all elements
 
template<typename T , unsigned Size>
unsigned olb::util::minElementPos (const Vector< T, Size > &a)
 finds position of minimum element of all elements
 
template<typename T , unsigned Size>
olb::util::maxElementAbs (const Vector< T, Size > &a)
 finds maximum element of all absolute elements
 
template<typename T , unsigned Size>
unsigned olb::util::maxElementAbsPos (const Vector< T, Size > &a)
 finds position of maximum element of all absolute elements
 
template<typename T , bool ensureAngularBounds = true>
olb::util::angleBetweenVectors (const Vector< T, 2 > &a, const Vector< T, 2 > &b)
 Calculates angles between two 2D vectors.
 
template<typename T , bool ensureAngularBounds = true>
Vector< T, 3 > olb::util::angleBetweenVectors (const Vector< T, 3 > &a, const Vector< T, 3 > &b)
 Calculates angles between two 3D vectors.
 
template<typename T >
std::vector< T > olb::util::assign (T a, T b)
 
template<typename T >
std::vector< T > olb::util::assign (T a, T b, T c)
 
template<typename U >
void olb::util::print (U data, const std::string &name="", OstreamManager clout=OstreamManager(std::cout,"print"), const char delimiter=',')
 
template<typename C , typename U >
bool olb::util::isContained (const C &c, U object)
 Check, if object is contained in iteratable container c.