libcon2020.cc
3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#include "libcon2020.h"
// BRE - Due to this global variable, the Con2020 constructor is called on library load
// => the init integrals is a little bit long so the call of this method has been moved outside of the constructor
Con2020 con2020;
// BRE - 10/10/2023 - Add method to init integrals
void Con2020Init() {
con2020.Init();
}
//-------------------------
void Con2020FieldArray(int n, double *p0, double *p1, double *p2,
double *B0, double *B1, double *B2) {
/* could create a separate function for default model */
con2020.Field(n,p0,p1,p2,B0,B1,B2);
}
void Con2020Field(double p0, double p1, double p2,
double *B0, double *B1, double *B2) {
/* could create a separate function for default model */
con2020.Field(p0,p1,p2,B0,B1,B2);
}
void GetCon2020Params(double *mui, double *irho, double *r0, double *r1,
double *d, double *xt, double *xp, char *eqtype,
bool *Edwards, bool *ErrChk, bool *CartIn, bool *CartOut,
bool *smooth, double *DeltaRho, double *DeltaZ,
double *g, char *azfunc, double *wO_open, double *wO_om,
double *thetamm, double *dthetamm, double *thetaoc, double *dthetaoc) {
mui[0] = con2020.GetAzCurrentParameter();
irho[0] = con2020.GetRadCurrentParameter();
r0[0] = con2020.GetR0();
r1[0] = con2020.GetR1();
d[0] = con2020.GetCSHalfThickness();
xt[0] = con2020.GetCSTilt();
xp[0] = con2020.GetCSTiltAzimuth();
Edwards[0] = con2020.GetEdwardsEqs();
ErrChk[0] = con2020.GetErrCheck();
CartIn[0] = con2020.GetCartIn();
CartOut[0] = con2020.GetCartOut();
con2020.GetEqType(eqtype);
smooth[0] = con2020.GetSmooth();
DeltaRho[0] = con2020.GetDeltaRho();
DeltaZ[0] = con2020.GetDeltaZ();
/* new LMIC parameters */
g[0] = con2020.GetG();
con2020.GetAzimuthalFunc(azfunc);
wO_open[0] = con2020.GetOmegaOpen();
wO_om[0] = con2020.GetOmegaOM();
thetamm[0] = con2020.GetThetaMM();
dthetamm[0] = con2020.GetdThetaMM();
thetaoc[0] = con2020.GetThetaOC();
dthetaoc[0] = con2020.GetdThetaOC();
}
void SetCon2020Params(double mui, double irho, double r0, double r1,
double d, double xt, double xp, const char *eqtype,
bool Edwards, bool ErrChk, bool CartIn, bool CartOut,
bool smooth, double DeltaRho, double DeltaZ,
double g, const char *azfunc, double wO_open, double wO_om,
double thetamm, double dthetamm, double thetaoc, double dthetaoc) {
con2020.SetAzCurrentParameter(mui);
con2020.SetRadCurrentParameter(irho);
con2020.SetR0(r0);
con2020.SetR1(r1);
con2020.SetCSHalfThickness(d);
con2020.SetCSTilt(xt);
con2020.SetCSTiltAzimuth(xp);
con2020.SetEdwardsEqs(Edwards);
con2020.SetErrCheck(ErrChk);
con2020.SetCartIn(CartIn);
con2020.SetCartOut(CartOut);
con2020.SetEqType(eqtype);
con2020.SetSmooth(smooth);
con2020.SetDeltaRho(DeltaRho);
con2020.SetDeltaZ(DeltaZ);
/*set LMIC parameters */
con2020.SetG(g);
con2020.SetAzimuthalFunc(azfunc);
con2020.SetOmegaOpen(wO_open);
con2020.SetOmegaOM(wO_om);
con2020.SetThetaMM(thetamm);
con2020.SetdThetaMM(dthetamm);
con2020.SetThetaOC(thetaoc);
con2020.SetdThetaOC(dthetaoc);
}
void Con2020AnalyticField( int n, double a,
double *rho, double *z,
double *Brho, double *Bz) {
/* define a few required variables */
int i;
for (i=0;i<n;i++) {
con2020.AnalyticField(a,rho[i],z[i],&Brho[i],&Bz[i]);
}
}
void Con2020AnalyticFieldSmooth( int n, double a,
double *rho, double *z,
double *Brho, double *Bz) {
/* define a few required variables */
int i;
for (i=0;i<n;i++) {
con2020.AnalyticFieldSmooth(a,rho[i],z[i],&Brho[i],&Bz[i]);
}
}