Changeset 23 in TRACY3 for branches/tracy3-3.10.1b/tracy/tools/soltracy.cc
- Timestamp:
- Dec 6, 2013, 5:12:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tracy3-3.10.1b/tracy/tools/soltracy.cc
r11 r23 1 /* ***********************************1 /* 2 2 Current revision $Revision$ 3 3 On branch $Name$ 4 4 Latest change $Date$ by $Author$ 5 *************************************/ 6 #define ORDER 1 7 //#define ORDER 4 5 */ 6 #define ORDER 1 8 7 9 8 int no_tps = ORDER; // arbitrary TPSA order is defined locally 10 9 10 11 11 12 extern bool freq_map; 12 13 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 */ 21 24 22 25 #include "tracy_lib.h" … … 41 44 globval.H_exact = false; 42 45 43 44 //output files45 char fic_twiss[S_SIZE + 4] = ""; //twiss file46 char fic_summary[S_SIZE + 4]=""; //summary file47 48 49 46 /* parameters to read the user input script .prm */ 50 47 long i=0L; //initialize the for loop to read command string … … 64 61 UserCommand UserCommandFlag[NCOMMAND]; 65 62 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 70 70 /************************************************************************ 71 71 read in files and flags … … 76 76 read_script(argv[1], true,CommandNo, UserCommandFlag); 77 77 } else { 78 fprintf(stdout, "Not enough parameters\n 78 fprintf(stdout, "Not enough parameters\nSyntax is program parameter file\n"); 79 79 exit_(1); 80 80 } … … 105 105 else 106 106 globval.ge = ElemIndex(ge_name); 107 108 107 109 108 // 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 */ 117 111 printglob(); 118 printglob2file(fic_summary);119 //print the twiss file120 /* print out lattice functions, with all the optical information for the lattice with design values */121 printlatt(fic_twiss);122 123 112 /************************************************************************ 124 113 print files, very important file for debug … … 263 252 } 264 253 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 }276 254 //print the girder 277 255 // else if(strcmp(CommandStr,"PrintGirderFlag") == 0) { … … 468 446 else if(strcmp(CommandStr,"FmapFlag") == 0) { 469 447 printf("\n begin Fmap calculation for on momentum particles: \n"); 470 471 // #if MPI_EXEC 448 449 // /* 450 // #if MPI_EXEC 472 451 473 452 // //initialization for parallel computing … … 490 469 // UserCommandFlag[i]._FmapFlag_delta, 491 470 // UserCommandFlag[i]._FmapFlag_diffusion, 492 // UserCommandFlag[i]._FmapFlag_printloss,493 471 // numprocs,myid); 494 472 … … 543 521 UserCommandFlag[i]._FmapFlag_ymax, 544 522 UserCommandFlag[i]._FmapFlag_delta, 545 UserCommandFlag[i]._FmapFlag_diffusion, 546 UserCommandFlag[i]._FmapFlag_printloss); 523 UserCommandFlag[i]._FmapFlag_diffusion); 547 524 //#endif 525 548 526 } 549 527 … … 551 529 else if(strcmp(CommandStr,"FmapdpFlag") == 0) { 552 530 printf("\n begin Fmap calculation for off momentum particles: \n"); 553 531 532 // /* 554 533 // #if MPI_EXEC 555 534 … … 572 551 // UserCommandFlag[i]._FmapdpFlag_z, 573 552 // UserCommandFlag[i]._FmapdpFlag_diffusion, 574 // UserCommandFlag[i]._FmapdpFlag_printloss,575 553 // numprocs,myid); 576 554 … … 625 603 UserCommandFlag[i]._FmapdpFlag_emax, 626 604 UserCommandFlag[i]._FmapdpFlag_z, 627 UserCommandFlag[i]._FmapdpFlag_diffusion ,628 UserCommandFlag[i]._FmapdpFlag_printloss); 629 // #endif605 UserCommandFlag[i]._FmapdpFlag_diffusion); 606 // #endif 607 630 608 } 631 609 … … 657 635 printf("\n Calculate momentum acceptance: \n"); 658 636 659 // #if MPI_EXEC 637 638 // #if MPI_EXEC 660 639 661 640 // /* calculate momentum acceptance*/ … … 789 768 790 769 // #else 770 791 771 MomentumAcceptance(UserCommandFlag[i]._MomentumAccFlag_momacc_file, 792 772 UserCommandFlag[i]._MomentumAccFlag_istart, … … 800 780 UserCommandFlag[i]._MomentumAccFlag_nturn, 801 781 UserCommandFlag[i]._MomentumAccFlag_zmax); 802 // #endif 782 /* 783 #endif 784 */ 803 785 804 786 /* restore the initial values*/ … … 863 845 UserCommandFlag[i]._Phase_ctau, 864 846 UserCommandFlag[i]._Phase_nturn); 865 printf(" 6D phase space tracking: \nthe simulation time for phase space in tracy 3 is \n");847 printf("the simulation time for phase space in tracy 3 is \n"); 866 848 stop = stampstop(start); 867 849 … … 1021 1003 1022 1004 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 1027 1011 return 0; 1028 1012 }//end of main()
Note: See TracChangeset
for help on using the changeset viewer.