diff --git a/src/Algorithms/ParallelTTracker.cpp b/src/Algorithms/ParallelTTracker.cpp index 2c7c3794dd26135860daff697e969fb645374e20..f5af0acda237f25264808e19d5deca7693b829ff 100644 --- a/src/Algorithms/ParallelTTracker.cpp +++ b/src/Algorithms/ParallelTTracker.cpp @@ -19,8 +19,6 @@ #include "Algorithms/ParallelTTracker.h" -#include "mithra/fieldvector.hh" - #include <cfloat> #include <iostream> #include <fstream> @@ -1466,4 +1464,4 @@ void ParallelTTracker::evenlyDistributeParticles() { // mode:c++ // c-basic-offset: 4 // indent-tabs-mode:nil -// End: +// End: \ No newline at end of file diff --git a/src/Algorithms/ParallelTTracker.h b/src/Algorithms/ParallelTTracker.h index e6fa0c84ebc3a53d4ad4ec438ead99d0feddc3ca..55159418c08b16404ed55c49a6e73d2769f16087 100644 --- a/src/Algorithms/ParallelTTracker.h +++ b/src/Algorithms/ParallelTTracker.h @@ -36,7 +36,6 @@ #include "AbsBeamline/Diagnostic.h" #include "AbsBeamline/Degrader.h" #include "AbsBeamline/Drift.h" -#include "AbsBeamline/Undulator.h" #include "AbsBeamline/FlexibleCollimator.h" #include "AbsBeamline/ElementBase.h" #include "AbsBeamline/Lambertson.h" @@ -123,9 +122,6 @@ public: /// Apply the algorithm to a Drift. virtual void visitDrift(const Drift &); - /// Apply the algorithm to a Undulator. - virtual void visitUndulator(const Undulator &); - /// Apply the algorithm to a flexible collimator virtual void visitFlexibleCollimator(const FlexibleCollimator &); @@ -360,10 +356,6 @@ inline void ParallelTTracker::visitDiagnostic(const Diagnostic &diag) { } -inline void ParallelTTracker::visitUndulator(const Undulator &u) { - itsOpalBeamline_m.visit(u, *this, itsBunch_m); -} - inline void ParallelTTracker::visitDrift(const Drift &drift) { itsOpalBeamline_m.visit(drift, *this, itsBunch_m); } diff --git a/src/Classic/AbsBeamline/BeamlineVisitor.h b/src/Classic/AbsBeamline/BeamlineVisitor.h index 64895d287bb806c9968d3f2f05d0d07bc357df68..5c6c88413a4b45ef4fad64ed6ef4221536a11129 100644 --- a/src/Classic/AbsBeamline/BeamlineVisitor.h +++ b/src/Classic/AbsBeamline/BeamlineVisitor.h @@ -43,7 +43,6 @@ class CyclotronValley; class Degrader; class Diagnostic; class Drift; -class Undulator; class FlexibleCollimator; class Lambertson; class Marker; @@ -131,9 +130,6 @@ public: /// Apply the algorithm to a drift space. virtual void visitDrift(const Drift &) = 0; - /// Apply the algorithm to a undulator space. - virtual void visitUndulator(const Undulator &) = 0; - /// Apply the algorithm to a flexible collimator virtual void visitFlexibleCollimator(const FlexibleCollimator &) = 0; diff --git a/src/Classic/AbsBeamline/CMakeLists.txt b/src/Classic/AbsBeamline/CMakeLists.txt index 42ff51fddb6ff86bcc3bc147d5c16ee017dffbe9..2115b06b084f3e27ffa707462db73477de13fa87 100644 --- a/src/Classic/AbsBeamline/CMakeLists.txt +++ b/src/Classic/AbsBeamline/CMakeLists.txt @@ -16,7 +16,6 @@ set (_SRCS Degrader.cpp Diagnostic.cpp Drift.cpp - Undulator.cpp ElementBase.cpp ElementImage.cpp FlexibleCollimator.cpp @@ -74,7 +73,6 @@ set (HDRS Degrader.h Diagnostic.h Drift.h - Undulator.h ElementBase.h ElementImage.h FlexibleCollimator.h diff --git a/src/Classic/AbsBeamline/ElementBase.h b/src/Classic/AbsBeamline/ElementBase.h index 8f8d03adc98d3594a61da3298a8c9523c5a23b69..777e3768ed82a39e04533ec20e994d00d4c71285 100644 --- a/src/Classic/AbsBeamline/ElementBase.h +++ b/src/Classic/AbsBeamline/ElementBase.h @@ -42,7 +42,6 @@ class ElementImage; enum ElemType { isDrift, - isUndulator, isSolenoid, isSource, isRF, @@ -161,8 +160,7 @@ public: , CYCLOTRONVALLEY , DEGRADER , DIAGNOSTIC - , DRIFT - , UNDULATOR + , DRIFT , FLEXIBLECOLLIMATOR , INTEGRATOR , LAMBERTSON @@ -716,4 +714,4 @@ bool ElementBase::isElementPositionSet() const { return elemedgeSet_m; } -#endif // CLASSIC_ElementBase_HH +#endif // CLASSIC_ElementBase_HH \ No newline at end of file diff --git a/src/Classic/AbsBeamline/Undulator.cpp b/src/Classic/AbsBeamline/Undulator.cpp deleted file mode 100644 index fd773963015ae1229f74ffe1e52692f650dd1855..0000000000000000000000000000000000000000 --- a/src/Classic/AbsBeamline/Undulator.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// ------------------------------------------------------------------------ -// $RCSfile: Undulator.cpp,v $ -// ------------------------------------------------------------------------ -// $Revision: 1.1.1.1 $ -// ------------------------------------------------------------------------ -// Copyright: see Copyright.readme -// ------------------------------------------------------------------------ -// -// Class: Undulator -// Defines the abstract interface for a drift space. -// -// ------------------------------------------------------------------------ -// Class category: AbsBeamline -// ------------------------------------------------------------------------ -// -// $Date: 2000/03/27 09:32:31 $ -// $Author: fci $ -// -// ------------------------------------------------------------------------ - -#include "AbsBeamline/Undulator.h" -#include "AbsBeamline/BeamlineVisitor.h" -#include "Algorithms/PartBunchBase.h" - -extern Inform *gmsg; - -// Class Undulator -// ------------------------------------------------------------------------ - -Undulator::Undulator(): - Component(), - nSlices_m(1) -{ } - - -Undulator::Undulator(const Undulator &right): - Component(right), - nSlices_m(right.nSlices_m) -{ } - - -Undulator::Undulator(const std::string &name): - Component(name), - nSlices_m(1) -{ } - - -Undulator::~Undulator() -{ } - - -void Undulator::accept(BeamlineVisitor &visitor) const { - visitor.visitUndulator(*this); -} - -void Undulator::initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) { - endField = startField + getElementLength(); - RefPartBunch_m = bunch; - startField_m = startField; -} - - -//set the number of slices for map tracking -void Undulator::setNSlices(const std::size_t& nSlices) { - nSlices_m = nSlices; -} - -//get the number of slices for map tracking -std::size_t Undulator::getNSlices() const { - return nSlices_m; -} - -void Undulator::finalise() { -} - -bool Undulator::bends() const { - return false; -} - -void Undulator::getDimensions(double &zBegin, double &zEnd) const { - zBegin = startField_m; - zEnd = startField_m + getElementLength(); -} - -ElementBase::ElementType Undulator::getType() const { - return UNDULATOR; -} diff --git a/src/Classic/AbsBeamline/Undulator.h b/src/Classic/AbsBeamline/Undulator.h deleted file mode 100644 index 4156eedc57c30e75cf20e68113685699c5482c98..0000000000000000000000000000000000000000 --- a/src/Classic/AbsBeamline/Undulator.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef CLASSIC_Undulator_HH -#define CLASSIC_Undulator_HH - -// ------------------------------------------------------------------------ -// $RCSfile: Undulator.h,v $ -// ------------------------------------------------------------------------ -// $Revision: 1.1.1.1 $ -// ------------------------------------------------------------------------ -// Copyright: see Copyright.readme -// ------------------------------------------------------------------------ -// -// Class: Undulator -// Defines the abstract interface for a drift space. -// -// ------------------------------------------------------------------------ -// Class category: AbsBeamline -// ------------------------------------------------------------------------ -// -// $Date: 2000/03/27 09:32:31 $ -// $Author: fci $ -// -// ------------------------------------------------------------------------ - -#include "AbsBeamline/Component.h" - - - -// Class Undulator -// ------------------------------------------------------------------------ -/// Interface for drift space. -// Class Undulator defines the abstract interface for a drift space. - -class Undulator: public Component { - -public: - - /// Constructor with given name. - explicit Undulator(const std::string &name); - - Undulator(); - Undulator(const Undulator &right); - virtual ~Undulator(); - - /// Apply visitor to Undulator. - virtual void accept(BeamlineVisitor &) const; - - virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField); - - virtual void finalise(); - - virtual bool bends() const; - - virtual ElementBase::ElementType getType() const; - - virtual void getDimensions(double &zBegin, double &zEnd) const; - - //set number of slices for map tracking - void setNSlices(const std::size_t& nSlices); // Philippe was here - - //set number of slices for map tracking - std::size_t getNSlices() const; // Philippe was here - -private: - - double startField_m; - std::size_t nSlices_m; - - // Not implemented. - void operator=(const Undulator &); -}; - -#endif // CLASSIC_Undulator_HH diff --git a/src/Classic/BeamlineCore/CMakeLists.txt b/src/Classic/BeamlineCore/CMakeLists.txt index ed0ef6cb6b35ba65484552de1931c24a542e9575..f9e12de71e66e5efc79713a366c156e356943b90 100644 --- a/src/Classic/BeamlineCore/CMakeLists.txt +++ b/src/Classic/BeamlineCore/CMakeLists.txt @@ -6,7 +6,6 @@ set (_SRCS CyclotronValleyRep.cpp DegraderRep.cpp DriftRep.cpp - UndulatorRep.cpp FlexibleCollimatorRep.cpp MarkerRep.cpp MonitorRep.cpp @@ -49,7 +48,6 @@ set (HDRS CyclotronValleyRep.h DegraderRep.h DriftRep.h - UndulatorRep.h FlexibleCollimatorRep.h MarkerRep.h MonitorRep.h diff --git a/src/Classic/BeamlineCore/UndulatorRep.cpp b/src/Classic/BeamlineCore/UndulatorRep.cpp deleted file mode 100644 index e89cf33ec5b9b2fb8907af4bcbe496aa72ec1dff..0000000000000000000000000000000000000000 --- a/src/Classic/BeamlineCore/UndulatorRep.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// ------------------------------------------------------------------------ -// $RCSfile: UndulatorRep.cpp,v $ -// ------------------------------------------------------------------------ -// $Revision: 1.1.1.1 $ -// ------------------------------------------------------------------------ -// Copyright: see Copyright.readme -// ------------------------------------------------------------------------ -// -// Class: UndulatorRep -// Defines a concrete drift space representation. -// -// ------------------------------------------------------------------------ -// Class category: BeamlineCore -// ------------------------------------------------------------------------ -// -// $Date: 2000/03/27 09:32:33 $ -// $Author: fci $ -// -// ------------------------------------------------------------------------ - -#include "BeamlineCore/UndulatorRep.h" -#include "AbsBeamline/ElementImage.h" -#include "Channels/IndirectChannel.h" - - -// Attribute access table. -// ------------------------------------------------------------------------ - -namespace { - struct Entry { - const char *name; - double(UndulatorRep::*get)() const; - void (UndulatorRep::*set)(double); - }; - - const Entry entries[] = { - { - "L", - &UndulatorRep::getElementLength, - &UndulatorRep::setElementLength - }, - { 0, 0, 0 } - }; -} - - -// Class UndulatorRep -// ------------------------------------------------------------------------ - -UndulatorRep::UndulatorRep(): - Undulator(), - geometry(0.0) -{} - - -UndulatorRep::UndulatorRep(const UndulatorRep &right): - Undulator(right), - geometry(right.geometry) -{} - - -UndulatorRep::UndulatorRep(const std::string &name): - Undulator(name), - geometry() -{} - - -UndulatorRep::~UndulatorRep() -{} - - -ElementBase *UndulatorRep::clone() const { - return new UndulatorRep(*this); -} - - -Channel *UndulatorRep::getChannel(const std::string &aKey, bool create) { - for(const Entry *entry = entries; entry->name != 0; ++entry) { - if(aKey == entry->name) { - return new IndirectChannel<UndulatorRep>(*this, entry->get, entry->set); - } - } - - return ElementBase::getChannel(aKey, create); -} - - -NullField &UndulatorRep::getField() { - return field; -} - -const NullField &UndulatorRep::getField() const { - return field; -} - - -StraightGeometry &UndulatorRep::getGeometry() { - return geometry; -} - -const StraightGeometry &UndulatorRep::getGeometry() const { - return geometry; -} - - -ElementImage *UndulatorRep::getImage() const { - ElementImage *image = ElementBase::getImage(); - - for(const Entry *entry = entries; entry->name != 0; ++entry) { - image->setAttribute(entry->name, (this->*(entry->get))()); - } - - return image; -} diff --git a/src/Classic/BeamlineCore/UndulatorRep.h b/src/Classic/BeamlineCore/UndulatorRep.h deleted file mode 100644 index 63443a65e3e33d0f8d65cef088cc688fce1eea16..0000000000000000000000000000000000000000 --- a/src/Classic/BeamlineCore/UndulatorRep.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef CLASSIC_UndulatorRep_HH -#define CLASSIC_UndulatorRep_HH - -// ------------------------------------------------------------------------ -// $RCSfile: UndulatorRep.h,v $ -// ------------------------------------------------------------------------ -// $Revision: 1.1.1.1 $ -// ------------------------------------------------------------------------ -// Copyright: see Copyright.readme -// ------------------------------------------------------------------------ -// -// Class: UndulatorRep -// -// ------------------------------------------------------------------------ -// Class category: BeamlineCore -// ------------------------------------------------------------------------ -// -// $Date: 2000/03/27 09:32:33 $ -// $Author: fci $ -// -// ------------------------------------------------------------------------ - -#include "AbsBeamline/Undulator.h" -#include "BeamlineGeometry/StraightGeometry.h" -#include "Fields/NullField.h" - - -// Class UndulatorRep -// ------------------------------------------------------------------------ -/// Representation for a drift space. - -class UndulatorRep: public Undulator { - -public: - - /// Constructor with given name. - explicit UndulatorRep(const std::string &name); - - UndulatorRep(); - UndulatorRep(const UndulatorRep &); - virtual ~UndulatorRep(); - - /// Return clone. - // Return an identical deep copy of the element. - virtual ElementBase *clone() const; - - /// Construct a read/write channel. - // This method constructs a Channel permitting read/write access to - // the attribute [b]aKey[/b] and returns it. - // If the attribute does not exist, it returns NULL. - virtual Channel *getChannel(const std::string &aKey, bool = false); - - /// Get field. - // Version for non-constant object. - virtual NullField &getField(); - - /// Get field. - // Version for constant object. - virtual const NullField &getField() const; - - /// Get geometry. - // Version for non-constant object. - virtual StraightGeometry &getGeometry(); - - /// Get geometry. - // Version for constant object. - virtual const StraightGeometry &getGeometry() const; - - /// Construct an image. - // Return the image of the element, containing the name and type string - // of the element, and a copy of the user-defined attributes. - virtual ElementImage *getImage() const; - -private: - - // Not implemented. - void operator=(const UndulatorRep &); - - /// The zero magnetic field. - NullField field; - - /// The geometry. - StraightGeometry geometry; -}; - -#endif // CLASSIC_UndulatorRep_HH diff --git a/src/Elements/CMakeLists.txt b/src/Elements/CMakeLists.txt index 31e5bd0b0c765fc0686b8249282e7ab92d1c46ee..4bf1fadf1aa5ff95d7b78d51983b42347e174728 100644 --- a/src/Elements/CMakeLists.txt +++ b/src/Elements/CMakeLists.txt @@ -8,7 +8,6 @@ set (_SRCS OpalCCollimator.cpp OpalCyclotron.cpp OpalDrift.cpp - OpalUndulator.cpp OpalECollimator.cpp OpalFlexibleCollimator.cpp OpalDegrader.cpp @@ -78,7 +77,6 @@ set (HDRS OpalCyclotronValley.h OpalDegrader.h OpalDrift.h - OpalUndulator.h OpalECollimator.h OpalElement.h OpalHKicker.h diff --git a/src/Elements/OpalUndulator.cpp b/src/Elements/OpalUndulator.cpp deleted file mode 100644 index ffedc53ce7b55789cf113d44836be9c160ac5dcc..0000000000000000000000000000000000000000 --- a/src/Elements/OpalUndulator.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// ------------------------------------------------------------------------ -// $RCSfile: OpalUndulator.cpp,v $ -// ------------------------------------------------------------------------ -// $Revision: 1.1.1.1 $ -// ------------------------------------------------------------------------ -// Copyright: see Copyright.readme -// ------------------------------------------------------------------------ -// -// Class: OpalUndulator -// The class of OPAL drift spaces. -// -// ------------------------------------------------------------------------ -// -// $Date: 2000/03/27 09:33:39 $ -// $Author: Andreas Adelmann $ -// -// ------------------------------------------------------------------------ - -#include "Elements/OpalUndulator.h" -#include "Structure/BoundaryGeometry.h" -#include "Attributes/Attributes.h" -#include "BeamlineCore/UndulatorRep.h" -#include "Structure/OpalWake.h" -#include "Structure/ParticleMatterInteraction.h" - -// Class OpalUndulator -// ------------------------------------------------------------------------ - -OpalUndulator::OpalUndulator(): - OpalElement(SIZE, "DRIFT", - "The \"DRIFT\" element defines a drift space."), - owk_m(NULL), - parmatint_m(NULL), - obgeo_m(NULL) { - // CKR: the following 3 lines are redundant: OpalElement does this already! - // they prevent drift from working properly - // - // itsAttr[LENGTH] = Attributes::makeReal - // ("LENGTH", "Undulator length"); - - // registerRealAttribute("LENGTH"); - itsAttr[GEOMETRY] = Attributes::makeString - ("GEOMETRY", "BoundaryGeometry for Undulators"); - - itsAttr[NSLICES] = Attributes::makeReal - ("NSLICES", - "The number of slices/ steps for this element in Map Tracking", 1); - - - registerStringAttribute("GEOMETRY"); - registerRealAttribute("NSLICES"); - registerOwnership(); - - setElement(new UndulatorRep("DRIFT")); -} - - -OpalUndulator::OpalUndulator(const std::string &name, OpalUndulator *parent): - OpalElement(name, parent), - owk_m(NULL), - parmatint_m(NULL), - obgeo_m(NULL) { - setElement(new UndulatorRep(name)); -} - - -OpalUndulator::~OpalUndulator() { - if(owk_m) - delete owk_m; - if(parmatint_m) - delete parmatint_m; - if(obgeo_m) - delete obgeo_m; -} - - -OpalUndulator *OpalUndulator::clone(const std::string &name) { - return new OpalUndulator(name, this); -} - - -bool OpalUndulator::isUndulator() const { - return true; -} - - -void OpalUndulator::update() { - OpalElement::update(); - - UndulatorRep *drf = static_cast<UndulatorRep *>(getElement()); - drf->setElementLength(Attributes::getReal(itsAttr[LENGTH])); - drf->setNSlices(Attributes::getReal(itsAttr[NSLICES])); - if(itsAttr[WAKEF] && owk_m == NULL) { - owk_m = (OpalWake::find(Attributes::getString(itsAttr[WAKEF])))->clone(getOpalName() + std::string("_wake")); - owk_m->initWakefunction(*drf); - drf->setWake(owk_m->wf_m); - } - - if(itsAttr[PARTICLEMATTERINTERACTION] && parmatint_m == NULL) { - parmatint_m = (ParticleMatterInteraction::find(Attributes::getString(itsAttr[PARTICLEMATTERINTERACTION])))->clone(getOpalName() + std::string("_parmatint")); - parmatint_m->initParticleMatterInteractionHandler(*drf); - drf->setParticleMatterInteraction(parmatint_m->handler_m); - } - if(itsAttr[GEOMETRY] && obgeo_m == NULL) { - obgeo_m = (BoundaryGeometry::find(Attributes::getString(itsAttr[GEOMETRY])))->clone(getOpalName() + std::string("_geometry")); - if(obgeo_m) { - drf->setBoundaryGeometry(obgeo_m); - } - } - - // Transmit "unknown" attributes. - OpalElement::updateUnknown(drf); -} diff --git a/src/Elements/OpalUndulator.h b/src/Elements/OpalUndulator.h deleted file mode 100644 index 9b8f35930cddec3d2cb3180af0c3b0fb8200ed23..0000000000000000000000000000000000000000 --- a/src/Elements/OpalUndulator.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef OPAL_OpalUndulator_HH -#define OPAL_OpalUndulator_HH - -// ------------------------------------------------------------------------ -// $RCSfile: OpalUndulator.h,v $ -// ------------------------------------------------------------------------ -// $Revision: 1.1.1.1 $ -// ------------------------------------------------------------------------ -// Copyright: see Copyright.readme -// ------------------------------------------------------------------------ -// -// Class: OpalUndulator -// -// ------------------------------------------------------------------------ -// -// $Date: 2000/03/27 09:33:39 $ -// $Author: Andreas Adelmann $ -// -// ------------------------------------------------------------------------ - -#include "Elements/OpalElement.h" - -class BoundaryGeometry; - -// Class OpalUndulator -// ------------------------------------------------------------------------ -/// The DRIFT element. - -class OpalWake; -class ParticleMatterInteraction; - -class OpalUndulator: public OpalElement { - -public: - - enum { - GEOMETRY = COMMON, // geometry of boundary, one more enum member besides the common ones in OpalElement. - NSLICES, // The number of slices / steps per element for map tracking - SIZE - - }; - /// Exemplar constructor. - OpalUndulator(); - - virtual ~OpalUndulator(); - - /// Make clone. - virtual OpalUndulator *clone(const std::string &name); - - /// Test for drift. - // Return true. - virtual bool isUndulator() const; - - /// Update the embedded CLASSIC drift. - virtual void update(); - -private: - - // Not implemented. - OpalUndulator(const OpalUndulator &); - void operator=(const OpalUndulator &); - - // Clone constructor. - OpalUndulator(const std::string &name, OpalUndulator *parent); - - OpalWake *owk_m; - ParticleMatterInteraction *parmatint_m; - BoundaryGeometry *obgeo_m; -}; - -#endif // OPAL_OpalUndulator_HH diff --git a/src/OpalConfigure/Configure.cpp b/src/OpalConfigure/Configure.cpp index 6e598f20140f52b95e224d61afde8a240f8674d7..e9c1749b113c6af59d00b1c8af52a1ed7768e3c5 100644 --- a/src/OpalConfigure/Configure.cpp +++ b/src/OpalConfigure/Configure.cpp @@ -94,7 +94,6 @@ #include "Elements/OpalCCollimator.h" #include "Elements/OpalCyclotron.h" #include "Elements/OpalDrift.h" -#include "Elements/OpalUndulator.h" #include "Elements/OpalECollimator.h" #include "Elements/OpalFlexibleCollimator.h" #include "Elements/OpalDegrader.h" @@ -249,7 +248,6 @@ namespace { opal->create(new OpalCCollimator()); opal->create(new OpalCyclotron()); opal->create(new OpalDrift()); - opal->create(new OpalUndulator()); opal->create(new OpalECollimator()); opal->create(new OpalFlexibleCollimator()); opal->create(new OpalDegrader());