DUNE PDELab (git)

trigonometricfunction.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
5
6#include <cmath>
7
8namespace Dune {
9namespace Functions {
10
11
12
25template<class K, int sinFactor, int cosFactor>
27{
28public:
30 K operator () (const K& x) const
31 {
32 return sinFactor * std::sin(x) + cosFactor * std::cos(x);
33 }
34};
35
36
38template<class K, int sinFactor, int cosFactor>
40{
41 return TrigonometricFunction<K, -cosFactor, sinFactor>();
42}
43
44
45
46}} // namespace Dune::Functions
47
48
49
50#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
A linear combination of trigonomic functions.
Definition: trigonometricfunction.hh:27
K operator()(const K &x) const
Evaluate function.
Definition: trigonometricfunction.hh:30
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition: trigonometricfunction.hh:39
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)