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 2702c2e9 authored by Philippe Ganz's avatar Philippe Ganz
Browse files

simplified unit transformation in ThickTracker::updateParticle_m

parent 698ea61c
No related branches found
No related tags found
1 merge request!42Opal maps
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: MapAnalyser
// Organizes the function for a linear map analysis from
// ThickTracker.
// Transfer map -> tunes, symplecticity and stability
// Sigma Matrix -> (not projected) beam emittance
//
// ------------------------------------------------------------------------
//
// $Author: ganz $
//
// ------------------------------------------------------------------------
#include "MapAnalyser.h" #include "MapAnalyser.h"
#include <fstream> #include <fstream>
...@@ -31,7 +48,7 @@ void MapAnalyser::linTAnalyze(const fMatrix_t& tMatrix){ ...@@ -31,7 +48,7 @@ void MapAnalyser::linTAnalyze(const fMatrix_t& tMatrix){
cfMatrix_t eigenValM, eigenVecM, invEigenVecM; cfMatrix_t eigenValM, eigenVecM, invEigenVecM;
eigenDecomp_m(tMatrix, eigenValM, eigenVecM, invEigenVecM); eigenDecomp_m(tMatrix, eigenValM, eigenVecM, invEigenVecM);
//normaize eigen Vectors //normalize eigen Vectors
for (int i=0; i <6 ; i++){ for (int i=0; i <6 ; i++){
double temp=0; double temp=0;
...@@ -443,8 +460,6 @@ MapAnalyser::cfMatrix_t MapAnalyser::complexTypeMatrix_m(fMatrix_t M){ ...@@ -443,8 +460,6 @@ MapAnalyser::cfMatrix_t MapAnalyser::complexTypeMatrix_m(fMatrix_t M){
MapAnalyser::cfMatrix_t MapAnalyser::invertMatrix_m(const cfMatrix_t& M){ MapAnalyser::cfMatrix_t MapAnalyser::invertMatrix_m(const cfMatrix_t& M){
gsl_set_error_handler_off(); gsl_set_error_handler_off();
//gsl_vector_complex *m = gsl_vector_complex_alloc(6); //gsl_vector_complex *m = gsl_vector_complex_alloc(6);
gsl_matrix_complex *m = gsl_matrix_complex_alloc(6, 6); gsl_matrix_complex *m = gsl_matrix_complex_alloc(6, 6);
......
...@@ -25,6 +25,7 @@ DG2: DRIFT, L=0.3, ELEMEDGE=1.900, NSLICES=10; ...@@ -25,6 +25,7 @@ DG2: DRIFT, L=0.3, ELEMEDGE=1.900, NSLICES=10;
QP3: QUADRUPOLE, L=0.3, K1= 8.64195, ELEMEDGE=2.200, NSLICES=15; QP3: QUADRUPOLE, L=0.3, K1= 8.64195, ELEMEDGE=2.200, NSLICES=15;
D3: DRIFT, L=.9, ELEMEDGE=2.500, NSLICES=5; D3: DRIFT, L=.9, ELEMEDGE=2.500, NSLICES=5;
D4: DRIFT, L=.3, ELEMEDGE=3.400, NSLICES=20; D4: DRIFT, L=.3, ELEMEDGE=3.400, NSLICES=20;
//QUADTEST: LINE=(D1); //QUADTEST: LINE=(D1);
QUADTEST: LINE=( D1, QP1 , DG1, QP2, DG2, QP3, D3, D4); QUADTEST: LINE=( D1, QP1 , DG1, QP2, DG2, QP3, D3, D4);
...@@ -47,7 +48,7 @@ BEAM1: BEAM, PARTICLE=PROTON, PC=P0, NPART=200, BCURRENT=2.0e-03, BFREQ=rf, CHAR ...@@ -47,7 +48,7 @@ BEAM1: BEAM, PARTICLE=PROTON, PC=P0, NPART=200, BCURRENT=2.0e-03, BFREQ=rf, CHAR
SELECT, LINE=QUADTEST; SELECT, LINE=QUADTEST;
TRACK, LINE= QUADTEST, BEAM=BEAM1, MAXSTEPS=10000, DT=1.0e-10, ZSTOP=4.0, MAP_ORDER=8; TRACK, LINE= QUADTEST, BEAM=BEAM1, MAXSTEPS=10000, DT=1.0e-10, ZSTOP=4.0, MAP_ORDER=2;
  • snuverink_j @snuverink_j ·
    Developer

    @ganz_p : was this change in map_order on purpose? Should I also change this in the regression test?

  • With MAP_ORDER you can change the polynomial length of the map (, respective the truncation order).

    You can change it, if you like to.

    The advantages:

    If you set it to MAP_ORDER=2 the simulation would speed up. In my opinion the expansion would be sufficient for a regression test, because here the loop of the Lie expansion (ExpMap function in FTps) is then done twice (with MAP_ORDER=8 its just repeated 6 times more...). Also the map accumulation would be faster, arguing similar as before (overloaded * operator in FVps).

  • snuverink_j @snuverink_j ·
    Developer

    okay thanks for the info. I have changed the MAP_ORDERs to 2 in regression-tests/8b5f2002

  • Please register or sign in to reply
RUN, METHOD = "THICK", BEAM=BEAM1, FIELDSOLVER=FS1, DISTRIBUTION=DIST1; RUN, METHOD = "THICK", BEAM=BEAM1, FIELDSOLVER=FS1, DISTRIBUTION=DIST1;
......
...@@ -57,7 +57,7 @@ BEAM1: BEAM, PARTICLE=ELECTRON, PC=P0, NPART=200, BCURRENT=2.0e-03, BFREQ=rf, CH ...@@ -57,7 +57,7 @@ BEAM1: BEAM, PARTICLE=ELECTRON, PC=P0, NPART=200, BCURRENT=2.0e-03, BFREQ=rf, CH
SELECT, LINE=FODOCELL; SELECT, LINE=FODOCELL;
TRACK, LINE= FODOCELL, BEAM=BEAM1, MAXSTEPS=10000, DT=1.0e-10, ZSTOP=4.4, MAP_ORDER=8; TRACK, LINE= FODOCELL, BEAM=BEAM1, MAXSTEPS=10000, DT=1.0e-10, ZSTOP=4.4, MAP_ORDER=3;
RUN, METHOD = "THICK", BEAM=BEAM1, FIELDSOLVER=FS1, DISTRIBUTION=DIST; RUN, METHOD = "THICK", BEAM=BEAM1, FIELDSOLVER=FS1, DISTRIBUTION=DIST;
......
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