.. _physics-haloEnvironment: Halo Environment ================ Class providing models of the large-scale environment of dark matter halos---the linear and non-linear overdensity of the surrounding density field on a characteristic smoothing scale (typically several Mpc). Environmental overdensity modulates halo formation rates (assembly bias), the critical overdensity for collapse, and the :term:`IGM` photo-ionization background. Implementations provide the overdensity PDF/CDF, its value for individual nodes, and the radius and mean mass of the environmental region, ranging from a uniform (field) environment to constrained local density models. **Default implementation:** ``haloEnvironmentUniform`` Methods ------- ``overdensityLinear`` → ``double precision`` Return the linear (pre-collapse) large-scale environmental overdensity for the given ``node``, optionally evaluated at the present day rather than at the node's cosmic time. * ``type (treeNode), intent(inout) :: node`` * ``logical , intent(in ), optional :: presentDay`` ``overdensityLinearGradientTime`` → ``double precision`` Return the gradient with time of the environmental linear overdensity for the given ``node``. * ``type (treeNode), intent(inout) :: node`` ``overdensityNonLinear`` → ``double precision`` Return the non-linear (post-collapse) large-scale environmental overdensity for the given ``node``, accounting for gravitational non-linear evolution of the surrounding density field. * ``type(treeNode), intent(inout) :: node`` ``environmentRadius`` → ``double precision`` Return the radius (in Mpc) of the spherical region over which the large-scale density is averaged to define the halo environment. ``environmentMass`` → ``double precision`` Return the mean mass (in :math:`\mathrm{M}_\odot`) enclosed within the environmental smoothing region, equal to the background matter density times the volume of the sphere of radius ``environmentRadius``. ``overdensityLinearMinimum`` → ``double precision`` Return the minimum linear overdensity for which the environmental overdensity :term:`PDF` is non-zero. ``overdensityLinearMaximum`` → ``double precision`` Return the maximum linear overdensity for which the environmental overdensity :term:`PDF` is non-zero. ``pdf`` → ``double precision`` Return the :term:`PDF` of the environmental overdensity for the given overdensity. * ``double precision, intent(in ) :: overdensity`` ``cdf`` → ``double precision`` Return the :term:`CDF` of the environmental overdensity for the given overdensity. * ``double precision, intent(in ) :: overdensity`` ``overdensityLinearSet`` → ``void`` Set the linear environmental overdensity for the given ``node``, allowing external code (e.g., constrained realization samplers) to assign a specific large-scale density to the node's host region. * ``type (treeNode), intent(inout) :: node`` * ``double precision , intent(in ) :: overdensity`` ``overdensityIsSettable`` → ``logical`` Return true if the environmental overdensity can be set externally via ``overdensityLinearSet``, allowing the caller to determine at runtime whether the environment model supports direct assignment. ``volumeFractionOccupied`` → ``double precision`` Return the fraction of the volume occupied by the regions described by this environment. ``isNodeDependent`` → ``logical`` Return true if the environment is node dependent (but false if the only dependency on the node is via its host tree). ``isTreeDependent`` → ``logical`` Return true if the environmental overdensity depends on the host merger tree (i.e., on ``node%hostTree``), as opposed to depending only on the individual node or being completely node-independent. .. _physics-haloEnvironmentFixed: ``haloEnvironmentFixed`` ------------------------ Implements a halo environment with a fixed, user-specified overdensity, representing a deterministic large-scale density field around a halo. The environmental overdensity is set by ``[overdensity]``, while the filtering scale for variance computations is specified by either ``[radiusEnvironment]`` or the corresponding environmental mass ``[massEnvironment]``. **Parameters** * ``[overdensity]`` (real) — The fixed linear overdensity :math:`\delta` of the large-scale environment assigned uniformly to all halos; a positive value places halos in an overdense region, while negative values simulate voids. * ``[radiusEnvironment]`` (real; default ``0.0d0``) — The radius of the sphere used to determine the variance in the environmental density. * ``[massEnvironment]`` (real; default ``1.0d15``) — The mass within the sphere sphere used to determine the variance in the environmental density. .. _physics-haloEnvironmentLogNormal: ``haloEnvironmentLogNormal`` ---------------------------- Implements a halo environment in which the large-scale overdensity follows a log-normal probability distribution, modeling the statistical distribution of cosmic environments around dark matter halos. The variance of the density field is computed within a sphere of radius given by ``[radiusEnvironment]``, drawn from the linear power spectrum. **Parameters** * ``[radiusEnvironment]`` (real; default ``7.0d0``) — The radius of the sphere used to determine the variance in the environmental density. .. _physics-haloEnvironmentNormal: ``haloEnvironmentNormal`` ------------------------- Implements a halo environment in which the large-scale overdensity follows a Gaussian (normal) probability distribution, modeling the statistical distribution of cosmic large-scale density fields around dark matter halos. The filtering scale and redshift at which the environment is defined are set by ``[massEnvironment]`` or ``[radiusEnvironment]`` and ``[redshift]``. **Methods** * ``calculationReset`` — Reset memoized calculations. **Parameters** * ``[massEnvironment]`` (real; default ``1.0d15``) — The mass within the sphere sphere used to determine the variance in the environmental density. * ``[radiusEnvironment]`` (real; default ``7.0d0``) — The radius of the sphere used to determine the variance in the environmental density. * ``[redshift]`` (real; default ``0.0d0``) — The redshift at which the large-scale environmental overdensity is defined; the linear density variance and growth factor are evaluated at the corresponding cosmic time to normalize the Gaussian environmental PDF. .. _physics-haloEnvironmentUniform: ``haloEnvironmentUniform`` -------------------------- Implements a uniform halo environment. **(Default implementation)**