Commit ff6a92d2 authored by kraus's avatar kraus
Browse files

issue 744: sort definitions and remove duplicates; remove dummy field map class

parent 1e5400d5
......@@ -320,4 +320,4 @@ install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
RENAME ${PROJECT_NAME}Config.cmake
)
)
\ No newline at end of file
set (_SRCS
Astra1DDynamic.cpp
Astra1DDynamic_fast.cpp
Astra1DElectroStatic.cpp
Astra1DElectroStatic_fast.cpp
Astra1DMagnetoStatic.cpp
Astra1DMagnetoStatic_fast.cpp
Astra1D_fast.cpp
BDipoleField.cpp
BMultipoleField.cpp
ConstBField.cpp
ConstBzField.cpp
ConstEzField.cpp
EMField.cpp
NullField.cpp
StaticElectricField.cpp
StaticMagneticField.cpp
Fieldmap.cpp
FM3DH5BlockBase.cpp
FM3DH5Block.cpp
FM3DH5Block_nonscale.cpp
FM3DMagnetoStaticH5Block.cpp
FM3DMagnetoStatic.cpp
FM3DMagnetoStaticExtended.cpp
FM3DDynamic.cpp
FM2DElectroStatic.cpp
FM2DMagnetoStatic.cpp
FM2DDynamic.cpp
FM1DDynamic.cpp
FM1DDynamic_fast.cpp
Astra1D_fast.cpp
Astra1DDynamic.cpp
Astra1DDynamic_fast.cpp
FM1DElectroStatic.cpp
FM1DElectroStatic_fast.cpp
Astra1DElectroStatic.cpp
Astra1DElectroStatic_fast.cpp
FM1DMagnetoStatic.cpp
FM1DMagnetoStatic_fast.cpp
Astra1DMagnetoStatic.cpp
Astra1DMagnetoStatic_fast.cpp
FM1DProfile1.cpp
FM1DProfile2.cpp
FMDummy.cpp
SectorMagneticFieldMap.cpp
FM2DDynamic.cpp
FM2DElectroStatic.cpp
FM2DMagnetoStatic.cpp
FM3DDynamic.cpp
FM3DH5Block.cpp
FM3DH5BlockBase.cpp
FM3DH5Block_nonscale.cpp
FM3DMagnetoStatic.cpp
FM3DMagnetoStaticExtended.cpp
FM3DMagnetoStaticH5Block.cpp
Fieldmap.cpp
NullField.cpp
SectorField.cpp
SectorMagneticFieldMap.cpp
StaticElectricField.cpp
StaticMagneticField.cpp
)
include_directories (
......@@ -50,13 +49,13 @@ add_opal_sources (${_SRCS})
set (HDRS
AcceleratingField.h
Astra1DDynamic_fast.h
Astra1DDynamic.h
Astra1DElectroStatic_fast.h
Astra1DDynamic_fast.h
Astra1DElectroStatic.h
Astra1D_fast.h
Astra1DMagnetoStatic_fast.h
Astra1DElectroStatic_fast.h
Astra1DMagnetoStatic.h
Astra1DMagnetoStatic_fast.h
Astra1D_fast.h
BDipoleField.h
BMultipoleField.h
BSingleMultipoleField.h
......@@ -64,27 +63,26 @@ set (HDRS
ConstBzField.h
ConstEzField.h
EMField.h
Fieldmap.h
Fieldmap.hpp
FM1DDynamic_fast.h
FM1DDynamic.h
FM1DElectroStatic_fast.h
FM1DDynamic_fast.h
FM1DElectroStatic.h
FM1DMagnetoStatic_fast.h
FM1DElectroStatic_fast.h
FM1DMagnetoStatic.h
FM1DMagnetoStatic_fast.h
FM1DProfile1.h
FM1DProfile2.h
FM2DDynamic.h
FM2DElectroStatic.h
FM2DMagnetoStatic.h
FM3DDynamic.h
FM3DH5BlockBase.h
FM3DH5Block.h
FM3DH5BlockBase.h
FM3DH5Block_nonscale.h
FM3DMagnetoStaticH5Block.h
FM3DMagnetoStatic.h
FM3DMagnetoStaticExtended.h
FMDummy.h
FM3DMagnetoStaticH5Block.h
Fieldmap.h
Fieldmap.hpp
NullField.h
OscillatingField.h
SectorField.h
......@@ -93,4 +91,4 @@ set (HDRS
StaticMagneticField.h
)
install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/Fields")
install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/Fields")
\ No newline at end of file
......@@ -2,53 +2,32 @@
#include <memory>
class _Fieldmap;
using Fieldmap = std::shared_ptr<_Fieldmap>;
class _Astra1DDynamic;
using Astra1DDynamic = std::shared_ptr<_Astra1DDynamic>;
class _FM3DH5BlockBase;
using FM3DH5BlockBase = std::shared_ptr<_FM3DH5BlockBase>;
class _Astra1DDynamic_fast;
using Astra1DDynamic_fast = std::shared_ptr<_Astra1DDynamic_fast>;
class _FM1DProfile1;
using FM1DProfile1 = std::shared_ptr<_FM1DProfile1>;
class _Astra1DElectroStatic;
using Astra1DElectroStatic = std::shared_ptr<_Astra1DElectroStatic>;
class _Astra1D_fast;
using Astra1D_fast = std::shared_ptr<_Astra1D_fast>;
class _Astra1DElectroStatic_fast;
using Astra1DElectroStatic_fast = std::shared_ptr<_Astra1DElectroStatic_fast>;
class _FM1DDynamic_fast;
using FM1DDynamic_fast = std::shared_ptr<_FM1DDynamic_fast>;
class _Astra1DMagnetoStatic;
using Astra1DMagnetoStatic = std::shared_ptr<_Astra1DMagnetoStatic>;
class _FM1DMagnetoStatic;
using FM1DMagnetoStatic = std::shared_ptr<_FM1DMagnetoStatic>;
class _Astra1DMagnetoStatic_fast;
using Astra1DMagnetoStatic_fast = std::shared_ptr<_Astra1DMagnetoStatic_fast>;
class _FM3DDynamic;
using FM3DDynamic = std::shared_ptr<_FM3DDynamic>;
class _Fieldmap;
using Fieldmap = std::shared_ptr<_Fieldmap>;
class _FM1DDynamic;
using FM1DDynamic = std::shared_ptr<_FM1DDynamic>;
class _FM3DMagnetoStaticExtended;
using FM3DMagnetoStaticExtended = std::shared_ptr<_FM3DMagnetoStaticExtended>;
class _FM2DElectroStatic;
using FM2DElectroStatic = std::shared_ptr<_FM2DElectroStatic>;
class _FM2DMagnetoStatic;
using FM2DMagnetoStatic = std::shared_ptr<_FM2DMagnetoStatic>;
class _FM1DProfile2;
using FM1DProfile2 = std::shared_ptr<_FM1DProfile2>;
class _FM1DMagnetoStatic_fast;
using FM1DMagnetoStatic_fast = std::shared_ptr<_FM1DMagnetoStatic_fast>;
class _FMDummy;
using FMDummy = std::shared_ptr<_FMDummy>;
class _Astra1DElectroStatic;
using Astra1DElectroStatic = std::shared_ptr<_Astra1DElectroStatic>;
class _Astra1DElectroStatic_fast;
using Astra1DElectroStatic_fast = std::shared_ptr<_Astra1DElectroStatic_fast>;
class _FM1DDynamic_fast;
using FM1DDynamic_fast = std::shared_ptr<_FM1DDynamic_fast>;
class _FM1DElectroStatic;
using FM1DElectroStatic = std::shared_ptr<_FM1DElectroStatic>;
......@@ -56,33 +35,30 @@ using FM1DElectroStatic = std::shared_ptr<_FM1DElectroStatic>;
class _FM1DElectroStatic_fast;
using FM1DElectroStatic_fast = std::shared_ptr<_FM1DElectroStatic_fast>;
class _Astra1DDynamic;
using Astra1DDynamic = std::shared_ptr<_Astra1DDynamic>;
class _FM1DMagnetoStatic;
using FM1DMagnetoStatic = std::shared_ptr<_FM1DMagnetoStatic>;
class _Astra1DDynamic_fast;
using Astra1DDynamic_fast = std::shared_ptr<_Astra1DDynamic_fast>;
class _FM1DMagnetoStatic_fast;
using FM1DMagnetoStatic_fast = std::shared_ptr<_FM1DMagnetoStatic_fast>;
class _FM2DDynamic;
using FM2DDynamic = std::shared_ptr<_FM2DDynamic>;
class _FM1DProfile1;
using FM1DProfile1 = std::shared_ptr<_FM1DProfile1>;
class _Astra1DMagnetoStatic;
using Astra1DMagnetoStatic = std::shared_ptr<_Astra1DMagnetoStatic>;
class _FM1DProfile2;
using FM1DProfile2 = std::shared_ptr<_FM1DProfile2>;
class _Astra1DMagnetoStatic_fast;
using Astra1DMagnetoStatic_fast = std::shared_ptr<_Astra1DMagnetoStatic_fast>;
class _FM2DDynamic;
using FM2DDynamic = std::shared_ptr<_FM2DDynamic>;
class _FM1DElectroStatic_fast;
using FM1DElectroStatic_fast = std::shared_ptr<_FM1DElectroStatic_fast>;
class _FM2DElectroStatic;
using FM2DElectroStatic = std::shared_ptr<_FM2DElectroStatic>;
class _FM3DMagnetoStatic;
using FM3DMagnetoStatic = std::shared_ptr<_FM3DMagnetoStatic>;
class _FM2DMagnetoStatic;
using FM2DMagnetoStatic = std::shared_ptr<_FM2DMagnetoStatic>;
class _FM3DDynamic;
using FM3DDynamic = std::shared_ptr<_FM3DDynamic>;
class _FM3DH5BlockBase;
using FM3DH5BlockBase = std::shared_ptr<_FM3DH5BlockBase>;
class _FM3DH5Block;
using FM3DH5Block = std::shared_ptr<_FM3DH5Block>;
......
#include "Fields/FMDummy.h"
#include "Fields/Fieldmap.hpp"
_FMDummy::_FMDummy(const std::string& filename):
_Fieldmap(filename),
zbegin_m(0.0),
zend_m(-1e-3) {
std::stringstream errormsg;
errormsg << "THERE SEEMS TO BE SOMETHING WRONG WITH YOUR FIELD MAP '" << Filename_m << "'.\n"
<< "Could not determine the file type.\n"
<< "Please check the section about field maps in the user manual.\n";
std::string errormsg_str = typeset_msg(errormsg.str(), "error");
WARNMSG(errormsg_str << "\n" << endl);
if(Ippl::myNode() == 0) {
std::ofstream omsg("errormsg.txt", std::ios_base::app);
omsg << errormsg_str << std::endl;
omsg.close();
}
disableFieldmapWarning();
}
_FMDummy::~_FMDummy()
{ }
void _FMDummy::readMap()
{ }
void _FMDummy::freeMap()
{ }
bool _FMDummy::getFieldstrength(const Vector_t &/*R*/, Vector_t &/*E*/, Vector_t &/*B*/) const {
return false;
}
bool _FMDummy::getFieldDerivative(const Vector_t &/*R*/, Vector_t &/*E*/, Vector_t &/*B*/, const DiffDirection &/*dir*/) const {
return false;
}
void _FMDummy::getFieldDimensions(double &zBegin, double &zEnd) const {
zBegin = zbegin_m;
zEnd = zend_m;
}
void _FMDummy::getFieldDimensions(double &/*xIni*/, double &/*xFinal*/, double &/*yIni*/, double &/*yFinal*/, double &/*zIni*/, double &/*zFinal*/) const {}
void _FMDummy::swap()
{ }
void _FMDummy::getInfo(Inform */*msg*/)
{ }
double _FMDummy::getFrequency() const {
static double dummy = 0.0;
return dummy;
}
void _FMDummy::setFrequency(double /*freq*/)
{ }
\ No newline at end of file
#ifndef CLASSIC_FIELDMAPDUMMY
#define CLASSIC_FIELDMAPDUMMY
#include "Fields/Fieldmap.h"
class _FMDummy: public _Fieldmap {
public:
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const;
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const;
virtual void getFieldDimensions(double &zBegin, double &zEnd) const;
virtual void getFieldDimensions(double &xIni, double &xFinal, double &yIni, double &yFinal, double &zIni, double &zFinal) const;
virtual void swap();
virtual void getInfo(Inform *);
virtual double getFrequency() const;
virtual void setFrequency(double freq);
private:
_FMDummy(const std::string& filename);
~_FMDummy();
virtual void readMap();
virtual void freeMap();
double zbegin_m;
double zend_m;
friend class _Fieldmap;
};
using FMDummy = std::shared_ptr<_FMDummy>;
#endif
\ No newline at end of file
......@@ -27,7 +27,6 @@
#include "Fields/FM3DMagnetoStatic.h"
#include "Fields/FM3DMagnetoStaticExtended.h"
#include "Fields/FM3DMagnetoStaticH5Block.h"
#include "Fields/FMDummy.h"
#include "Physics/Physics.h"
#include "Utilities/GeneralClassicException.h"
#include "Utilities/Options.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment