OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
ConstEzField.h
Go to the documentation of this file.
1 //
2 // Class ConstEzField
3 // A homogeneous electrostatic field in z-direction.
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_ConstEzField_HH
19 #define CLASSIC_ConstEzField_HH
20 
22 
24 
25 public:
26 
28  // Constructs a null field.
29  ConstEzField();
30 
31  virtual ~ConstEzField();
32 
34  // Return the time-independent part of the electric field in point [b]P[/b].
35  virtual EVector Efield(const Point3D &P) const;
36 
38  // Return the electric field at time [b]t[/b] in point [b]P[/b].
39  virtual EVector Efield(const Point3D &P, double t) const;
40 
42  // Return the x-component of the electric field in A/m.
43  virtual double getEz() const;
44 
46  // Assign the z-component of the electric field in A/m.
47  virtual void setEz(double);
48 
50  // Multiply the field by [b]scalar[/b].
51  virtual void scale(double scalar);
52 
53 private:
54 
55  // The field components.
56  double Ez;
57 };
58 
59 #endif // CLASSIC_ConstEzField_HH
virtual double getEz() const
Get component.
virtual void setEz(double)
Set component.
ConstEzField()
Default constructor.
virtual EVector Efield(const Point3D &P) const
Get field.
virtual ~ConstEzField()
virtual void scale(double scalar)
Scale the field.
A point in 3 dimensions.
Definition: EMField.h:33
An electric field vector.
Definition: EMField.h:63
Abstract base class for static electric fields.