sarkas.core.Parameters#

class sarkas.core.Parameters(dic=None)[source]#

Class containing all the constants and physical constants of the simulation.

Parameters

dic (dict, optional) – Dictionary to be copied.

Variables
  • a_ws (float) – Wigner-Seitz radius. Calculated from the total_num_density .

  • equilibration_steps (int) – Total number of equilibration timesteps.

  • eq_dump_step (int) – Equilibration dump interval.

  • magnetization_steps (int) – Total number of magnetization timesteps.

  • mag_dump_step (int) – Magnetization dump interval.

  • production_steps (int) – Total number of production timesteps.

  • prod_dump_step (int) – Production dump interval.

  • box_volume (float) – Volume of simulation box.

  • pbox_volume (float) – Volume of initial particle box.

  • dimensions (int) – Number of non-zero dimensions. Default = 3.

  • fourpie0 (float) – Electrostatic constant \(4\pi \epsilon_0\).

  • num_species (int) – Number of species.

  • kB (float) – Boltzmann constant obtained from scipy.constants.

  • hbar (float) – Reduced Planck’s constant.

  • hbar2 (float) – Square of reduced Planck’s constant.

  • a0 (float) – Bohr Radius.

  • c0 (float) – Speed of light.

  • qe (float) – Elementary charge.

  • me (float) – Electron mass.

  • eps0 (float) – Vacuum electrical permittivity.

  • eV2K (float) – Conversion factor from eV to Kelvin obtained from scipy.constants.

  • J2erg (float) – Conversion factor from Joules to erg. Needed for cgs units.

  • QFactor (float) – Charge Factor defined as \(\mathcal Q = \sum_{i}^{N} q_{i}^2\) .

  • Lx (float) – Box length in the \(x\) direction.

  • Ly (float) – Box length in the \(y\) direction.

  • Lz (float) – Box length in the \(z\) direction.

  • e1 (float) – Unit vector in the \(x\) direction.

  • e2 (float) – Unit vector in the \(y\) direction.

  • e3 (float) – Unit vector in the \(z\) direction.

  • LPx (float) – Initial particle box length in the \(x\) direction.

  • LPy (float) – Initial particle box length in the \(y\) direction.

  • LPz (float) – Initial particle box length in the \(z\) direction.

  • ep1 (float) – Unit vector of the initial particle box in the \(x\) direction.

  • ep2 (float) – Unit vector of the initial particle box in the \(y\) direction.

  • ep3 (float) – Unit vector of the initial particle box in the \(z\) direction.

  • input_file (str) – YAML Input file with all the simulation’s parameters.

  • T_desired (float) – Target temperature for the equilibration phase.

  • species_num (numpy.ndarray) – Number of particles of each species. Shape = (num_species)

  • species_concentrations (numpy.ndarray) – Concentration of each species. Shape = (num_species)

  • species_temperatures (numpy.ndarray) – Initial temperature of each species. Shape = (num_species)

  • species_masses (numpy.ndarray) – Mass of each species. Shape = (num_species)

  • species_charges (numpy.ndarray) – Charge of each species. Shape = (num_species)

  • species_names (list) – Name of each species. Len = (num_species)

  • species_plasma_frequencies (numpy.ndarray) – Plasma Frequency of each species. Shape = (num_species)

  • species_num_dens (numpy.ndarray) – Number density of each species. Shape = (num_species)

  • total_ion_temperature (float) – Total initial ion temperature calculated as `` = species_concentration @ species_temperatures``.

  • total_net_charge (float) – Total charge in the system.

  • total_num_density (float) – Total number density. Calculated from the sum of Species.number_density.

  • total_num_ptcls (int) – Total number of particles. Calculated from the sum of Species.num.

  • measure (bool) – Flag for production phase.

  • verbose (bool) – Flag for screen output.

  • simulations_dir (str) – Name of directory where to store simulations.

  • job_dir (str) – Directory name of the current job/run

  • production_dir (str) – Directory name where to store simulation’s files of the production phase. Default = ‘Production’.

  • equilibration_dir (str) – Directory name where to store simulation’s file of the equilibration phase. Default = ‘Equilibration’.

  • preprocessing_dir (str) – Directory name where to store preprocessing files. Default = “PreProcessing”.

  • postprocessing_dir (str) – Directory name where to store postprocessing files. Default = “PostProcessing”.

  • prod_dump_dir (str) – Directory name where to store production phase’s simulation’s checkpoints. Default = ‘dumps’.

  • eq_dump_dir (str) – Directory name where to store equilibration phase’s simulation’s checkpoints. Default = ‘dumps’.

  • job_id (str) – Appendix of all simulation’s files.

  • log_file (str) – Filename of the simulation’s log.

  • np_per_side (numpy.ndarray) – Number of particles per simulation’s box side. The product of its components should be equal to total_num_ptcls.

  • pre_run (bool) – Flag for preprocessing phase.

Methods

Parameters.__init__([dic])

Parameters.calc_coupling_constant(species)

Calculate the coupling constant of each species and the total coupling constant.

Parameters.calc_electron_properties(species)

Check whether the electrons are a dynamical species or not.

Parameters.calc_magnetic_parameters(species)

Calculate cyclotron frequency in case of a magnetized simulation.

Parameters.calc_parameters(species)

Assign the parsed parameters.

Parameters.check_units()

Adjust default physical constants for cgs unit system and check for LJ potential.

Parameters.create_species_arrays(species)

Get species information into arrays for the postprocessing part.

Parameters.from_dict(input_dict)

Update attributes from input dictionary.

Parameters.pretty_print()

Print simulation parameters in a user-friendly way.

Parameters.set_species_attributes(species)

Set species attributes that have not been defined in the input file.

Parameters.setup(species)

Setup simulations' parameters.

Parameters.sim_box_setup()

Calculate initial particle's and simulation's box parameters.