OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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>
23class Inform;
24
33public:
42 const std::vector<double>& f, const std::vector<double>& p,
43 const std::vector<double>& a, const std::vector<double>& o);
44
47
49 ~SinusoidalTimeDependence() override = default;
50
54 double getValue(double time) override;
55
59 double getIntegral(double time) override;
60
66
70 Inform& print(Inform& os) const;
71
72 /* Getters for the test case use */
73 [[nodiscard]] const std::vector<double>& getFrequencies() const { return f_m; }
74 [[nodiscard]] const std::vector<double>& getAmplitudes() const { return a_m; }
75 [[nodiscard]] const std::vector<double>& getOffsets() const { return o_m; }
76 [[nodiscard]] const std::vector<double>& getPhases() const { return p_m; }
77
78private:
79 std::vector<double> f_m;
80 std::vector<double> p_m;
81 std::vector<double> a_m;
82 std::vector<double> o_m;
83};
84
85inline Inform& operator<<(Inform& os, const SinusoidalTimeDependence& p) { return p.print(os); }
86
87#endif // OPAL_SINUSOIDALTIMEDEPENDENCE_H
Inform & operator<<(Inform &os, const SinusoidalTimeDependence &p)
SinusoidalTimeDependence * clone() override
const std::vector< double > & getOffsets() const
Inform & print(Inform &os) const
~SinusoidalTimeDependence() override=default
const std::vector< double > & getPhases() const
const std::vector< double > & getAmplitudes() const
const std::vector< double > & getFrequencies() const
SinusoidalTimeDependence()=default
double getIntegral(double time) override
double getValue(double time) override