OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
SolenoidRep.h
Go to the documentation of this file.
1//
2// Class SolenoidRep
3// Representation for a solenoid magnet.
4//
5// Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18#ifndef CLASSIC_SolenoidRep_HH
19#define CLASSIC_SolenoidRep_HH
20
23#include "Fields/ConstBzField.h"
24
25
26class SolenoidRep: public Solenoid {
27
28public:
29
31 explicit SolenoidRep(const std::string &name);
32
34 SolenoidRep(const SolenoidRep &);
35 virtual ~SolenoidRep();
36
38 // Return an identical deep copy of the element.
39 virtual ElementBase *clone() const;
40
42 // This method constructs a Channel permitting read/write access to
43 // the attribute [b]aKey[/b] and returns it.
44 // If the attribute does not exist, it returns nullptr.
45 virtual Channel *getChannel(const std::string &aKey, bool = false);
46
48 // Version for non-constant object.
49 virtual ConstBzField &getField();
50
52 // Version for constant object.
53 virtual const ConstBzField &getField() const;
54
56 // Version for non-constant object.
58
60 // Version for constant object.
61 virtual const StraightGeometry &getGeometry() const;
62
64 // Return the solenoid field in Teslas.
65 virtual double getBz() const;
66
68 // Assign the solenoid field in Teslas.
69 virtual void setBz(double Bz);
70
71private:
72
73 // Not implemented.
74 void operator=(const SolenoidRep &);
75
78
81};
82
83#endif // CLASSIC_SolenoidRep_HH
const std::string name
Interface for solenoids.
Definition: Solenoid.h:36
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: SolenoidRep.cpp:72
virtual StraightGeometry & getGeometry()
Get geometry.
Definition: SolenoidRep.cpp:92
virtual ElementBase * clone() const
Return clone.
Definition: SolenoidRep.cpp:67
ConstBzField field
The solenoid field.
Definition: SolenoidRep.h:80
StraightGeometry geometry
The solenoid geometry.
Definition: SolenoidRep.h:77
virtual ~SolenoidRep()
Definition: SolenoidRep.cpp:63
void operator=(const SolenoidRep &)
virtual double getBz() const
Get field.
virtual void setBz(double Bz)
Set field.
virtual ConstBzField & getField()
Get field.
Definition: SolenoidRep.cpp:83
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition: Channel.h:32
A homogeneous magnetostatic field in z-direction.
Definition: ConstBzField.h:30