Commit b95c6fc2 authored by frey_m's avatar frey_m
Browse files

Distinguish between AMR and non-AMR bunch in OpalData.

src/AbstractObjects/OpalData.cpp
src/AbstractObjects/OpalData.h
src/Track/TrackRun.cpp
parent 52d29fef
......@@ -41,7 +41,7 @@
#include "OpalParser/OpalParser.h"
#include "Parser/FileStream.h"
#include "Parser/StringStream.h"
#include "Algorithms/PartBunch.h"
#include "Algorithms/PartBunchBase.h"
#include "Algorithms/bet/EnvelopeBunch.h"
// /DTA
......@@ -112,7 +112,7 @@ struct OpalDataImpl {
// The particle bunch to be tracked.
PartBunch *bunch_m;
PartBunchBase<double, 3> *bunch_m;
DataSink *dataSink_m;
......@@ -144,7 +144,11 @@ struct OpalDataImpl {
bool isInOPALCyclMode_m;
bool isInOPALTMode_m;
bool isInOPALEnvMode_m;
#ifdef HAVE_AMR_SOLVER
bool isInAmrMode_m;
#endif
bool isInPrepState_m;
};
......@@ -301,6 +305,16 @@ void OpalData::setInOPALEnvMode() {
p->isInOPALEnvMode_m = true;
}
#ifdef HAVE_AMR_SOLVER
void OpalData::setInAmrMode() {
p->isInAmrMode_m = true;
}
bool OpalData::isInAmrMode() const {
return p->isInAmrMode_m;
}
#endif
bool OpalData::isInPrepState() {
return p->isInPrepState_m;
}
......@@ -390,11 +404,11 @@ void OpalData::bunchIsAllocated() {
p->hasBunchAllocated_m = true;
}
void OpalData::setPartBunch(PartBunch *b) {
void OpalData::setPartBunch(PartBunchBase<double, 3> *b) {
p->bunch_m = b;
}
PartBunch *OpalData::getPartBunch() {
PartBunchBase<double, 3> *OpalData::getPartBunch() {
return p->bunch_m;
}
......
......@@ -25,7 +25,9 @@
#include <map>
#include <stack>
class PartBunch;
template <class T = double, unsigned Dim = 3>
class PartBunchBase;
class EnvelopeBunch;
class AttributeBase;
class Object;
......@@ -151,6 +153,11 @@ public:
void setInOPALCyclMode();
void setInOPALTMode();
void setInOPALEnvMode();
#ifdef HAVE_AMR_SOLVER
void setInAmrMode();
bool isInAmrMode() const;
#endif
bool isInPrepState();
void setInPrepState(bool state);
......@@ -208,9 +215,9 @@ public:
void bunchIsAllocated();
PartBunch *getPartBunch();
PartBunchBase<double, 3> *getPartBunch();
void setPartBunch(PartBunch *p);
void setPartBunch(PartBunchBase<double, 3> *p);
/// true if we already allocated a DataSink object
bool hasDataSinkAllocated();
......
......@@ -844,6 +844,11 @@ void TrackRun::setupFieldsolver() {
Track::block->bunch->setBCForDCBeam();
else
Track::block->bunch->setBCAllOpen();
#ifdef HAVE_AMR_SOLVER
if (fs->isAmrSolver() || fs->getAmrMaxLevel() > 0)
OpalData::getInstance()->setInAmrMode();
#endif
}
double TrackRun::setDistributionParallelT(Beam *beam) {
......
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