Nektar++
Public Member Functions | List of all members
Nektar::LibUtilities::functions Struct Reference
Inheritance diagram for Nektar::LibUtilities::functions:
[legend]

Public Member Functions

 functions ()
 

Detailed Description

This struct creates a parser that matches the function definitions from math.h. All of the functions accept one or more NekDoubles as arguments and returns a NekDouble.

Definition at line 125 of file Interpreter/Interpreter.cpp.

Constructor & Destructor Documentation

◆ functions()

Nektar::LibUtilities::functions::functions ( )
inline

Definition at line 127 of file Interpreter/Interpreter.cpp.

128 {
129 // Add all of the functions from math.h
130 add("abs", std::abs) // absolute value
131 ("asin", asin) // arcsin
132 ("acos", acos) // arccos
133 ("atan", atan) // arctan
134 ("atan2", atan2) // arctan2
135 ("ang", ang) // angle calculation
136 ("ceil", ceil) // ceiling
137 ("cos", cos) // cosine
138 ("cosh", cosh) // hyperbolic cosine
139 ("exp", exp) // exponential
140 ("fabs", fabs) // absolute value
141 ("floor", floor) // floor
142 ("fmax", fmax) // max function
143 ("fmin", fmin) // min function
144 ("fmod", static_cast<double (*)(double, double)>(
145 &fmod)) // floating-point remainder
146 ("log", log) // natural log
147 ("log10", log10) // log base 10
148 ("max", fmax) // max function
149 ("min", fmin) // min function
150 ("rad", rad) // radians
151 ("sin", sin) // sine
152 ("sinh", sinh) // hyperbolic sine
153 ("sqrt", sqrt) // square root
154 ("tan", tan) // tangent
155 ("tanh", tanh) // hyperbolic tangent
156 // and few more custom functions
157 ("sign", sign) // sign
158 ("awgn", awgn) // white noise
159 ;
160 }
static NekDouble rad(NekDouble x, NekDouble y)
NekDouble awgn(NekDouble sigma)
static NekDouble ang(NekDouble x, NekDouble y)
NekDouble sign(NekDouble arg)
scalarT< T > abs(scalarT< T > in)
Definition: scalar.hpp:298
scalarT< T > log(scalarT< T > in)
Definition: scalar.hpp:303
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

References tinysimd::abs(), Nektar::LibUtilities::ang(), Nektar::LibUtilities::awgn(), tinysimd::log(), Nektar::LibUtilities::rad(), Nektar::LibUtilities::sign(), and tinysimd::sqrt().