Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
TRACY3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Optics
TRACY3
Commits
2ccdd909
Commit
2ccdd909
authored
Nov 4, 2010
by
zhang
Browse files
Options
Downloads
Patches
Plain Diff
Make small change to make the code more compact
parent
da7d4445
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tracy/tools/soltracy.cc
+23
-21
23 additions, 21 deletions
tracy/tools/soltracy.cc
with
23 additions
and
21 deletions
tracy/tools/soltracy.cc
+
23
−
21
View file @
2ccdd909
...
@@ -20,10 +20,11 @@ extern bool freq_map;
...
@@ -20,10 +20,11 @@ extern bool freq_map;
// turn on globval.Cavity_on and globval.radiation to get proper synchr radiation damping
// turn on globval.Cavity_on and globval.radiation to get proper synchr radiation damping
// IDs accounted too if: wiggler model and symplectic integrator (method = 1)
// IDs accounted too if: wiggler model and symplectic integrator (method = 1)
globval
.
H_exact
=
false
;
globval
.
H_exact
=
false
;
globval
.
quad_fringe
=
false
;
// quadrupole fringe field
/*The following values are set in the Read_lattice( ) in soleilcommon.cc*/
globval
.
radiation
=
false
;
// synchrotron radiation
// globval.quad_fringe = false; // quadrupole fringe field
globval
.
emittance
=
false
;
// emittance
// globval.radiation = false; // synchrotron radiation
globval
.
pathlength
=
false
;
// globval.emittance = false; // emittance
// globval.pathlength = false;
// globval.bpm = 0;
// globval.bpm = 0;
// const double x_max_FMA = 10e-3, delta_FMA = 10e-2;
// const double x_max_FMA = 10e-3, delta_FMA = 10e-2;
...
@@ -41,7 +42,7 @@ extern bool freq_map;
...
@@ -41,7 +42,7 @@ extern bool freq_map;
/************************************************************************
/************************************************************************
start
read in files and flags
read in files and flags
*************************************************************************/
*************************************************************************/
if
(
argc
>
1
){
if
(
argc
>
1
){
read_script
(
argv
[
1
],
true
);}
read_script
(
argv
[
1
],
true
);}
...
@@ -50,15 +51,10 @@ extern bool freq_map;
...
@@ -50,15 +51,10 @@ extern bool freq_map;
exit_
(
1
);
exit_
(
1
);
}
}
/************************************************************************
/************************************************************************
end read in files
an
d
f
lags
writes flat file with all the design values of the lattice, very import
an
t
f
ile for debug
*************************************************************************/
*************************************************************************/
prtmfile
(
"flat_file.dat"
);
// writes flat file /* very important file for debug*/
prtmfile
(
"flat_file.dat"
);
printlatt
();
/* SOLEIL print out lattice functions */
printglob
();
// Flag factory
// Flag factory
...
@@ -211,27 +207,32 @@ extern bool freq_map;
...
@@ -211,27 +207,32 @@ extern bool freq_map;
if
(
ReadMultipoleFlag
==
true
){
if
(
ReadMultipoleFlag
==
true
){
fprintf
(
stdout
,
"
\n
Read Multipoles file for lattice with thick sextupoles
\n
"
);
fprintf
(
stdout
,
"
\n
Read Multipoles file for lattice with thick sextupoles
\n
"
);
ReadFieldErr
(
multipole_file
);
ReadFieldErr
(
multipole_file
);
//first print the full lattice with error as a flat file
prtmfile
(
"flat_file_error.dat"
);
// writes flat file /* very important file for debug*/
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printglob
();
}
}
//Old version to multipole errors in soleil lattice, is obsoleted
if
(
MultipoleFlag
==
true
){
if
(
MultipoleFlag
==
true
){
if
(
ThinsextFlag
==
true
){
if
(
ThinsextFlag
==
true
){
fprintf
(
stdout
,
"
\n
Setting Multipoles for lattice with thin sextupoles
\n
"
);
fprintf
(
stdout
,
"
\n
Setting Multipoles for lattice with thin sextupoles
\n
"
);
Multipole_thinsext
(
fic_hcorr
,
fic_vcorr
,
fic_skew
);
/* for thin sextupoles */
Multipole_thinsext
(
fic_hcorr
,
fic_vcorr
,
fic_skew
);
/* for thin sextupoles */
prtmfile
(
"flat_file_error.dat"
);
// writes flat file /* very important file for debug*/
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printglob
();
printglob
();
}
}
else
{
else
{
fprintf
(
stdout
,
"
\n
Setting Multipoles for lattice with thick sextupoles
\n
"
);
fprintf
(
stdout
,
"
\n
Setting Multipoles for lattice with thick sextupoles
\n
"
);
Multipole_thicksext
(
fic_hcorr
,
fic_vcorr
,
fic_skew
);
/* for thick sextupoles */
Multipole_thicksext
(
fic_hcorr
,
fic_vcorr
,
fic_skew
);
/* for thick sextupoles */
prtmfile
(
"flat_file_error.dat"
);
// writes flat file /* very important file for debug*/
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printglob
();
printglob
();
}
}
}
}
//first print the full lattice with error as a flat file
prtmfile
(
"flat_file_error.dat"
);
// writes flat file /* very important file for debug*/
printlatt
();
/* SOLEIL print out lattice functions */
printglob
();
/******************************************************************************************/
/******************************************************************************************/
// COMPUTATION PART after setting the model
// COMPUTATION PART after setting the model
...
@@ -288,16 +289,16 @@ extern bool freq_map;
...
@@ -288,16 +289,16 @@ extern bool freq_map;
if
(
MomentumAccFlag
==
true
){
if
(
MomentumAccFlag
==
true
){
bool
cavityflag
,
radiationflag
;
bool
cavityflag
,
radiationflag
;
/* record the initial values*/
/* record the initial values*/
cavityflag
=
globval
.
Cavity_on
;
cavityflag
=
globval
.
Cavity_on
;
radiationflag
=
globval
.
radiation
;
radiationflag
=
globval
.
radiation
;
if
(
strncmp
(
"6D"
,
DimTrack
,
2
)
==
0
){
/* set the dimension for the momentum tracking*/
if
(
strncmp
(
"6D"
,
TrackDim
,
2
)
==
0
){
globval
.
Cavity_on
=
true
;
globval
.
Cavity_on
=
true
;
globval
.
radiation
=
true
;
globval
.
radiation
=
true
;
}
}
else
if
(
strncmp
(
"4D"
,
Dim
Track
,
2
)
==
0
){
else
if
(
strncmp
(
"4D"
,
Track
Dim
,
2
)
==
0
){
globval
.
Cavity_on
=
false
;
globval
.
Cavity_on
=
false
;
globval
.
radiation
=
false
;
globval
.
radiation
=
false
;
}
}
...
@@ -306,12 +307,13 @@ extern bool freq_map;
...
@@ -306,12 +307,13 @@ extern bool freq_map;
exit_
(
1
);
exit_
(
1
);
};
};
/* calculate momentum accepetance*/
MomentumAcceptance
(
MomentumAcceptance
(
_MomentumAccFlag_istart
,
_MomentumAccFlag_istop
,
_MomentumAccFlag_istart
,
_MomentumAccFlag_istop
,
_MomentumAccFlag_deltaminp
,
_MomentumAccFlag_deltamaxp
,
_MomentumAccFlag_nstepp
,
_MomentumAccFlag_deltaminp
,
_MomentumAccFlag_deltamaxp
,
_MomentumAccFlag_nstepp
,
_MomentumAccFlag_deltaminn
,
_MomentumAccFlag_deltamaxn
,
_MomentumAccFlag_nstepn
);
_MomentumAccFlag_deltaminn
,
_MomentumAccFlag_deltamaxn
,
_MomentumAccFlag_nstepn
);
/* res
et back
to the initial values*/
/* resto
re
the initial values*/
globval
.
Cavity_on
=
cavityflag
;
globval
.
Cavity_on
=
cavityflag
;
globval
.
radiation
=
radiationflag
;
globval
.
radiation
=
radiationflag
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment