Package xal.smf.impl

Class Magnet

All Implemented Interfaces:
Comparable, ElementType, MagnetType, DataListener
Direct Known Subclasses:
Electromagnet, PermanentMagnet

public abstract class Magnet extends AcceleratorNode implements MagnetType
The abstract Magnet Class element. This class contains elements common to all magnets in an accelerator.
Author:
J. Galambos
  • Field Details

    • bucMagnet

      protected MagnetBucket bucMagnet
      The container for the magnet information
  • Constructor Details

    • Magnet

      protected Magnet(String strId, ChannelFactory channelFactory)
      Primary Constructor
    • Magnet

      protected Magnet(String strId)
      Constructor
  • Method Details

    • getMagBucket

      public MagnetBucket getMagBucket()
      Returns:
      the attribute bucket containing the machine multipole fields
    • setMagBucket

      public void setMagBucket(MagnetBucket buc)
      Set the attribute bucket containing the machine magnet info
    • addBucket

      public void addBucket(AttributeBucket buc)
      Override AcceleratorNode implementation to check for a MultipoleBucket
      Overrides:
      addBucket in class AcceleratorNode
    • isMagnet

      public boolean isMagnet()
      Override the inherited method to be true since all magnets are of the magnet type.
      Specified by:
      isMagnet in interface ElementType
      Overrides:
      isMagnet in class AcceleratorNode
      Returns:
      true
    • isPole

      public boolean isPole(String compPole)
      Test if the magnet is of the specified pole type. MagnetType defines the list of accepted pole types.
      Specified by:
      isPole in interface MagnetType
      Parameters:
      compPole - Comparison pole which should be one of MagnetType.poles
      Returns:
      true if the magnet is of the specified pole.
    • getOrientation

      public int getOrientation()
      Get the orientation of the magnet as defined by MagnetType.
      Specified by:
      getOrientation in interface MagnetType
      Returns:
      One of HORIZONTAL, VERTICAL or NO_ORIENTATION
    • isHorizontal

      public final boolean isHorizontal()
      Determine whether this magnet is oriented horizontally.
      Specified by:
      isHorizontal in interface MagnetType
      Returns:
      true if this magnet is oriented horizontally; false otherwise.
    • isVertical

      public final boolean isVertical()
      Determine whether this magnet is oriented vertically.
      Specified by:
      isVertical in interface MagnetType
      Returns:
      true if this magnet is oriented vertically; false otherwise.
    • isSkew

      public boolean isSkew()
      Determine whether this magnet is a skew magnet.
      Specified by:
      isSkew in interface MagnetType
      Returns:
      true if the magnet is skew and false otherwise.
    • isPermanent

      public boolean isPermanent()
      Get whether this magnet is a permanent magnet or an electromagnet.
      Specified by:
      isPermanent in interface MagnetType
      Returns:
      true if the magnet is permanent and false otherwise.
    • isCorrector

      public boolean isCorrector()
      Determine whether this magnet is a corrector.
      Specified by:
      isCorrector in interface MagnetType
      Returns:
      true if this magnet is a corrector.
    • getDesignField

      public double getDesignField()
      get the design field for the magnet (T for dipole, T/m for quad, etc.)
    • getEffLength

      public double getEffLength()
      get the effective magnetic length (m)
    • getDfltField

      public double getDfltField()
      get the default magnetic field
    • getPolarity

      public double getPolarity()
      get magnet polarity
    • getConversionFactor

      public double getConversionFactor()
      A magnet may have defined a (simple) conversion factor between the effective magnetic field and the current applied. Useful for simulating with current parameters.
      Returns:
      The conversion factor field/current [T/m^n/A]
    • getNormField

      public double[] getNormField()
      get Normal fields
    • getTangField

      public double[] getTangField()
      get tangential fields
    • setDfltField

      public void setDfltField(double field)
      Method setDfltField
      Parameters:
      field - the default magnetic field to be changed to.