Commit 814c8c73 authored by kraus's avatar kraus

- build libOPAL by default, link Main.cpp to libOPAL to get opal

- remove 'using namespace' from header files
- remove 'using std::string' and 'using std::abs' from header files

For reason see:
o http://stackoverflow.com/questions/5849457/using-namespace-in-c-headers
parent 36087904
......@@ -52,7 +52,7 @@ OPTION (NO_FIELD_ASSIGN_OPTIMIZATION "Disable compiler optimization of IPPL fiel
IF (ENABLE_AMR_SOLVER)
MESSAGE (STATUS "----> Enable AMR")
#
FIND_PACKAGE (CCSE REQUIRED HINTS $ENV{CCSE_INCLUDE_DIRS} $ENV{CCSE_LIBRARY_DIR})
FIND_PACKAGE (CCSE REQUIRED HINTS $ENV{CCSE_INCLUDE_DIRS} $ENV{CCSE_LIBRARY_DIR})
#
SET(BL_SPACEDIM 3 CACHE INT "Dimension of BoxLib build")
SET(ENABLE_MPI 1 CACHE INT "Enable build with MPI")
......@@ -60,7 +60,7 @@ IF (ENABLE_AMR_SOLVER)
SET(BL_PRECISION "DOUBLE" CACHE INT "Precision of BoxLib build")
SET(BL_USE_PARTICLES 1 CACHE INT "Include Particles classes in BoxLib build")
SET(ENABLE_PROFILING 0 CACHE INT "Include profiling information in BoxLib build")
SET(ENABLE_BACKTRACE 1 CACHE INT "Include backtrace information in BoxLib build")
SET(ENABLE_BACKTRACE 1 CACHE INT "Include backtrace information in BoxLib build")
INCLUDE($ENV{BOXLIB_HOME}/Tools/CMake/CCSEOptions.cmake)
SET (CMAKE_CXX_FLAGS "-Wno-sign-compare -DHAVE_AMR_SOLVER -DTULIN ${CMAKE_CXX_FLAGS}")
SET (CCSE_INCLUDE_DIRS $ENV{CCSE_INCLUDE_DIRS})
......@@ -240,4 +240,3 @@ MESSAGE (STATUS "Compiling with ${CMAKE_CXX_FLAGS}")
ADD_SUBDIRECTORY (classic/5.0/src)
ADD_SUBDIRECTORY (src)
......@@ -92,7 +92,7 @@ const BGeometryBase &AlignWrapper::getGeometry() const {
}
const string &AlignWrapper::getType() const {
const std::string &AlignWrapper::getType() const {
return itsElement->getType();
}
......
......@@ -93,9 +93,9 @@ public:
// structure.
Euclid3D &offset() const;
/// Get element type string.
// Returns the type string for the enclosed item.
virtual const string &getType() const;
/// Get element type std::string.
// Returns the type std::string for the enclosed item.
virtual const std::string &getType() const;
/// Disallow misalignment of an already misaligned object.
// This method returns [b]this[/b], since "this" is already an
......
......@@ -7,7 +7,7 @@
// ------------------------------------------------------------------------
//
// Class: AttributeSet
// A map of name (string) versus value (double) intended to store
// A map of name (std::string) versus value (double) intended to store
// user-defined attributes.
//
// ------------------------------------------------------------------------
......@@ -48,7 +48,7 @@ const AttributeSet &AttributeSet::operator=(const AttributeSet &rhs) {
}
double AttributeSet::getAttribute(const string &aKey) const {
double AttributeSet::getAttribute(const std::string &aKey) const {
const_iterator index = itsMap.find(aKey);
if(index == itsMap.end()) {
......@@ -59,17 +59,17 @@ double AttributeSet::getAttribute(const string &aKey) const {
}
bool AttributeSet::hasAttribute(const string &aKey) const {
bool AttributeSet::hasAttribute(const std::string &aKey) const {
return (itsMap.find(aKey) != itsMap.end());
}
void AttributeSet::removeAttribute(const string &aKey) {
void AttributeSet::removeAttribute(const std::string &aKey) {
itsMap.erase(aKey);
}
void AttributeSet::setAttribute(const string &aKey, double value) {
void AttributeSet::setAttribute(const std::string &aKey, double value) {
itsMap[aKey] = value;
}
......@@ -77,7 +77,7 @@ void AttributeSet::setAttribute(const string &aKey, double value) {
// This method is inlined so its const version can wrap it.
// ada 3-7-2000 remove inline because KCC does not like it.
Channel *AttributeSet::getChannel(const string &aKey, bool create) {
Channel *AttributeSet::getChannel(const std::string &aKey, bool create) {
NameMap::iterator index = itsMap.find(aKey);
if(index == itsMap.end()) {
......@@ -93,9 +93,8 @@ Channel *AttributeSet::getChannel(const string &aKey, bool create) {
}
const ConstChannel *AttributeSet::getConstChannel(const string &aKey) const {
const ConstChannel *AttributeSet::getConstChannel(const std::string &aKey) const {
// Use const_cast to allow calling the non-const GetChannel().
// The const return value will nevertheless inhibit set().
return const_cast<AttributeSet *>(this)->getChannel(aKey);
}
......@@ -10,7 +10,7 @@
// ------------------------------------------------------------------------
//
// Class: AttributeSet
// A map of name (string) versus value (double) intended to store
// A map of name (std::string) versus value (double) intended to store
// user-defined attributes.
//
// ------------------------------------------------------------------------
......@@ -33,8 +33,8 @@ class ConstChannel;
// Class AttributeSet
// ------------------------------------------------------------------------
/// Map of string versus double value.
// Class AttributeSet implements a map of name (string) versus value
/// Map of std::string versus double value.
// Class AttributeSet implements a map of name (std::string) versus value
// (double) for user-defined attributes. This map is intended for
// algorithms that require specific, but not predefined data in the
// accelerator model for their working.
......
......@@ -35,7 +35,7 @@ BeamBeam::BeamBeam(const BeamBeam &right):
{}
BeamBeam::BeamBeam(const string &name):
BeamBeam::BeamBeam(const std::string &name):
Component(name)
{}
......@@ -76,8 +76,7 @@ void BeamBeam::getDimensions(double &zBegin, double &zEnd) const {
}
const string &BeamBeam::getType() const {
static const string type("BeamBeam");
const std::string &BeamBeam::getType() const {
static const std::string type("BeamBeam");
return type;
}
......@@ -39,7 +39,7 @@ class BeamBeam: public Component {
public:
/// Constructor with given name.
explicit BeamBeam(const string &name);
explicit BeamBeam(const std::string &name);
BeamBeam();
BeamBeam(const BeamBeam &right);
......@@ -75,7 +75,7 @@ public:
virtual bool bends() const;
virtual const string &getType() const;
virtual const std::string &getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
......
......@@ -112,7 +112,7 @@ Collimator::Collimator(const Collimator &right):
}
Collimator::Collimator(const string &name):
Collimator::Collimator(const std::string &name):
Component(name),
filename_m(""),
plane_m(OFF),
......@@ -339,7 +339,7 @@ void Collimator::finalise()
void Collimator::goOnline() {
if(RefPartBunch_m == NULL) {
if(!informed_m) {
string errormsg = Fieldmap::typeset_msg("BUNCH SIZE NOT SET", "warning");
std::string errormsg = Fieldmap::typeset_msg("BUNCH SIZE NOT SET", "warning");
ERRORMSG(errormsg << endl);
if(Ippl::myNode() == 0) {
ofstream omsg("errormsg.txt", ios_base::app);
......@@ -378,7 +378,7 @@ void Collimator::goOnline() {
void Collimator::print() {
if(RefPartBunch_m == NULL) {
if(!informed_m) {
string errormsg = Fieldmap::typeset_msg("BUNCH SIZE NOT SET", "warning");
std::string errormsg = Fieldmap::typeset_msg("BUNCH SIZE NOT SET", "warning");
*gmsg << errormsg << "\n"
<< endl;
if(Ippl::myNode() == 0) {
......@@ -416,7 +416,7 @@ bool Collimator::bends() const {
return false;
}
void Collimator::setOutputFN(string fn) {
void Collimator::setOutputFN(std::string fn) {
filename_m = fn;
}
......@@ -558,8 +558,8 @@ void Collimator::getDimensions(double &zBegin, double &zEnd) const {
}
const string &Collimator::getType() const {
static const string type("Collimator");
const std::string &Collimator::getType() const {
static const std::string type("Collimator");
return type;
}
......
......@@ -52,7 +52,7 @@ public:
};
/// Constructor with given name.
explicit Collimator(const string &name);
explicit Collimator(const std::string &name);
Collimator();
Collimator(const Collimator &rhs);
......@@ -74,7 +74,7 @@ public:
virtual bool apply(const Vector_t &R, const Vector_t &centroid, const double &t, Vector_t &E, Vector_t &B);
virtual bool checkCollimator(PartBunch &bunch, const int turnnumber, const double t, const double tstep);
virtual bool checkCollimator(Vector_t r, Vector_t rmin, Vector_t rmax);
virtual void initialise(PartBunch *bunch, double &startField, double &endField, const double &scaleFactor);
......@@ -89,15 +89,15 @@ public:
virtual void goOffline();
virtual const string &getType() const;
virtual const std::string &getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
void print();
string getCollimatorShape();
void setOutputFN(string fn);
string getOutputFN();
std::string getCollimatorShape();
void setOutputFN(std::string fn);
std::string getOutputFN();
void setXsize(double a) ;
......@@ -155,7 +155,7 @@ private:
// Not implemented.
void operator=(const Collimator &);
string filename_m; /**< The name of the outputfile*/
std::string filename_m; /**< The name of the outputfile*/
Plane plane_m;
double position_m;
std::vector<double> PosX_m;
......
......@@ -43,7 +43,7 @@ Corrector::Corrector(const Corrector &right):
{ }
Corrector::Corrector(const string &name):
Corrector::Corrector(const std::string &name):
Component(name),
startField_m(0.0),
endField_m(0.0),
......@@ -96,13 +96,13 @@ bool Corrector::bends() const {
}
void Corrector::getDimensions(double &zBegin, double &zEnd) const
{
{
zBegin = startField_m;
zEnd = startField_m + getElementLength();
}
const string &Corrector::getType() const {
static const string type("Corrector");
const std::string &Corrector::getType() const {
static const std::string type("Corrector");
return type;
}
......
......@@ -50,7 +50,7 @@ public:
};
/// Constructor with given name.
explicit Corrector(const string &name);
explicit Corrector(const std::string &name);
Corrector();
Corrector(const Corrector &right);
......@@ -89,17 +89,17 @@ public:
virtual bool bends() const;
virtual const string &getType() const;
virtual const std::string &getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
void SetKickX(double k);
void SetKickY(double k);
double GetKickX() const;
double GetKickY() const;
double GetKickY() const;
private:
......@@ -117,7 +117,7 @@ protected:
Plane plane_m;
double position_m;
double position_m;
bool informed_m;
......
......@@ -72,7 +72,7 @@ Cyclotron::Cyclotron(const Cyclotron &right):
}
Cyclotron::Cyclotron(const string &name):
Cyclotron::Cyclotron(const std::string &name):
Component(name) {
}
......@@ -126,7 +126,7 @@ double Cyclotron::getPZinit() const {
return pzinit_m;
}
void Cyclotron::setFieldMapFN(string f) {
void Cyclotron::setFieldMapFN(std::string f) {
fmapfn_m = f;
}
......@@ -163,11 +163,11 @@ double Cyclotron::getSymmetry() const {
}
void Cyclotron::setType(string t) {
void Cyclotron::setType(std::string t) {
type_m = t;
}
const string &Cyclotron::getType() const {
const std::string &Cyclotron::getType() const {
return type_m;
}
......
......@@ -58,7 +58,7 @@ CyclotronValley::CyclotronValley(const CyclotronValley &right):
}
CyclotronValley::CyclotronValley(const string &name):
CyclotronValley::CyclotronValley(const std::string &name):
Component(name),
filename_m(""),
fieldmap_m(NULL),
......@@ -85,11 +85,11 @@ void CyclotronValley::accept(BeamlineVisitor &visitor) const {
visitor.visitCyclotronValley(*this);
}
void CyclotronValley::setFieldMapFN(string fn) {
void CyclotronValley::setFieldMapFN(std::string fn) {
filename_m = fn;
}
string CyclotronValley::getFieldMapFN() const {
std::string CyclotronValley::getFieldMapFN() const {
return filename_m;
}
......@@ -205,7 +205,7 @@ void CyclotronValley::getDimensions(double &zBegin, double &zEnd) const {
}
const string &CyclotronValley::getType() const {
static const string type("CyclotronValley");
const std::string &CyclotronValley::getType() const {
static const std::string type("CyclotronValley");
return type;
}
......@@ -39,7 +39,7 @@ public:
/// Constructor with given name.
explicit CyclotronValley(const string &name);
explicit CyclotronValley(const std::string &name);
CyclotronValley();
CyclotronValley(const CyclotronValley &);
......@@ -50,14 +50,14 @@ public:
/// Set the name of the field map
void setFieldMapFN(string fmapfn);
void setFieldMapFN(std::string fmapfn);
string getFieldMapFN() const;
std::string getFieldMapFN() const;
void setFast(bool fast);
bool getFast() const;
const string &getType() const;
const std::string &getType() const;
virtual bool apply(const size_t &i, const double &t, double E[], double B[]);
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B);
......@@ -79,7 +79,7 @@ public:
virtual void getDimensions(double &zBegin, double &zEnd) const;
private:
string filename_m; /**< The name of the inputfile*/
std::string filename_m; /**< The name of the inputfile*/
Fieldmap *fieldmap_m;
double scale_m; /**< scale multiplier*/
......
......@@ -67,7 +67,7 @@ Degrader::Degrader(const Degrader &right):
zend_m(right.zend_m)
{}
Degrader::Degrader(const string &name):
Degrader::Degrader(const std::string &name):
Component(name),
filename_m(""),
position_m(0.0),
......@@ -101,7 +101,7 @@ void Degrader::accept(BeamlineVisitor &visitor) const {
inline bool Degrader::isInMaterial(double z ) {
/**
check if the particle is in the degarder material
*/
return ((z > position_m) && (z <= position_m + getZSize())); //getElementLength()));
}
......@@ -131,7 +131,7 @@ bool Degrader::apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B)
MomentumZ_m.push_back(P(2));
time_m.push_back(t + frac * RefPartBunch_m->getdT());
id_m.push_back(i);
}
}
return false;
}
......@@ -169,7 +169,7 @@ void Degrader::goOnline() {
Inform msg("Degrader::goOnline ");
if(RefPartBunch_m == NULL) {
if(!informed_m) {
string errormsg = Fieldmap::typeset_msg("BUNCH SIZE NOT SET", "warning");
std::string errormsg = Fieldmap::typeset_msg("BUNCH SIZE NOT SET", "warning");
msg << errormsg << "\n"
<< endl;
if(Ippl::myNode() == 0) {
......@@ -203,14 +203,14 @@ bool Degrader::bends() const {