# Define the system of units to use internally.
InternalUnitSystem:
  UnitMass_in_cgs:     1.9891E43   # 10^10 solar masses 
  UnitLength_in_cgs:   3.08567758E21   # 1 kpc 
  UnitVelocity_in_cgs: 1E5   # km/s
  UnitCurrent_in_cgs:  1   # Amperes
  UnitTemp_in_cgs:     1   # Kelvin

# Parameters for the self-gravity scheme
Gravity:
  MAC:                           adaptive  # Choice of mulitpole acceptance criterion: 'adaptive' OR 'geometric'.
  epsilon_fmm:                   0.001     # Tolerance parameter for the adaptive multipole acceptance criterion.
  theta_cr:                      0.7       # Opening angle for the purely gemoetric criterion.
  eta:          0.025               # Constant dimensionless multiplier for time integration.
  theta:        0.7                 # Opening angle (Multipole acceptance criterion).
  max_physical_DM_softening: 0.7    # Physical softening length (in internal units).
  max_physical_baryon_softening: 0.2  # Physical softening length (in internal units)

# Parameters governing the time integration (Set dt_min and dt_max to the same value for a fixed time-step run.)
TimeIntegration:
  time_begin:        0.    # The starting time of the simulation (in internal units).
  time_end:          1.    # The end time of the simulation (in internal units).
  dt_min:            1e-6  # The minimal time-step size of the simulation (in internal units).
  dt_max:            1e-2  # The maximal time-step size of the simulation (in internal units).

# Parameters governing the snapshots
Snapshots:
  basename:   output      # Common part of the name of output files
  time_first: 0.          # (Optional) Time of the first output if non-cosmological time-integration (in internal units)
  delta_time: 0.01        # Time difference between consecutive outputs (in internal units)

Scheduler:
  cell_extra_gparts: 100       # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
  cell_extra_sinks: 100       # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
  cell_extra_sparts: 100       # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.

# Parameters governing the conserved quantities statistics
Statistics:
  delta_time:           1e-1     # Time between statistics output
  time_first:             0.     # (Optional) Time of the first stats output if non-cosmological time-integration (in internal units)

# Parameters related to the initial conditions
InitialConditions:
  file_name:          lowres8.hdf5  # The file to read
  periodic:                    0    # Are we running with periodic ICs?
  stars_smoothing_length:     5e-2  # (Optional) Set the smoothing length of all the stars to this value (disabled by default).

# Parameters for the hydrodynamics scheme
SPH:
  resolution_eta:                    1.2348   # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel).
  CFL_condition:                     0.1      # Courant-Friedrich-Levy condition for time integration.
  use_mass_weighted_num_ngb:         0        # (Optional) Are we using the mass-weighted definition of the number of neighbours?
  h_tolerance:                       1e-4     # (Optional) Relative accuracy of the Netwon-Raphson scheme for the smoothing lengths.
  h_max:                             10.      # (Optional) Maximal allowed smoothing length in internal units. Defaults to FLT_MAX if unspecified.
  h_min_ratio:                       0.       # (Optional) Minimal allowed smoothing length in units of the softening. Defaults to 0 if unspecified.
  max_volume_change:                 1.4      # (Optional) Maximal allowed change of kernel volume over one time-step.
  max_ghost_iterations:              30       # (Optional) Maximal number of iterations allowed to converge towards the smoothing length.
  particle_splitting:                1        # (Optional) Are we splitting particles that are too massive (default: 0)
  particle_splitting_mass_threshold: 7e-4     # (Optional) Mass threshold for particle splitting (in internal units)
  generate_random_ids:               0        # (Optional) When creating new particles via splitting, generate ids at random (1) or use new IDs beyond the current range (0) (default: 0)
  initial_temperature:               0        # (Optional) Initial temperature (in internal units) to set the gas particles at start-up. Value is ignored if set to 0.
  minimal_temperature:               10       # (Optional) Minimal temperature (in internal units) allowed for the gas particles. Value is ignored if set to 0.
  H_mass_fraction:                   0.755    # (Optional) Hydrogen mass fraction used for initial conversion from temp to internal energy. Default value is derived from the physical constants.
  H_ionization_temperature:          1e4      # (Optional) Temperature of the transition from neutral to ionized Hydrogen for primoridal gas.
  viscosity_alpha:                   0.8      # (Optional) Override for the initial value of the artificial viscosity. In schemes that have a fixed AV, this remains as alpha throughout the run.
  viscosity_alpha_max:               2.0      # (Optional) Maximal value for the artificial viscosity in schemes that allow alpha to vary.
  viscosity_alpha_min:               0.1      # (Optional) Minimal value for the artificial viscosity in schemes that allow alpha to vary.
  viscosity_length:                  0.1      # (Optional) Decay length for the artificial viscosity in schemes that allow alpha to vary.
  diffusion_alpha:                   0.0      # (Optional) Override the initial value for the thermal diffusion coefficient in schemes with thermal diffusion.
  diffusion_beta:                    0.01     # (Optional) Override the decay/rise rate tuning parameter for the thermal diffusion.
  diffusion_alpha_max:               1.0      # (Optional) Override the maximal thermal diffusion coefficient that is allowed for a given particle.
  diffusion_alpha_min:               0.0      # (Optional) Override the minimal thermal diffusion coefficient that is allowed for a given particle.
 
# Hernquist potential parameters
HernquistPotential:
  useabspos:       0        # 0 -> positions based on centre, 1 -> absolute positions 
  position:        [0.,0.,0.]    # Location of centre of isothermal potential with respect to centre of the box (if 0) otherwise absolute (if 1) (internal units)
  idealizeddisk:   1        # Run with an idealized galaxy disk
  M200:            137.0   # M200 of the galaxy disk
  h:               0.704    # reduced Hubble constant (value does not specify the used units!)
  concentration:   9.0      # concentration of the Halo
  diskfraction:              0.040   # Disk mass fraction
  bulgefraction:              0.014   # Bulge mass fraction
  timestep_mult:   0.01     # Dimensionless pre-factor for the time-step condition, basically determines the fraction of the orbital time we use to do the time integration
  epsilon:         0.2      # Softening size (internal units)

DefaultSink:
  cut_off_radius: 0.1      # Cut off radius of all the sinks in internal units.

GEARSink:
  use_fixed_cut_off_radius: 1                 # Are we using a fixed cutoff radius? If we are, in GEAR the cutoff radius is fixed at the value specified below, and the sink smoothing length is fixed at this value divided by kernel_gamma. If not, the cutoff radius varies with the sink smoothing length as r_cut = h*kernel_gamma.
  cut_off_radius: 5e-3                        # Cut off radius of all the sinks in internal units. Ignored if use_fixed_cut_off_radius is 0. 
  f_acc: 1e-2
  temperature_threshold_K: 5e3               # Max temperature (in K) for forming a sink when density_threshold_Hpcm3 <= density <= maximal_density_threshold_Hpcm3.
  density_threshold_Hpcm3: 1e0               # Minimum gas density (in Hydrogen atoms/cm3) required to form a sink particle.
  maximal_density_threshold_Hpcm3: 1e5       # If the gas density exceeds this value (in Hydrogen atoms/cm3), a sink forms regardless of temperature if all other criteria are passed.
  stellar_particle_mass_Msun: 1e5            # Mass of the stellar particle representing the low mass stars, in solar mass
  minimal_discrete_mass_Msun: 30             # Minimal mass of stars represented by discrete particles, in solar mass
  stellar_particle_mass_first_stars_Msun: 1e5 # Mass of the stellar particle representing the low mass stars, in solar mass
  minimal_discrete_mass_first_stars_Msun: 30  # Minimal mass of stars represented by discrete particles, in solar mass
  star_spawning_sigma_factor: 0.5             # Factor to rescale the velocity dispersion of the stars when they are spawned. (Default: 0.2)
  sink_formation_contracting_gas_criterion: 1     # (Optional) Activate the contracting gas check for sink formation. (Default: 1)
  sink_formation_smoothing_length_criterion: 0    # (Optional) Activate the smoothing length check for sink formation. (Default: 1)
  sink_formation_jeans_instability_criterion: 1   # (Optional) Activate the two Jeans instability checks for sink formation. (Default: 1)
  sink_formation_bound_state_criterion: 1         # (Optional) Activate the bound state check for sink formation. (Default: 1)
  sink_formation_overlapping_sink_criterion: 1    # (Optional) Activate the overlapping sink check for sink formation. (Default: 1)
  disable_sink_formation: 0                       # (Optional) Disable sink formation. (Default: 0)

  # Timesteps parameters
  CFL_condition:                        0.5       # Courant-Friedrich-Levy condition for time integration.
  timestep_age_threshold_unlimited_Myr: 100.      # (Optional) Age above which sinks have no time-step restriction any more (in Mega-years). Defaults to 0.
  timestep_age_threshold_Myr:           25.       # (Optional) Age at which sink switch from young to old for time-stepping purposes (in Mega-years). Defaults to FLT_MAX.
  max_timestep_young_Myr:               0.5       # (Optional) Maximal time-step length of young sinks (in Mega-years). Defaults to FLT_MAX.
  max_timestep_old_Myr:                  1.       # (Optional) Maximal time-step length of old sinks (in Mega-years). Defaults to FLT_MAX.
  n_IMF:                                 2.       # (Optional) Number of times the IMF mass can be swallowed in a single timestep. (Default: FLTM_MAX)

GEARFeedback:
  supernovae_energy_erg: 1e51
  supernovae_efficiency: 0.1
  yields_table: POPIIsw.h5
  discrete_yields: 1
  yields_table_first_stars: POPIIsw.h5          # Table containing the yields of the first stars.
  metallicity_max_first_stars: -5                          # Maximal metallicity (in mass fraction) for a first star (-1 to deactivate).
  elements: [Fe, Mg, O, C, Al, Ca, Ba, Zn, Eu]             # Elements to read in the yields table. The number of element should be one less than the number of elements (N) requested during the configuration (--with-chemistry=GEAR_N).

GEARChemistry:
  initial_metallicity: 0
  scale_initial_metallicity: 0
