Commit 9dbd7c1c authored by kraus's avatar kraus
Browse files

- remove unused files

- putting own header file first
  o for reason see http://www.cplusplus.com/forum/articles/10627/#msg49679 and
                   http://www.cplusplus.com/forum/articles/10627/#msg49680
parent 814c8c73
......@@ -1036,8 +1036,6 @@ src/Structure/OpalWake.cpp -text
src/Structure/OpalWake.h -text
src/Structure/PriEmissionPhysics.cpp -text
src/Structure/PriEmissionPhysics.h -text
src/Structure/Restart.cpp -text
src/Structure/Restart.h -text
src/Structure/SecondaryEmissionPhysics.cpp -text
src/Structure/SecondaryEmissionPhysics.h -text
src/Structure/SurfacePhysics.cpp -text
......
......@@ -18,13 +18,13 @@
//
// ------------------------------------------------------------------------
#include "Physics/Physics.h"
#include "AbsBeamline/Collimator.h"
#include "Physics/Physics.h"
#include "Algorithms/PartBunch.h"
#include "AbsBeamline/BeamlineVisitor.h"
#include "Fields/Fieldmap.hh"
#include "Structure/LossDataSink.h"
#include "Solvers/SurfacePhysicsHandler.hh"
#include "Solvers/SurfacePhysicsHandler.hh"
#include <memory>
extern Inform *gmsg;
......@@ -168,10 +168,10 @@ inline bool Collimator::isInColl(Vector_t R, Vector_t P, double recpgamma) {
range of the collimator
*/
const double z = R(2) + P(2) * recpgamma;
if((z > position_m) && (z <= position_m + getElementLength())) {
if(isAPepperPot_m) {
/**
------------
|(0)| |(0)|
......@@ -187,13 +187,13 @@ inline bool Collimator::isInColl(Vector_t R, Vector_t P, double recpgamma) {
Observation: the area in a) is much larger than the
area(s) (0). In a) particles are lost in (0)
particles they are not lost.
*/
const double h = pitch_m;
const double xL = - 0.5 * h * (nHolesX_m - 1);
const double yL = - 0.5 * h * (nHolesY_m - 1);
bool alive = false;
for(unsigned int m = 0; (m < nHolesX_m && (!alive)); m++) {
for(unsigned int n = 0; (n < nHolesY_m && (!alive)); n++) {
double x_m = xL + (m * h);
......@@ -210,10 +210,10 @@ inline bool Collimator::isInColl(Vector_t R, Vector_t P, double recpgamma) {
return (R(0) <= -getXsize() || R(1) <= -getYsize() || R(0) >= getXsize() || R(1) >= getYsize());
} else if(isAWire_m) {
ERRORMSG("Not yet implemented");
} else {
} else {
// case of an elliptic collimator
const double trm1 = ((R(0)*R(0))/(getXsize()*getXsize()));
const double trm2 = ((R(1)*R(1))/(getYsize()*getYsize()));
const double trm2 = ((R(1)*R(1))/(getYsize()*getYsize()));
return (trm1 + trm2) > 1.0;
}
}
......@@ -235,7 +235,7 @@ bool Collimator::apply(const size_t &i, const double &t, Vector_t &E, Vector_t &
if(pdead) {
double frac = (R(2) - position_m) / P(2) * recpgamma;
lossDs_m->addParticle(R,P, RefPartBunch_m->ID[i], t + frac * RefPartBunch_m->getdT(), 0);
}
}
return pdead;
}
......@@ -302,15 +302,15 @@ void Collimator::initialise(PartBunch *bunch, double &startField, double &endFie
position_m = startField;
endField = position_m + getElementLength();
sphys_m = getSurfacePhysics();
sphys_m = getSurfacePhysics();
if (!sphys_m) {
if (filename_m == std::string(""))
lossDs_m = std::unique_ptr<LossDataSink>(new LossDataSink(getName(), !Options::asciidump));
else
lossDs_m = std::unique_ptr<LossDataSink>(new LossDataSink(filename_m.substr(0, filename_m.rfind(".")), !Options::asciidump));
}
goOnline();
}
......@@ -325,7 +325,7 @@ void Collimator::initialise(PartBunch *bunch, const double &scaleFactor) {
else
lossDs_m = std::unique_ptr<LossDataSink>(new LossDataSink(filename_m.substr(0, filename_m.rfind(".")), !Options::asciidump));
}
goOnline();
}
......@@ -423,7 +423,7 @@ void Collimator::setOutputFN(std::string fn) {
string Collimator::getOutputFN() {
if (filename_m == std::string(""))
return getName();
else
else
return filename_m.substr(0, filename_m.rfind("."));
}
......
......@@ -18,12 +18,12 @@
//
// ------------------------------------------------------------------------
#include "Physics/Physics.h"
#include "AbsBeamline/Degrader.h"
#include "Algorithms/PartBunch.h"
#include "AbsBeamline/BeamlineVisitor.h"
#include "Fields/Fieldmap.hh"
#include "Structure/LossDataSink.h"
#include "Physics/Physics.h"
#include <memory>
extern Inform *gmsg;
......
......@@ -17,13 +17,13 @@
// $Author: fci $
//
// ------------------------------------------------------------------------
#include "AbsBeamline/Monitor.h"
#include "Physics/Physics.h"
#include "Algorithms/PartBunch.h"
#include "AbsBeamline/BeamlineVisitor.h"
#include "Fields/Fieldmap.hh"
#include "Structure/LossDataSink.h"
#include "Utilities/Options.h"
#include "AbsBeamline/Monitor.h"
#include <memory>
......@@ -85,7 +85,7 @@ bool Monitor::apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B)
double frac = (position_m - R(2)) / (P(2) * recpgamma);
lossDs_m->addParticle(Vector_t(R(0) + frac * P(0) * recpgamma, R(1) + frac * P(1) * recpgamma, position_m),
P, RefPartBunch_m->ID[i], t + frac * RefPartBunch_m->getdT(), 0);
P, RefPartBunch_m->ID[i], t + frac * RefPartBunch_m->getdT(), 0);
}
return false;
......@@ -172,7 +172,7 @@ map<string, unsigned int> Monitor::h5pfiles_s = map<string, unsigned int>();
/*
if (!Options::enableHDF5) return;
reduce(online_m, online_m, OpOr());
if(online_m) {
......@@ -231,8 +231,8 @@ map<string, unsigned int> Monitor::h5pfiles_s = map<string, unsigned int>();
std::unique_ptr<char> varray(new char[nLoc * sizeof(double)]);
double *fvalues = reinterpret_cast<double*>(varray.get());
h5_int64_t *ids = reinterpret_cast<h5_int64_t*>(varray.get());
FixMe: if I write with nLoc==0 -> rc == -2
FixMe: if I write with nLoc==0 -> rc == -2
......
......@@ -25,6 +25,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "AbsBeamline/Offset.h"
#include "math.h"
#include "Utilities/OpalException.h"
......@@ -32,7 +34,6 @@
#include "AbsBeamline/BeamlineVisitor.h"
#include "Elements/OpalRing.h"
#include "AbsBeamline/Offset.h"
double Offset::float_tolerance = 1e-12;
......
......@@ -18,8 +18,8 @@
//
// ------------------------------------------------------------------------
#include "Algorithms/PartPusher.h"
#include "AbsBeamline/SBend.h"
#include "Algorithms/PartPusher.h"
#include "Algorithms/PartBunch.h"
#include "AbsBeamline/BeamlineVisitor.h"
#include "Fields/Fieldmap.hh"
......@@ -1623,4 +1623,3 @@ bool SBend::TreatAsDrift(Inform &msg, double chordLength) {
} else
return false;
}
/*
/*
* Copyright (c) 2014, Chris Rogers
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STFC nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific
* 3. Neither the name of STFC nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "AbsBeamline/VariableRFCavity.h"
#include "Physics/Physics.h"
#include "Algorithms/PartBunch.h"
#include "AbsBeamline/BeamlineVisitor.h"
#include "AbsBeamline/VariableRFCavity.h"
VariableRFCavity::VariableRFCavity(const std::string &name) : Component(name) {
initNull(); // initialise everything to NULL
......@@ -216,6 +217,3 @@ void VariableRFCavity::setLength(double length) {
_length = length;
geometry.setElementLength(length);
}
#include "Algorithms/AbstractTimeDependence.h"
#include <sstream>
#include "AbstractTimeDependence.h"
std::map<std::string, AbstractTimeDependence*> AbstractTimeDependence::td_map =
std::map<std::string, AbstractTimeDependence*>();
......@@ -32,4 +32,3 @@ std::string AbstractTimeDependence::getName(AbstractTimeDependence* time_dep) {
throw OpalException("AbstractTimeDependence::getTimeDependence",
"Could not find TimeDependence with address "+ss.str());
}
#include <cfloat>
#include <vector>
#include "Algorithms/PartBins.h"
#include "Algorithms/PBunchDefs.h"
#include "Physics/Physics.h"
#include <cfloat>
#include <vector>
extern Inform *gmsg;
PartBins::PartBins(int bins, int sbins) :
......
#include <cfloat>
#include <vector>
#include "Algorithms/PartBinsCyc.h"
#include "Physics/Physics.h"
#include <cfloat>
#include <vector>
extern Inform *gmsg;
// constructer function for cyclotron
// constructer function for cyclotron
PartBinsCyc::PartBinsCyc(int specifiedNumBins, int bins, size_t partInBin[])
: PartBins::PartBins(specifiedNumBins, 0) {
bins_m = specifiedNumBins; // max bin number
nemittedBins_m = bins; // the bin number with particles
nemittedBins_m = bins; // the bin number with particles
binsEmitted_m = new bool[bins_m]; // flag whether the bin contain particles or not
nBin_m = new size_t[bins_m]; // number of particles in the bins on the local node
......@@ -17,11 +17,11 @@ PartBinsCyc::PartBinsCyc(int specifiedNumBins, int bins, size_t partInBin[])
nBin_m[i] = 0;
binsEmitted_m[i] = false;
}
for(int i = 0; i < nemittedBins_m; i++) {
nBin_m[i] = partInBin[i];
*gmsg << "Read in: Bin=" << i << " Particles Num=" << getTotalNumPerBin(i) << endl;
binsEmitted_m[i] = true;
}
......@@ -33,7 +33,7 @@ PartBinsCyc::PartBinsCyc(int specifiedNumBins, int bins)
: PartBins::PartBins(specifiedNumBins, 0) {
bins_m = specifiedNumBins; // max bin number
nemittedBins_m = bins; // the bin number with particles
nemittedBins_m = bins; // the bin number with particles
binsEmitted_m = new bool[bins_m]; // flag whether the bin contain particles or not
nBin_m = new size_t[bins_m]; // number of particles in the bins on the local node
......@@ -59,4 +59,3 @@ PartBinsCyc::~PartBinsCyc() {
if(h_m)
delete h_m;
}
......@@ -33,7 +33,7 @@
#include "Structure/FieldSolver.h" // OPAL file
#include "Utilities/Options.h" // OPAL file
#include "ListElem.h"
#include "Algorithms/ListElem.h"
#include "BasicActions/Option.h"
#include <gsl/gsl_rng.h>
......
......@@ -21,7 +21,7 @@
// ------------------------------------------------------------------------
#include "Ippl.h"
#include "PBunchDefs.h"
#include "Algorithms/PBunchDefs.h"
#include "Algorithms/Particle.h"
#include "FixedAlgebra/FMatrix.h"
#include "FixedAlgebra/FVector.h"
......@@ -104,7 +104,7 @@ public:
void do_binaryRepart();
/// per default the MT value of the field solver is used
void set_nBinsLineDensity(int n);
......@@ -280,13 +280,13 @@ public:
//void computeSelfFields_cycl(double gamma);
//void computeSelfFields_cycl(int b);
// Replaced computeSelfFields_cycl() with versions that have meanR and the quaternion of the
// Replaced computeSelfFields_cycl() with versions that have meanR and the quaternion of the
// rotation of the particle bunch in order to take into account the rotation
// when finding the boundary conditions for the fieldsolver. -DW
void computeSelfFields_cycl(double gamma, Vector_t const meanR=Vector_t(0.0, 0.0, 0.0),
void computeSelfFields_cycl(double gamma, Vector_t const meanR=Vector_t(0.0, 0.0, 0.0),
Quaternion_t const quaternion=Quaternion_t(1.0, 0.0, 0.0, 0.0));
void computeSelfFields_cycl(int b, Vector_t const meanR=Vector_t(0.0, 0.0, 0.0),
void computeSelfFields_cycl(int b, Vector_t const meanR=Vector_t(0.0, 0.0, 0.0),
Quaternion_t const quaternion=Quaternion_t(1.0, 0.0, 0.0, 0.0));
void resetInterpolationCache(bool clearCache = false);
......@@ -560,7 +560,7 @@ private:
/// Initialize the translation vector and rotation quaternion
/// here. Cyclotron tracker will reset these values each timestep
/// TTracker can just use 0 translation and 0 rotation (quat[1 0 0 0]).
/// TTracker can just use 0 translation and 0 rotation (quat[1 0 0 0]).
Vector_t globalMeanR_m = Vector_t(0.0, 0.0, 0.0);
Quaternion_t globalToLocalQuaternion_m = Quaternion_t(1.0, 0.0, 0.0, 0.0);
......@@ -688,7 +688,7 @@ private:
};
inline
inline
bool PartBunch::isDcBeam() { return dcBeam_m;}
inline
......
......@@ -19,15 +19,15 @@
//
// ------------------------------------------------------------------------
#include <cfloat>
#include <cmath>
#include "Algorithms/Tracker.h"
#include "AbsBeamline/AlignWrapper.h"
#include "AbsBeamline/Patch.h"
#include "Algorithms/MapIntegrator.h"
#include "Fields/BMultipoleField.h"
#include <cfloat>
#include <cmath>
typedef FTps<double, 2> Series2;
typedef FTps<double, 6> Series;
......
/*
/*
* Copyright (c) 2014, Chris Rogers
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STFC nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific
* 3. Neither the name of STFC nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "BeamlineGeometry/Euclid3DGeometry.h"
#include "Utilities/OpalException.h"
#include "math.h"
#include "BeamlineGeometry/Euclid3DGeometry.h"
Euclid3DGeometry::Euclid3DGeometry(Euclid3D transformation)
: BGeometryBase(), transformation_m(transformation) {
......@@ -67,4 +68,3 @@ Euclid3D Euclid3DGeometry::getTransform(double fromS, double toS) const {
Euclid3D Euclid3DGeometry::getTotalTransform() const {
return transformation_m;
}
#include <fstream>
#include <ios>
#include "Fields/Astra1DDynamic.hh"
#include "Fields/Fieldmap.icc"
#include "Physics/Physics.h"
......@@ -8,6 +5,9 @@
#include "gsl/gsl_spline.h"
#include "gsl/gsl_fft_real.h"
#include <fstream>
#include <ios>
using namespace std;
using Physics::mu_0;
using Physics::c;
......
#include <fstream>
#include <ios>
#include "Fields/Astra1DDynamic_fast.hh"
#include "Fields/Fieldmap.icc"
#include "Physics/Physics.h"
#include "gsl/gsl_fft_real.h"
#include <fstream>
#include <ios>
using namespace std;
using Physics::mu_0;
using Physics::c;
......
#include <fstream>
#include <ios>
#include "Fields/Astra1DElectroStatic.hh"
#include "Fields/Fieldmap.icc"
#include "Physics/Physics.h"
......@@ -8,6 +5,9 @@
#include "gsl/gsl_spline.h"
#include "gsl/gsl_fft_real.h"
#include <fstream>
#include <ios>
using namespace std;
using Physics::mu_0;
using Physics::c;
......
#include <fstream>
#include <ios>
#include "Fields/Astra1DElectroStatic_fast.hh"
#include "Fields/Fieldmap.icc"
#include "Physics/Physics.h"
#include "gsl/gsl_fft_real.h"
#include <fstream>
#include <ios>
using namespace std;
using Physics::mu_0;
using Physics::c;
......
#include <fstream>
#include <ios>
#include "Fields/Astra1DMagnetoStatic.hh"
#include "Fields/Fieldmap.icc"
#include "Physics/Physics.h"
......@@ -9,6 +5,9 @@
#include "gsl/gsl_spline.h"
#include "gsl/gsl_fft_real.h"
#include <fstream>
#include <ios>
using namespace std;
using Physics::mu_0;
using Physics::c;
......
#include <fstream>
#include <ios>
#include "Fields/Astra1DMagnetoStatic_fast.hh"
#include "Fields/Fieldmap.icc"
#include "Physics/Physics.h"
#include "gsl/gsl_fft_real.h"
#include <fstream>
#include <ios>
using namespace std;
using Physics::mu_0;
using Physics::c;
......
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