Commit 21e64e11 authored by snuverink_j's avatar snuverink_j

improve includes: only include strictly necessary

parent a6e43cdb
......@@ -17,6 +17,7 @@
#include "PETE/IpplExpressions.h"
#include "AppTypes/TSVMeta.h"
#include <cmath>
#include <iostream>
#include <iomanip>
......@@ -277,6 +278,17 @@ cross(const Vektor<T1,D> &lhs, const Vektor<T2,D> &rhs)
return TSV_MetaCross< Vektor<T1,D> , Vektor<T2,D> > :: apply(lhs,rhs);
}
//----------------------------------------------------------------------
// euclidean norm
//----------------------------------------------------------------------
template < class T, unsigned D >
inline double
euclidean_norm(const Vektor<T, D> &a)
{
return std::sqrt(dot(a, a));
}
//----------------------------------------------------------------------
// I/O
template<class T, unsigned D>
......@@ -296,10 +308,4 @@ inline std::ostream& operator<<(std::ostream& out, const Vektor<T,D>& rhs)
return out;
}
#endif // VEKTOR_H
/***************************************************************************
* $RCSfile: Vektor.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:24 $
* IPPL_VERSION_ID: $Id: Vektor.h,v 1.1.1.1 2003/01/23 07:40:24 adelmann Exp $
***************************************************************************/
\ No newline at end of file
#endif // VEKTOR_H
\ No newline at end of file
......@@ -15,7 +15,7 @@
#include "FFT/FFT.h"
#include "FieldLayout/FieldLayout.h"
#include "Field/BareField.h"
#include "Utility/IpplStats.h"
//#include "Utility/IpplStats.h"
//=============================================================================
// FFT CCTransform Constructors
......
......@@ -31,6 +31,7 @@
#include "Index/SIndex.h"
#include "SubField/SubBareField.h"
#include "Utility/IpplInfo.h"
#include "Utility/IpplStats.h"
#include "Utility/PAssert.h"
#include "Utility/Unique.h"
#include "Utility/my_auto_ptr.h"
......
......@@ -33,10 +33,9 @@
#include "Utility/Inform.h"
#include "Utility/Unique.h"
#include "Utility/IpplInfo.h"
#include "Utility/IpplStats.h"
//#include "Utility/IpplStats.h"
#include <map>
#include <utility>
#include <cstdlib>
......
......@@ -27,9 +27,9 @@
#include "Index/SIndexAssign.h"
#include "Index/SIndex.h"
#include "Field/BrickIterator.h"
#include "Field/Field.h"
#include "Field/IndexedField.h"
#include "Field/Assign.h"
// #include "Field/Field.h"
// #include "Field/IndexedField.h"
// #include "Field/Assign.h"
#include "Utility/IpplInfo.h"
......
......@@ -14,7 +14,6 @@
#include "Field/BareField.h"
#include "Field/BrickExpression.h"
#include "Field/LField.h"
#include "Field/Field.h"
#include "Field/Assign.h"
#include "Field/AssignDefs.h"
......
......@@ -38,7 +38,6 @@
#include "Utility/IpplInfo.h"
#include "Utility/IpplStats.h"
#include "Utility/RandomNumberGen.h"
#include "Utility/PAssert.h"
#include <cstdio>
......
......@@ -31,7 +31,6 @@
* of resolving who needs to free up the storage used for the Message elements.
***************************************************************************/
#include "Utility/Inform.h"
#include <complex>
#include <cstddef>
#include <vector>
......
......@@ -12,7 +12,6 @@
***************************************************************************/
#include "Message/Message.h"
#include "Utility/Inform.h"
#include "Utility/IpplInfo.h"
#include <iterator>
......
......@@ -22,7 +22,9 @@
#define ABSTRACT_PARTICLE_H
#include "Particle/ParticleLayout.h"
#include "Particle/ParticleAttrib.h"
template<class T> class ParticleAttrib;
class ParticleAttribBase;
template <class T, unsigned Dim>
class AbstractParticle {
......
......@@ -16,14 +16,13 @@
#include "Field/LField.h"
#include "Field/CompressedBrickIterator.h"
#include "Index/NDIndex.h"
#include "Meshes/Centering.h"
#include "AppTypes/Vektor.h"
#include "Utility/IpplInfo.h"
#include "Utility/IpplException.h"
#include <iostream>
#include <ostream>
#include <vector>
#include <utility>
#include <cmath>
// Helper class and functions for finding nearest grid point given centering
......
......@@ -95,15 +95,18 @@
// include files
#include "Particle/AbstractParticle.h"
#include "Particle/ParticleAttribBase.h"
#include "Particle/ParticleLayout.h"
#include "AppTypes/Vektor.h"
#include "DataSource/DataSource.h"
#include "DataSource/MakeDataSource.h"
#include "Message/Formatter.h"
#include <vector>
#include <algorithm> // Include algorithms
#include <utility>
#include <iostream>
template <class T, unsigned Dim>
using PLayout = ParticleLayout<T, Dim>;
// forward declarations
class Inform;
......@@ -120,7 +123,6 @@ template <class T, unsigned D> class ParticleBConds;
template<class PLayout>
class IpplParticleBase : public DataSource,
public AbstractParticle<typename PLayout::Position_t, PLayout::Dimension> {
public:
// useful enums
enum { Dim = PLayout::Dimension };
......
......@@ -18,7 +18,8 @@
// forward declarations
template<class T> class ParticleAttrib;
template<class T, unsigned Dim> class ParticleAttribElem;
template<class T> class ParticleAttribIterator;
template <class T> class ParticleAttribConstIterator;
//////////////////////////////////////////////////////////////////////
//
......
......@@ -73,6 +73,7 @@
// include files
#include "Particle/ParticleAttribBase.h"
#include "Particle/ParticleAttribElem.h"
#include "Particle/PAssign.h"
#include "SubParticle/SubParticleAttrib.h"
#include "DataSource/DataSource.h"
#include "DataSource/MakeDataSource.h"
......
......@@ -13,7 +13,7 @@
// include files
#include "SubField/SubFieldAssignDefs.h"
#include "SubParticle/SubParticleAssign.h"
#include "SubParticle/SubParticleAttrib.h"
//////////////////////////////////////////////////////////////////////
//
......
......@@ -14,7 +14,6 @@
// include files
#include "Index/NDIndex.h"
#include "Field/BrickExpression.h"
#include "Field/Field.h"
#include "Utility/DiscBuffer.h"
#include "Utility/DiscConfig.h"
#include "Utility/Inform.h"
......@@ -24,8 +23,6 @@
#include <cstdlib>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <vector>
#include <iostream>
......
......@@ -27,7 +27,6 @@
#include "Utility/DiscField.h"
#include "Utility/DiscConfig.h"
#include "Utility/DiscMeta.h"
#include "Field/BrickIterator.h"
#include "Message/Tags.h"
#include "Utility/PAssert.h"
......
......@@ -15,9 +15,9 @@
#include "Utility/DiscConfig.h"
#include "Utility/IpplInfo.h"
#include "Utility/PAssert.h"
#include "Message/Communicate.h"
#include "Message/Message.h"
#include "Message/Tags.h"
#include <vector>
#include <iostream>
......@@ -26,7 +26,6 @@
// forward declarations
template<class T> class IpplParticleBase;
template<class T> class ParticleAttrib;
class Message;
class DiscParticle {
......
......@@ -34,6 +34,7 @@
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#define INFORM_ALL_NODES (-1)
......
......@@ -25,6 +25,7 @@
// include files
#include "Utility/IpplInfo.h"
#include "Utility/Inform.h"
#include "Utility/IpplStats.h"
#include "Utility/PAssert.h"
#include "Utility/RandomNumberGen.h"
......
......@@ -43,9 +43,8 @@
*/
// include files
#include "Utility/Inform.h"
#include "Message/Communicate.h"
#include "Utility/StaticIpplInfo.h"
#include "Utility/Inform.h"
#include <iostream>
#include <stack>
......@@ -56,6 +55,8 @@
#include <mpi.h>
// forward declarations
class Communicate;
class Inform;
class IpplStats;
class IpplInfo;
std::ostream& operator<<(std::ostream&, const IpplInfo&);
......
......@@ -40,6 +40,9 @@
//
#include "Utility/IpplMemoryUsage.h"
#include "Message/GlobalComm.h"
#include "Utility/IpplInfo.h"
//////////////////////////////////////////////////////////////////////
IpplMemoryUsage::IpplMemoryUsage()
{ }
......
......@@ -38,11 +38,11 @@
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#ifndef IPPL_MEMPRYUSAGE_H
#define IPPL_MEMPRYUSAGE_H
#ifndef IPPL_MEMORYUSAGE_H
#define IPPL_MEMORYUSAGE_H
#include "Ippl.h"
#include <memory>
#include <string>
#include <sys/resource.h>
#include <sys/time.h> // not required but increases portability
......
......@@ -38,10 +38,11 @@
// include files
#include "Utility/IpplInfo.h"
#include "Utility/Timer.h"
#include "Utility/Inform.h"
#include <vector>
class Inform;
class IpplStats {
public:
......
......@@ -7,7 +7,6 @@
#include "Utility/IpplTimings.h"
#include "Utility/Inform.h"
#include "Utility/IpplInfo.h"
#include "Message/GlobalComm.h"
#include "PETE/IpplExpressions.h"
......
......@@ -6,7 +6,6 @@
#ifndef PASSERT_H
#define PASSERT_H
#include "Utility/IpplInfo.h"
#include <exception>
#include <stdexcept>
......
......@@ -21,8 +21,6 @@
#ifndef __COMM_TYPES__
#define __COMM_TYPES__
#include <vector>
#include "mpi.h"
namespace Comm {
......
......@@ -27,6 +27,8 @@
//
#include "Util/CmdArguments.h"
#include "boost/algorithm/string.hpp"
void CmdArguments::addArguments(int argc, char **argv) {
for(int i=1; i<argc; i++) {
......
......@@ -35,7 +35,6 @@
#include <set>
#include "boost/smart_ptr.hpp"
#include "boost/algorithm/string.hpp"
#include "boost/utility/value_init.hpp"
#include "Util/OptPilotException.h"
......
......@@ -22,6 +22,7 @@
#include <boost/static_assert.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
......
......@@ -21,17 +21,12 @@
#ifndef __TYPES_H__
#define __TYPES_H__
#include <vector>
#include <map>
#include <utility>
#include <vector>
#include <boost/serialization/map.hpp>
#include "boost/serialization/vector.hpp"
#include "boost/tuple/tuple.hpp"
#include "boost/variant.hpp"
#include "boost/fusion/adapted/struct/adapt_struct.hpp"
#include "boost/fusion/include/adapt_struct.hpp"
#include "Expression/Expression.h"
//FIXME: add namespaces
......
......@@ -20,6 +20,8 @@
#include "AbstractObjects/AttributeBase.h"
#include "Utilities/Options.h"
#include "Utility/Inform.h"
#include <set>
#include <iostream>
......
......@@ -24,9 +24,6 @@
#include <iosfwd>
#include <string>
// #include <Ippl.h>
#include <Utility/Inform.h>
class Statement;
// Class Attribute
......
......@@ -22,19 +22,18 @@
#include "Algorithms/ParallelTTracker.h"
#include <cfloat>
#include <iostream>
#include <cmath>
#include <fstream>
#include <limits>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <limits>
#include <cmath>
#include "Algorithms/OrbitThreader.h"
#include "Algorithms/CavityAutophaser.h"
#include "Beamlines/Beamline.h"
#include "Beamlines/FlaggedBeamline.h"
#include "Lines/Sequence.h"
#include "Solvers/CSRWakeFunction.hh"
......
......@@ -24,42 +24,27 @@
#define OPAL_ThickTracker_HH
#include "Algorithms/Tracker.h"
#include "Structure/DataSink.h"
#include "Hamiltonian.h"
#include "MapAnalyser.h"
#include "Algorithms/IndexMap.h"
#include "AbsBeamline/BeamStripping.h"
#include "AbsBeamline/CCollimator.h"
#include "AbsBeamline/Corrector.h"
#include "AbsBeamline/Degrader.h"
#include "AbsBeamline/Drift.h"
#include "AbsBeamline/FlexibleCollimator.h"
#include "AbsBeamline/ElementBase.h"
#include "AbsBeamline/Marker.h"
#include "AbsBeamline/Monitor.h"
#include "AbsBeamline/Multipole.h"
#include "AbsBeamline/Probe.h"
#include "AbsBeamline/RFCavity.h"
#include "AbsBeamline/RBend.h"
#include "AbsBeamline/RBend3D.h"
#include "AbsBeamline/SBend.h"
#include "AbsBeamline/Septum.h"
#include "AbsBeamline/Solenoid.h"
#include "AbsBeamline/TravelingWave.h"
#include "Elements/OpalBeamline.h"
#include "Structure/Beam.h"
//#include <array>
#include <cmath>
#include <list>
#include <string>
#include <tuple>
#include <vector>
class BMultipoleField;
class DataSink;
template <class T, unsigned Dim>
class PartBunchBase;
......@@ -101,14 +86,13 @@ class PartBunchBase;
class ThickTracker: public Tracker {
public:
private:
typedef Hamiltonian::series_t series_t;
typedef MapAnalyser::fMatrix_t fMatrix_t;
typedef MapAnalyser::cfMatrix_t cfMatrix_t;
typedef FVps<double, 6> map_t;
typedef FVector<double, 6> particle_t;
typedef std::tuple<series_t, std::size_t, double> tuple_t;
typedef std::list<tuple_t> beamline_t;
typedef FMatrix<double, 6, 6> fMatrix_t;
public:
......@@ -331,7 +315,6 @@ private:
Hamiltonian hamiltonian_m;
MapAnalyser mapAnalyser_m;
Vector_t RefPartR_m;
......
......@@ -20,13 +20,13 @@
#include "BasicActions/Option.h"
#include "Attributes/Attributes.h"
#include "Parser/FileStream.h"
#include "Utilities/OpalException.h"
#include "Utilities/Options.h"
#include "Utilities/OptionTypes.h"
#include "Utilities/ClassicRandom.h"
#include "Utility/IpplInfo.h"
#include "Utilities/OpalException.h"
#include "Utility/Inform.h"
#include "Utility/IpplInfo.h"
#include "Utility/IpplMemoryUsage.h"
#include <ctime>
......
......@@ -18,9 +18,10 @@
#include "BasicActions/PSystem.h"
#include "Ippl.h"
#include "Attributes/Attributes.h"
#include "Utility/IpplInfo.h"
#include <cstdlib>
// Class PSystem
// ------------------------------------------------------------------------
......
......@@ -18,9 +18,10 @@
#include "BasicActions/System.h"
#include "Ippl.h"
#include "Attributes/Attributes.h"
#include "Utility/IpplInfo.h"
#include <cstdlib>
// Class System
// ------------------------------------------------------------------------
......
......@@ -38,10 +38,7 @@
#include <cmath>
#include <cstdio>
#include "Ippl.h"
#include "gsl/gsl_spline.h"
#include "gsl/gsl_interp.h"
#include "Utility/Inform.h"
#define CHECK_BSTP_FSCANF_EOF(arg) if (arg == EOF)\
throw GeneralClassicException("BeamStripping::getPressureFromFile",\
......
......@@ -25,7 +25,6 @@
#include "AbsBeamline/ElementBase.h"
#include "Fields/EMField.h"
#include "Algorithms/Vektor.h"
class PartData;
......
......@@ -21,13 +21,12 @@
#include "AbsBeamline/Degrader.h"
#include "Algorithms/PartBunchBase.h"
#include "AbsBeamline/BeamlineVisitor.h"
#include "Fields/Fieldmap.h"
#include "Structure/LossDataSink.h"
#include "Utilities/Options.h"
#include "Solvers/ParticleMatterInteractionHandler.hh"
#include "Physics/Physics.h"
#include "Utilities/Util.h"
#include <memory>
#include <string>
extern Inform *gmsg;
......
......@@ -25,6 +25,8 @@
#include "AbsBeamline/Component.h"
#include "AbsBeamline/BeamlineVisitor.h"
#include "BeamlineGeometry/StraightGeometry.h"
#include <string>
#include <vector>
class LossDataSink;
......
......@@ -65,8 +65,8 @@
#include "AbsBeamline/AttributeSet.h"
#include "BeamlineGeometry/Geometry.h"
#include "BeamlineGeometry/Euclid3D.h"
#include "MemoryManagement/RCObject.h"
#include "Algorithms/Vektor.h"
#include "Algorithms/Quaternion.h"
#include "Algorithms/CoordinateSystemTrafo.h"
#include "Utilities/GeneralClassicException.h"
......@@ -328,7 +328,6 @@ public:
virtual bool isInside(const Vector_t &r) const;
void setMisalignment(double x, double y, double s);
void setMisalignment(const CoordinateSystemTrafo &cst);
void getMisalignment(double &x, double &y, double &s) const;
......
......@@ -19,13 +19,10 @@
// ------------------------------------------------------------------------
#include "AbsBeamline/SBend.h"
#include "Algorithms/PartBunchBase.h"
#include "AbsBeamline/BeamlineVisitor.h"
#include "Utilities/Options.h"
#include "Fields/Fieldmap.h"
#include "AbstractObjects/OpalData.h"
#include <iostream>
#include <fstream>
#include <string>
extern Inform *gmsg;
......
......@@ -3,17 +3,10 @@
#include "Algorithms/Vektor.h"
#include "Particle/IntCIC.h"
#include "Particle/IntNGP.h"
#include "Particle/IntSUDS.h"
#include "Particle/IntTSC.h"
#include "Particle/ParticleSpatialLayout.h"
#include "Particle/ParticleUniformLayout.h"
#include "Particle/ParticleAttrib.h"
#include "Meshes/UniformCartesian.h"
#include "Meshes/Centering.h"
#include "FieldLayout/CenteredFieldLayout.h"
#include "Field/Field.h"
#include "FFT/FFT.h"
#ifdef ENABLE_AMR
#include "Amr/AmrDefs.h"
......@@ -22,37 +15,21 @@
#endif
typedef IntCIC IntrplCIC_t;
typedef IntNGP IntrplNGP_t;
typedef IntSUDS IntrplSUDS_t;
typedef IntTSC IntrplTSC_t;
typedef ParticleSpatialLayout<double, 3>::ParticlePos_t Ppos_t;
typedef ParticleSpatialLayout<double, 3>::ParticleIndex_t PID_t;
typedef ParticleUniformLayout<double, 3>::ParticlePos_t UPpos_t;
typedef ParticleUniformLayout<double, 3>::ParticleIndex_t UPID_t;
typedef ParticleAttrib<double> Pscalar_t;
typedef InterpolatorTraits<double, 3, IntrplCIC_t>::Cache_t Pcache_t;
typedef UniformCartesian<3, double> Mesh_t;