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
/*
/*
* Copyright (c) 2012, 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 "Utilities/LogicalError.h"
#include "Fields/SectorMagneticFieldMap/Interpolator3dGridTo3d.h"
#include "Utilities/LogicalError.h"
Interpolator3dGridTo3d::Interpolator3dGridTo3d
(const Interpolator3dGridTo3d& rhs) {
......@@ -77,5 +77,3 @@ void Interpolator3dGridTo3d::setAll(ThreeDGrid* grid,
);
}
}
/*
/*
* Copyright (c) 2012, 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 <iomanip>
#include "Fields/SectorMagneticFieldMap/Mesh.h"
#include <iomanip>
std::ostream& operator<<(std::ostream& out, const Mesh::Iterator& it) {
out << std::setw(5) << it.toInteger() << " ** ";
for (unsigned int i = 0; i < it.getState().size(); i++)
......@@ -39,4 +39,3 @@ std::ostream& operator<<(std::ostream& out, const Mesh::Iterator& it) {
<< it.getPosition()[i] << " ";
return out;
}
/*
/*
* Copyright (c) 2012, 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 "Fields/SectorMagneticFieldMap/SectorField.h"
#include <math.h>
#include <limits>
......@@ -33,8 +35,6 @@
#include "Utilities/LogicalError.h"
#include "Fields/SectorMagneticFieldMap/SectorField.h"
// note I don't use exactly max() as the bounding box because I don't want to
// accidentally wrap around due to some unforeseen floating point precision
// issue
......@@ -212,5 +212,3 @@ void SectorField::getFieldDimensions(double &xIni, double &xFinal,
yFinal = bbMax_m[1];
zFinal = bbMax_m[2];
}
/*
/*
* Copyright (c) 2012, 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 "Utilities/LogicalError.h"
#include "Fields/SectorMagneticFieldMap/ThreeDGrid.h"
#include "Utilities/LogicalError.h"
ThreeDGrid::ThreeDGrid()
: x_m(2, 0), y_m(2, 0), z_m(2, 0), xSize_m(0), ySize_m(0), zSize_m(0), maps_m(0),
......@@ -273,4 +273,3 @@ Mesh::Iterator ThreeDGrid::getNearest(const double* position) const {
index[2] = zSize_m;
return Mesh::Iterator(index, this);
}
#include <iostream>
#include <fstream>
#include "Solvers/CSRIGFWakeFunction.hh"
#include "Algorithms/PartBunch.h"
#include "Filters/Filter.h"
......@@ -8,6 +6,8 @@
#include "AbsBeamline/SBend.h"
#include "Utilities/Options.h"
#include <iostream>
#include <fstream>
CSRIGFWakeFunction::CSRIGFWakeFunction(const std::string &name, ElementBase *element, std::vector<Filter *> filters, const unsigned int &N):
WakeFunction(name, element),
......
#include <iostream>
#include <fstream>
#include "Solvers/CSRWakeFunction.hh"
#include "Algorithms/PartBunch.h"
#include "Filters/Filter.h"
......@@ -8,6 +6,8 @@
#include "AbsBeamline/SBend.h"
#include "Utilities/Options.h"
#include <iostream>
#include <fstream>
// using namespace std;
CSRWakeFunction::CSRWakeFunction(const std::string &name, ElementBase *element, std::vector<Filter *> filters, const unsigned int &N):
......
#include "SwitcherError.h"
#include "Utilities/SwitcherError.h"
SwitcherError::SwitcherError(const std::string &meth, const std::string &msg):
ClassicException(meth, msg)
......
......@@ -16,13 +16,13 @@
//
// ------------------------------------------------------------------------
#include <set>
#include <iostream>
#include "AbstractObjects/Attribute.h"
#include "AbstractObjects/AttributeBase.h"
#include "Utilities/Options.h"
#include <set>
#include <iostream>
extern Inform *gmsg;
......
......@@ -16,7 +16,6 @@
//
// ------------------------------------------------------------------------
#include "AbstractObjects/OpalData.h"
#include "AbstractObjects/BeamSequence.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/OpalException.h"
......
......@@ -15,12 +15,14 @@
// $Author: adelmann, yang, winklehner $
//
// ------------------------------------------------------------------------
#include "Algorithms/ParallelCyclotronTracker.h"
#include <cfloat>
#include <iostream>
#include <fstream>
#include <vector>
#include "AbstractObjects/OpalData.h"
#include "Algorithms/ParallelCyclotronTracker.h"
#include "AbsBeamline/Collimator.h"
#include "AbsBeamline/Corrector.h"
......
#include "Algorithms/ParallelSliceTracker.h"
#include <cfloat>
#include <iostream>
#include <fstream>
#include <iomanip>
#include "AbstractObjects/OpalData.h"
#include "Algorithms/bet/EnvelopeBunch.h"
#include "Algorithms/ParallelSliceTracker.h"
#include "Beamlines/Beamline.h"
#include "Distribution/Distribution.h"
#include "Lines/Sequence.h"
......
......@@ -4,7 +4,7 @@
#include <vector>
#include <list>
class EnvelopeBunch;
#include "Algorithms/bet/EnvelopeBunch.h"
#include "Algorithms/Vektor.h"
#include "Algorithms/Tracker.h"
......
......@@ -17,6 +17,8 @@
//
// ------------------------------------------------------------------------
#include "Algorithms/ParallelTTracker.h"
#include <cfloat>
#include <iostream>
#include <fstream>
......@@ -26,7 +28,6 @@
#include <limits>
#include <cmath>
#include "Algorithms/ParallelTTracker.h"
#include "Algorithms/PartPusher.h"
#include "AbsBeamline/AlignWrapper.h"
#include "AbsBeamline/BeamBeam.h"
......
......@@ -18,10 +18,10 @@
//
// ------------------------------------------------------------------------
#include <cfloat>
#include "Algorithms/ThickTracker.h"
#include <cfloat>
#include "AbsBeamline/Collimator.h"
#include "AbsBeamline/Corrector.h"
#include "AbsBeamline/Diagnostic.h"
......
......@@ -16,8 +16,9 @@
//
// ------------------------------------------------------------------------
#include "Utility/IpplInfo.h"
#include "BasicActions/Dump.h"
#include "Utility/IpplInfo.h"
#include "AbstractObjects/OpalData.h"
#include "AbstractObjects/ObjectFunction.h"
#include <iostream>
......
......@@ -15,8 +15,10 @@
// $Author: jsberg $
//
// ------------------------------------------------------------------------
#include "Ippl.h"
#include "BasicActions/System.h"
#include "Ippl.h"
#include "Attributes/Attributes.h"
#include <cstdlib>
......
......@@ -10,6 +10,9 @@
// The class for the OPAL Distribution command.
//
// ------------------------------------------------------------------------
#include "Distribution/Distribution.h"
#include <cmath>
#include <cfloat>
#include <iomanip>
......@@ -18,7 +21,6 @@
#include <vector>
#include <numeric>
#include "Distribution/Distribution.h"
#include "AbstractObjects/Expressions.h"
#include "Attributes/Attributes.h"
#include "Utilities/Options.h"
......@@ -41,7 +43,7 @@
extern Inform *gmsg;
#define DISTDBG1
#define DISTDBG1
#define noDISTDBG2
//
......@@ -703,7 +705,7 @@ void Distribution::DoRestartOpalCycl(PartBunch &beam, size_t Np, int restartStep
}
}
*gmsg << "Restart from hdf5 format file " << fn
*gmsg << "Restart from hdf5 format file " << fn
<< ", read phase space data of DumpStep " << (int)restartStep << endl;
rc = H5SetStep(H5file, restartStep);
......@@ -721,7 +723,7 @@ void Distribution::DoRestartOpalCycl(PartBunch &beam, size_t Np, int restartStep
endi = -1;
else
endi = starti + numberOfParticlesPerNode - 1;
rc = H5PartSetView(H5file, starti, endi);
if(rc != H5_SUCCESS)
ERRORMSG("H5 rc= " << rc << " in " << __FILE__ << " @ line " << __LINE__ << endl);
......@@ -1529,7 +1531,7 @@ double Distribution::ConvertMeVPerCToBetaGamma(double valueInMeVPerC, double mas
void Distribution::CreateDistributionBinomial(size_t numberOfParticles, double massIneV) {
SetDistParametersBinomial(massIneV);
SetDistParametersBinomial(massIneV);
GenerateBinomial(numberOfParticles);
}
......@@ -1699,9 +1701,9 @@ void Distribution::CreateOpalCycl(PartBunch &beam,
* for the first pass.
*/
/*
Fixme:
/*
Fixme:
avrgpz_m = beam.getP()/beam.getM();
*/
size_t numberOfPartToCreate = numberOfParticles;
......@@ -1781,7 +1783,7 @@ void Distribution::CreateOpalE(Beam *beam,
ChooseInputMomentumUnits(InputMomentumUnitsT::NONE);
SetDistType();
// Check if this is to be an emitted beam.
CheckIfEmitted();
......@@ -2349,14 +2351,14 @@ void Distribution::GenerateBinomial(size_t numberOfParticles) {
/*!
*
* \brief Following W. Johos for his report <a href="http://gfa.web.psi.ch/publications/presentations/WernerJoho/TM-11-14.pdf"> TM-11-14 </a>
* \brief Following W. Johos for his report <a href="http://gfa.web.psi.ch/publications/presentations/WernerJoho/TM-11-14.pdf"> TM-11-14 </a>
*
* For the \f$x,p_x\f$ phase space we have:
* \f[
* \epsilon_x = \sigma_x \sigma_{p_x} \cos{( \arcsin{(\sigma_{12}) }) }
* \f]
*
* \f{eqnarray*}{
* \f{eqnarray*}{
* \beta_x &=& \frac{\sigma_x^2}{\epsilon_x} \\
* \gamma_x &=& \frac{\sigma_{p_x}^2}{\epsilon_x} \\
* \alpha_x &=& -\sigma_{12} \sqrt{(\beta_x \gamma_x)} \\
......@@ -2558,7 +2560,7 @@ void Distribution::GenerateFlattopLaserProfile(size_t numberOfParticles) {
void Distribution::GenerateFlattopT(size_t numberOfParticles) {
gsl_rng_env_setup();
gsl_rng *randGenStandard = gsl_rng_alloc(gsl_rng_default);
gsl_rng *randGenStandard = gsl_rng_alloc(gsl_rng_default);
gsl_qrng *quasiRandGen2D = NULL;
if(Options::rngtype != std::string("RANDOM")) {
......@@ -2631,7 +2633,7 @@ void Distribution::GenerateFlattopT(size_t numberOfParticles) {
void Distribution::GenerateFlattopZ(size_t numberOfParticles) {
gsl_rng_env_setup();
gsl_rng *randGenStandard = gsl_rng_alloc(gsl_rng_default);
gsl_rng *randGenStandard = gsl_rng_alloc(gsl_rng_default);
gsl_qrng *quasiRandGen1D = NULL;
gsl_qrng *quasiRandGen2D = NULL;
if(Options::rngtype != std::string("RANDOM")) {
......@@ -2712,17 +2714,17 @@ void Distribution::GenerateFlattopZ(size_t numberOfParticles) {
gsl_qrng_free(quasiRandGen2D);
}
void Distribution::GenerateGaussZ(size_t numberOfParticles) {
void Distribution::GenerateGaussZ(size_t numberOfParticles) {
gsl_rng_env_setup();
gsl_rng *randGen = gsl_rng_alloc(gsl_rng_default);
gsl_rng *randGen = gsl_rng_alloc(gsl_rng_default);
gsl_matrix * m = gsl_matrix_alloc (6, 6);
gsl_vector * rx = gsl_vector_alloc(6);
gsl_vector * ry = gsl_vector_alloc(6);
int i,j;
for (i = 0; i < 6; i++) {
for (j = 0; j < 6; j++) {
if (i==j)
......@@ -2742,7 +2744,7 @@ void Distribution::GenerateGaussZ(size_t numberOfParticles) {
gsl_matrix_set (m,0,5, distCorr_m.at(3));
gsl_matrix_set (m,5,1, distCorr_m.at(4));
gsl_matrix_set (m,1,5, distCorr_m.at(4));
gsl_matrix_set (m,4,0, distCorr_m.at(5));
gsl_matrix_set (m,0,4, distCorr_m.at(5));
gsl_matrix_set (m,4,1, distCorr_m.at(6));
......@@ -2752,7 +2754,7 @@ void Distribution::GenerateGaussZ(size_t numberOfParticles) {
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
if (j==0)
*gmsg << "* r(" << std::setprecision(1) << i << "," << std::setprecision(1) << j << ") = "
*gmsg << "* r(" << std::setprecision(1) << i << "," << std::setprecision(1) << j << ") = "
<< std::setprecision(3) << gsl_matrix_get (m, i, j);
else
*gmsg << "\t" << std::setprecision(3) << gsl_matrix_get (m, i, j);
......@@ -2772,14 +2774,14 @@ void Distribution::GenerateGaussZ(size_t numberOfParticles) {
for (int j = 0; j < i ; j++) {
gsl_matrix_set (m, i, j, 0.0);
}
}
}
gsl_matrix_transpose(m);
#ifdef DISTDBG2
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
if (j==0)
*gmsg << "* r(" << std::setprecision(1) << i << "," << std::setprecision(1) << j << ") = "
*gmsg << "* r(" << std::setprecision(1) << i << "," << std::setprecision(1) << j << ") = "
<< std::setprecision(3) << gsl_matrix_get (m, i, j);
else
*gmsg << "\t" << std::setprecision(3) << gsl_matrix_get (m, i, j);
......@@ -2787,7 +2789,7 @@ void Distribution::GenerateGaussZ(size_t numberOfParticles) {
*gmsg << endl;
}
#endif
int saveProcessor = -1;
for (size_t partIndex = 0; partIndex < numberOfParticles; partIndex++) {
......@@ -2795,27 +2797,27 @@ void Distribution::GenerateGaussZ(size_t numberOfParticles) {
while (std::abs((rval = gsl_ran_gaussian (randGen,1.0)))>cutoffR_m[0])
;
gsl_vector_set(rx,0,rval);
gsl_vector_set(rx,0,rval);
while (std::abs((rval = gsl_ran_gaussian (randGen,1.0)))>cutoffP_m[0])
;
gsl_vector_set(rx,1,rval);
gsl_vector_set(rx,1,rval);
while (std::abs((rval = gsl_ran_gaussian (randGen,1.0)))>cutoffR_m[1])
;
gsl_vector_set(rx,2,rval);
gsl_vector_set(rx,2,rval);
while (std::abs((rval = gsl_ran_gaussian (randGen,1.0)))>cutoffP_m[1])
;
gsl_vector_set(rx,3,rval);
gsl_vector_set(rx,3,rval);
while (std::abs((rval = gsl_ran_gaussian (randGen,1.0)))>cutoffR_m[2])
;
gsl_vector_set(rx,4,rval);
gsl_vector_set(rx,4,rval);
while (std::abs((rval = gsl_ran_gaussian (randGen,1.0)))>cutoffP_m[2])
;
gsl_vector_set(rx,5,rval);
gsl_vector_set(rx,5,rval);
// Save to each processor in turn.
saveProcessor++;
......@@ -2833,7 +2835,7 @@ void Distribution::GenerateGaussZ(size_t numberOfParticles) {
pyDist_m.push_back( sigmaP_m[1]*gsl_vector_get(ry, 3));
tOrZDist_m.push_back( sigmaR_m[2]*gsl_vector_get(ry, 4));
pzDist_m.push_back(avrgpz_m +(sigmaP_m[2]*gsl_vector_get(ry, 5)));
}
}
}