Package xal.model.elem
Class ThickElement
java.lang.Object
xal.model.elem.Element
xal.model.elem.ThickElement
- All Implemented Interfaces:
IComponent
,IElement
- Direct Known Subclasses:
IdealDrift
,IdealMagSextupole
,RfqDummyModel
,ThickElectromagnet
,ThickElectrostatic
,ThickMatrix
,ThickRfFieldMap
Base class for all modeling elements having a finite length. As such, space charge will affect probes propagation through these elements.
The transfer matrix that is stored in the parent element is actually the incremental transfer matrix of the full element. Thus, derived classes should implement the method subTransferMatrix() that returns the nSecs root of the full transfer matrix. Deriving beamline elements from this class allows space charge kicks to be applied at nSecs equally spaced locations throughout the element.
- Author:
- Christopher K. Allen
-
Field Summary
Fields inherited from class xal.model.elem.Element
dblNodeLen, dblNodePos
Fields inherited from interface xal.model.IElement
LIGHT_SPEED, PERMEABILITY, PERMITTIVITY, UNIT_CHARGE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ThickElement
(String strType) Default constructor to be used by automatic lattice generation.protected
ThickElement
(String strType, String strId) Default constructor to be used by automatic lattice generation.protected
ThickElement
(String strType, String strId, double dblLen) Creates a new instance of ThickElement -
Method Summary
Modifier and TypeMethodDescriptionprotected PhaseMatrix
applyErrors
(PhaseMatrix matPhi, IProbe probe, double length) Add Rotation and Displacement Error to Transfer Matrixabstract 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) Return the energy gain of the beamline element over a subsection of the specified length.double
Return the total length of this elementvoid
initializeFrom
(LatticeElement latticeElement) Conversion method to be provided by the userprotected boolean
isFirstSubslice
(double position) Checks if this is the first subslice transfer matrix is requested forprotected boolean
isLastSubslice
(double position) Checks if this is the last subslice transfer matrix is requested fordouble
longitudinalPhaseAdvance
(IProbe probe, double dblLen) This is a kluge to make RF gaps work, since frequency is not defined for modeling elements outside RF cavities.void
setLength
(double dblLen) Set the length of the element.abstract PhaseMap
transferMap
(IProbe probe, double dblLen) Compute the transfer matrix for subsection of this element of lengthdblLen
for the specified given probe.Methods inherited from class xal.model.elem.Element
addCloseElements, backPropagate, backPropagate, compDriftingTime, compProbeLocation, getAlignX, getAlignY, getAlignZ, getCloseElements, getHardwareNodeId, getId, getLatticePosition, getNodeLen, getNodePos, getParent, getPhiX, getPhiY, getPhiZ, getPosition, getType, getUID, print, propagate, propagate, setAlign, setAlignX, setAlignY, setAlignZ, setHardwareNodeId, setId, setParent, setPhiX, setPhiY, setPhiZ, setPosition, toString
-
Constructor Details
-
ThickElement
Default constructor to be used by automatic lattice generation. Creates a new parameter-uninitialized instance of ThickElement.- Parameters:
strType
- the string type-identifier of the element type
-
ThickElement
Default constructor to be used by automatic lattice generation. Creates a new instance of ThickElement specifying its type identifier and its instance identifier.- Parameters:
strType
- the string type-identifier of the element typestrId
- the string identifier of the element instance
-
ThickElement
Creates a new instance of ThickElement- Parameters:
strType
- string type identifier for the elementstrId
- string instance identifier for this elementdblLen
- total length of the element (in meters)
-
-
Method Details
-
initializeFrom
Conversion method to be provided by the user- Specified by:
initializeFrom
in interfaceIComponent
- Overrides:
initializeFrom
in classElement
- Parameters:
latticeElement
- the SMF node to convert
-
setLength
public void setLength(double dblLen) Set the length of the element.- Parameters:
dblLen
- length of element (in meters)
-
getLength
public double getLength()Return the total length of this element- Specified by:
getLength
in interfaceIComponent
- Specified by:
getLength
in classElement
- Returns:
- total element length (in meters)
-
energyGain
Return the energy gain of the beamline element over a subsection of the specified length.- Specified by:
energyGain
in interfaceIElement
- Specified by:
energyGain
in classElement
- Parameters:
probe
- probe for which energy gain is to be determineddblLen
- subsection length to calculate energyGain for- Returns:
- the value #subEnergyGain(probe)*#getCount()
-
transferMap
Description copied from class:Element
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
- Specified by:
transferMap
in classElement
- Parameters:
probe
- probe containing parameters for the sub-sectional transfer matrixdblLen
- length of sub-element- Returns:
- transfer map for an element of length dblLen
- Throws:
ModelException
- unable to compute transfer map- Since:
- Jan 22, 2015 by Christopher K. Allen
- See Also:
-
isFirstSubslice
protected boolean isFirstSubslice(double position) Checks if this is the first subslice transfer matrix is requested for- Parameters:
position
- position of the probe- Returns:
- is this the first subslice
-
isLastSubslice
protected boolean isLastSubslice(double position) Checks if this is the last subslice transfer matrix is requested for- Parameters:
position
- position of the probe + subslice length- Returns:
- is this the last sub-slice
-
applyErrors
Add Rotation and Displacement Error to Transfer Matrix
Method to add the effects of a spatial rotation and displacement to the beamline element represented by the given transfer matrix.
- Parameters:
matPhi
- transfer matrix Φ to be processedprobe
- instance of the probelength
- total think element length- Returns:
- transfer matrix Φ after applying displacement and rotation
- See Also:
-
elapsedTime
Description copied from class:Element
Returns the time taken for the probeprobe
to propagate through a subsection of the element with lengthdblLen
.- Specified by:
elapsedTime
in interfaceIElement
- Specified by:
elapsedTime
in classElement
- Parameters:
probe
- determine energy gain for this probedblLen
- length of subsection to calculate energy gain for- Returns:
- the elapsed time through section
Units: seconds
-
longitudinalPhaseAdvance
This is a kluge to make RF gaps work, since frequency is not defined for modeling elements outside RF cavities. For such elements we simply return 0 phase advance. For elements where frequency is defined, we compute the phase advance as the angular frequency times the elapsed time through the element (see
).elapsedTime(IProbe, double)
- Specified by:
longitudinalPhaseAdvance
in interfaceIElement
- Specified by:
longitudinalPhaseAdvance
in classElement
- 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:
- Jan 22, 2015 by Christopher K. Allen
- See Also:
-