COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Functions
cf3::math::Functions Namespace Reference

Static functions for various useful operations. More...

Functions

Real signum (const Real &value)
 
Real sign (const Real &value)
 
Real change_sign (const Real &value, const Real &newSignValue)
 
Real heavyside (const Real &value)
 
template<class T1 , class T2 >
Real get_distance (const T1 &n1, const T2 &n2)
 
Uint factorial (const Uint &n)
 
template<class T1 , class T2 , class T3 , class T4 >
Real mixed_product (const T1 &v1, const T2 &v2, const T3 &v3, T4 &temp)
 
template<class T1 , class T2 , class T3 >
void cross_product (const T1 &v1, const T2 &v2, T3 &result)
 
template<class T1 , class T2 >
Real inner_product (const T1 &v1, const T2 &v2)
 
template<class T1 , class T2 , class T3 >
void tensor_product (const T1 &v1, const T2 &v2, T3 &m)
 

Detailed Description

Static functions for various useful operations.

Author
Andrea Lani
Tiago Quintino
Mehmet Sarp Yalim

Function Documentation

Real change_sign ( const Real &  value,
const Real &  newSignValue 
)
inline

Change the sign of the first argument with the sign of the second argument

Parameters
valuethe value of this will be returned
newSignValuethe sign of what will be returned
Returns
the value with the sign of newSignValue

Definition at line 125 of file Functions.hpp.

void cross_product ( const T1 &  v1,
const T2 &  v2,
T3 &  result 
)
inline

Cross Product for vector*vector operations

Precondition
v1.size() == v2.size() == result.size() == 3
Parameters
v1first vector
v2second vector
resultvector storing the result

Definition at line 181 of file Functions.hpp.

Uint factorial ( const Uint n)
inline

Calculate the factorial

Parameters
ncalculate factorial of this number
Returns
factorial of n

Definition at line 155 of file Functions.hpp.

Real get_distance ( const T1 &  n1,
const T2 &  n2 
)
inline

Calculate the euclidean distance between two "points"

Precondition
T1 and T2 must have the overloading of the operator[] implemented

Definition at line 140 of file Functions.hpp.

Real heavyside ( const Real &  value)
inline

Heavyside function

Parameters
valueis real
Returns
1.0 if value > 0.0
0.0 if value < 0.0
0.5 if value = 0.0

Definition at line 131 of file Functions.hpp.

Real inner_product ( const T1 &  v1,
const T2 &  v2 
)
inline

Internal Product for vector*vector operations \( s = v \cdot v1 \). Objects must be of same size.

Parameters
v1first vector
v2second vector
Returns
the inner product of the two given vectors

Definition at line 197 of file Functions.hpp.

Real mixed_product ( const T1 &  v1,
const T2 &  v2,
const T3 &  v3,
T4 &  temp 
)
inline

Mixed Product of three vectors

Precondition
size() == 3 == v1.size() == v2.size() == v3.size() == temp.size() (cf3_assertion can check this)
Parameters
v1first vector
v2second vector
v3third vector
temptemporary vector
Returns
the mixed product

Definition at line 165 of file Functions.hpp.

Real sign ( const Real &  value)
inline

Sign function

Parameters
valuethe real to which infer the sign
Returns
-1.0 if value < 0.0
1.0 if value >= 0.0

Definition at line 118 of file Functions.hpp.

Real signum ( const Real &  value)
inline

Signum function

Parameters
valuethe real to which infer the sign
Returns
-1.0 if value < 0.0
0.0 if value = 0.0
1.0 if value > 0.0

Definition at line 110 of file Functions.hpp.

void tensor_product ( const T1 &  v1,
const T2 &  v2,
T3 &  m 
)
inline

Tensor Product for vector*vector operations \( s = v \cdot v1 \).

Parameters
v1[in] first vector
v2[in] second vector
v3[out] the tensor product of the two given vectors

Definition at line 210 of file Functions.hpp.

Send comments to:
COOLFluiD Web Admin