67#include <boost/filesystem.hpp>
92 csTrafoGlobal2Local_m(right.csTrafoGlobal2Local_m),
93 misalignment_m(right.misalignment_m),
94 aperture_m(right.aperture_m),
95 elementEdge_m(right.elementEdge_m),
96 rotationZAxis_m(right.rotationZAxis_m),
97 elementID(right.elementID),
98 userAttribs(right.userAttribs),
100 bgeometry_m(right.bgeometry_m),
101 parmatint_m(right.parmatint_m),
102 positionIsFixed(right.positionIsFixed),
103 elementPosition_m(right.elementPosition_m),
104 elemedgeSet_m(right.elemedgeSet_m),
105 outputfn_m(right.outputfn_m),
106 deleteOnTransverseExit_m(right.deleteOnTransverseExit_m) {
112 csTrafoGlobal2Local_m(),
115 rotationZAxis_m(0.0),
119 bgeometry_m(nullptr),
120 parmatint_m(nullptr),
121 positionIsFixed(false),
122 elementPosition_m(0.0),
123 elemedgeSet_m(false),
149 return filePath.replace_extension().native();
156 if (aChannel !=
nullptr) {
157 double val = *aChannel;
168 if (aChannel !=
nullptr) {
183 if (aChannel !=
nullptr && aChannel->
isSettable()) {
187 std::cout <<
"Channel nullptr or not Settable" <<
std::endl;
253 factor = fractionLength *
aperture_m.second[2];
258 return (std::abs(r[0]) < xLimit && std::abs(r[1]) < yLimit);
260 return (std::pow(r[0] / xLimit, 2) + std::pow(r[1] / yLimit, 2) < 1.0);
262 return (std::abs(r[0]) < factor * xLimit && std::abs(r[1]) < factor * yLimit);
265 std::pow(r[0] / (factor * xLimit), 2) + std::pow(r[1] / (factor * yLimit), 2)
280 std::vector<Vector_t<double, 3>> corners(8);
281 for (
int i = -1; i < 2; i += 2) {
282 for (
int j = -1; j < 2; j += 2) {
283 unsigned int idx = (i + 1) / 2 + (j + 1);
Inform & endl(Inform &inf)
Map of std::string versus double value.
void removeAttribute(const std::string &aKey)
Remove an existing attribute.
const_iterator begin() const
Iterator accessing first member.
NameMap::const_iterator const_iterator
An iterator for a map of name versus value.
Channel * getChannel(const std::string &aKey, bool create=false)
Construct a read/write channel.
const_iterator end() const
Iterator marking the end of the list.
virtual void setBoundaryGeometry(BoundaryGeometry *geo)
attach a boundary geometry field to the element
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.
static const std::map< ElementType, std::string > elementTypeToString_s
virtual double getElementLength() const
Get design length.
bool update(const AttributeSet &)
Update element.
std::string outputfn_m
The name of the outputfile.
ParticleMatterInteractionHandler * parmatint_m
virtual const ConstChannel * getConstChannel(const std::string &aKey) const
Construct a read-only channel.
virtual ElementBase * clone() const =0
Return clone.
virtual void setAttribute(const std::string &aKey, double val)
Set value of an attribute.
std::string getOutputFN() const
Get output filename.
void setOutputFN(std::string fn)
Set output filename.
std::pair< ApertureType, std::vector< double > > aperture_m
virtual void setParticleMatterInteraction(ParticleMatterInteractionHandler *spys)
bool isInsideTransverse(const Vector_t< double, 3 > &r) const
virtual void makeSharable()
Set sharable flag.
virtual bool hasAttribute(const std::string &aKey) const
Test for existence of an attribute.
std::queue< std::pair< double, double > > actionRange_m
virtual CoordinateSystemTrafo getEdgeToBegin() const
std::string getTypeString() const
virtual ElementBase * copyStructure()
Make a structural copy.
BoundaryGeometry * bgeometry_m
bool isSharable() const
Test if the element can be shared.
void setCurrentSCoordinate(double s)
virtual double getAttribute(const std::string &aKey) const
Get attribute value.
virtual CoordinateSystemTrafo getEdgeToEnd() const
virtual void setWake(WakeFunction *wf)
attach a wake field to the element
virtual BoundingBox getBoundingBoxInLabCoords() const
CoordinateSystemTrafo csTrafoGlobal2Local_m
ippl::Vector< double, 3 > transformFrom(const ippl::Vector< double, 3 > &r) const
ippl::Vector< double, 3 > transformTo(const ippl::Vector< double, 3 > &r) const
Abstract interface for read/write access to variable.
virtual bool isSettable() const
Test if settable.
Abstract interface for read-only access to variable.
Abstract base class for reference counted objects.
static BoundingBox getBoundingBox(const std::vector< Vector_t< double, 3 > > &positions)