Commit 1ebb1071 authored by snuverink_j's avatar snuverink_j
Browse files

remove Aperture actions: APERTURE, SPLIT

parent 8580b9e9
This diff is collapsed.
#ifndef OPAL_Aperture_HH
#define OPAL_Aperture_HH
#include "Algorithms/DefaultVisitor.h"
#include "Beamlines/FlaggedElmPtr.h"
#include "FixedAlgebra/FMatrix.h"
#include "FixedAlgebra/FVector.h"
#include "AbstractObjects/Table.h"
#include "Beamlines/TBeamline.h"
#include "Tables/Twiss.h"
#include <cmath>
#include <vector>
#include <string>
#include <iosfwd>
class Aperture: public DefaultVisitor, public Table {
protected:
//Properties of the optic element
struct Data {
double kq, k0s, e1, e2, l, phi, courb;
std::string type;
} data;
//data needed for the aperture calculation
double co, K_beta, delta_p, n1;
double tolerance_x, tolerance_y, offsetx, offsety;
//vector of points of the beam screen
struct coord {
double x;
double y;
};
std::vector<coord> ShapeBeamScreen;
std::vector<coord> ShapeHalo;
public:
class A_row: public FlaggedElmPtr {
friend class Aperture;
public:
A_row() {};
A_row(const A_row &a);
A_row(ElementBase *elem, int occur): FlaggedElmPtr(elem) {
setCounter(occur);
}
A_row(const FlaggedElmPtr &rhs, int order):
FlaggedElmPtr(rhs), Interpol(order)
{}
inline double getBeta_x(int ind) ;
inline double getBeta_y(int ind) ;
inline double getDisp_x(int ind) ;
inline double getDisp_y(int ind) ;
inline double getDisp_x_prim(int ind) ;
inline double getDisp_y_prim(int ind) ;
inline double getApert(int ind);
inline std::string getType_elm() ;
inline double getOrb();
private:
std::string Type_elm;
double Orb;
struct pt_interpol {
double Beta_x, Beta_y;
double Disp_x, Disp_x_prim;
double Disp_y, Disp_y_prim;
double delta_x, delta_y;
double apert;
};
//Vector of pt_interpol of size "order" containing the different values of Beta
//and Disp... inside the optic element pointed by p.
std::vector<pt_interpol> Interpol;
};
typedef TBeamline<A_row> A_Tline;
Aperture();
Aperture(const std::string &name, Aperture *parent);
virtual ~Aperture() {};
//return the maximum of the betax(y) function in the elm
double getBETXMAX(const A_row &, int i1 = 0, int i2 = 0) const;
double getBETYMAX(const A_row &, int i1 = 0, int i2 = 0) const;
//return the minimum of the aperture function inside the elm
double getAPERTMIN(const A_row &row, int i1 = 0, int i2 = 0) const;
//return the shape of the beam screen or the halo
std::vector<Aperture::coord> getShape(std::vector<double> vec);
//return the minimum apert of a slice if an element
void calcul_Apert(A_row &a, int slice, Twiss *tp);
//return the lenght of the table
virtual double getLength();
virtual double getCell(const PlaceRep &place, const std::string &colName);
//return the beamline used
virtual const Beamline *getLine() const;
//comments in Twiss class
virtual CellArray getDefault() const;
virtual std::vector<double> getColumn(const RangeRep &rng, const std::string
&colName);
virtual std::vector<double> getRow(const PlaceRep &pos, const
std::vector<std::string> &cols);
virtual bool isDependent(const std::string &name) const;
virtual bool matches(Table *rhs) const;
virtual Expressions::PtrToScalar<double> makeColumnExpression(const std::string &colname) const;
virtual Object *clone(const std::string &name);
virtual void printTable(std::ostream &, const CellArray &)const;
virtual void fill();
A_Tline::const_iterator begin() const;
A_Tline::iterator begin();
A_Tline::const_iterator end() const;
A_Tline::iterator end();
const A_row &getCurrent() const;
//functions in charge of catching the properties of optic elements
virtual void visitMultipole(const Multipole &);
virtual void visitRBend(const RBend &);
virtual void visitSBend(const SBend &);
virtual void visitCyclotron(const Cyclotron &);
virtual void applyDefault(const ElementBase &);
//call of the aperture command
void execute();
//execution of the aperture command
void run();
void calcul(Twiss::TLine::iterator i, A_row &a, int order, Twiss *tp);
protected:
enum {
TABLE,
BEAM,
NSLICE,
STATIC,
DATA,
DEFAULTAPERTURE,
FILE,
SIZE
};
A_Tline itsTable;
A_Tline::iterator n;
const Beam *beam;
Twiss *tp;
Twiss::TLine::iterator i;
//Transformation matrix for optic elements
FMatrix<double, 6, 6> Transf_mat;
//vector alpha,beta,gamma
FVector<double, 3> Euler_x;
FVector<double, 3> Euler_y;
//Variable for dispersion
FVector<double, 2> Dispx;
FVector<double, 2> Dispy;
private:
A_row &findRow(const PlaceRep &row);
mutable A_Tline::const_iterator current;
//line name
std::string itsLine;
};
#endif //OPAL_Aperture_HH
set (_SRCS
Split.cpp
Aperture.cpp
)
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
add_opal_sources (${_SRCS})
set (HDRS
Aperture.h
Split.h
)
install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/Aperture")
# vi: set et ts=4 sw=4 sts=4:
# Local Variables:
# mode: cmake
# cmake-tab-width: 4
# indent-tabs-mode: nil
# require-final-newline: nil
# End:
This diff is collapsed.
#ifndef OPAL_Split_HH
#define OPAL_Split_HH
#include "Algorithms/DefaultVisitor.h"
#include "Beamlines/FlaggedElmPtr.h"
#include "FixedAlgebra/FMatrix.h"
#include "FixedAlgebra/FVector.h"
#include "AbstractObjects/Table.h"
#include "Beamlines/TBeamline.h"
#include "Tables/Twiss.h"
#include <cmath>
#include <vector>
#include <iosfwd>
class MSplit: public DefaultVisitor, public Table {
protected:
//Properties of the optic element
struct Data {
double kq, k0s, e1, e2, l, phi, courb;
std::string type;
} data;
public:
class A_row: public FlaggedElmPtr {
friend class MSplit;
public:
A_row() {};
A_row(const A_row &a);
A_row(ElementBase *elem, int occur): FlaggedElmPtr(elem) {
setCounter(occur);
}
A_row(const FlaggedElmPtr &rhs, int order):
FlaggedElmPtr(rhs), Interpol(order)
{}
inline double getBeta_x(int ind) ;
inline double getBeta_y(int ind) ;
inline double getAlpha_x(int ind) ;
inline double getAlpha_y(int ind) ;
inline double getDisp_x(int ind) ;
inline double getDisp_y(int ind) ;
inline double getDisp_x_prim(int ind) ;
inline double getDisp_y_prim(int ind) ;
private:
struct pt_interpol {
double Beta_x, Beta_y;
double Alpha_x, Alpha_y;
double Disp_x, Disp_x_prim;
double Disp_y, Disp_y_prim;
double delta_x, delta_y;
};
//Vector of pt_interpol of size "nslice" containing the different values of Beta
//and Disp... inside the optic element pointed by p.
std::vector<pt_interpol> Interpol;
};
typedef TBeamline<A_row> A_Tline;
MSplit();
MSplit(const std::string &name, MSplit *parent);
virtual ~MSplit() {};
//return the maximum of the betax(y) function in the elm
double getBETXMAX(const A_row &, int i1 = 0, int i2 = 0) const;
double getBETYMAX(const A_row &, int i1 = 0, int i2 = 0) const;
//return the lenght of the table
virtual double getLength();
virtual double getCell(const PlaceRep &place, const std::string &colName);
//return the beamline used
virtual const Beamline *getLine() const;
//comments in Twiss class
virtual CellArray getDefault() const;
virtual std::vector<double> getColumn(const RangeRep &rng, const std::string
&colName);
virtual std::vector<double> getRow(const PlaceRep &pos, const
std::vector<std::string> &cols);
virtual bool isDependent(const std::string &name) const;
virtual bool matches(Table *rhs) const;
virtual Expressions::PtrToScalar<double> makeColumnExpression(const std::string &colname) const;
virtual Object *clone(const std::string &name);
virtual void printTable(std::ostream &, const CellArray &)const;
virtual void fill();
A_Tline::const_iterator begin() const;
A_Tline::iterator begin();
A_Tline::const_iterator end() const;
A_Tline::iterator end();
const A_row &getCurrent() const;
//functions in charge of catching the properties of optic elements
virtual void visitMultipole(const Multipole &);
virtual void visitRBend(const RBend &);
virtual void visitSBend(const SBend &);
virtual void visitCyclotron(const Cyclotron &);
virtual void applyDefault(const ElementBase &);
//call of the split command
void execute();
//execution of the split command
void run();
void calcul(Twiss::TLine::iterator i, A_row &a, int order, Twiss *tp);
protected:
enum {
LINE,
BEAM,
NSLICE,
STATIC,
FILE,
SIZE
};
A_Tline itsTable;
A_Tline::iterator n;
const Beam *beam;
Twiss *tp;
Twiss::TLine::iterator i;
//Transformation matrix for optic elements
FMatrix<double, 6, 6> Transf_mat;
//vector alpha,beta,gamma
FVector<double, 3> Euler_x;
FVector<double, 3> Euler_y;
//Variable for dispersion
FVector<double, 2> Dispx;
FVector<double, 2> Dispy;
private:
A_row &findRow(const PlaceRep &row);
mutable A_Tline::const_iterator current;
//line name
std::string itsLine;
};
#endif //OPAL_SPLIT_HH
......@@ -70,7 +70,6 @@ add_opal_sources (changes.cpp)
add_subdirectory (AbstractObjects)
add_subdirectory (Algebra)
add_subdirectory (Algorithms)
add_subdirectory (Aperture)
add_subdirectory (Attributes)
add_subdirectory (BasicActions)
add_subdirectory (Classic)
......
......@@ -60,9 +60,6 @@
#include "Tables/List.h"
#include "Tables/Period.h"
#include "Tables/Survey.h"
#include "Aperture/Aperture.h"
#include "Aperture/Split.h"
// Value definitions commands.
#include "ValueDefinitions/BoolConstant.h"
......@@ -168,8 +165,6 @@ namespace {
opal->create(new System());
opal->create(new Title());
opal->create(new TrackCmd());
opal->create(new Aperture());
opal->create(new MSplit());
opal->create(new Value());
opal->create(new What());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment