Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 0b392ce2 authored by adelmann's avatar adelmann :reminder_ribbon:
Browse files

autophasing is working: extimated energy ok, tracked energy is to low, E =...

autophasing is working: extimated energy ok, tracked energy is to low, E = 3.2565 [MeV] insted  of E = 6.2831 [MeV], caused by wrong phase
parent 658be1b2
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ DR1: DRIFT, L = 0.4, ELEMEDGE = 0.2; ...@@ -91,7 +91,7 @@ DR1: DRIFT, L = 0.4, ELEMEDGE = 0.2;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// DEFINE BEAM LINE // DEFINE BEAM LINE
GS: Line = (GUN, DR1); GS: Line = (GUN);
Dist: DISTRIBUTION, TYPE= GAUSS, SIGMAX=1e-3, SIGMAY=1e-3; Dist: DISTRIBUTION, TYPE= GAUSS, SIGMAX=1e-3, SIGMAY=1e-3;
...@@ -105,7 +105,7 @@ Fs_SC: FIELDSOLVER, TYPE=NONE, MX=64; ...@@ -105,7 +105,7 @@ Fs_SC: FIELDSOLVER, TYPE=NONE, MX=64;
BEAM1: BEAM, PARTICLE = ELECTRON, pc = P0, NPART = n_particles, BEAM1: BEAM, PARTICLE = ELECTRON, pc = P0, NPART = n_particles,
BFREQ = rf_freq, BCURRENT = beam_bunch_charge * rf_freq * 1E6, CHARGE = -1; BFREQ = rf_freq, BCURRENT = beam_bunch_charge * rf_freq * 1E6, CHARGE = -1;
TRACK, LINE = GS, BEAM = BEAM1, MAXSTEPS = 1000000, DT = {dTg}, ZSTOP={.4}; TRACK, LINE = GS, BEAM = BEAM1, MAXSTEPS = 2, DT = {dTg}, ZSTOP={.4};
RUN, METHOD = "PARALLEL", BEAM = BEAM1, RUN, METHOD = "PARALLEL", BEAM = BEAM1,
FIELDSOLVER = FS_SC, DISTRIBUTION = Dist; FIELDSOLVER = FS_SC, DISTRIBUTION = Dist;
ENDTRACK; ENDTRACK;
num Nodes Wall tot
=====================================
mainTimer........... 1 0.6308
num Nodes Wall max Wall min Wall avg
=========================================================
mainTimer........... 1 0.6308 0.6308 0.6308
Write Stat.......... 1 0 0 0
Write H5-File....... 1 0 0 0
TIntegration1....... 1 0 0 0
TIntegration2....... 1 0 0 0
External field eval. 1 0 0 0
Binaryrepart........ 1 0 0 0
...@@ -698,7 +698,6 @@ std::pair<double, double> RFCavity::trackOnAxisParticle( ...@@ -698,7 +698,6 @@ std::pair<double, double> RFCavity::trackOnAxisParticle(
const double beta = std::sqrt(1. - 1 / (dot(p, p) + 1.)); const double beta = std::sqrt(1. - 1 / (dot(p, p) + 1.));
const double tErr = (z(2) - zend) / (Physics::c * beta); const double tErr = (z(2) - zend) / (Physics::c * beta);
return std::pair<double, double>(p(2), t - tErr); return std::pair<double, double>(p(2), t - tErr);
} }
......
...@@ -284,8 +284,7 @@ std::pair<double, double> CavityAutophaser::optimizeCavityPhase( ...@@ -284,8 +284,7 @@ std::pair<double, double> CavityAutophaser::optimizeCavityPhase(
} }
} }
Phimax = std::fmod(initialPhase + Physics::two_pi, Physics::two_pi); Phimax = std::fmod(initialPhase + Physics::two_pi, Physics::two_pi);
E = track(t, dt, Phimax + originalPhase);
E = track(t, dt, Phimax + originalPhase);
std::pair<double, double> status(Phimax, E); std::pair<double, double> status(Phimax, E);
return status; return status;
...@@ -306,6 +305,5 @@ double CavityAutophaser::track( ...@@ -306,6 +305,5 @@ double CavityAutophaser::track(
double finalKineticEnergy = Util::getKineticEnergy( double finalKineticEnergy = Util::getKineticEnergy(
Vector_t<double, 3>(0.0, 0.0, pe.first), itsReference_m.getM() * Units::eV2MeV); Vector_t<double, 3>(0.0, 0.0, pe.first), itsReference_m.getM() * Units::eV2MeV);
return finalKineticEnergy; return finalKineticEnergy;
} }
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>. // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
// //
#ifndef USEFULFUNCTIONS #ifndef UTIL
#define USEFULFUNCTIONS #define UTIL
#include "Algorithms/Quaternion.hpp" #include "Algorithms/Quaternion.hpp"
...@@ -42,7 +42,10 @@ namespace Util { ...@@ -42,7 +42,10 @@ namespace Util {
double erfinv(double x); double erfinv(double x);
inline double getGamma(ippl::Vector<double, 3> p) { inline double getGamma(ippl::Vector<double, 3> p) {
return std::sqrt(dot(p, p) + 1.0); double dotP = 0.0; // \todo dot(p, p); // .apply();
for (unsigned i = 0; i < 3; i++)
dotP += p(i) * p(i);
return std::sqrt(dotP + 1.0);
} }
inline ippl::Vector<double, 3> getBeta(ippl::Vector<double, 3> p) { inline ippl::Vector<double, 3> getBeta(ippl::Vector<double, 3> p) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment