Class PeriodicMagneticField

Inheritance Relationships

Base Type

Class Documentation

class PeriodicMagneticField : public MagneticField

Magnetic field decorator implementing periodic fields.

The periodic cube is defined by its origin (Vector3d) and an extends parameter (Vector3d). All points x=(x_1, x_2, x_3) that are described by x_i = origin_i + epsilon * extend_i, with epsilon = 0…1 are within the base cube. Magnetic field strengths for all positions outside of this cube are calculated based on the values in the base cube. This can be done periodically or reflectively.

Public Functions

PeriodicMagneticField(ref_ptr<MagneticField> field, const Vector3d &extends)

Constructor

Parameters:
  • field – magnetic field reference pointer

  • extends – length, width, and height of the base cube

PeriodicMagneticField(ref_ptr<MagneticField> field, const Vector3d &extends, const Vector3d &origin, bool reflective)

Constructor

Parameters:
  • field – magnetic field reference pointer

  • extends – length, width, and height of the base cube

  • origin – defines the reference position

  • reflective – for periodic or reflective behavior

Vector3d &getOrigin()
void setOrigin(const Vector3d &origin)
Vector3d &getExtends()
void setExtends(const Vector3d &origin)
bool isReflective()
void setReflective(bool reflective)
virtual Vector3d getField(const Vector3d &position) const
inline virtual Vector3d getField(const Vector3d &position, double z) const
inline size_t addReference() const
inline size_t removeReference() const
inline int removeReferenceNoDelete() const
inline size_t getReferenceCount() const

Protected Attributes

mutable size_t _referenceCount