63#ifndef OPALX_ElementBase_HH
64#define OPALX_ElementBase_HH
91class ParticleMatterInteractionHandler;
123class ElementBase :
public std::enable_shared_from_this<ElementBase> {
133 virtual const std::string&
getName()
const;
136 virtual void setName(
const std::string& name);
196 virtual double getExit()
const;
245 virtual double getAttribute(
const std::string& aKey)
const;
249 virtual bool hasAttribute(
const std::string& aKey)
const;
255 virtual void setAttribute(
const std::string& aKey,
double val);
311 virtual void setWake(WakeFunction* wf);
314 virtual WakeFunction*
getWake()
const;
402 std::pair<ApertureType, std::vector<double> >
getAperture()
const;
411 void setActionRange(
const std::queue<std::pair<double, double> >& range);
622 "ElementBase::getElementPosition()",
623 std::string(
"ELEMEDGE for \"") +
getName() +
"\" not set");
ippl::Vector< T, Dim > Vector_t
Map of std::string versus double value.
Abstract base class for accelerator geometry classes.
virtual Euclid3D getTransform(double fromS, double toS) const =0
Get transform.
virtual Euclid3D getExitFrame() const
Get transform.
virtual Euclid3D getExitPatch() const
Get patch.
virtual void setElementLength(double length)
Set geometry length.
virtual double getEntrance() const
Get entrance position.
virtual double getExit() const
Get exit position.
virtual Euclid3D getTotalTransform() const
Get transform.
virtual double getElementLength() const =0
Get geometry length.
virtual double getOrigin() const
Get origin position.
virtual Euclid3D getEntranceFrame() const
Get transform.
virtual Euclid3D getEntrancePatch() const
Get patch.
virtual double getArcLength() const =0
Get arc length.
Abstract interface for read/write access to variable.
Abstract interface for read-only access to variable.
Rigid spatial transform between a parent frame and a local frame.
virtual void setBoundaryGeometry(BoundaryGeometry *geo)
void setElementPosition(double elemedge)
Access to ELEMEDGE attribute.
virtual Channel * getChannel(const std::string &aKey, bool create=false)
Construct a read/write channel.
virtual void setName(const std::string &name)
Set element name.
virtual const std::string & getName() const
Get element name.
virtual void removeAttribute(const std::string &aKey)
Remove an existing attribute.
virtual double getArcLength() const
Get arc length.
static const std::map< ElementType, std::string > elementTypeToString_s
virtual double getExit() const
Get exit position.
void setAperture(const ApertureType &type, const std::vector< double > &args)
virtual const BGeometryBase & getGeometry() const =0
Get geometry.
virtual ParticleMatterInteractionHandler * getParticleMatterInteraction() const
bool getFlagDeleteOnTransverseExit() const
virtual double getElementLength() const
Get design length.
bool update(const AttributeSet &)
Update element.
virtual Euclid3D getExitPatch() const
Get patch.
void setPlacementPose(const PlacementPose &pose)
Set the nominal rigid placement transform of the element.
bool isPositioned() const
std::pair< ApertureType, std::vector< double > > getAperture() const
virtual void setElementLength(double length)
Set design length.
ParticleMatterInteractionHandler * parmatint_m
virtual Euclid3D getExitFrame() const
Get transform.
CoordinateSystemTrafo misalignment_m
void setMisalignment(const CoordinateSystemTrafo &cst)
CoordinateSystemTrafo getMisalignment() const
void getMisalignment(double &x, double &y, double &s) const
virtual const ConstChannel * getConstChannel(const std::string &aKey) const
Construct a read-only channel.
void operator=(const ElementBase &)
bool deleteOnTransverseExit_m
virtual void accept(BeamlineVisitor &visitor) const =0
Apply visitor.
virtual ElementBase * clone() const =0
Return clone.
CoordinateSystemTrafo getCSTrafoGlobal2Local() const
virtual void setAttribute(const std::string &aKey, double val)
Set value of an attribute.
virtual double getOrigin() const
Get origin position.
virtual Euclid3D getEntranceFrame() const
Get transform.
std::string getOutputFN() const
Get output filename.
virtual ElementType getType() const =0
Get element type std::string.
virtual Port getEntryPort() const
Return the entrance port of the canonical local chart.
void setOutputFN(std::string fn)
Set output filename.
std::pair< ApertureType, std::vector< double > > aperture_m
virtual bool hasBoundaryGeometry() const
double elementPosition_m
ELEMEDGE attribute.
virtual void setParticleMatterInteraction(ParticleMatterInteractionHandler *spys)
void setFlagDeleteOnTransverseExit(bool=true)
ElementGeometry getPlacementGeometry() const
Return the bridge geometry ports assembled from legacy edge state.
bool isInsideTransverse(const Vector_t< double, 3 > &r) const
virtual Euclid3D getTransform(double fromS, double toS) const
Get transform.
virtual void makeSharable()
Set sharable flag.
virtual bool hasAttribute(const std::string &aKey) const
Test for existence of an attribute.
bool isElementPositionSet() const
void setRotationAboutZ(double rotation)
Set rotation about z axis in bend frame.
std::queue< std::pair< double, double > > actionRange_m
void setCSTrafoGlobal2Local(const CoordinateSystemTrafo &ori)
virtual Port getBodyPort() const
Return the body port of the canonical local chart.
virtual BoundaryGeometry * getBoundaryGeometry() const
return the attached boundary geometrt object if there is any
Misalignment getPlacementMisalignment() const
Return the local nominal-to-actual correction stored for the element.
virtual double getEntrance() const
Get entrance position.
virtual CoordinateSystemTrafo getEdgeToBegin() const
std::string getTypeString() const
double getElementPosition() const
virtual ElementBase * copyStructure()
Make a structural copy.
PlacementPose getPlacementPose() const
Return the nominal rigid placement transform of the element.
double getRotationAboutZ() const
BoundaryGeometry * bgeometry_m
virtual Port getExitPort() const
Return the exit port of the canonical local chart.
virtual Euclid3D getTotalTransform() const
Get transform.
bool isSharable() const
Test if the element can be shared.
void setActionRange(const std::queue< std::pair< double, double > > &range)
virtual int getRequiredNumberOfTimeSteps() const
virtual Euclid3D getEntrancePatch() const
Get patch.
virtual WakeFunction * getWake() const
return the attached wake object if there is any
void setCurrentSCoordinate(double s)
virtual double getAttribute(const std::string &aKey) const
Get attribute value.
SupportPlacement getPlacementSupport() const
Return the support-frame bridge object. The default is the body frame.
virtual bool hasParticleMatterInteraction() const
virtual CoordinateSystemTrafo getEdgeToEnd() const
virtual bool hasWake() const
PlacedElement getPlacedElement() const
Return a placed-element view assembled from the current bridge objects.
virtual void getElementDimensions(double &begin, double &end) const
Return the nominal body extent of the element.
virtual void setWake(WakeFunction *wf)
attach a wake field to the element
virtual BGeometryBase & getGeometry()=0
Get geometry.
virtual BoundingBox getBoundingBoxInLabCoords() const
virtual bool isInside(const Vector_t< double, 3 > &r) const
CoordinateSystemTrafo csTrafoGlobal2Local_m
Named body-relative ports used for placement and chaining.
Displacement and rotation in space.
Local nominal-to-actual correction transform.
Geometric placement record for an element instance.
Nominal rigid placement transform.
const CoordinateSystemTrafo & getParentToNominal() const
Named local frame attached to an element body.
Quaternion storage and rotation algebra used by OPALX geometry code.
Optional offset from the canonical body frame to the support frame.