|
ROCK 1.10.0
Relativistic Oscillator Calculation Kit
|
BLAS is less used in electron trajectory calculations. For example, evaluating Lorentz force is the hotspot, whose first step is to calculate the Larmor radius using:
as well as other operations cannot be expressed in BLAS operations.
To be simple, data are stored in raw 1D vectors, which can be reshaped into multi-dimensional arrays. The following table contains the conventions of the variables which appear as arguments.
| Name | Type | Shape | Description |
|---|---|---|---|
| beam_init | real | [DIM_BEAM_INIT] | The statistic initial parameters of beams, see enum ROW_OF_BEAM_INIT. |
| bvn_blt_trj | real | [dim_b, DIM_BLT_TRJ, dim_z] | Beamlet trajectory, see enum ROWS_OF_BLT_TRJ |
| dim_b | size_t | scalar | Number of beamlets |
| dim_bcc | size_t | scalar | Dimension of radial grids for beam coupling coefficients |
| dim_m | size_t | scalar | Total number of modes |
| dim_z | size_t | scalar | Number of mesh nodes |
| mv_tdm_zk | real | [dim_m, DIM_TDM(dim_z)] | FEM matrix operation (Mz-Mk) for each mode |
| mvn_env | cplx | [dim_m, dim_z] | State of the envelope |
| mvn_losscoef | real | [dim_m, dim_z] | An array for incorporating Ohmic loss in the field equation. Summing over all (i.e., outer and inner) walls results in mvn_losscoef = ∑(mvn_uuload * (wall_radius / sqrt(vn_econd))[None, :]), whose unit = (Ω·m)⁻¹ same as electrical conductivity. |
| mvn_mod | real | [dim_m, DIM_MOD, dim_z] | Multi-mode collection of vn_mod |
| mvn_src | cplx | [dim_m, dim_z] | Excitation (source) for the envelope equation without FEM-weighting (Unit in TE-mode: V/m^2) |
| mvn_uuload | real | [dim_m, dim_z] | "Very" unscaled Ohmic load, unit = (Ω·m)^(-3⁄2)/m. Summing abs(mvn_env)^2 × mvn_uuload over modes results in vn_uload |
| num_azi | int16_t | scalar | Azimuth mode number, whose sign represents the co- and counter-rotation |
| num_rad | int16_t | scalar | Radial mode number, whose negative sign is reserved for TM-modes |
| nvmh_bcc | real | [dim_z, dim_bcc, dim_m, DIM_HARM] | The grid of beamlet coupling coefficients where the v axis is an equidistant grid of radial span |
| tdm_c | real | [DIM_TDM(dim_z)] | FEM matrix Mc |
| vm_bc | cplx | [DIM_BC, dim_m] | Boundary condition, see enum ROW_OF_BC |
| vm_bd | cplx | [DIM_BD, dim_m] | Boundary data, which is dU/dz at left and right boundaries, see enum ROW_OF_BD |
| vm_bp | real | [2, dim_m] | Boundary phases, for the transient updating of boundary condition, [0, :] are the left side while [1, :] are the right side |
| vm_cf | real | [dim_m] | Carrier frequency in Hz (caution: not omega!) |
| vm_cp | real | [dim_m] | Carrier phase in rad |
| vm_df | real | [dim_m] | Delta frequency (drift of carrier) in Hz |
| vm_num | int16_t | [2, dim_m] | [0, :] = vector of num_azi while [1, :] = vector of num_rad |
| vm_rfc | cplx | [dim_m] | (Complex) Resonance Frequency of Cold cavity |
| vn_blt_avg | real | [DIM_BLT_AVG, dim_z] | Averaged beamlet data at each node, see enum ROWS_OF_BLT_AVG |
| vn_econd | real | [dim_z] | Electrical conductivity along the 𝑧-axis, unit: (Ω·m)⁻¹ |
| vn_mod | real | [DIM_MOD, dim_z] | Parameters of a single mode along the 𝑧-discretization |
| vn_mrs | real | [dim_z] | Mesh Refinement Score of vn_z, a high value means the mesh is too coarse. The score at vn_mrs[i] indicates the mesh segment between vn_z[i] and vn_z[i+1] |
| vn_uload | real | [dim_z] | Unscaled Ohmic load: vn_uload = numpy.sum(abs(mvn_env)**2 × mvn_uuload, aixs=0). Then, vn_uload / sqrt(vn_econd) is the true load. |
| vn_z | real | [dim_z] | Nodes of 1D discretization of 𝑧-axis |
IMPORTANT We treat num_azi=0 as having the same effect as a positive num_azi. (This choice is flexible but must be consistent.)
Arguments are sorted in the order (skip the element if not applicable):