OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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 OPALX_SolenoidRep_HH
19#define OPALX_SolenoidRep_HH
20
23#include "Fields/ConstBzField.h"
24
25class SolenoidRep : public Solenoid {
26public:
28 explicit SolenoidRep(const std::string& name);
29
32 virtual ~SolenoidRep();
33
35 // Return an identical deep copy of the element.
36 virtual ElementBase* clone() const;
37
39 // This method constructs a Channel permitting read/write access to
40 // the attribute [b]aKey[/b] and returns it.
41 // If the attribute does not exist, it returns nullptr.
42 virtual Channel* getChannel(const std::string& aKey, bool = false);
43
45 // Version for non-constant object.
46 virtual ConstBzField& getField();
47
49 // Version for constant object.
50 virtual const ConstBzField& getField() const;
51
53 // Version for non-constant object.
55
57 // Version for constant object.
58 virtual const StraightGeometry& getGeometry() const;
59
61 // Return the solenoid field in Teslas.
62 virtual double getBz() const;
63
65 // Assign the solenoid field in Teslas.
66 virtual void setBz(double Bz);
67
68private:
69 // Not implemented.
70 void operator=(const SolenoidRep&);
71
74
77};
78
79#endif // OPALX_SolenoidRep_HH
Abstract interface for read/write access to variable.
Definition Channel.h:30
A homogeneous magnetostatic field in z-direction.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
virtual StraightGeometry & getGeometry()
Get geometry.
virtual ElementBase * clone() const
Return clone.
ConstBzField field
The solenoid field.
Definition SolenoidRep.h:76
StraightGeometry geometry
The solenoid geometry.
Definition SolenoidRep.h:73
virtual ~SolenoidRep()
void operator=(const SolenoidRep &)
virtual double getBz() const
Get field.
virtual void setBz(double Bz)
Set field.
virtual ConstBzField & getField()
Get field.
Abstract class for a solenoid magnet.
Definition Solenoid.h:33
A geometry representing a straight line.