OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
SinusoidalTimeDependence.h
Go to the documentation of this file.
1//
2// Class SinusoidalTimeDependence
3// A time dependence class that generates sine waves
4//
5// Copyright (c) 2025, Jon Thompson, STFC Rutherford Appleton Laboratory, Didcot, UK
6//
7// This file is part of OPAL.
8//
9// OPAL is free software: you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// You should have received a copy of the GNU General Public License
15// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
16//
17
18#ifndef OPAL_SINUSOIDALTIMEDEPENDENCE_H
19#define OPAL_SINUSOIDALTIMEDEPENDENCE_H
20
21#include <vector>
22#include <cmath>
23
25class Inform;
26
35public:
44 const std::vector<double>& f, const std::vector<double>& p, const std::vector<double>& a,
45 const std::vector<double>& o);
46
49
51 ~SinusoidalTimeDependence() override = default;
52
56 double getValue(double time) override;
57
61 double getIntegral(double time) override;
62
68
72 Inform& print(Inform& os) const;
73
74private:
75 std::vector<double> f_m;
76 std::vector<double> p_m;
77 std::vector<double> a_m;
78 std::vector<double> o_m;
79};
80
82 return p.print(os);
83}
84
85#endif // OPAL_SINUSOIDALTIMEDEPENDENCE_H
Inform & operator<<(Inform &os, const SinusoidalTimeDependence &p)
std::complex< double > a
Time dependence abstraction for field parameters that vary slowly with time; for example,...
Time dependence that follows sum of a set of sinusoids sigma_over_i(a[i] / 2 * sin(2 * pi * f[i] * t ...
SinusoidalTimeDependence * clone() override
Inheritable clone function.
Inform & print(Inform &os) const
Print the sinusoidals.
~SinusoidalTimeDependence() override=default
Destructor does default.
SinusoidalTimeDependence()=default
Default Constructor makes a 0 length polynomial.
double getIntegral(double time) override
Return the integral from 0 to time.
double getValue(double time) override
Return the sinusoidal value.
Definition: Inform.h:42