Commit ba6d6886 authored by frey_m's avatar frey_m

use 'opal' variable

parent 84c5e2a7
......@@ -125,14 +125,16 @@ double CavityAutophaser::getPhaseAtMaxEnergy(const Vector_t &R,
newPhase = std::fmod(originalPhase + optimizedPhase + Physics::two_pi, Physics::two_pi);
element->setPhasem(newPhase);
element->setAutophaseVeto();
OpalData::getInstance()->setMaxPhase(itsCavity_m->getName(), newPhase);
auto opal = OpalData::getInstance();
opal->setMaxPhase(itsCavity_m->getName(), newPhase);
newPhase = std::fmod(newPhase + basePhase, Physics::two_pi);
auto opal = OpalData::getInstance();
if (!opal->isOptimizerRun()) {
std::string fname = Util::combineFilePath({
OpalData::getInstance()->getAuxiliaryOutputDirectory(),
opal->getAuxiliaryOutputDirectory(),
itsCavity_m->getName() + "_AP.dat"
});
std::ofstream out(fname);
......
......@@ -49,10 +49,10 @@ OrbitThreader::OrbitThreader(const PartData &ref,
auto opal = OpalData::getInstance();
if (Ippl::myNode() == 0 && !opal->isOptimizerRun()) {
std::string fileName = Util::combineFilePath({
OpalData::getInstance()->getAuxiliaryOutputDirectory(),
OpalData::getInstance()->getInputBasename() + "_DesignPath.dat"
opal->getAuxiliaryOutputDirectory(),
opal->getInputBasename() + "_DesignPath.dat"
});
if (OpalData::getInstance()->getOpenMode() == OpalData::OPENMODE::WRITE ||
if (opal->getOpenMode() == OpalData::OPENMODE::WRITE ||
!boost::filesystem::exists(fileName)) {
logger_m.open(fileName);
logger_m << "#"
......
......@@ -371,7 +371,7 @@ void FM3DDynamic::getOnaxisEz(std::vector<std::pair<double, double> > & F) {
if (opal->isOptimizerRun()) return;
std::string fname = Util::combineFilePath({
OpalData::getInstance()->getAuxiliaryOutputDirectory(),
opal->getAuxiliaryOutputDirectory(),
Filename_m
});
std::ofstream out(fname);
......
......@@ -475,7 +475,7 @@ void Fieldmap::checkMap(unsigned int accuracy,
std::ofstream out;
if (Ippl::myNode() == 0 && !opal->isOptimizerRun()) {
std::string fname = Util::combineFilePath({
OpalData::getInstance()->getAuxiliaryOutputDirectory(),
opal->getAuxiliaryOutputDirectory(),
Filename_m.substr(lastSlash, lastDot) + ".check"
});
out.open(fname);
......
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