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 double
total length of the node before it was sliced by scenario generatorprotected double
position 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 TypeMethodDescriptionvoid
addCloseElements
(Element closeElem) Add an element to the list of nearest neighbor elements used when considering the effects of PMQsvoid
backPropagate
(IProbe probe) Back propagates the Probe object through this element based on the associated algorithm.void
backPropagate
(IProbe probe, double pos) Back propagates the Probe object through this element based on the associated algorithm.double
compDriftingTime
(IProbe probe, double dblLen) Compute the time the probeprobe
spends drifting a a distancedblLen
.double
compProbeLocation
(IProbe probe) abstract double
elapsedTime
(IProbe probe, double dblLen) Returns the time taken for the probeprobe
to propagate through a subsection of the element with lengthdblLen
.abstract double
energyGain
(IProbe probe, double dblLen) Returns energy gain for subsection of this element of lengthdblLen
for the specified given probe.double
Get the horizontal misalignmentdouble
Get the vertical misalignmentdouble
Get 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.double
Return the (center) position of this component within the global lattice structure to which it belongs.abstract double
Return the length of this element.double
Returns the total length of the node, before the element was sliced by scenario generatordouble
Returns the position of the node, before the element was sliced by scenario generatorReturns the composite structure (if any) that owns this component.double
getPhiX()
double
getPhiY()
double
getPhiZ()
double
Return the center position of the element along the design trajectory.getType()
Return the element type identifierint
getUID()
Return the internal class unique identifier of this element.void
initializeFrom
(LatticeElement latticeElement) Conversion method to be provided by the userabstract double
longitudinalPhaseAdvance
(IProbe probe, double dblLen) This is a kluge to make RF gaps work, since frequency is not defined for most modeling elements.void
print
(PrintWriter os) Dump current state and content to output stream.void
Override ofIComponent.propagate(xal.model.IProbe, double)
Propagates the Probe object through this element based on the associated algorithm.void
Override ofIComponent.propagate(xal.model.IProbe, double)
Propagates the Probe object through this element based on the associated algorithm.void
Set the alignment parameters all at once.void
setAlignX
(double x) Set the horizontal misalignmentvoid
setAlignY
(double y) Set the vertical misalignmentvoid
setAlignZ
(double z) Set the longitudinal misalignmentvoid
setHardwareNodeId
(String strSmfId) Sets the string identifier of the hardware node which this element models.void
Set the string identifier for the element.void
setParent
(IComposite cpsParent) Sets the parent structure containing this component.void
setPhiX
(double phix) void
setPhiY
(double phiy) void
setPhiZ
(double phiz) void
setPosition
(double dblPos) Set the center position of the element with the containing lattice.toString()
abstract PhaseMap
transferMap
(IProbe probe, double dblLen) Compute the transfer matrix for subsection of this element of lengthdblLen
for 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 probeprobe
spends 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:
getType
in interfaceIComponent
- Returns:
- element type string
-
getId
Returns the string identifier for this element.- Specified by:
getId
in 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:
getHardwareNodeId
in 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:
initializeFrom
in 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:
getLength
in 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:
getPosition
in 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:IComponent
Return 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
IComponent
which 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:
getLatticePosition
in 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:IComponent
Returns the composite structure (if any) that owns this component.- Specified by:
getParent
in interfaceIComponent
- Returns:
- returns the composite structure owning this element, or
null
if this component is isolated - Since:
- Jan 22, 2015 by Christopher K. Allen
- See Also:
-
setParent
Description copied from interface:IComponent
Sets the parent structure containing this component. The parent is assumed to be a composite structure built from component elements.- Specified by:
setParent
in 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 the
of theTracker.propagate(IProbe, IElement)
class. Careful when modifying.Tracker
- Specified by:
propagate
in 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:
propagate
in 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 the
of 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:
backPropagate
in 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:
backPropagate
in interfaceIComponent
- Parameters:
probe
- probe object to propagate- Throws:
ModelException
- error occurred during propagation- See Also:
-
elapsedTime
Returns the time taken for the probeprobe
to propagate through a subsection of the element with lengthdblLen
.- Specified by:
elapsedTime
in 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 lengthdblLen
for the specified given probe.- Specified by:
energyGain
in 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:
longitudinalPhaseAdvance
in 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 lengthdblLen
for the specified given probe. That is, this method should return the incremental transfer matrix.- Specified by:
transferMap
in 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
-