# PhasicFlow: src/phasicFlow/types/quadruple/quadrupleMath.hpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

quadrupleMath.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 Q4Func(fnName) \
template<typename T> \
inline pFlow::quadruple<T> pFlow::fnName(const quadruple<T>& q) \
{ \
return quadruple<T>(fnName(q.s_), fnName(q.v_)); \
}
#define Q4Func2(fnName) \
template<typename T> \
inline pFlow::quadruple<T> pFlow::fnName( \
const quadruple<T>& arg1, const quadruple<T>& arg2 \
) \
{ \
return quadruple<T>( \
fnName(arg1.s_, arg2.s_), fnName(arg1.v_, arg2.v_) \
); \
}
//* * * * * * * * * * * 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
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Q4Func(abs);
Q4Func2(mod);
Q4Func(exp);
Q4Func(log);
Q4Func(log10);
Q4Func2(pow);
Q4Func(sqrt);
Q4Func(cbrt);
Q4Func(sin);
Q4Func(cos);
Q4Func(tan);
Q4Func(asin);
Q4Func(acos);
Q4Func(atan);
Q4Func2(atan2);
Q4Func(sinh);
Q4Func(cosh);
Q4Func(tanh);
Q4Func(asinh);
Q4Func(acosh);
Q4Func(atanh);
Q4Func2(min);
Q4Func2(max);
template<typename T>
inline pFlow::quadruple<T>
pFlow::pow(const quadruple<T>& q4, T e)
{
return quadruple<T>(pow(q4.s_, e), pow(q4.v_, e));
}
// return the min of 3 elements x, y, z
template<typename T>
inline T
pFlow::min(const quadruple<T>& q4)
{
return min(min(q4.v_), q4.s_);
}
// return the max of 3 elements x, y, z
template<typename T>
inline T
pFlow::max(const quadruple<T>& q4)
{
return max(max(q4.v_), q4.s_);
}
#undef Q4Func
#undef Q4Func2
pFlow::exp
Vector< T, Allocator > exp(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:86
pFlow::atan
Vector< T, Allocator > atan(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:97
pFlow::asin
Vector< T, Allocator > asin(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:95
pFlow::cbrt
Vector< T, Allocator > cbrt(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:91
pFlow::sinh
Vector< T, Allocator > sinh(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:99
pFlow::pow
Vector< T, Allocator > pow(const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
Definition: VectorMath.hpp:89
pFlow::sqrt
Vector< T, Allocator > sqrt(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:90
pFlow::cosh
Vector< T, Allocator > cosh(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:100
pFlow::algorithms::KOKKOS::max
INLINE_FUNCTION_H Type max(const Type *first, uint32 numElems)
Definition: kokkosAlgorithms.hpp:104
pFlow::cos
Vector< T, Allocator > cos(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:93
pFlow::algorithms::KOKKOS::min
INLINE_FUNCTION_H Type min(const Type *first, int32 numElems)
Definition: kokkosAlgorithms.hpp:124
pFlow::max
T max(const internalField< T, MemorySpace > &iField)
Definition: internalFieldAlgorithms.hpp:79
Q4Func
#define Q4Func(fnName)
Definition: quadrupleMath.hpp:21
pFlow::asinh
Vector< T, Allocator > asinh(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:102
pFlow::log10
Vector< T, Allocator > log10(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:88
pFlow::log
Vector< T, Allocator > log(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:87
pFlow::mod
Vector< T, Allocator > mod(const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
Definition: VectorMath.hpp:85
pFlow::abs
Vector< T, Allocator > abs(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:84
pFlow::min
T min(const internalField< T, MemorySpace > &iField)
Definition: internalFieldAlgorithms.hpp:28
Q4Func2
#define Q4Func2(fnName)
Definition: quadrupleMath.hpp:28
pFlow::sin
Vector< T, Allocator > sin(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:92
pFlow::atanh
Vector< T, Allocator > atanh(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:104
pFlow::quadruple
Definition: quadruple.hpp:36
pFlow::tanh
Vector< T, Allocator > tanh(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:101
pFlow::atan2
Vector< T, Allocator > atan2(const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
Definition: VectorMath.hpp:98
pFlow::tan
Vector< T, Allocator > tan(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:94
pFlow::acosh
Vector< T, Allocator > acosh(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:103
pFlow::acos
Vector< T, Allocator > acos(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:96