# PhasicFlow: src/phasicFlow/types/triple/tripleMath.hpp Source File

tripleMath.hpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#define T3Func(fnName) \
template<typename T> \
INLINE_FUNCTION_HD pFlow::triple<T> pFlow::fnName(const pFlow::triple<T>& v) \
{ \
return pFlow::triple<T>(fnName(v.x_), fnName(v.y_), fnName(v.z_)); \
}
#define T3Func2(fnName) \
template<typename T> \
INLINE_FUNCTION_HD pFlow::triple<T> pFlow::fnName(const pFlow::triple<T>& arg1, const pFlow::triple<T>& arg2) \
{ \
return pFlow::triple<T>(fnName(arg1.x_, arg2.x_), fnName(arg1.y_,arg2.y_), fnName(arg1.z_, arg2.z_)); \
}
//* * * * * * * * * * * List of functinos * * * * * * * * //
// abs, mod, exp, log, log10, pow, sqrt, cbrt
// sin, cos, tan, asin, acos, atan, atan2
// sinh, cosh, tanh, asinh, acosh, atanh
// min, max
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * //
T3Func(abs);
T3Func2(mod);
T3Func(exp);
T3Func(log);
T3Func(log10);
T3Func2(pow);
T3Func(sqrt);
T3Func(cbrt);
T3Func(sin);
T3Func(cos);
T3Func(tan);
T3Func(asin);
T3Func(acos);
T3Func(atan);
T3Func2(atan2);
T3Func(sinh);
T3Func(cosh);
T3Func(tanh);
T3Func(asinh);
T3Func(acosh);
T3Func(atanh);
T3Func2(min);
T3Func2(max);
// elements of t3 raised by e
template<typename T>
INLINE_FUNCTION_HD pFlow::triple<T> pFlow::pow(const pFlow::triple<T>& t3, T e)
{
return pFlow::triple<T>( pow(t3.x_, e), pow(t3.y_,e), pow(t3.z_,e));
}
// return the min of 3 elements x, y, z
template<typename T>
INLINE_FUNCTION_HD T pFlow::min(const pFlow::triple<T>& t3)
{
return min( min(t3.x_, t3.y_), t3.z_);
}
// return the max of 3 elements x, y, z
template<typename T>
INLINE_FUNCTION_HD T pFlow::max(const pFlow::triple<T>& t3)
{
return max( max(t3.x_, t3.y_), t3.z_);
}
#undef T3Func
#undef T3Func2
pFlow::atan
INLINE_FUNCTION_HD real atan(real x)
Definition: math.hpp:218
pFlow::atan2
INLINE_FUNCTION_HD real atan2(real y, real x)
Definition: math.hpp:229
T3Func2
#define T3Func2(fnName)
Definition: tripleMath.hpp:28
T3Func
#define T3Func(fnName)
Definition: tripleMath.hpp:21
pFlow::atanh
INLINE_FUNCTION_HD real atanh(real x)
Definition: math.hpp:286
pFlow::cos
INLINE_FUNCTION_HD real cos(real x)
Definition: math.hpp:178
pFlow::algorithms::KOKKOS::min
INLINE_FUNCTION_H Type min(const Type *first, int32 numElems)
Definition: kokkosAlgorithms.hpp:124
pFlow::sin
INLINE_FUNCTION_HD real sin(real x)
Definition: math.hpp:168
pFlow::cosh
INLINE_FUNCTION_HD real cosh(real x)
Definition: math.hpp:249
pFlow::asin
INLINE_FUNCTION_HD real asin(real x)
Definition: math.hpp:197
pFlow::log10
INLINE_FUNCTION_HD real log10(real x)
Definition: math.hpp:128
pFlow::log
INLINE_FUNCTION_HD real log(real x)
Definition: math.hpp:119
pFlow::tan
INLINE_FUNCTION_HD real tan(real x)
Definition: math.hpp:188
pFlow::sinh
INLINE_FUNCTION_HD real sinh(real x)
Definition: math.hpp:239
pFlow::algorithms::KOKKOS::max
INLINE_FUNCTION_H Type max(const Type *first, int32 numElems)
Definition: kokkosAlgorithms.hpp:104
pFlow::pow
Vector< T, Allocator > pow(const Vector< T, Allocator > &v, T e)
Definition: VectorMath.hpp:109
pFlow::abs
INLINE_FUNCTION_HD real abs(real x)
Definition: math.hpp:43
pFlow::triple::x_
T x_
Definition: triple.hpp:49
pFlow::acos
INLINE_FUNCTION_HD real acos(real x)
Definition: math.hpp:208
pFlow::mod
INLINE_FUNCTION_HD real mod(real x, real y)
Definition: math.hpp:72
pFlow::tanh
INLINE_FUNCTION_HD real tanh(real x)
Definition: math.hpp:259
pFlow::exp
INLINE_FUNCTION_HD real exp(real x)
Definition: math.hpp:110
pFlow::max
T max(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:164
pFlow::triple::y_
T y_
Definition: triple.hpp:50
pFlow::asinh
INLINE_FUNCTION_HD real asinh(real x)
Definition: math.hpp:268
pFlow::triple::z_
T z_
Definition: triple.hpp:51
pFlow::acosh
INLINE_FUNCTION_HD real acosh(real x)
Definition: math.hpp:277
pFlow::sqrt
INLINE_FUNCTION_HD real sqrt(real x)
Definition: math.hpp:148
pFlow::cbrt
INLINE_FUNCTION_HD real cbrt(real x)
Definition: math.hpp:158
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:51
pFlow::triple
Definition: triple.hpp:37
pFlow::min
T min(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:138