Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments implemented in survey #755

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mad_gcst.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const int survey_table_types[] =
2, 2, 2, 2, 2, 2,
1, 1, 2,
/*== dealt with the new property v_pos as for mech_sep */
2
2,3
/*==*/
};

Expand All @@ -114,7 +114,7 @@ const char* const survey_table_cols[] =
"y", "z", "theta", "phi", "psi", "globaltilt",
"slot_id", "assembly_id", "mech_sep",
/*== dealt with the new property v_pos as for mech_sep */
"v_pos",
"v_pos", "comments",
/*==*/
" " /* blank terminates */
};
Expand Down
2 changes: 2 additions & 0 deletions src/mad_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,8 @@ string_to_table_curr(const char* table, const char* name, const char* string)
tbl->s_cols[col][tbl->curr] = tmpbuff(current_node->name);
else if (strcmp(buf, "base_name") == 0)
tbl->s_cols[col][tbl->curr] = tmpbuff(current_node->base_name);
else if (strcmp(buf, "comments") == 0)
tbl->s_cols[col][tbl->curr] = command_par_string("comments",current_node->p_elem->def);
else
tbl->s_cols[col][tbl->curr] = tmpbuff(buf);
return 0;
Expand Down
1 change: 1 addition & 0 deletions src/survey.f90
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ subroutine sufill(suml, v, theta, phi, psi, globaltilt)
el = node_value('l ')
call string_to_table_curr('survey ', 'name ', 'name ')
call string_to_table_curr('survey ', 'keyword ', 'base_name ')
call string_to_table_curr('survey ', 'comments ', 'comments ')
call double_to_table_curr('survey ', 's ',suml )
call double_to_table_curr('survey ', 'l ',el )
call double_to_table_curr('survey ', 'x ',v(1) )
Expand Down
2,428 changes: 1,214 additions & 1,214 deletions tests/test-sequence-4/all_survey.ref

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions tests/test-translation/survey.out.ref
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
@ NAME %06s "SURVEY"
@ TYPE %06s "SURVEY"
@ TITLE %08s "no-title"
@ ORIGIN %16s "5.04.01 Linux 64"
@ DATE %08s "14/02/19"
@ TIME %08s "13.27.05"
* NAME KEYWORD S L ANGLE X Y Z THETA PHI PSI GLOBALTILT SLOT_ID ASSEMBLY_ID MECH_SEP V_POS
$ %s %s %le %le %le %le %le %le %le %le %le %le %d %d %le %le
"SEQ$START" "MARKER" 0 0 0 0.01 0 0 0 0 0 0 0 0 0 0
"DRIFT_0" "DRIFT" 1 1 0 0.01 0 1 0 0 0 0 0 0 0 0
"TRANS" "TRANSLATION" 1 0 0 0.02 0.002 1.1 0 0 0 0 0 0 0 0
"DRIFT_1" "DRIFT" 1.5 0.5 0 0.02 0.002 1.6 0 0 0 0 0 0 0 0
"NEWQUAD" "MULTIPOLE" 1.5 0 0 0.02 0.002 1.6 0 0 0 0 0 0 0 0
"DRIFT_2" "DRIFT" 2 0.5 0 0.02 0.002 2.1 0 0 0 0 0 0 0 0
"SEQ$END" "MARKER" 2 0 0 0.02 0.002 2.1 0 0 0 0 0 0 0 0
@ ORIGIN %16s "5.04.02 Linux 64"
@ DATE %08s "02/04/19"
@ TIME %08s "14.17.58"
* NAME KEYWORD S L ANGLE X Y Z THETA PHI PSI GLOBALTILT SLOT_ID ASSEMBLY_ID MECH_SEP V_POS COMMENTS
$ %s %s %le %le %le %le %le %le %le %le %le %le %d %d %le %le %s
"SEQ$START" "MARKER" 0 0 0 0.01 0 0 0 0 0 0 0 0 0 0 ""
"DRIFT_0" "DRIFT" 1 1 0 0.01 0 1 0 0 0 0 0 0 0 0 ""
"TRANS" "TRANSLATION" 1 0 0 0.02 0.002 1.1 0 0 0 0 0 0 0 0 ""
"DRIFT_1" "DRIFT" 1.5 0.5 0 0.02 0.002 1.6 0 0 0 0 0 0 0 0 ""
"NEWQUAD" "MULTIPOLE" 1.5 0 0 0.02 0.002 1.6 0 0 0 0 0 0 0 0 "testing the comments"
"DRIFT_2" "DRIFT" 2 0.5 0 0.02 0.002 2.1 0 0 0 0 0 0 0 0 ""
"SEQ$END" "MARKER" 2 0 0 0.02 0.002 2.1 0 0 0 0 0 0 0 0 ""
2 changes: 1 addition & 1 deletion tests/test-translation/test-translation.madx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ circum=2;
beam, particle=proton, energy = 5500;


newquad: MULTIPOLE, KNL={0.00, 0.001};
newquad: MULTIPOLE, KNL={0.00, 0.001}, comments="testing the comments";
trans: TRANSLATION, X=0.01, Y=0.002, z=0.1;

seq: sequence, refer=center, l=circum;
Expand Down
8 changes: 4 additions & 4 deletions tests/test-translation/test-translation.ref
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

++++++++++++++++++++++++++++++++++++++++++++
+ MAD-X 5.04.01 (64 bit, Linux) +
+ MAD-X 5.04.02 (64 bit, Linux) +
+ Support: mad@cern.ch, http://cern.ch/mad +
+ Release date: 2018.07.10 +
+ Execution date: 2019.02.14 13:27:05 +
+ Release date: 2018.10.03 +
+ Execution date: 2019.04.02 14:19:03 +
++++++++++++++++++++++++++++++++++++++++++++
circum=2;

Expand All @@ -13,7 +13,7 @@ beam, particle=proton, energy = 5500;



newquad: MULTIPOLE, KNL={0.00, 0.001};
newquad: MULTIPOLE, KNL={0.00, 0.001}, comments="testing the comments";

trans: TRANSLATION, X=0.01, Y=0.002, z=0.1;

Expand Down
24 changes: 12 additions & 12 deletions tests/test-xrotation/survey.out.ref
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
@ NAME %06s "SURVEY"
@ TYPE %06s "SURVEY"
@ TITLE %08s "no-title"
@ ORIGIN %16s "5.04.00 Linux 64"
@ DATE %08s "15/05/18"
@ TIME %08s "18.33.51"
* NAME KEYWORD S L ANGLE X Y Z THETA PHI PSI GLOBALTILT SLOT_ID ASSEMBLY_ID MECH_SEP V_POS
$ %s %s %le %le %le %le %le %le %le %le %le %le %d %d %le %le
"SEQ$START" "MARKER" 0 0 0 0 0 0 0 0 0 0 0 0 0 0
"DRIFT_0" "DRIFT" 1 1 0 0 0 1 0 0 0 0 0 0 0 0
"ROTX" "XROTATION" 1 0 0 0 0 1 0 -0.005 0 0 0 0 0 0
"QF" "QUADRUPOLE" 2 1 0 0 -0.004999979167 1.9999875 0 -0.005 0 0 0 0 0 0
"MROTX" "XROTATION" 2 0 0 0 -0.004999979167 1.9999875 0 0 0 0 0 0 0 0
"DRIFT_1" "DRIFT" 3 1 0 0 -0.004999979167 2.9999875 0 0 0 0 0 0 0 0
"SEQ$END" "MARKER" 3 0 0 0 -0.004999979167 2.9999875 0 0 0 0 0 0 0 0
@ ORIGIN %16s "5.04.02 Linux 64"
@ DATE %08s "02/04/19"
@ TIME %08s "14.07.45"
* NAME KEYWORD S L ANGLE X Y Z THETA PHI PSI GLOBALTILT SLOT_ID ASSEMBLY_ID MECH_SEP V_POS COMMENTS
$ %s %s %le %le %le %le %le %le %le %le %le %le %d %d %le %le %s
"SEQ$START" "MARKER" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ""
"DRIFT_0" "DRIFT" 1 1 0 0 0 1 0 0 0 0 0 0 0 0 ""
"ROTX" "XROTATION" 1 0 0 0 0 1 0 -0.005 0 0 0 0 0 0 ""
"QF" "QUADRUPOLE" 2 1 0 0 -0.004999979167 1.9999875 0 -0.005 0 0 0 0 0 0 ""
"MROTX" "XROTATION" 2 0 0 0 -0.004999979167 1.9999875 0 0 0 0 0 0 0 0 ""
"DRIFT_1" "DRIFT" 3 1 0 0 -0.004999979167 2.9999875 0 0 0 0 0 0 0 0 ""
"SEQ$END" "MARKER" 3 0 0 0 -0.004999979167 2.9999875 0 0 0 0 0 0 0 0 ""
22 changes: 11 additions & 11 deletions tests/test-yrotation/survey.out.ref
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
@ TYPE %06s "SURVEY"
@ TITLE %08s "no-title"
@ ORIGIN %16s "5.04.02 Linux 64"
@ DATE %08s "14/02/19"
@ TIME %08s "16.30.07"
* NAME KEYWORD S L ANGLE X Y Z THETA PHI PSI GLOBALTILT SLOT_ID ASSEMBLY_ID MECH_SEP V_POS
$ %s %s %le %le %le %le %le %le %le %le %le %le %d %d %le %le
"SEQ$START" "MARKER" 0 0 0 0 0 0 0 0 0 0 0 0 0 0
"DRIFT_0" "DRIFT" 1 1 0 0 0 1 0 0 0 0 0 0 0 0
"ROTY" "YROTATION" 1 0 0 0 0 1 0.005 0 0 0 0 0 0 0
"QF" "QUADRUPOLE" 2 1 0 0.004999979167 0 1.9999875 0.005 0 0 0 0 0 0 0
"MROTY" "YROTATION" 2 0 0 0.004999979167 0 1.9999875 0 0 0 0 0 0 0 0
"DRIFT_1" "DRIFT" 3 1 0 0.004999979167 0 2.9999875 0 0 0 0 0 0 0 0
"SEQ$END" "MARKER" 3 0 0 0.004999979167 0 2.9999875 0 0 0 0 0 0 0 0
@ DATE %08s "02/04/19"
@ TIME %08s "14.07.45"
* NAME KEYWORD S L ANGLE X Y Z THETA PHI PSI GLOBALTILT SLOT_ID ASSEMBLY_ID MECH_SEP V_POS COMMENTS
$ %s %s %le %le %le %le %le %le %le %le %le %le %d %d %le %le %s
"SEQ$START" "MARKER" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ""
"DRIFT_0" "DRIFT" 1 1 0 0 0 1 0 0 0 0 0 0 0 0 ""
"ROTY" "YROTATION" 1 0 0 0 0 1 0.005 0 0 0 0 0 0 0 ""
"QF" "QUADRUPOLE" 2 1 0 0.004999979167 0 1.9999875 0.005 0 0 0 0 0 0 0 ""
"MROTY" "YROTATION" 2 0 0 0.004999979167 0 1.9999875 0 0 0 0 0 0 0 0 ""
"DRIFT_1" "DRIFT" 3 1 0 0.004999979167 0 2.9999875 0 0 0 0 0 0 0 0 ""
"SEQ$END" "MARKER" 3 0 0 0.004999979167 0 2.9999875 0 0 0 0 0 0 0 0 ""