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  ("fmod", static_cast<double (*)(double, double)>(
143  &fmod)) // floating-point remainder
144  ("log", log) // natural log
145  ("log10", log10) // log base 10
146  ("rad", rad) // radians
147  ("sin", sin) // sine
148  ("sinh", sinh) // hyperbolic sine
149  ("sqrt", sqrt) // square root
150  ("tan", tan) // tangent
151  ("tanh", tanh) // hyperbolic tangent
152  // and few more custom functions
153  ("sign", sign) // sign
154  ("awgn", awgn) // white noise
155  ;
156  }
static NekDouble rad(NekDouble x, NekDouble y)
NekDouble awgn(NekDouble sigma)
static NekDouble ang(NekDouble x, NekDouble y)
NekDouble sign(NekDouble arg)
scalarT< T > log(scalarT< T > in)
Definition: scalar.hpp:303
scalarT< T > abs(scalarT< T > in)
Definition: scalar.hpp:298
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().