Commit fdb171eb authored by snuverink_j's avatar snuverink_j

Merge branch 'small-fixes' into 'master'

Small fixes

See merge request OPAL/src!441
parents a48c0f81 d4ece97d
......@@ -41,6 +41,7 @@ set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)
# Disable compile time assert (used by IPPL)
add_definitions (-DNOCTAssert)
add_compile_options (-Wall)
......@@ -171,7 +172,7 @@ if (ENABLE_AMR)
endif ()
option (ENABLE_AMR_MG_SOLVER "Enable AMR MG solver" OFF)
option (ENABLE_SAAMG_SOLVER "Enable iteartive SA-AMG-PCG self field solver" OFF)
option (ENABLE_SAAMG_SOLVER "Enable iterative SA-AMG-PCG self field solver" OFF)
if (ENABLE_SAAMG_SOLVER OR ENABLE_AMR_MG_SOLVER)
#
# :FIXME: We have to add checks whether the required Trilinos modules
......
#
# Find gtest Google Test includes and library
#
# gtest
# It can be found at:
# http://amas.web.psi.ch/tools/GSL/index.html
#
# GTEST_INCLUDE_DIR - where to find gtest/gtest.h
# GTEST_LIBRARY - libgtest.a path
# GTEST_MAIN_LIBRARY - libgtest_main.a path
......
......@@ -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
......@@ -7,6 +7,7 @@ set (_HDRS
FFTBase.h
FFT.hpp
FFT.h
fftpack.h
fftpack_FFT.h
)
......
......@@ -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>
......
......@@ -3,10 +3,10 @@ set (_SRCS
set (_HDRS
Assign.hpp
Assign.h
AssignDefs.h
AssignGeneralBF.hpp
AssignGeneralIBF.hpp
Assign.h
AssignTags.h
BareField.hpp
BareField.h
......
......@@ -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 {
......
......@@ -2,6 +2,7 @@ set (_SRCS
)
set (_HDRS
AbstractParticle.h
BoxParticleCachingPolicy.h
CellParticleCachingPolicy.h
GenArrayParticle.h
......@@ -9,8 +10,8 @@ set (_HDRS
IntCIC.h
Interpolator.h
IntNGP.h
IntTSC.h
IntSUDS.h
IntTSC.h
NoParticleCachingPolicy.h
PairBuilder/BasicPairBuilder.h
PairBuilder/HashPairBuilder.h
......
......@@ -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,7 @@
#include <mpi.h>
// forward declarations
class Communicate;
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>
......
......@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform msg("Configure ");
Inform errmsg("Error ");
string bc_str;
string interPol_str;
string dist_str;
for (int i=1; i < argc; ++i) {
string s(argv[i]);
if (s == "-grid") {
......
......@@ -24,10 +24,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform msg("Configure ");
Inform errmsg("Error ");
string bc_str;
string interPol_str;
string dist_str;
for (int i=1; i < argc; ++i) {
string s(argv[i]);
if (s == "-grid") {
......
......@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform msg("Configure ");
Inform errmsg("Error ");
string bc_str;
string interPol_str;
string dist_str;
for (int i=1; i < argc; ++i) {
string s(argv[i]);
if (s == "-grid") {
......@@ -247,16 +243,4 @@ int main(int argc, char *argv[])
testmsg << " nx= " << nx << " ny= " << ny << " nz= " << nz;
testmsg << " ||d||= " << fabs(realDiff) << endl;
return 0;
}
/***************************************************************************
* $RCSfile: TestFFT-SSP.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:36 $
***************************************************************************/
/***************************************************************************
* $RCSfile: addheaderfooter,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:17 $
* IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $
***************************************************************************/
}
\ No newline at end of file
......@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform msg("Configure ");
Inform errmsg("Error ");
string bc_str;
string interPol_str;
string dist_str;
for (int i=1; i < argc; ++i) {
string s(argv[i]);
if (s == "-grid") {
......
......@@ -51,10 +51,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform msg("Configure ");
Inform errmsg("Error ");
string bc_str;
string interPol_str;
string dist_str;
for (int i=1; i < argc; ++i) {
string s(argv[i]);
if (s == "-grid") {
......
......@@ -26,9 +26,6 @@ bool Configure(int argc, char *argv[],
Inform msg("Configure ");
Inform errmsg("Error ");
string bc_str;
string dist_str;
for (int i=1; i < argc; ++i) {
string s(argv[i]);
if (s == "-grid") {
......@@ -167,8 +164,8 @@ int main(int argc, char *argv[])
BareField<double,D> RFieldSPStan_save(layoutSPStan);
BareField<std::complex<double>,D> CFieldSPStan0h(layoutSPStan0h);
INFOMSG("RFieldSPStan layout= " << layoutSPStan << endl;);
INFOMSG("CFieldSPStan0h layout= " << layoutSPStan0h << endl;);
INFOMSG("RFieldSPStan layout= " << layoutSPStan << endl);
INFOMSG("CFieldSPStan0h layout= " << layoutSPStan0h << endl);
// For calling FieldDebug functions from debugger, set up output format:
setFormat(4,3);
......
......@@ -195,7 +195,7 @@ void PwrSpec<T,Dim>::CICforward(ChargedParticles<T,Dim> *univ)
rho_m[gDomainL_m] = rhocic_m[gDomainL_m];
INFOMSG("rhocic_m= " << sum(rhocic_m) << " sum(M)= " << sum(univ->M) << " rho_m= " << sum(rho_m) << endl;);
INFOMSG("rhocic_m= " << sum(rhocic_m) << " sum(M)= " << sum(univ->M) << " rho_m= " << sum(rho_m) << endl);
}
/***************************************************************************
......
......@@ -474,7 +474,7 @@ public:
smsg->put(tmp[i]);
bool res = Ippl::Comm->send(smsg, 0, tag);
if (! res)
ERRORMSG("Ippl::Comm->send(smsg, 0, tag) failed " << endl;);
ERRORMSG("Ippl::Comm->send(smsg, 0, tag) failed " << endl);
}
}
......
......@@ -211,8 +211,6 @@ int main(int argc, char *argv[]){
Inform msg(argv[0]);
Inform msg2all(argv[0],INFORM_ALL_NODES);
// variable declarations
int i,j,k;
// indices of the 3D array of cells
int nx, ny, nz;
// total number of cells along the x, y, and z axes, respectively
......
......@@ -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
......
......@@ -38,9 +38,6 @@ class BoundaryGeometry;
// store element name, max phase
typedef std::pair<std::string, double > MaxPhasesT;
typedef std::map<double, double> energyEvolution_t;
typedef energyEvolution_t::value_type energyEvData_t;
// Class OpalData
// ------------------------------------------------------------------------
......
......@@ -899,7 +899,7 @@ void ParallelCyclotronTracker::visitRFCavity(const RFCavity &as) {
RFCavity *elptr = dynamic_cast<RFCavity *>(as.clone());
myElements.push_back(elptr);
if((elptr->getComponentType() != "SINGLEGAP") && (elptr->getComponentType() != "DOUBLEGAP")) {
if ( elptr->getComponentType() != "SINGLEGAP" ) {
*gmsg << (elptr->getComponentType()) << endl;
throw OpalException("ParallelCyclotronTracker::visitRFCavity",
"The ParallelCyclotronTracker can only play with cyclotron type RF system currently ...");
......@@ -1633,7 +1633,7 @@ double ParallelCyclotronTracker::getHarmonicNumber() const {
return elcycl->getCyclHarm();
throw OpalException("ParallelCyclotronTracker::getHarmonicNumber()",
std::string("The first item in the FieldDimensions list does not ")
+std::string("seem to be an Ring or a Cyclotron element"));
+std::string("seem to be a Ring or a Cyclotron element"));
}