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 115 of file Interpreter/Interpreter.cpp.

Constructor & Destructor Documentation

◆ functions()

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

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

118 {
119 // Add all of the functions from math.h
120 add("abs", std::abs) // absolute value
121 ("asin", asin) // arcsin
122 ("acos", acos) // arccos
123 ("atan", atan) // arctan
124 ("atan2", atan2) // arctan2
125 ("ang", ang) // angle calculation
126 ("ceil", ceil) // ceiling
127 ("cos", cos) // cosine
128 ("cosh", cosh) // hyperbolic cosine
129 ("exp", exp) // exponential
130 ("fabs", fabs) // absolute value
131 ("floor", floor) // floor
132 ("fmax", fmax) // max function
133 ("fmin", fmin) // min function
134 ("fmod", static_cast<double (*)(double, double)>(
135 &fmod)) // floating-point remainder
136 ("log", log) // natural log
137 ("log10", log10) // log base 10
138 ("max", fmax) // max function
139 ("min", fmin) // min function
140 ("rad", rad) // radians
141 ("sin", sin) // sine
142 ("sinh", sinh) // hyperbolic sine
143 ("sqrt", sqrt) // square root
144 ("tan", tan) // tangent
145 ("tanh", tanh) // hyperbolic tangent
146 // and few more custom functions
147 ("sign", sign) // sign
148 ("awgn", awgn) // white noise
149 ;
150 }
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().