Skip to content

Commit

Permalink
Refactoring MagfieldCoils member variables to be in line with general…
Browse files Browse the repository at this point in the history
… naming scheme
  • Loading branch information
richeldichel committed Dec 8, 2023
1 parent 5038bc6 commit acc9433
Show file tree
Hide file tree
Showing 2 changed files with 674 additions and 674 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,51 +82,51 @@ class MagfieldCoils
double Mag(double* vec);
double Mag(double x, double y, double z);
// VARIABLES:
int Ncoil; // number of coils; coil indexing: i=0, ..., Ncoil-1
double** coil; // coil parameters: coil[i][j], i=0, ..., Ncoil-1; j=0,...,13.
string dirname; // name of directory where the coil and source coefficient data files are stored
string coilfilename; // name of coil input file
string objectname; // this string identifies the Magfield object (used as starting part of the source files)
int Nelliptic; // radial numerical integration parameter for magnetic field calc. with elliptic integrals
int nmax; // number of source coefficients for fixed z: nmax+1
double epstol; // small tolerance parameter needed for the symmetry group definitions (distance: in meter)
int Ng; // number of coil symmetry groups; group indexing: g=0, ..., Ng-1
int* G; // coil with global index i is in symmetry group g=G[i], i=0,...,Ncoil-1
int* Nc; // number of coils in symmetry group g: Nc[g]; local coil indexing in group g: c=0,..., Nc[g]-1
int** Cin; // global coil indices i in symmetry group g: i=Cin[g][c],...,c=0 to Nc[g]-1 (g=0,...,Ng-1)
double** Line; // symmetry group axis line of symmetry group g (g=0,...,Ng-1):
int fNcoil; // number of coils; coil indexing: i=0, ..., Ncoil-1
double** fcoil; // coil parameters: coil[i][j], i=0, ..., Ncoil-1; j=0,...,13.
string fdirname; // name of directory where the coil and source coefficient data files are stored
string fcoilfilename; // name of coil input file
string fobjectname; // this string identifies the Magfield object (used as starting part of the source files)
int fNelliptic; // radial numerical integration parameter for magnetic field calc. with elliptic integrals
int fnmax; // number of source coefficients for fixed z: nmax+1
double fepstol; // small tolerance parameter needed for the symmetry group definitions (distance: in meter)
int fNg; // number of coil symmetry groups; group indexing: g=0, ..., Ng-1
int* fG; // coil with global index i is in symmetry group g=G[i], i=0,...,Ncoil-1
int* fNc; // number of coils in symmetry group g: Nc[g]; local coil indexing in group g: c=0,..., Nc[g]-1
int** fCin; // global coil indices i in symmetry group g: i=Cin[g][c],...,c=0 to Nc[g]-1 (g=0,...,Ng-1)
double** fLine; // symmetry group axis line of symmetry group g (g=0,...,Ng-1):
// line point: Line[g][0], Line[g][1], Line[g][2]; line direction unit vector: Line[g][3], Line[g][4], Line[g][5];
double** Z; // local z coordinate of coil center in symmetry group g: Z[g][c], c=0,..., Nc[g]-1; Z[g][0]=0
double** fZ; // local z coordinate of coil center in symmetry group g: Z[g][c], c=0,..., Nc[g]-1; Z[g][0]=0
// (g: group index, c: local coil index)
double *C0, *C1, *c1, *c2, *c3, *c4, *c5, *c6, *c7, *c8, *c9, *c10, *c11, *c12;
double *fC0, *fC1, *fc1, *fc2, *fc3, *fc4, *fc5, *fc6, *fc7, *fc8, *fc9, *fc10, *fc11, *fc12;

double *Pp, *P; // Legendre polynomial P and first derivative Pp
double *Bzplus, *Brplus; // used in Bz and Br mag. field calc.
double *fPp, *fP; // Legendre polynomial P and first derivative Pp
double *fBzplus, *fBrplus; // used in Bz and Br mag. field calc.
// Remote source constant variables:
double* Brem1; // 1-dim. remote source constants Brem1[n], n=2,...,nmax.
double* rorem; // remote convergence radius for coil i: rorem[i]
double** Brem; // remote source constant for coil i: Brem[i][n] (coil index i, source constant index n)
double* z0remG; // remote source point for group G: z0remG[g]
double* roremG; // remote convergence radius for group G: roremG[g]
double* fBrem1; // 1-dim. remote source constants Brem1[n], n=2,...,nmax.
double* frorem; // remote convergence radius for coil i: rorem[i]
double** fBrem; // remote source constant for coil i: Brem[i][n] (coil index i, source constant index n)
double* fz0remG; // remote source point for group G: z0remG[g]
double* froremG; // remote convergence radius for group G: roremG[g]
double**
BremG; // remote source constant for symmetry group g: BremG[g][n] (group index g, source constant index n)
fBremG; // remote source constant for symmetry group g: BremG[g][n] (group index g, source constant index n)
// Magnetic charge source constant variables:
double**
Vrem; // magnetic charge remote source constant for coil i: Vrem[i][n] (coil index i, source const. index n)
fVrem; // magnetic charge remote source constant for coil i: Vrem[i][n] (coil index i, source const. index n)
// Central source constant variables:
double* Bcen1; // 1-dim. central source constants Bcen1[n], n=0,...,nmax.
int* Nsp; // number of central source points for coil i: Nsp[i] (i=0,...,Ncoil-1)
double** z0cen; // central source point local z value for coil i: z0cen[i][j] (coil index i, source point index j)
double** rocen; // central convergence radius for coil i: rocen[i][j] (coil index i, source point index j)
double* fBcen1; // 1-dim. central source constants Bcen1[n], n=0,...,nmax.
int* fNsp; // number of central source points for coil i: Nsp[i] (i=0,...,Ncoil-1)
double** fz0cen; // central source point local z value for coil i: z0cen[i][j] (coil index i, source point index j)
double** frocen; // central convergence radius for coil i: rocen[i][j] (coil index i, source point index j)
double***
Bcen; // central source constant for coil i: Bcen[i][j][n] (coil index i, source point index j, source constant index n)
int* NspG; // number of central source points for group g: Nsp[g] (g=0,...,Ng-1)
double** z0cenG; // central source point local z value: z0cenG[g][j] (group index g, source point index j)
double** rocenG; // central convergence radius: rocenG[g][j] (group index g, source point index j)
fBcen; // central source constant for coil i: Bcen[i][j][n] (coil index i, source point index j, source constant index n)
int* fNspG; // number of central source points for group g: Nsp[g] (g=0,...,Ng-1)
double** fz0cenG; // central source point local z value: z0cenG[g][j] (group index g, source point index j)
double** frocenG; // central convergence radius: rocenG[g][j] (group index g, source point index j)
double***
BcenG; // central source constant: BcenG[g][j][n] (group index g, source point index j, source const. index n)
int *jlast, *jlastG; // last central source point index for coil and group calculation
double rclimit;
fBcenG; // central source constant: BcenG[g][j][n] (group index g, source point index j, source const. index n)
int *fjlast, *fjlastG; // last central source point index for coil and group calculation
double frclimit;
};


Expand Down Expand Up @@ -183,10 +183,10 @@ inline double MagfieldCoils::Mag(double x, double y, double z)

inline void MagfieldCoils::SetTrackingStart()
{
for (int i = 0; i < Ncoil; i++)
jlast[i] = -1;
for (int g = 0; g < Ng; g++)
jlastG[g] = -1;
for (int i = 0; i < fNcoil; i++)
fjlast[i] = -1;
for (int g = 0; g < fNg; g++)
fjlastG[g] = -1;
}


Expand Down
Loading

0 comments on commit acc9433

Please sign in to comment.