public abstract class Element extends java.lang.Object implements IElement
IElement
interface that are not element specific.LightSpeed, Permeability, Permittivity, UnitCharge
Constructor and Description |
---|
Element(java.lang.String strType)
Creates a new instance of Element
|
Element(java.lang.String strType,
java.lang.String strId)
Creates a new instance of Element
|
Modifier and Type | Method and Description |
---|---|
void |
addCloseElements(Element closeElem)
Add an element to the list of nearest neighbor elements used when
considering the effects of PMQs
|
protected PhaseMatrix |
applyAlignError(PhaseMatrix matPhi)
Returns the given transfer matrix adjusted by the
misalignment parameters of this element.
|
void |
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 probe
probe spends drifting a
a distance dblLen . |
double |
compProbeLocation(IProbe probe)
This method is intended to return the location of the probe within
the current element.
|
abstract double |
elapsedTime(IProbe probe,
double dblLen)
Returns the time taken for the probe
probe to propagate
through a subsection of the element with length dblLen . |
abstract double |
energyGain(IProbe probe,
double dblLen)
Returns energy gain for subsection of this element of length
dblLen for the specified given probe. |
double |
getAlignX() |
double |
getAlignY() |
double |
getAlignZ() |
java.util.ArrayList<Element> |
getCloseElements()
Return the list of nearest adjacent elements to this element.
|
java.lang.String |
getHardwareNodeId()
Returns the string identifier of the hardware node which this
element models.
|
java.lang.String |
getId()
Returns the string identifier for this element.
|
abstract double |
getLength()
Return the length of this element.
|
double |
getPosition()
Return the center position of the element along the design trajectory.
|
java.lang.String |
getType()
Return the element type identifier
|
int |
getUID()
Return the internal class unique identifier of this element.
|
void |
initializeFrom(LatticeElement latticeElement)
Conversion method to be provided by the user
|
void |
print(java.io.PrintWriter os)
Dump current state and content to output stream.
|
void |
propagate(IProbe probe)
Override of
IComponent.propagate(xal.model.IProbe, double)
Propagates the Probe object through this element based on the associated algorithm. |
void |
propagate(IProbe probe,
double pos)
Override of
IComponent.propagate(xal.model.IProbe, double)
Propagates the Probe object through this element based on the associated algorithm. |
void |
setAlign(R3 vecAlign)
Set the alignment parameters all at once.
|
void |
setAlignX(double x) |
void |
setAlignY(double y) |
void |
setAlignZ(double z) |
void |
setHardwareNodeId(java.lang.String strSmfId)
Sets the string identifier of the hardware node which this
element models.
|
void |
setId(java.lang.String strId)
Set the string identifier for the element.
|
void |
setPosition(double dblPos)
Set the center position of the element with the containing
lattice.
|
java.lang.String |
toString()
Writes a general parameters description of this modeling element to the
returned string.
|
abstract PhaseMap |
transferMap(IProbe probe,
double dblLen)
Compute the transfer matrix for subsection of this element of length
dblLen for the specified given probe. |
public Element(java.lang.String strType)
strType
- type identifier of the elementpublic Element(java.lang.String strType, java.lang.String strId)
strType
- type identifier of the elementstrId
- string identifier of the elementpublic abstract double getLength()
getLength
in interface IComponent
public abstract double elapsedTime(IProbe probe, double dblLen)
probe
to propagate
through a subsection of the element with length dblLen
.elapsedTime
in interface IElement
probe
- determine energy gain for this probedblLen
- length of subsection to calculate energy gain forpublic abstract double energyGain(IProbe probe, double dblLen)
dblLen
for the specified given probe.energyGain
in interface IElement
probe
- determine energy gain for this probedblLen
- length of subsection to calculate energy gainpublic abstract PhaseMap transferMap(IProbe probe, double dblLen) throws ModelException
dblLen
for the specified given probe. That is, this method should
return the incremental transfer matrix.transferMap
in interface IElement
dblLen
- length of sub-elementprobe
- probe containing parameters for the sub-sectional transfer matrixModelException
- unable to compute transfer mapIElement.transferMap(IProbe,double)
public void initializeFrom(LatticeElement latticeElement)
initializeFrom
in interface IComponent
latticeElement
- the SMF node to convertpublic void setId(java.lang.String strId)
strId
- new string identifier for elementpublic void setHardwareNodeId(java.lang.String strSmfId)
strSmfId
- identifier for the modeled hardware node (SMF object)public void setPosition(double dblPos)
dblPos
- center position along the design trajectory (meters)public void setAlign(R3 vecAlign)
vecAlign
- (dx,dy,dz)public void setAlignX(double x)
public void setAlignY(double y)
public void setAlignZ(double z)
public double getAlignX()
public double getAlignY()
public double getAlignZ()
public void addCloseElements(Element closeElem)
closeElem
- an adjacent elementpublic int getUID()
protected PhaseMatrix applyAlignError(PhaseMatrix matPhi)
matPhi
- a transfer matrixpublic double compProbeLocation(IProbe probe)
This method is intended to return the location of the probe within the current element. Actually, we compute and return the distance of the probe from the element entrance location.
NOTEThis method will always return a value regardless of whether or not the probe is within the element domain. The returned value is the distance fromt the entrance location. Thus, negative values indicate an upstream position and values larger than the element length indicate positions downstream.
probe
- probe within element domainpublic java.lang.String getType()
getType
in interface IComponent
public java.lang.String getId()
getId
in interface IComponent
public java.lang.String getHardwareNodeId()
getHardwareNodeId
in interface IComponent
public void propagate(IProbe probe, double pos) throws ModelException
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 the
Tracker.propagate(IProbe, IElement)
class. Careful when modifying.
Tracker
propagate
in interface IComponent
probe
- probe object to propagatepos
- I think it is position of the probe within this elementModelException
- error occurred during propagationIComponent.propagate(xal.model.IProbe, double)
,
Tracker.propagate(IProbe, IElement)
public void propagate(IProbe probe) throws ModelException
Override of IComponent.propagate(xal.model.IProbe, double)
Propagates the Probe object through this element based on the associated algorithm.
propagate
in interface IComponent
probe
- probe object to propagateModelException
- error occurred during propagationIComponent.propagate(xal.model.IProbe, double)
public void backPropagate(IProbe probe, double pos) throws ModelException
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 the
Tracker.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!
backPropagate
in interface IComponent
probe
- probe object to propagatepos
- I think it is position of the probe within this elementModelException
- error occurred during propagationIComponent.propagate(xal.model.IProbe, double)
,
Tracker.propagate(IProbe, IElement)
public void backPropagate(IProbe probe) throws ModelException
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!
backPropagate
in interface IComponent
probe
- probe object to propagateModelException
- error occurred during propagationIComponent.propagate(xal.model.IProbe, double)
public double getPosition()
public java.util.ArrayList<Element> getCloseElements()
public double compDriftingTime(IProbe probe, double dblLen)
probe
spends drifting a
a distance dblLen
.probe
- interface to drifting probedblLen
- length of drift in meterspublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void print(java.io.PrintWriter os)
os
- output stream object