Commit 21e64e11 authored by snuverink_j's avatar snuverink_j

improve includes: only include strictly necessary

parent a6e43cdb
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "PETE/IpplExpressions.h" #include "PETE/IpplExpressions.h"
#include "AppTypes/TSVMeta.h" #include "AppTypes/TSVMeta.h"
#include <cmath>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
...@@ -277,6 +278,17 @@ cross(const Vektor<T1,D> &lhs, const Vektor<T2,D> &rhs) ...@@ -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); 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 // I/O
template<class T, unsigned D> template<class T, unsigned D>
...@@ -296,10 +308,4 @@ inline std::ostream& operator<<(std::ostream& out, const Vektor<T,D>& rhs) ...@@ -296,10 +308,4 @@ inline std::ostream& operator<<(std::ostream& out, const Vektor<T,D>& rhs)
return out; return out;
} }
#endif // VEKTOR_H #endif // VEKTOR_H
\ No newline at end of file
/***************************************************************************
* $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
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "FFT/FFT.h" #include "FFT/FFT.h"
#include "FieldLayout/FieldLayout.h" #include "FieldLayout/FieldLayout.h"
#include "Field/BareField.h" #include "Field/BareField.h"
#include "Utility/IpplStats.h" //#include "Utility/IpplStats.h"
//============================================================================= //=============================================================================
// FFT CCTransform Constructors // FFT CCTransform Constructors
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "Index/SIndex.h" #include "Index/SIndex.h"
#include "SubField/SubBareField.h" #include "SubField/SubBareField.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include "Utility/IpplStats.h"
#include "Utility/PAssert.h" #include "Utility/PAssert.h"
#include "Utility/Unique.h" #include "Utility/Unique.h"
#include "Utility/my_auto_ptr.h" #include "Utility/my_auto_ptr.h"
......
...@@ -33,10 +33,9 @@ ...@@ -33,10 +33,9 @@
#include "Utility/Inform.h" #include "Utility/Inform.h"
#include "Utility/Unique.h" #include "Utility/Unique.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include "Utility/IpplStats.h" //#include "Utility/IpplStats.h"
#include <map> #include <map>
#include <utility>
#include <cstdlib> #include <cstdlib>
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
#include "Index/SIndexAssign.h" #include "Index/SIndexAssign.h"
#include "Index/SIndex.h" #include "Index/SIndex.h"
#include "Field/BrickIterator.h" #include "Field/BrickIterator.h"
#include "Field/Field.h" // #include "Field/Field.h"
#include "Field/IndexedField.h" // #include "Field/IndexedField.h"
#include "Field/Assign.h" // #include "Field/Assign.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "Field/BareField.h" #include "Field/BareField.h"
#include "Field/BrickExpression.h" #include "Field/BrickExpression.h"
#include "Field/LField.h" #include "Field/LField.h"
#include "Field/Field.h"
#include "Field/Assign.h" #include "Field/Assign.h"
#include "Field/AssignDefs.h" #include "Field/AssignDefs.h"
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include "Utility/IpplStats.h" #include "Utility/IpplStats.h"
#include "Utility/RandomNumberGen.h"
#include "Utility/PAssert.h" #include "Utility/PAssert.h"
#include <cstdio> #include <cstdio>
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
* of resolving who needs to free up the storage used for the Message elements. * of resolving who needs to free up the storage used for the Message elements.
***************************************************************************/ ***************************************************************************/
#include "Utility/Inform.h"
#include <complex> #include <complex>
#include <cstddef> #include <cstddef>
#include <vector> #include <vector>
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
***************************************************************************/ ***************************************************************************/
#include "Message/Message.h" #include "Message/Message.h"
#include "Utility/Inform.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include <iterator> #include <iterator>
......
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
#define ABSTRACT_PARTICLE_H #define ABSTRACT_PARTICLE_H
#include "Particle/ParticleLayout.h" #include "Particle/ParticleLayout.h"
#include "Particle/ParticleAttrib.h"
template<class T> class ParticleAttrib;
class ParticleAttribBase;
template <class T, unsigned Dim> template <class T, unsigned Dim>
class AbstractParticle { class AbstractParticle {
......
...@@ -16,14 +16,13 @@ ...@@ -16,14 +16,13 @@
#include "Field/LField.h" #include "Field/LField.h"
#include "Field/CompressedBrickIterator.h" #include "Field/CompressedBrickIterator.h"
#include "Index/NDIndex.h" #include "Index/NDIndex.h"
#include "Meshes/Centering.h"
#include "AppTypes/Vektor.h" #include "AppTypes/Vektor.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include "Utility/IpplException.h" #include "Utility/IpplException.h"
#include <iostream> #include <ostream>
#include <vector> #include <vector>
#include <utility>
#include <cmath>
// Helper class and functions for finding nearest grid point given centering // Helper class and functions for finding nearest grid point given centering
......
...@@ -95,15 +95,18 @@ ...@@ -95,15 +95,18 @@
// include files // include files
#include "Particle/AbstractParticle.h" #include "Particle/AbstractParticle.h"
#include "Particle/ParticleAttribBase.h"
#include "Particle/ParticleLayout.h"
#include "AppTypes/Vektor.h" #include "AppTypes/Vektor.h"
#include "DataSource/DataSource.h" #include "DataSource/DataSource.h"
#include "DataSource/MakeDataSource.h" #include "DataSource/MakeDataSource.h"
#include "Message/Formatter.h" #include "Message/Formatter.h"
#include <vector> #include <vector>
#include <algorithm> // Include algorithms
#include <utility> #include <utility>
#include <iostream> #include <iostream>
template <class T, unsigned Dim>
using PLayout = ParticleLayout<T, Dim>;
// forward declarations // forward declarations
class Inform; class Inform;
...@@ -120,7 +123,6 @@ template <class T, unsigned D> class ParticleBConds; ...@@ -120,7 +123,6 @@ template <class T, unsigned D> class ParticleBConds;
template<class PLayout> template<class PLayout>
class IpplParticleBase : public DataSource, class IpplParticleBase : public DataSource,
public AbstractParticle<typename PLayout::Position_t, PLayout::Dimension> { public AbstractParticle<typename PLayout::Position_t, PLayout::Dimension> {
public: public:
// useful enums // useful enums
enum { Dim = PLayout::Dimension }; enum { Dim = PLayout::Dimension };
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
// forward declarations // forward declarations
template<class T> class ParticleAttrib; template<class T> class ParticleAttrib;
template<class T, unsigned Dim> class ParticleAttribElem; template<class T, unsigned Dim> class ParticleAttribElem;
template<class T> class ParticleAttribIterator;
template <class T> class ParticleAttribConstIterator;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// //
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
// include files // include files
#include "Particle/ParticleAttribBase.h" #include "Particle/ParticleAttribBase.h"
#include "Particle/ParticleAttribElem.h" #include "Particle/ParticleAttribElem.h"
#include "Particle/PAssign.h"
#include "SubParticle/SubParticleAttrib.h" #include "SubParticle/SubParticleAttrib.h"
#include "DataSource/DataSource.h" #include "DataSource/DataSource.h"
#include "DataSource/MakeDataSource.h" #include "DataSource/MakeDataSource.h"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// include files // include files
#include "SubField/SubFieldAssignDefs.h" #include "SubField/SubFieldAssignDefs.h"
#include "SubParticle/SubParticleAssign.h" #include "SubParticle/SubParticleAttrib.h"
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// //
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
// include files // include files
#include "Index/NDIndex.h" #include "Index/NDIndex.h"
#include "Field/BrickExpression.h" #include "Field/BrickExpression.h"
#include "Field/Field.h"
#include "Utility/DiscBuffer.h" #include "Utility/DiscBuffer.h"
#include "Utility/DiscConfig.h" #include "Utility/DiscConfig.h"
#include "Utility/Inform.h" #include "Utility/Inform.h"
...@@ -24,8 +23,6 @@ ...@@ -24,8 +23,6 @@
#include <cstdlib> #include <cstdlib>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <vector> #include <vector>
#include <iostream> #include <iostream>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "Utility/DiscField.h" #include "Utility/DiscField.h"
#include "Utility/DiscConfig.h" #include "Utility/DiscConfig.h"
#include "Utility/DiscMeta.h" #include "Utility/DiscMeta.h"
#include "Field/BrickIterator.h"
#include "Message/Tags.h" #include "Message/Tags.h"
#include "Utility/PAssert.h" #include "Utility/PAssert.h"
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
#include "Utility/DiscConfig.h" #include "Utility/DiscConfig.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include "Utility/PAssert.h" #include "Utility/PAssert.h"
#include "Message/Communicate.h"
#include "Message/Message.h" #include "Message/Message.h"
#include "Message/Tags.h"
#include <vector> #include <vector>
#include <iostream> #include <iostream>
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
// forward declarations // forward declarations
template<class T> class IpplParticleBase; template<class T> class IpplParticleBase;
template<class T> class ParticleAttrib; template<class T> class ParticleAttrib;
class Message;
class DiscParticle { class DiscParticle {
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <sstream> #include <sstream>
#include <string>
#define INFORM_ALL_NODES (-1) #define INFORM_ALL_NODES (-1)
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
// include files // include files
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include "Utility/Inform.h"
#include "Utility/IpplStats.h" #include "Utility/IpplStats.h"
#include "Utility/PAssert.h" #include "Utility/PAssert.h"
#include "Utility/RandomNumberGen.h" #include "Utility/RandomNumberGen.h"
......
...@@ -43,9 +43,8 @@ ...@@ -43,9 +43,8 @@
*/ */
// include files // include files
#include "Utility/Inform.h"
#include "Message/Communicate.h"
#include "Utility/StaticIpplInfo.h" #include "Utility/StaticIpplInfo.h"
#include "Utility/Inform.h"
#include <iostream> #include <iostream>
#include <stack> #include <stack>
...@@ -56,6 +55,8 @@ ...@@ -56,6 +55,8 @@
#include <mpi.h> #include <mpi.h>
// forward declarations // forward declarations
class Communicate;
class Inform;
class IpplStats; class IpplStats;
class IpplInfo; class IpplInfo;
std::ostream& operator<<(std::ostream&, const IpplInfo&); std::ostream& operator<<(std::ostream&, const IpplInfo&);
......
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
// //
#include "Utility/IpplMemoryUsage.h" #include "Utility/IpplMemoryUsage.h"
#include "Message/GlobalComm.h"
#include "Utility/IpplInfo.h"
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
IpplMemoryUsage::IpplMemoryUsage() IpplMemoryUsage::IpplMemoryUsage()
{ } { }
......
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>. // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
// //
#ifndef IPPL_MEMPRYUSAGE_H #ifndef IPPL_MEMORYUSAGE_H
#define IPPL_MEMPRYUSAGE_H #define IPPL_MEMORYUSAGE_H
#include "Ippl.h"
#include <memory> #include <memory>
#include <string>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/time.h> // not required but increases portability #include <sys/time.h> // not required but increases portability
......
...@@ -38,10 +38,11 @@ ...@@ -38,10 +38,11 @@
// include files // include files
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include "Utility/Timer.h" #include "Utility/Timer.h"
#include "Utility/Inform.h"
#include <vector> #include <vector>
class Inform;
class IpplStats { class IpplStats {
public: public:
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "Utility/IpplTimings.h" #include "Utility/IpplTimings.h"
#include "Utility/Inform.h" #include "Utility/Inform.h"
#include "Utility/IpplInfo.h"
#include "Message/GlobalComm.h" #include "Message/GlobalComm.h"
#include "PETE/IpplExpressions.h" #include "PETE/IpplExpressions.h"
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#ifndef PASSERT_H #ifndef PASSERT_H
#define PASSERT_H #define PASSERT_H
#include "Utility/IpplInfo.h"
#include <exception> #include <exception>
#include <stdexcept> #include <stdexcept>
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#ifndef __COMM_TYPES__ #ifndef __COMM_TYPES__
#define __COMM_TYPES__ #define __COMM_TYPES__
#include <vector>
#include "mpi.h" #include "mpi.h"
namespace Comm { namespace Comm {
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
// //
#include "Util/CmdArguments.h" #include "Util/CmdArguments.h"
#include "boost/algorithm/string.hpp"
void CmdArguments::addArguments(int argc, char **argv) { void CmdArguments::addArguments(int argc, char **argv) {
for(int i=1; i<argc; i++) { for(int i=1; i<argc; i++) {
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <set> #include <set>
#include "boost/smart_ptr.hpp" #include "boost/smart_ptr.hpp"
#include "boost/algorithm/string.hpp"
#include "boost/utility/value_init.hpp" #include "boost/utility/value_init.hpp"
#include "Util/OptPilotException.h" #include "Util/OptPilotException.h"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/serialization/map.hpp> #include <boost/serialization/map.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_iarchive.hpp>
......
...@@ -21,17 +21,12 @@ ...@@ -21,17 +21,12 @@
#ifndef __TYPES_H__ #ifndef __TYPES_H__
#define __TYPES_H__ #define __TYPES_H__
#include <vector>
#include <map> #include <map>
#include <utility>
#include <vector>
#include <boost/serialization/map.hpp>
#include "boost/serialization/vector.hpp"
#include "boost/tuple/tuple.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" #include "Expression/Expression.h"
//FIXME: add namespaces //FIXME: add namespaces
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include "AbstractObjects/AttributeBase.h" #include "AbstractObjects/AttributeBase.h"
#include "Utilities/Options.h" #include "Utilities/Options.h"
#include "Utility/Inform.h"
#include <set> #include <set>
#include <iostream> #include <iostream>
......
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
#include <iosfwd> #include <iosfwd>
#include <string> #include <string>
// #include <Ippl.h>
#include <Utility/Inform.h>
class Statement; class Statement;
// Class Attribute // Class Attribute
......
...@@ -22,19 +22,18 @@ ...@@ -22,19 +22,18 @@
#include "Algorithms/ParallelTTracker.h" #include "Algorithms/ParallelTTracker.h"
#include <cfloat> #include <cfloat>
#include <iostream> #include <cmath>
#include <fstream> #include <fstream>
#include <limits>
#include <iomanip> #include <iomanip>
#include <iostream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <limits>
#include <cmath>
#include "Algorithms/OrbitThreader.h" #include "Algorithms/OrbitThreader.h"
#include "Algorithms/CavityAutophaser.h" #include "Algorithms/CavityAutophaser.h"
#include "Beamlines/Beamline.h" #include "Beamlines/Beamline.h"
#include "Beamlines/FlaggedBeamline.h" #include "Beamlines/FlaggedBeamline.h"
#include "Lines/Sequence.h"
#include "Solvers/CSRWakeFunction.hh" #include "Solvers/CSRWakeFunction.hh"
......
...@@ -24,42 +24,27 @@ ...@@ -24,42 +24,27 @@
#define OPAL_ThickTracker_HH #define OPAL_ThickTracker_HH
#include "Algorithms/Tracker.h" #include "Algorithms/Tracker.h"
#include "Structure/DataSink.h"
#include "Hamiltonian.h" #include "Hamiltonian.h"