Ignore:
Timestamp:
Dec 6, 2013, 5:12:43 PM (10 years ago)
Author:
zhangj
Message:

Clean version of Tracy: SoleilVersion at the end of 2011.Use this clean version to find the correct dipole fringe field to have the correct FMAP and FMAPDP of ThomX. Modified files: tpsa_lin.cc, soleillib.cc, prtmfile.cc, rdmfile.cc, read_script.cc, physlib.cc, tracy.cc, t2lat.cc, t2elem.cc, naffutils.cc in /tracy/tracy/src folder; naffutils.h, tracy_global.h, physlib.h, tracy.h, read_script.h, solielilib.h, t2elem.h in /tracy/tracy.inc folder; soltracy.cc in tracy/tools folder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/tracy3-3.10.1b/tracy/tools/soltracy.cc

    r11 r23  
    1 /************************************
     1/*
    22 Current revision $Revision$
    33 On branch $Name$
    44 Latest change $Date$ by $Author$
    5 *************************************/
    6 #define ORDER 1   
    7 //#define ORDER 4   
     5*/
     6#define ORDER 1         
    87
    98int no_tps = ORDER; // arbitrary TPSA order is defined locally
    109
     10
     11
    1112extern bool freq_map;
    1213
    13 // #if HAVE_CONFIG_H
    14 // #include <config.h>
    15 // #endif
    16 
    17 // #if MPI_EXEC
    18 //   //library of parallel computation,must be before "stdio.h"
    19 //   #include <mpi.h>
    20 // #endif
     14#if HAVE_CONFIG_H
     15#include <config.h>
     16#endif
     17
     18/*
     19#if MPI_EXEC
     20  //library of parallel computation,must be before "stdio.h"
     21  #include <mpi.h>
     22#endif
     23*/
    2124
    2225  #include "tracy_lib.h"
     
    4144  globval.H_exact = false;
    4245
    43  
    44   //output files
    45   char fic_twiss[S_SIZE + 4] = "";   //twiss file
    46   char fic_summary[S_SIZE + 4]="";   //summary file
    47  
    48  
    4946  /* parameters to read the user input script .prm */
    5047  long i=0L; //initialize the for loop to read command string
     
    6461  UserCommand UserCommandFlag[NCOMMAND];
    6562 
    66 // #if MPI_EXEC
    67 //   //Initialize parallel computation
    68 //     MPI_Init(&argc, &argv);
    69 // #endif
     63  /*
     64#if MPI_EXEC
     65  //Initialize parallel computation
     66    MPI_Init(&argc, &argv);
     67#endif
     68  */
     69
    7070  /************************************************************************
    7171   read in files and flags
     
    7676    read_script(argv[1], true,CommandNo, UserCommandFlag);
    7777  } else {
    78     fprintf(stdout, "Not enough parameters\n Syntax is program parameter file\n");
     78    fprintf(stdout, "Not enough parameters\nSyntax is program parameter file\n");
    7979    exit_(1);
    8080  }
     
    105105  else
    106106    globval.ge = ElemIndex(ge_name);
    107  
    108  
     107 
    109108//  globval.g = ElemIndex("g");  /* get family index of  girder*/
    110  strcpy(fic_twiss,lat_file);
    111   strcpy(fic_summary,lat_file);
    112   strcat(fic_twiss,".twi");
    113   strcat(fic_summary,".sum");
    114  
    115     //generate the twiss and summary files with proper appendix 
    116   /* print the summary of the element in lattice to the screen and an external file*/ 
     109   
     110  /* print the summary of the element in lattice */ 
    117111  printglob();   
    118   printglob2file(fic_summary);
    119  //print the twiss file
    120    /* print out lattice functions, with all the optical information for the lattice with design values */
    121   printlatt(fic_twiss); 
    122  
    123112  /************************************************************************
    124113    print files, very important file for debug
     
    263252   }
    264253   
    265    else if(strcmp(CommandStr,"PrintTrackElemFlag") == 0) {
    266       cout << "\n";
    267       cout << "print the tracked coordinates to file: "
    268            << UserCommandFlag[i]._PrintTrackElem_track_file << "\n";
    269        
    270       PrintTrackElem(UserCommandFlag[i]._PrintTrackElem_track_file,
    271                  UserCommandFlag[i]._PrintTrackElem_x, UserCommandFlag[i]._PrintTrackElem_px,
    272                  UserCommandFlag[i]._PrintTrackElem_y, UserCommandFlag[i]._PrintTrackElem_py,
    273                  UserCommandFlag[i]._PrintTrackElem_delta,UserCommandFlag[i]._PrintTrackElem_ctau,
    274                  UserCommandFlag[i]._PrintTrackElem_nelem1,UserCommandFlag[i]._PrintTrackElem_nelem2); 
    275    }
    276254    //print the girder
    277255  // else if(strcmp(CommandStr,"PrintGirderFlag") == 0) {
     
    468446  else if(strcmp(CommandStr,"FmapFlag") == 0) {
    469447    printf("\n begin Fmap calculation for on momentum particles: \n");
    470    
    471   //  #if MPI_EXEC
     448 
     449  //   /* 
     450 //   #if MPI_EXEC
    472451
    473452 //    //initialization for parallel computing
     
    490469 //        UserCommandFlag[i]._FmapFlag_delta,
    491470 //        UserCommandFlag[i]._FmapFlag_diffusion,
    492  //        UserCommandFlag[i]._FmapFlag_printloss,
    493471 //        numprocs,myid);
    494472
     
    543521           UserCommandFlag[i]._FmapFlag_ymax,
    544522           UserCommandFlag[i]._FmapFlag_delta,
    545            UserCommandFlag[i]._FmapFlag_diffusion,
    546            UserCommandFlag[i]._FmapFlag_printloss);
     523           UserCommandFlag[i]._FmapFlag_diffusion);
    547524      //#endif
     525   
    548526  }
    549527
     
    551529  else if(strcmp(CommandStr,"FmapdpFlag") == 0) {
    552530    printf("\n begin Fmap calculation for off momentum particles: \n");
    553    
     531   
     532  //   /*
    554533 //   #if MPI_EXEC
    555534
     
    572551 //          UserCommandFlag[i]._FmapdpFlag_z,
    573552 //          UserCommandFlag[i]._FmapdpFlag_diffusion,
    574  //            UserCommandFlag[i]._FmapdpFlag_printloss,
    575553 //          numprocs,myid);
    576554
     
    625603              UserCommandFlag[i]._FmapdpFlag_emax,
    626604              UserCommandFlag[i]._FmapdpFlag_z,
    627               UserCommandFlag[i]._FmapdpFlag_diffusion,
    628                UserCommandFlag[i]._FmapdpFlag_printloss);
    629        //  #endif
     605              UserCommandFlag[i]._FmapdpFlag_diffusion);
     606       // #endif
     607   
    630608  }
    631609
     
    657635    printf("\n Calculate momentum acceptance: \n");
    658636
    659 //  #if MPI_EXEC
     637   
     638 // #if MPI_EXEC
    660639   
    661640//     /* calculate momentum acceptance*/
     
    789768
    790769// #else
     770
    791771     MomentumAcceptance(UserCommandFlag[i]._MomentumAccFlag_momacc_file,
    792772                        UserCommandFlag[i]._MomentumAccFlag_istart,
     
    800780                        UserCommandFlag[i]._MomentumAccFlag_nturn,
    801781                        UserCommandFlag[i]._MomentumAccFlag_zmax);
    802      //  #endif   
     782     /*
     783  #endif   
     784     */
    803785
    804786    /* restore the initial values*/
     
    863845          UserCommandFlag[i]._Phase_ctau,
    864846          UserCommandFlag[i]._Phase_nturn);
    865     printf("6D phase space tracking: \n the simulation time for phase space in tracy 3 is \n");
     847    printf("the simulation time for phase space in tracy 3 is \n");
    866848    stop = stampstop(start);
    867849
     
    10211003
    10221004 
    1023  // #if MPI_EXEC
    1024  //  MPI_Finalize();   //finish parallel computation
    1025  // #endif
    1026  
     1005  /*
     1006 #if MPI_EXEC
     1007  MPI_Finalize();   //finish parallel computation
     1008 #endif
     1009  */
     1010
    10271011  return 0;
    10281012}//end of main()
Note: See TracChangeset for help on using the changeset viewer.