.. _physics-virialDensityContrast: Virial Density Contrasts ======================== Class providing dark matter halo virial mean density contrasts, :math:`\Delta_\mathrm{vir}`. The virial radius of a halo is defined as the radius within which the mean enclosed density equals :math:`\Delta_\mathrm{vir}` times the background matter density (or critical density, depending on convention). Different cosmologies and spherical-collapse approximations lead to different values of :math:`\Delta_\mathrm{vir}(z)`. **Default implementation:** ``virialDensityContrastSphericalCollapseClsnlssMttrCsmlgclCnstnt`` Methods ------- ``densityContrast`` → ``double precision`` Returns the virial density contrast at the given epoch. * ``double precision, intent(in ) :: mass`` * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsing`` ``densityContrastRateOfChange`` → ``double precision`` Returns the rate of change of virial density contrast at the given epoch. * ``double precision, intent(in ) :: mass`` * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsing`` ``turnAroundOverVirialRadii`` → ``double precision`` Returns the ratio of turnaround and virial radii at the given epoch. * ``double precision, intent(in ) :: mass`` * ``double precision, intent(in ), optional :: time , expansionFactor`` * ``logical , intent(in ), optional :: collapsing`` ``isMassDependent`` → ``logical`` Returns true if the virial density contrast is mass-dependent. .. _physics-virialDensityContrastBryanNorman1998: ``virialDensityContrastBryanNorman1998`` ---------------------------------------- A dark matter halo virial density contrast class using the fitting functions given by :cite:t:`bryan_statistical_1998`. As such, it is valid only for :math:`\Omega_\Lambda=0` or :math:`\Omega_\mathrm{M}+\Omega_\Lambda=1` cosmologies and will either abort on other cosmologies (if ``[allowUnsupportedCosmology]=false``), or revert to a numerical solution from top-hat collapse (if ``[allowUnsupportedCosmology]=true``). **Parameters** * ``[allowUnsupportedCosmology]`` (boolean; default ``.false.``) — If true, unsupported cosmologies revert to using a numerical solution from the top-hat collapse model. Otherwise, unsupported cosmologies result in an error. .. _physics-virialDensityContrastFixed: ``virialDensityContrastFixed`` ------------------------------ A dark matter halo virial density contrast class which uses a fixed virial density contrast of ``[densityContrastValue]``, defined relative to ``critical`` or ``mean`` density as specified by ``[densityType]``. **Parameters** * ``[densityContrastValue]`` (real; default ``200.0d0``) — The virial density contrast to use in the fixed value model. * ``[densityType]`` (string; one of ``critical``, ``mean``; default ``critical``) — The reference density to use in the fixed value virial density contrast model. Either of ``critical`` and ``mean`` are allowed. * ``[turnAroundOverVirialRadius]`` (real; default ``2.0d0``) — The ratio of the turnaround to virial radii in the fixed value model. .. _physics-virialDensityContrastFriendsOfFriends: ``virialDensityContrastFriendsOfFriends`` ----------------------------------------- Dark matter halo virial density contrasts based on the friends-of-friends algorithm linking length. The virial density contrast is computed consistent with a given friends-of-friends algorithm linking length. According to :cite:t:`lacey_merger_1994`, the friends-of-friends algorithm selects objects bounded by an isodensity contour of density contrast .. math:: \Delta_\mathrm{iso} = {3 \over 2 \pi b^3}, where :math:`b=`\ ``[virialDensityContrastFoFLinkingLength]`` is the dimensionless linking length of the algorithm (i.e. the linking length in units of the mean interparticle spacing). The virial density contrast is then given by: .. math:: \Delta_\mathrm{vir} = {\bar{\rho}_\mathrm{vir} \over \rho(r_\mathrm{vir})} \Delta_\mathrm{iso}, where :math:`\bar{\rho}_\mathrm{vir}` is the mean density inside the virial radius and :math:`\rho(r_\mathrm{vir})` is the density at the virial radius. The ratio :math:`\bar{\rho}_\mathrm{vir} / \rho(r_\mathrm{vir})` is specified via the parameter ``[virialDensityContrastFoFDensityRatio]``. Its default value of :math:`4.688` is appropriate for an :term:`NFW` halo of concentration :math:`c=6.88` which is the concentration found by :cite:t:`prada_halo_2011` for halos with :math:`\sigma=1.686` which is the approximate critical overdensity for collapse). **Parameters** * ``[linkingLength]`` (real; default ``0.2d0``) — The friends-of-friends linking length algorithm to use in computing virial density contrast. * ``[densityRatio]`` (real; default ``4.688d0``) — The ratio of mean virial density to density at the virial radius to assume when setting virial density contrasts in the friends-of-friends model. .. _physics-virialDensityContrastKitayamaSuto1996: ``virialDensityContrastKitayamaSuto1996`` ----------------------------------------- A virial density contrast class using the fitting formula of :cite:t:`kitayama_semianalytic_1996`, and so is valid only in flat cosmological models (an error will be reported in non-flat models). Specifically, .. math:: \Delta_\mathrm{virial}(t) = 18 \pi^2 [1+0.4093 \left\{{1\over \Omega_\mathrm{matter}(t)}-1\right\}(t)^{0.9052}]. .. _physics-virialDensityContrastPercolation: ``virialDensityContrastPercolation`` ------------------------------------ A dark matter halo virial density contrast class based on the percolation analysis of :cite:t:`more_overdensity_2011`. The virial density contrast is computed to be consistent with a given friends-of-friends algorithm linking length using the percolation-theory-motivated calibration of :cite:t:`more_overdensity_2011`. Specifically, the friends-of-friends algorithm is assumed to link together particles forming an isodensity surface of density :math:`\rho = \bar{\rho} n_\mathrm{c}/b^3`, where :math:`\bar{\rho}` is the mean density of the universe, :math:`n_\mathrm{c}=0.652960` is a critical density for percolation as given by :cite:t:`more_overdensity_2011`, and :math:`b` is the linking length. Given this bounding density, the virial density contrast is found by requiring that the halo contain the required mass within such a bounding density, given the halo density profile. **Methods** * ``tabulate`` — Tabulate the virial density contrast as a function of mass and time. * ``restoreTable`` — Restore a tabulated solution from file. * ``storeTable`` — Store a tabulated solution to file. **Parameters** * ``[linkingLength]`` (real; default ``0.2d0``) — The friends-of-friends linking length to use in computing virial density contrasts with the percolation analysis of :cite:t:`more_overdensity_2011`. .. _physics-virialDensityContrastSphericalCollapseBrynsDrkMttrDrkEnrgy: ``virialDensityContrastSphericalCollapseBrynsDrkMttrDrkEnrgy`` -------------------------------------------------------------- Dark matter halo virial density contrasts based on the spherical collapse in a matter plus cosmological constant universe. **Methods** * ``retabulate`` — Tabulate spherical collapse critical overdensity. **Parameters** * ``[tableStore]`` (boolean; default ``.true.``) — If true, store the tabulated spherical collapse solutions to a file and restore them on subsequent runs to avoid recomputing the numerical ODE integration from scratch. * ``[energyFixedAt]`` (string; one of ``undefined``, ``turnaround``, ``virialization``; default ``turnaround``) — Selects the epoch at which the energy of a spherical top hat perturbation in a dark energy cosmology should be "fixed" for the purposes of computing virial density contrasts. (See the discussion in :cite:author:`percival_cosmological_2005` :cite:year:`percival_cosmological_2005`; Section 8.) * ``[tablePointsPerOctave]`` (integer; default ``300``) — The number of evenly-spaced tabulation points per octave of cosmic time used when building the look-up table of spherical collapse critical overdensity vs.\ time; higher values give greater interpolation accuracy at the cost of longer initialization time. .. _physics-virialDensityContrastSphericalCollapseClsnlssMttrCsmlgclCnstnt: ``virialDensityContrastSphericalCollapseClsnlssMttrCsmlgclCnstnt`` ------------------------------------------------------------------ A class implementing dark matter halo virial density contrasts based on the spherical collapse model in a universe which contains collisionless matter and a cosmological constant (see, for example, :cite:author:`percival_cosmological_2005` :cite:year:`percival_cosmological_2005`). **(Default implementation)** **Methods** * ``retabulate`` — Tabulate spherical collapse critical overdensity. **Parameters** * ``[tableStore]`` (boolean; default ``.true.``) — If true, store the tabulated spherical collapse solutions to a file and restore them on subsequent runs to avoid recomputing the numerical ODE integration from scratch. .. _physics-virialDensityContrastSphericalCollapseClsnlssMttrDrkEnrgy: ``virialDensityContrastSphericalCollapseClsnlssMttrDrkEnrgy`` ------------------------------------------------------------- Dark matter halo virial density contrasts based on the spherical collapse in a matter plus dark energy universe. **Parameters** * ``[tableStore]`` (boolean; default ``.true.``) — If true, store the tabulated spherical collapse solutions to a file and restore them on subsequent runs to avoid recomputing the numerical ODE integration from scratch. * ``[energyFixedAt]`` (string; one of ``undefined``, ``turnaround``, ``virialization``; default ``turnaround``) — Selects the epoch at which the energy of a spherical top hat perturbation in a dark energy cosmology should be "fixed" for the purposes of computing virial density contrasts. (See the discussion in :cite:author:`percival_cosmological_2005` :cite:year:`percival_cosmological_2005`; Section 8.)