OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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, phase offset, amplitude, 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 sine waves included.");
35 "PHASE_OFFSETS", "Phase offset for each sine wave. If undefined, defaults to 0.0.");
37 "AMPLITUDES",
38 "Peak-to-peak amplitude for each sine wave. If undefined, defaults to 1.0.");
40 "DC_OFFSETS", "DC offset for each sine wave. If undefined, defaults to 0.0.");
42}
43
47
48void OpalSinusoidalTimeDependence::print(std::ostream& out) const { OpalElement::print(out); }
49
53
@ SIZE
Definition IndexMap.cpp:179
static void setTimeDependence(const std::string &name, std::shared_ptr< AbstractTimeDependence > time_dep)
const std::string & getOpalName() const
Return object name.
Definition Object.cpp:267
std::vector< Attribute > itsAttr
The object attributes.
Definition Object.h:210
virtual void print(std::ostream &) const
Print the object.
void registerOwnership() const
OpalSinusoidalTimeDependence * clone(const std::string &name) override
void print(std::ostream &) const override
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.