OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
OpalSinusoidalTimeDependence.cpp
Go to the documentation of this file.
1//
2// Class OpalSinusoidalTimeDependence
3// User interface for 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
19#include <string>
22
24 "The \"SINUSOIDAL_TIME_DEPENDENCE\" element defines "
25 "sinusoidal coefficients for a time dependence, "
26 "frequency, amplitude, phase offset, DC offset, given by "
27 "f(t) = sigma_over_i(a[i] / 2 * sin(2 * pi * f[i] * t + p[i]) + o[i])";
28
30 : OpalElement(static_cast<int>(SIZE), "SINUSOIDAL_TIME_DEPENDENCE", doc_string.c_str()) {
32 "FREQUENCIES",
33 "Sine wave frequencies, length determines the number of size waves included.");
35 "AMPLITUDES", "Peak-to-peak amplitude for each size wave. If undefined, defaults to 1.0.");
37 "PHASE_OFFSETS", "Phase offset for each sine wave. If undefined, defaults to 0.0.");
39 "DC_OFFSETS", "DC offset for each sine wave. If undefined, defaults to 0.0.");
41}
42
46
47void OpalSinusoidalTimeDependence::print(std::ostream& out) const {
49}
50
55
const std::string name
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
const std::string & getOpalName() const
Return object name.
Definition Object.cpp:310
std::vector< Attribute > itsAttr
The object attributes.
Definition Object.h:216
static void setTimeDependence(std::string name, std::shared_ptr< AbstractTimeDependence > time_dep)
virtual void print(std::ostream &) const
Print the object.
OpalElement(int size, const char *name, const char *help)
Exemplar constructor.
void registerOwnership() const
OpalSinusoidalTimeDependence * clone(const std::string &name) override
void print(std::ostream &) const override