Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

There are two routines that can be used to write out the field used in opal-cycl.

DUMPFIELDS: write out static magnetic field map on a Cartesian grid
DUMPEMFIELDS: write out electromagnetic field map on a 4D grid in space-time. Cartesian and cylindrical grids are supported.

1. DUMPFIELDS Command

The DUMPFIELDS statement causes opal-cycl to write out static magnetic field data on a 3D cartesian grid. The format of field output is:

<number of rows>
1 x [m]
2 y [m]
3 z [m]
4 Bx [kGauss]
5 By [kGauss]
6 Bz [kGauss]
0
<x0> <y0> <z0> <Bx0> <By0> <Bz0>
<x1> <y1> <z1> <Bx1> <By1> <Bz1>
...

The following attributes are enabled on the DUMPFIELDS statement:

FILE_NAME

Name of the file to which field data is dumped

X_START

Start point in the grid in x

DX

Grid step size in x

X_STEPS

Number of steps in x

Y_START

Start point in the grid in y

DY

Grid step size in y

Y_STEPS

Number of steps in y

Z_START

Start point in the grid in z

DZ

Grid step size in z

Z_STEPS

Number of steps in z

This example makes a field map in the midplane (x-y plane) only, starting at (x,y) = (0,0)_ m, with 101 steps in each direction and a stride of 0.1 m. z is always 0.

DUMPFIELDS, X_START=0., X_STEPS=101, DX=0.100,
            Y_START=0., Y_STEPS=101, DY=0.100,
            Z_START=0., Z_STEPS=1, DZ=0.100,
            FILE_NAME="FieldMapXY.dat";

2. DUMPEMFIELDS Command

The DUMPEMFIELDS statement causes opal-cycl to write out electromagnetic field data on a 4D grid. Grids in a Cartesian coordinate system (x,y,z,t) and a cylindrical coordinate system about the z-axis in (r,\phi,z,t) are supported.

In Cartesian mode the format of the field output is:

<number of rows>
1 x [m]
2 y [m]
3 z [m]
4 Bx [kGauss]
5 By [kGauss]
6 Bz [kGauss]
0
<field map data>
// would be nice if "steps" could be integer
itsAttr[0] = Attributes::makeReal
             ("X_START", "(Cartesian) Start point in the grid in x [mm]");
itsAttr[1] = Attributes::makeReal
             ("DX", "(Cartesian) Grid step size in x [mm]");
itsAttr[2] = Attributes::makeReal
             ("X_STEPS", "(Cartesian) Number of steps in x");
itsAttr[3] = Attributes::makeReal
             ("Y_START", "(Cartesian) Start point in the grid in y [mm]");
itsAttr[4] = Attributes::makeReal
             ("DY", "(Cartesian) Grid step size in y [mm]");
itsAttr[5] = Attributes::makeReal
             ("Y_STEPS", "(Cartesian) Number of steps in y");
itsAttr[6] = Attributes::makeReal
             ("Z_START", "Start point in the grid in z [mm]");
itsAttr[7] = Attributes::makeReal
             ("DZ", "Grid step size in z [mm]");
itsAttr[8] = Attributes::makeReal
             ("Z_STEPS", "Number of steps in z");
itsAttr[9] = Attributes::makeReal
             ("T_START", "Start point in the grid in time [ns]");
itsAttr[10] = Attributes::makeReal
             ("DT", "Grid step size in time [ns]");
itsAttr[11] = Attributes::makeReal
             ("T_STEPS", "Number of steps in time");
itsAttr[12] = Attributes::makeString
             ("FILE_NAME", "Name of the file to which field data is dumped");
itsAttr[13] = Attributes::makeString("COORDINATE_SYSTEM",
            "Choose to use 'Cartesian' or 'Cylindrical' coordinates");
itsAttr[14] = Attributes::makeReal
             ("R_START", "(Cylindrical) Start point in the grid in radius [mm]");
itsAttr[15] = Attributes::makeReal
             ("DR", "(Cylindrical) Grid step size in radius [mm]");
itsAttr[16] = Attributes::makeReal
             ("R_STEPS", "(Cylindrical) Number of steps in radius");
itsAttr[17] = Attributes::makeReal
             ("PHI_START", "(Cylindrical) Start point in the grid in phi [degree]");
itsAttr[18] = Attributes::makeReal
             ("DPHI", "(Cylindrical) Grid step size in phi [degree]");
itsAttr[19] = Attributes::makeReal
             ("PHI_STEPS", "(Cylindrical) Number of steps in phi");