Class Element
- All Implemented Interfaces:
IComponent,IElement
- Direct Known Subclasses:
ThickElement,ThinElement
IElement
interface that are not element specific.- Author:
- Christopher Allen, Craig McChesney
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubletotal length of the node before it was sliced by scenario generatorprotected doubleposition of the node before it was sliced by scenario generatorFields inherited from interface xal.model.IElement
LIGHT_SPEED, PERMEABILITY, PERMITTIVITY, UNIT_CHARGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseElements(Element closeElem) Add an element to the list of nearest neighbor elements used when considering the effects of PMQsvoidbackPropagate(IProbe probe) Back propagates the Probe object through this element based on the associated algorithm.voidbackPropagate(IProbe probe, double pos) Back propagates the Probe object through this element based on the associated algorithm.doublecompDriftingTime(IProbe probe, double dblLen) Compute the time the probeprobespends drifting a a distancedblLen.doublecompProbeLocation(IProbe probe) abstract doubleelapsedTime(IProbe probe, double dblLen) Returns the time taken for the probeprobeto propagate through a subsection of the element with lengthdblLen.abstract doubleenergyGain(IProbe probe, double dblLen) Returns energy gain for subsection of this element of lengthdblLenfor the specified given probe.doubleGet the horizontal misalignmentdoubleGet the vertical misalignmentdoubleGet the longitudinal misalignmentReturn the list of nearest adjacent elements to this element.Returns the string identifier of the hardware node which this element models.getId()Returns the string identifier for this element.doubleReturn the (center) position of this component within the global lattice structure to which it belongs.abstract doubleReturn the length of this element.doubleReturns the total length of the node, before the element was sliced by scenario generatordoubleReturns the position of the node, before the element was sliced by scenario generatorReturns the composite structure (if any) that owns this component.doublegetPhiX()doublegetPhiY()doublegetPhiZ()doubleReturn the center position of the element along the design trajectory.getType()Return the element type identifierintgetUID()Return the internal class unique identifier of this element.voidinitializeFrom(LatticeElement latticeElement) Conversion method to be provided by the userabstract doublelongitudinalPhaseAdvance(IProbe probe, double dblLen) This is a kluge to make RF gaps work, since frequency is not defined for most modeling elements.voidprint(PrintWriter os) Dump current state and content to output stream.voidOverride ofIComponent.propagate(xal.model.IProbe, double)Propagates the Probe object through this element based on the associated algorithm.voidOverride ofIComponent.propagate(xal.model.IProbe, double)Propagates the Probe object through this element based on the associated algorithm.voidSet the alignment parameters all at once.voidsetAlignX(double x) Set the horizontal misalignmentvoidsetAlignY(double y) Set the vertical misalignmentvoidsetAlignZ(double z) Set the longitudinal misalignmentvoidsetHardwareNodeId(String strSmfId) Sets the string identifier of the hardware node which this element models.voidSet the string identifier for the element.voidsetParent(IComposite cpsParent) Sets the parent structure containing this component.voidsetPhiX(double phix) voidsetPhiY(double phiy) voidsetPhiZ(double phiz) voidsetPosition(double dblPos) Set the center position of the element with the containing lattice.toString()abstract PhaseMaptransferMap(IProbe probe, double dblLen) Compute the transfer matrix for subsection of this element of lengthdblLenfor the specified given probe.
-
Field Details
-
dblNodeLen
protected double dblNodeLentotal length of the node before it was sliced by scenario generator -
dblNodePos
protected double dblNodePosposition of the node before it was sliced by scenario generator
-
-
Constructor Details
-
Element
Creates a new instance of Element- Parameters:
strType- type identifier of the element
-
Element
Creates a new instance of Element- Parameters:
strType- type identifier of the elementstrId- string identifier of the element
-
-
Method Details
-
setId
Set the string identifier for the element.- Parameters:
strId- new string identifier for element
-
setHardwareNodeId
Sets the string identifier of the hardware node which this element models. Node that this element may only model part of the underlying hardware node or simply some aspect of it. Thus, this is not a unique value amount all modeling elements.- Parameters:
strSmfId- identifier for the modeled hardware node (SMF object)- Since:
- Sep 2, 2014
-
setPosition
public void setPosition(double dblPos) Set the center position of the element with the containing lattice.- Parameters:
dblPos- center position along the design trajectory (meters)
-
setAlign
Set the alignment parameters all at once.- Parameters:
vecAlign- (dx,dy,dz)
-
setAlignX
public void setAlignX(double x) Set the horizontal misalignment- Parameters:
x- misalignment (in m)- Since:
- Dec 17, 2014 by Christopher K. Allen
-
setAlignY
public void setAlignY(double y) Set the vertical misalignment- Parameters:
y- misalignment (in m)- Since:
- Dec 17, 2014 by Christopher K. Allen
-
setAlignZ
public void setAlignZ(double z) Set the longitudinal misalignment- Parameters:
z- misalignment (in m)- Since:
- Dec 17, 2014 by Christopher K. Allen
-
getUID
public int getUID()Return the internal class unique identifier of this element.- Returns:
- the unique identifier of this object
-
getAlignX
public double getAlignX()Get the horizontal misalignment- Returns:
- the misalignment (in meters)
- Since:
- Dec 17, 2014 by Christopher K. Allen
-
getAlignY
public double getAlignY()Get the vertical misalignment- Returns:
- the misalignment (in meters)
- Since:
- Dec 17, 2014 by Christopher K. Allen
-
getAlignZ
public double getAlignZ()Get the longitudinal misalignment- Returns:
- the misalignment (in meters)
- Since:
- Dec 17, 2014 by Christopher K. Allen
-
getPhiX
public double getPhiX() -
getPhiY
public double getPhiY() -
getPhiZ
public double getPhiZ() -
setPhiX
public void setPhiX(double phix) -
setPhiY
public void setPhiY(double phiy) -
setPhiZ
public void setPhiZ(double phiz) -
addCloseElements
Add an element to the list of nearest neighbor elements used when considering the effects of PMQs- Parameters:
closeElem- an adjacent element
-
compProbeLocation
-
getCloseElements
Return the list of nearest adjacent elements to this element. THis is used primarily in permanent magnet quadrupole considerations.- Returns:
- List of adjacent modeling elements
-
compDriftingTime
Compute the time the probeprobespends drifting a a distancedblLen.- Parameters:
probe- interface to drifting probedblLen- length of drift in meters- Returns:
- time interval during drift in seconds
-
getType
Return the element type identifier- Specified by:
getTypein interfaceIComponent- Returns:
- element type string
-
getId
Returns the string identifier for this element.- Specified by:
getIdin interfaceIComponent- Returns:
- string identifier
-
getHardwareNodeId
Returns the string identifier of the hardware node which this element models. Note that the element may model only a portion of the hardware object or simply an aspect of it. Thus, this is not a unique values among modeling elements.- Specified by:
getHardwareNodeIdin interfaceIComponent- Returns:
- the identifier string of the hardware this element models
- Since:
- Sep 2, 2014
-
initializeFrom
Conversion method to be provided by the user- Specified by:
initializeFromin interfaceIComponent- Parameters:
latticeElement- the SMF node to convert
-
getLength
public abstract double getLength()Return the length of this element. Derived class must implement this because it is undetermined whether or not this is a thin or thick element.- Specified by:
getLengthin interfaceIComponent- Returns:
- length of the element (in meters)
-
getPosition
public double getPosition()Return the center position of the element along the design trajectory. This is the position with the containing lattice.- Specified by:
getPositionin interfaceIComponent- Returns:
- center position of the element (meters)
-
getNodeLen
public double getNodeLen()Returns the total length of the node, before the element was sliced by scenario generator- Returns:
- original node length
-
getNodePos
public double getNodePos()Returns the position of the node, before the element was sliced by scenario generator- Returns:
- original node length
-
getLatticePosition
public double getLatticePosition()Description copied from interface:IComponentReturn the (center) position of this component within the global lattice structure to which it belongs. Note the difference between this parameter and that returned by
IComponentwhich returns the position with respect to the direct parent.IComponent.getLength()The returned value is not usually a design parameter, in particular if composites are pasted together or otherwise form a larger tree structure. It should be computed according to the current structure of the global composite structure. Thus, moving this element in the lattice should change this value.
- Specified by:
getLatticePositionin interfaceIComponent- Returns:
- the center position of this component within the entire lattice containing this element (not just the parent)
- Since:
- Dec 3, 2015, Christopher K. Allen
- See Also:
-
getParent
Description copied from interface:IComponentReturns the composite structure (if any) that owns this component.- Specified by:
getParentin interfaceIComponent- Returns:
- returns the composite structure owning this element, or
nullif this component is isolated - Since:
- Jan 22, 2015 by Christopher K. Allen
- See Also:
-
setParent
Description copied from interface:IComponentSets the parent structure containing this component. The parent is assumed to be a composite structure built from component elements.- Specified by:
setParentin interfaceIComponent- Parameters:
cpsParent- the composite structure built from this component- Since:
- Jan 22, 2015 by Christopher K. Allen
- See Also:
-
propagate
Override of
IComponent.propagate(xal.model.IProbe, double)Propagates the Probe object through this element based on the associated algorithm.NOTE: CKA
The position of the probe within the element appears to be kept as a field of the algorithm object. I am not exactly sure of any side-effects of this implementation when using theof theTracker.propagate(IProbe, IElement)class. Careful when modifying.Tracker- Specified by:
propagatein interfaceIComponent- Parameters:
probe- probe object to propagatepos- I think it is position of the probe within this element- Throws:
ModelException- error occurred during propagation- See Also:
-
propagate
Override of
IComponent.propagate(xal.model.IProbe, double)Propagates the Probe object through this element based on the associated algorithm.- Specified by:
propagatein interfaceIComponent- Parameters:
probe- probe object to propagate- Throws:
ModelException- error occurred during propagation- See Also:
-
backPropagate
Back propagates the Probe object through this element based on the associated algorithm.
NOTES: CKA
The position of the probe within the element appears to be kept as a field of the algorithm object. I am not exactly sure of any side-effects of this implementation when using theof theTracker.propagate(IProbe, IElement)class. Careful when modifying.Tracker
· Support for backward propagation February, 2009.
· You must use the proper algorithm object for this method to work correctly!- Specified by:
backPropagatein interfaceIComponent- Parameters:
probe- probe object to propagatepos- I think it is position of the probe within this element- Throws:
ModelException- error occurred during propagation- See Also:
-
backPropagate
Back propagates the Probe object through this element based on the associated algorithm.
NOTES: CKA
· Support for backward propagation February, 2009.
· You must use the proper algorithm object for this method to work correctly!- Specified by:
backPropagatein interfaceIComponent- Parameters:
probe- probe object to propagate- Throws:
ModelException- error occurred during propagation- See Also:
-
elapsedTime
Returns the time taken for the probeprobeto propagate through a subsection of the element with lengthdblLen.- Specified by:
elapsedTimein interfaceIElement- Parameters:
probe- determine energy gain for this probedblLen- length of subsection to calculate energy gain for- Returns:
- the elapsed time through section
Units: seconds
-
energyGain
Returns energy gain for subsection of this element of lengthdblLenfor the specified given probe.- Specified by:
energyGainin interfaceIElement- Parameters:
probe- determine energy gain for this probedblLen- length of subsection to calculate energy gain- Returns:
- the energy gain provided by this element
Units: eV
-
longitudinalPhaseAdvance
This is a kluge to make RF gaps work, since frequency is not defined for most modeling elements. For such elements we simply return 0 phase advance. For elements where frequency is defined, we can override this.- Specified by:
longitudinalPhaseAdvancein interfaceIElement- Parameters:
probe- the probe propagating through this elementdblLen- distance the probe propagates through the element- Returns:
- longitudinal phase advance of the probe through given distance
- Since:
- Nov 23, 2014
- See Also:
-
transferMap
Compute the transfer matrix for subsection of this element of lengthdblLenfor the specified given probe. That is, this method should return the incremental transfer matrix.- Specified by:
transferMapin interfaceIElement- Parameters:
dblLen- length of sub-elementprobe- probe containing parameters for the sub-sectional transfer matrix- Returns:
- transfer map for an element of length dblLen
- Throws:
ModelException- unable to compute transfer map- See Also:
-
toString
-
print
Dump current state and content to output stream.- Parameters:
os- output stream object
-