Skip to content

Commit 0301367

Browse files
JeanLucPonslfarv
andauthored
Update and centralize the C constants (#691)
* Centralize constants * Adjusted constants to the one used in PhysConstant.m * Updated test_physics for the new constants Co-authored-by: Laurent Farvacque <[email protected]>
1 parent 1e32037 commit 0301367

29 files changed

+134
-310
lines changed

atintegrators/BeamLoadingCavityPass.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atimplib.c"
34
#include "attrackfunc.c"
@@ -6,8 +7,6 @@
67
* BeamLoadingCavity pass method by Simon White.
78
*
89
*/
9-
10-
#define C0 2.99792458e8
1110

1211
struct elem
1312
{

atintegrators/BndMPoleSymplectic4E2Pass.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atlalib.c"
34
#include "atphyslib.c"
45

5-
#define DRIFT1 0.6756035959798286638
6-
#define DRIFT2 -0.1756035959798286639
7-
#define KICK1 1.351207191959657328
8-
#define KICK2 -1.702414383919314656
9-
106
struct elem
117
{
128
double Length;

atintegrators/BndMPoleSymplectic4E2RadPass.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atlalib.c"
34
#include "atphyslib.c"
45

5-
#define DRIFT1 0.6756035959798286638
6-
#define DRIFT2 -0.1756035959798286639
7-
#define KICK1 1.351207191959657328
8-
#define KICK2 -1.702414383919314656
9-
106
#define SQR(X) ((X)*(X))
117

128
struct elem
@@ -44,10 +40,6 @@ struct elem
4440
Last modified on 8/26/2009
4541
*/
4642

47-
48-
#define TWOPI 6.28318530717959
49-
#define CGAMMA 8.846056192e-05
50-
5143
static double B2perp(double bx, double by, double irho,
5244
double x, double xpr, double y, double ypr)
5345
/* Calculates sqr(|e x B|) , where e is a unit vector in the direction of velocity */

atintegrators/BndMPoleSymplectic4Pass.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atlalib.c"
34
#include "atphyslib.c"
45
#include "driftkick.c" /* fastdrift and bndthinkick */
56
#include "quadfringe.c" /* QuadFringePassP, QuadFringePassN */
67

7-
#define DRIFT1 0.6756035959798286638
8-
#define DRIFT2 -0.1756035959798286639
9-
#define KICK1 1.351207191959657328
10-
#define KICK2 -1.702414383919314656
11-
128
struct elem
139
{
1410
double Length;

atintegrators/BndMPoleSymplectic4QuantPass.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atlalib.c"
34
#include "atphyslib.c"
@@ -6,11 +7,6 @@
67
#include "quadfringe.c" /* QuadFringePassP, QuadFringePassN */
78
#include <math.h>
89

9-
#define DRIFT1 0.6756035959798286638
10-
#define DRIFT2 -0.1756035959798286639
11-
#define KICK1 1.351207191959657328
12-
#define KICK2 -1.702414383919314656
13-
1410
struct elem
1511
{
1612
double Length;

atintegrators/BndMPoleSymplectic4RadPass.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atlalib.c"
34
#include "atphyslib.c"
45
#include "driftkickrad.c" /* bndthinkickrad.c */
56
#include "quadfringe.c" /* QuadFringePassP, QuadFringePassN */
67

7-
#define DRIFT1 0.6756035959798286638
8-
#define DRIFT2 -0.1756035959798286639
9-
#define KICK1 1.351207191959657328
10-
#define KICK2 -1.702414383919314656
11-
128
struct elem
139
{
1410
double Length;

atintegrators/BndStrMPoleSymplectic4Pass.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atlalib.c"
34
#include "atphyslib.c"
45
#include "driftkick.c" /* strthinkick.c */
56

6-
#define DRIFT1 0.6756035959798286638
7-
#define DRIFT2 -0.1756035959798286639
8-
#define KICK1 1.351207191959657328
9-
#define KICK2 -1.702414383919314656
10-
117
/* Straight dipole w/ multipole using Symplectic Integration and rotation at
128
* dipole faces.
139
* Created by Xiaobiao Huang, 7/31/2018 */

atintegrators/CavityPass.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
* Revision 3/10/04
55
* A.Terebilo
66
*/
7-
7+
#include "atconstants.h"
88
#include "atelem.c"
99

10-
#define TWOPI 6.28318530717959
11-
#define C0 2.99792458e8
12-
1310
struct elem
1411
{
1512
double Length;

atintegrators/DeltaQPass.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atlalib.c"
34

4-
#define TWOPI 6.28318530717959
5-
65
struct elem
76
{
87
double Alphax;

atintegrators/ExactMultipolePass.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
1+
#include "atconstants.h"
12
#include "atelem.c"
23
#include "atlalib.c"
34
#include "driftkick.c" /* fastdrift.c, strthinkick.c */
45
#include "exactdrift.c"
56
#include "exactmultipolefringe.c"
67

7-
/* Generated by:
8-
9-
#!/usr/bin/env python
10-
c1 = 1.0/(2.0*(2.0-2.0**(1.0/3.0)))
11-
c2 = (1-2**(1.0/3.0))/(2.0*(2.0-2.0**(1.0/3.0)))
12-
d1 = 1.0/(2.0-2.0**(1.0/3.0))
13-
d2 = -(2**(1.0/3.0)/(2.0-2.0**(1.0/3.0)))
14-
print(f"#define DRIFT1 {c1: .18}")
15-
print(f"#define DRIFT2 {c2: .18}")
16-
print(f"#define KICK1 {d1: .18}")
17-
print(f"#define KICK2 {d2: .18}")
18-
*/
19-
#define DRIFT1 0.675603595979828886
20-
#define DRIFT2 -0.17560359597982883
21-
#define KICK1 1.35120719195965777
22-
#define KICK2 -1.70241438391931532
23-
248
struct elem {
259
double Length;
2610
double *PolynomA;

0 commit comments

Comments
 (0)