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
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
8#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
9
10#include <cmath>
11
12namespace Dune {
13namespace Functions {
14
15
16
29template<class K, int sinFactor, int cosFactor>
31{
32public:
34 K operator () (const K& x) const
35 {
36 return sinFactor * std::sin(x) + cosFactor * std::cos(x);
37 }
38};
39
40
42template<class K, int sinFactor, int cosFactor>
44{
45 return TrigonometricFunction<K, -cosFactor, sinFactor>();
46}
47
48
49
50}} // namespace Dune::Functions
51
52
53
54#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
A linear combination of trigonomic functions.
Definition: trigonometricfunction.hh:31
K operator()(const K &x) const
Evaluate function.
Definition: trigonometricfunction.hh:34
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition: trigonometricfunction.hh:43
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)