Commit e6af01d5 authored by Serhii Yaskovets's avatar Serhii Yaskovets
Browse files

Add scalar grid operations tanh & signum

parent 46684b80
......@@ -111,6 +111,22 @@ namespace AMDiS
return invokeAtQP([](auto const& v) { using std::abs; return abs(v); }, FWD(value));
}
/// \brief Applies \ref Operation::Tanh to GridFunctions. \relates ComposerGridFunction
template <class T,
REQUIRES(Concepts::AnyGridFunction<T>)>
auto tanh(T&& value)
{
return invokeAtQP([](auto const& v) { using std::tanh; return tanh(v); }, FWD(value));
}
/// \brief Applies \ref Operation::Signum to GridFunctions. \relates ComposerGridFunction
template <class T,
REQUIRES(Concepts::AnyGridFunction<T>)>
auto signum(T&& value)
{
return invokeAtQP([](auto const& v) { return v > 0.0 ? 1.0 : -1.0; }, FWD(value));
}
/// \brief Applies \ref Operation::Sqr to GridFunction. \relates ComposerGridFunction
template <class T,
REQUIRES(Concepts::AnyGridFunction<T>)>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment