analysis_modules.eigenmode.SLANS package

Subpackages

Submodules

analysis_modules.eigenmode.SLANS.geometry_manual module

class analysis_modules.eigenmode.SLANS.geometry_manual.Geometry(win=None)[source]

Bases: object

Methods

set_geom_parameters

set_geom_parameters_multicell

write_cst_paramters

write_cst_paramters_mid

set_geom_parameters(n_cells, mid_cells_par=None, l_end_cell_par=None, r_end_cell_par=None, beampipes=None)[source]
set_geom_parameters_multicell(n_cells, mid_cells_par=None, l_end_cell_par=None, r_end_cell_par=None, beampipes=None)[source]
write_cst_paramters(fid)[source]
write_cst_paramters_mid(fid)[source]
analysis_modules.eigenmode.SLANS.geometry_manual.print_(*arg)[source]

analysis_modules.eigenmode.SLANS.slansTuner module

class analysis_modules.eigenmode.SLANS.slansTuner.SLANSTune(parentDir, projectDir)[source]

Bases: object

Methods

calculate_li

end_cell_tune

mid_cell_tune

read_tuned_data

read_tuned_data_end

write_beta_end_Tune

write_beta_mid_Tune

write_geometry_parameters_end_tune

write_geometry_parameters_mid_tune

calculate_li(A, B, a, b, Ri, L, Req, L_bp)[source]
end_cell_tune(par_in, par_out, freq0, proc, f_shift=0, n_modes=1, beta=1)[source]
mid_cell_tune(A, B, a, b, Ri, L, Req_0, freq0, proc=0, f_shift=0, n_modes=1, beta=1)[source]
read_tuned_data()[source]
read_tuned_data_end()[source]
write_beta_end_Tune(beta, f_shift, n_modes)[source]
write_beta_mid_Tune(beta, f_shift, n_modes)[source]
write_geometry_parameters_end_tune(par_in, par_out)[source]
write_geometry_parameters_mid_tune(A, B, a, b, Req0, Rbp, L)[source]

analysis_modules.eigenmode.SLANS.slans_Req_tune_par module

analysis_modules.eigenmode.SLANS.slans_code module

class analysis_modules.eigenmode.SLANS.slans_code.SLANS(left_beam_pipe, left_end_cell, mid_cell, right_end_cell, right_beam_pipe, jxy_all, jxy_all_bp)[source]

Bases: object

This class contains functions for writing the cavity geometry in a format readable by SLANS genmesh.exe The type of cavity geometry it writes is regular elliptical cavity geometry with mid-cup dimensions equal and end cups different. Geometry type shown in the figure below:

Cavity parametrised model

Note

Considering renaming to better reflect this purpose.

Methods

rz_conjug(cell)

Calculate shift in geoemetric values

slans_M(n, zr12_M, WG_L, f, i, end_type)

Writes the mid cup dimensions to a geometry file

slans_bp_L(n, zr12_BPL, WG_L, f)

Writes the left beam pipe dimensions to a geometry file

slans_bp_R(n, zr12_BPR, WG_L, f)

Writes the right beam pipe dimensions to a geometry file

slans_n1_L(n, zr12_L, WG_L, f)

Writes the left end cup dimensions to a geometry file

slans_n1_R(n, zr12_R, WG_L, f)

Writes the right end cup dimensions to a geometry file

rz_conjug(cell)[source]

Calculate shift in geoemetric values

Parameters

cell ({"left", "right", "mid"}) – Specifies the cell cup type.

Returns

  • zr12 (list) – Maybe it’s a shift of some sort calculated from the coordinates of the tangent of the ellipses comprising the cavity

  • alpha (float) – Angle of the line tangent to the iris and equator ellipses.

slans_M(n, zr12_M, WG_L, f, i, end_type)[source]

Writes the mid cup dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells.

  • zr12_M (list, array like) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

  • i (int) – Cell index

  • end_type (int) – if end_type = 1 the end HALF cell is changed for tuning. I don’t know what this means. Never had need for it.

Note

Consider renaming zr12_R to reflect what the variable is.

slans_bp_L(n, zr12_BPL, WG_L, f)[source]

Writes the left beam pipe dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells

  • zr12_BPL (list, array like) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

Note

Consider renaming zr12_BPL to reflect what the variable is. Variable n is unused by the function. Consider removing

slans_bp_R(n, zr12_BPR, WG_L, f)[source]

Writes the right beam pipe dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells.

  • zr12_BPR (list, array like) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

Note

Consider renaming zr12_BPR to reflect what the variable is.

slans_n1_L(n, zr12_L, WG_L, f)[source]

Writes the left end cup dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells.

  • zr12_L

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

Note

Consider renaming zr12_R to reflect what the variable is. Variable n is unused by the function. Consider removing

slans_n1_R(n, zr12_R, WG_L, f)[source]

Writes the right end cup dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells.

  • zr12_R (list, array like) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

Note

Consider renaming zr12_R to reflect what the variable is.

class analysis_modules.eigenmode.SLANS.slans_code.SLANS_Flattop(left_beam_pipe, left_end_cell, mid_cell, right_end_cell, right_beam_pipe, jxy_all, jxy_all_bp)[source]

Bases: object

This class contains functions for writing the cavity geometry in a format readable by SLANS genmesh.exe The type of cavity geometry it writes is regular elliptical cavity geometry with mid-cup dimensions equal and end cups different. Geometry type shown in the figure below:

Cavity parametrised model

Note

Considering renaming to better reflect this purpose.

Methods

rz_conjug(cell)

Calculate shift in geoemetric values

slans_M(n, zr12_M, WG_L, f, i, end_type)

Writes the left beam pipe dimensions to a geometry file

slans_bp_L(n, zr12_BPL, WG_L, f)

Writes the left beam pipe dimensions to a geometry file

slans_bp_R(n, zr12_BPR, WG_L, f)

Writes the left beam pipe dimensions to a geometry file

slans_n1_L(n, zr12_L, WG_L, f)

Writes the left beam pipe dimensions to a geometry file

slans_n1_R(n, zr12_R, WG_L, f)

Writes the left beam pipe dimensions to a geometry file

rz_conjug(cell)[source]

Calculate shift in geoemetric values

Parameters

cell ({"left", "right", "mid"}) – Specifies the cell cup type.

Returns

  • zr12 (list) – Maybe it’s a shift of some sort calculated from the coordinates of the tangent of the ellipses comprising the cavity

  • alpha (float) – Angle of the line tangent to the iris and equator ellipses.

slans_M(n, zr12_M, WG_L, f, i, end_type)[source]

Writes the left beam pipe dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells.

  • zr12_M (float) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

  • i (int) – Cell index

  • end_type (int) – if end_type = 1 the end HALF cell is changed for tuning. I don’t know what this means. Never had need for it.

Note

Consider renaming zr12_R to reflect what the variable is.

slans_bp_L(n, zr12_BPL, WG_L, f)[source]

Writes the left beam pipe dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells

  • zr12_BPL (float) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

Note

Consider renaming zr12_BPL to reflect what the variable is. Variable n is unused by the function. Consider removing

slans_bp_R(n, zr12_BPR, WG_L, f)[source]

Writes the left beam pipe dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells.

  • zr12_BPR (float) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

Note

Consider renaming zr12_BPR to reflect what the variable is.

slans_n1_L(n, zr12_L, WG_L, f)[source]

Writes the left beam pipe dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells.

  • zr12_L (float) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

Note

Consider renaming zr12_R to reflect what the variable is. Variable n is unused by the function. Consider removing

slans_n1_R(n, zr12_R, WG_L, f)[source]

Writes the left beam pipe dimensions to a geometry file

Parameters
  • n (int) – Number of cavity cells.

  • zr12_R (float) –

  • WG_L (float) – Length of left beam pipe

  • f (file) – Geometry <filename>.geo file to be written to

Note

Consider renaming zr12_R to reflect what the variable is.

class analysis_modules.eigenmode.SLANS.slans_code.SLANS_Multicell(left_beam_pipe, left_end_cell, mid_cell, right_end_cell, right_beam_pipe, jxy_all, jxy_all_bp)[source]

Bases: object

Methods

rz_conjug(cell)

Calculate shift in geoemetric values

slans_M

slans_bp_L

slans_bp_R

slans_n1_L

slans_n1_R

rz_conjug(cell)[source]

Calculate shift in geoemetric values

Parameters

cell ({"left", "right", "mid"}) – Specifies the cell cup type.

Returns

  • zr12 (list) – Maybe it’s a shift of some sort calculated from the coordinates of the tangent of the ellipses comprising the cavity

  • alpha (float) – Angle of the line tangent to the iris and equator ellipses.

slans_M(n, zr12_M, WG_L, f, i, end_type)[source]
slans_bp_L(n, zr12_BPL, WG_L, f)[source]
slans_bp_R(n, zr12_BPR, WG_L, f)[source]
slans_n1_L(zr12_L, WG_L, f)[source]
slans_n1_R(n, zr12_R, WG_L, f)[source]
class analysis_modules.eigenmode.SLANS.slans_code.SLANS_Multicell_full(left_beam_pipe, left_end_cell, mid_cell, right_end_cell, right_beam_pipe, jxy_all, jxy_all_bp)[source]

Bases: object

This class contains functions for writing the cavity geometry in a format readable by SLANS genmesh.exe Considering renaming to better reflect this purpose

The type of cavity geometry it writes is a fully parametrised elliptical cavity geometry with every mid-cup and end cup having separate dimensions.

Methods

rz_conjug

slans_M

slans_bp_L

slans_bp_R

slans_n1_L

slans_n1_R

rz_conjug(cell, i=0)[source]
slans_M(n, zr12_M, WG_L, f, i, end_type)[source]
slans_bp_L(n, zr12_BPL, WG_L, f)[source]
slans_bp_R(n, zr12_BPR, WG_L, f)[source]
slans_n1_L(zr12_L, WG_L, f)[source]
slans_n1_R(n, zr12_R, WG_L, f)[source]

analysis_modules.eigenmode.SLANS.slans_geom_par module

class analysis_modules.eigenmode.SLANS.slans_geom_par.SLANSGeometry(win=None)[source]

Bases: Geometry

Methods

cavity

createFolder

set_geom_parameters

set_geom_parameters_multicell

write_cst_paramters

write_cst_paramters_mid

write_dtr

cavity(no_of_cells=1, no_of_modules=1, mid_cells_par=None, l_end_cell_par=None, r_end_cell_par=None, fid=None, bc=33, f_shift='default', beta=1, n_modes=2, proc=0, beampipes=None, parentDir=None, projectDir=None)[source]
createFolder()[source]
write_dtr(path, filename, beta, f_shift, n_modes)[source]

analysis_modules.eigenmode.SLANS.slans_geometry module

class analysis_modules.eigenmode.SLANS.slans_geometry.SLANSGeometry(win=None)[source]

Bases: Geometry

Methods

cavity([no_of_cells, no_of_modules, ...])

Write geometry file and run eigenmode analysis with SLANS

button_clicked

cavity_multicell

cavity_multicell_full

createFolder

get_axis_field_data

set_geom_parameters

set_geom_parameters_multicell

write_cst_paramters

write_cst_paramters_mid

write_dtr

static button_clicked(i)[source]
cavity(no_of_cells=1, no_of_modules=1, mid_cells_par=None, l_end_cell_par=None, r_end_cell_par=None, fid=None, bc=33, f_shift='default', beta=1, n_modes=None, beampipes='None', parentDir=None, projectDir=None, subdir='')[source]

Write geometry file and run eigenmode analysis with SLANS

Parameters
no_of_cells: int

Number of cells

no_of_modules: int

Number of modules

mid_cells_par: list, array like

Mid cell geometric parameters -> [A, B, a, b, Ri, L, Req, alpha]

l_end_cell_par: list, array like

Left end cell geometric parameters -> [A_el, B_el, a_el, b_el, Ri_el, L_el, Req, alpha_el]

r_end_cell_par: list, array like

Right end cell geometric parameters -> [A_er, B_er, a_er, b_er, Ri_er, L_er, Req, alpha_er]

fid: int, str

File id

bc: int

Boundary condition -> 1:inner contour, 2:Electric wall Et = 0, 3:Magnetic Wall En = 0, 4:Axis, 5:metal

f_shift: float

Eigenvalue frequency shift

beta: int, float

Velocity ratio :math: `beta =

rac{v}{c}`
n_modes: int

Number of modes

beampipes: {“left”, “right”, “both”, “none”}

Specify if beam pipe is on one or both ends or at no end at all

parentDir: str

Parent directory

projectDir: str

Project directory

subdir: str

Sub directory to save simulation results to

Returns
cavity_multicell(no_of_modules=1, cells_par=None, fid=None, bc=33, f_shift='default', beta=1, n_modes=None, beampipes='None', parentDir=None, projectDir=None, subdir='')[source]
cavity_multicell_full(no_of_modules=1, cells_par=None, fid=None, bc=33, f_shift='default', beta=1, n_modes=None, beampipes='None', parentDir=None, projectDir=None, subdir='')[source]
static createFolder(fid, projectDir, subdir='')[source]
static get_axis_field_data(folder, mode)[source]
static write_dtr(path, filename, beta, f_shift, n_modes)[source]
analysis_modules.eigenmode.SLANS.slans_geometry.print_(*arg)[source]

analysis_modules.eigenmode.SLANS.slans_mpi module

analysis_modules.eigenmode.SLANS.slans_mpi_MP module

analysis_modules.eigenmode.SLANS.slans_mpi_MP.print_(*arg)[source]
analysis_modules.eigenmode.SLANS.slans_mpi_MP.run_MP()[source]
analysis_modules.eigenmode.SLANS.slans_mpi_MP.run_sequential(n_cells, n_modules, processor_shape_space, n_modes, f_shift, parentDir, projectDir)[source]

analysis_modules.eigenmode.SLANS.slans_par_run module

class analysis_modules.eigenmode.SLANS.slans_par_run.SLANSPar[source]

Bases: object

Methods

run

run()[source]

Module contents