.. _physics-massDistribution: Mass Distributions ================== Class providing mass distributions---fully general descriptions of the spatial distribution of mass (dark matter, gas, stars, or black holes) in a galaxy or halo. Implementations provide the density profile :math:`\rho(\mathbf{x})`, gravitational potential :math:`\Phi(\mathbf{x})`, enclosed mass :math:`M(r)`, surface density, rotation curve, and velocity dispersion via the Jeans equation. The class also tracks the component and mass type of the distribution and supports arbitrary geometries, enabling self-consistent multi-component dynamical models of galaxies and halos. Methods ------- ``setKinematicsDistribution`` → ``void`` Set the kinematics distribution for this mass distribution. * ``class(kinematicsDistributionClass), intent(in ) :: kinematicsDistribution_`` ``kinematicsDistribution`` → ``class(kinematicsDistributionClass)`` Get a pointer to the kinematics distribution for this mass distribution. ``setTypes`` → ``void`` Set the component and mass types of the mass distribution. * ``type(enumerationComponentTypeType), intent(in ), optional :: componentType`` * ``type(enumerationMassTypeType ), intent(in ), optional :: massType`` ``subset`` → ``class(massDistributionClass)`` Return the subset of the mass distribution matching the given componentType and ``massType``. * ``type(enumerationComponentTypeType), intent(in ), optional :: componentType`` * ``type(enumerationMassTypeType ), intent(in ), optional :: massType`` ``describe`` → ``void`` Display a description of the mass distribution. ``matches`` → ``logical`` Return true if this mass distribution matches the specified component and mass type. * ``type(enumerationComponentTypeType), intent(in ), optional :: componentType`` * ``type(enumerationMassTypeType ), intent(in ), optional :: massType`` ``symmetry`` → ``type(enumerationMassDistributionSymmetryType)`` Return the symmetry of the distribution. ``isSphericallySymmetric`` → ``logical`` Return true if the distribution is spherically symmetric. ``assumeMonotonicDecreasingSurfaceDensity`` → ``logical`` Return true if the distribution can be assumed to have a monotonically decreasing surface density. ``isDimensionless`` → ``logical`` Return true if the distribution is dimensionless. ``massTotal`` → ``double precision`` Return the total mass of the distribution. ``acceleration`` → ``double precision, dimension(3)`` Return the gravitational acceleration due to the distribution at the given coordinates. * ``class(coordinate), intent(in ) :: coordinates`` ``tidalTensor`` → ``type(tensorRank2Dimension3Symmetric)`` Return the gravitational tidal tensor due to the distribution at the given coordinates. * ``class(coordinate), intent(in ) :: coordinates`` ``density`` → ``double precision`` Return the density of the distribution at the given coordinates. * ``class(coordinate), intent(in ) :: coordinates`` ``densitySphericalAverage`` → ``double precision`` Return the average density on a spherical shell of the given radius. * ``double precision, intent(in ) :: radius`` ``densityGradientRadial`` → ``double precision`` Return the radial gradient of density of the distribution at the given coordinates. * ``class (coordinate), intent(in ) :: coordinates`` * ``logical , intent(in ), optional :: logarithmic`` ``potential`` → ``double precision`` Return the gravitational potential of the distribution at the given coordinates. * ``class(coordinate ), intent(in ) :: coordinates`` * ``type (enumerationStructureErrorCodeType), intent( out), optional :: status`` ``potentialIsAnalytic`` → ``logical`` Return true if the gravitational potential for this distribution has an analytic form. ``potentialDifference`` → ``double precision`` Return the difference in that gravitational potential of the distribution between the given coordinates. * ``class(coordinate ), intent(in ) :: coordinates1, coordinates2`` * ``type (enumerationStructureErrorCodeType), intent( out), optional :: status`` ``potentialDifferenceNumerical`` → ``double precision`` Return the difference in that gravitational potential of the distribution between the given coordinates using a numerical calculation. * ``class(coordinate ), intent(in ) :: coordinates1, coordinates2`` * ``type (enumerationStructureErrorCodeType), intent( out), optional :: status`` ``massEnclosedBySphere`` → ``double precision`` Return the mass enclosed in the distribution by a sphere of given radius. * ``double precision, intent(in ) :: radius`` ``massEnclosedByCylinder`` → ``double precision`` Return the mass enclosed in the distribution by a cylinder of given radius. * ``double precision, intent(in ) :: radius`` ``radiusEnclosingMass`` → ``double precision`` Return the radius enclosing a specified mass. * ``double precision, intent(in ), optional :: mass, massFractional`` ``radiusEnclosingMassNumerical`` → ``double precision`` Return the radius enclosing a specified mass using a numerical calculation. * ``double precision, intent(in ), optional :: mass, massFractional`` ``radiusCylindricalEnclosingMass`` → ``double precision`` Return the cylindrical radius enclosing a specified mass. * ``double precision, intent(in ), optional :: mass, massFractional`` ``radiusCylindricalEnclosingMassNumerical`` → ``double precision`` Return the cylindrical radius enclosing a specified mass using a numerical calculation. * ``double precision, intent(in ), optional :: mass, massFractional`` ``radiusEnclosingDensity`` → ``double precision`` Return the radius enclosing a specified density. * ``double precision, intent(in ) :: density`` * ``double precision, intent(in ), optional :: radiusGuess`` ``radiusEnclosingDensityNumerical`` → ``double precision`` Return the radius enclosing a specified density using a numerical calculation. * ``double precision, intent(in ) :: density`` * ``double precision, intent(in ), optional :: radiusGuess`` ``radiusEnclosingSurfaceDensity`` → ``double precision`` Return the radius enclosing a specified surface density. * ``double precision, intent(in ) :: densitySurface`` * ``double precision, intent(in ), optional :: radiusGuess`` ``radiusEnclosingSurfaceDensityNumerical`` → ``double precision`` Return the radius enclosing a specified surface density using a numerical calculation. * ``double precision, intent(in ) :: densitySurface`` * ``double precision, intent(in ), optional :: radiusGuess`` ``radiusFromSpecificAngularMomentum`` → ``double precision`` Return the radius corresponding to a given specific angular momentum. * ``double precision, intent(in ) :: angularMomentumSpecific`` ``radiusFromSpecificAngularMomentumNumerical`` → ``double precision`` Return the radius corresponding to a given specific angular momentum using a numerical calculation. * ``double precision, intent(in ) :: angularMomentumSpecific`` ``rotationCurve`` → ``double precision`` Return the rotation curve at the given radius. * ``double precision, intent(in ) :: radius`` ``rotationCurveGradient`` → ``double precision`` Return the rotation curve gradient, :math:`\mathrm{d}V^2/\mathrm{d}r`, at the given radius. * ``double precision, intent(in ) :: radius`` ``velocityRotationCurveMaximum`` → ``double precision`` Return the maximum velocity in the rotation curve. ``radiusRotationCurveMaximum`` → ``double precision`` Return the radius of the maximum velocity in the rotation curve. ``radiusRotationCurveMaximumNumerical`` → ``double precision`` Return the radius of the maximum velocity in the rotation curve. ``surfaceDensity`` → ``double precision`` Return the surface density at the given coordinates. * ``class(coordinate), intent(in ) :: coordinates`` ``surfaceDensityRadialMoment`` → ``double precision`` Return the surface density at the given coordinates. * ``double precision, intent(in ) :: moment`` * ``double precision, intent(in ), optional :: radiusMinimum, radiusMaximum`` * ``logical , intent( out), optional :: isInfinite`` ``densityRadialMoment`` → ``double precision`` Return the radial moment of the distribution. * ``double precision, intent(in ) :: moment`` * ``double precision, intent(in ), optional :: radiusMinimum, radiusMaximum`` * ``logical , intent( out), optional :: isInfinite`` ``densitySquareIntegral`` → ``double precision`` Return the integral over the square of the density of the distribution. * ``double precision, intent(in ), optional :: radiusMinimum, radiusMaximum`` * ``logical , intent( out), optional :: isInfinite`` ``chandrasekharIntegral`` → ``double precision, dimension(3)`` Return the Chandrasekhar integral of the distribution. * ``class (massDistributionClass), intent(inout) :: massDistributionEmbedding, massDistributionPerturber`` * ``double precision , intent(in ) :: massPerturber`` * ``class (coordinate ), intent(in ) :: coordinates , velocity`` ``radiusFreefall`` → ``double precision`` Return the radius at which the freefall time to the center equals the given ``time``. * ``double precision, intent(in ) :: time`` ``radiusFreefallIncreaseRate`` → ``double precision`` Return the rate of increase of the freefall radius corresponding to the given ``time``. * ``double precision, intent(in ) :: time`` ``fourierTransform`` → ``double precision`` Return the spherically-symmetrized Fourier transform of the density profile at the given wavenumber. * ``double precision, intent(in ) :: radiusOuter , wavenumber`` ``energy`` → ``double precision`` Return the total energy of the distribution within the given radius. * ``double precision , intent(in ) :: radiusOuter`` * ``class (massDistributionClass), intent(inout), target :: massDistributionEmbedding`` ``positionSample`` → ``double precision, dimension(3)`` Return a position sampled from the distribution. * ``class(randomNumberGeneratorClass ), intent(inout) :: randomNumberGenerator_`` ``solverSet`` → ``void`` Set a sub-module scope pointers on a stack to allow recursive calls to functions. * ``double precision, intent(in ), dimension(3), optional :: position1 , position2 , vectorUnit`` * ``double precision, intent(in ) , optional :: massTarget, densityTarget, angularMomentumSpecificTarget, densitySurfaceTarget, separation`` ``solverUnset`` → ``void`` Unset a sub-module scope pointers on the stack. .. _physics-massDistributionBetaProfile: ``massDistributionBetaProfile`` ------------------------------- A mass distribution class for :math:`\beta`-profile distributions. **Methods** * ``initialize`` — (Re)initialize the parameters of the :math:`\beta`-profile mass distribution. **Parameters** * ``[beta]`` (real; default ``2.0d0/3.0d0``) — The value :math:`\beta` in a :math:`\beta`-model mass distribution. * ``[densityNormalization]`` (real; default ``0.0d0``) — The density normalization of a :math:`\beta`-model mass distribution. * ``[mass]`` (real; default ``0.0d0``) — The mass of a :math:`\beta`-model mass distribution. * ``[outerRadius]`` (real; default ``0.0d0``) — The outer radius of a :math:`\beta`-model mass distribution. * ``[coreRadius]`` (real; default ``0.0d0``) — The core radius of a :math:`\beta`-model mass distribution. * ``[dimensionless]`` (boolean; default ``.false.``) — If true then the :math:`\beta`-model mass distribution is considered to be in dimensionless units. * ``[truncateAtOuterRadius]`` (boolean; default ``.false.``) — If true then the :math:`\beta`-model mass distribution is truncated beyond the outer radius. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionBlackHole: ``massDistributionBlackHole`` ----------------------------- A mass distribution class for point masses. **Methods** * ``initialize`` — (Re)initialize the parameters of the black hole mass distribution. **Parameters** * ``[mass]`` (real; default ``1.0d0``) — The mass (in :math:`\mathrm{M}_\odot`) of the black hole, which is treated as a point mass whose gravitational potential is :math:`-\mathrm{G}M/r`. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the point mass distribution is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionBurkert: ``massDistributionBurkert`` --------------------------- A mass distribution class which implements the :cite:p:`burkert_structure_1995` density profile: .. math:: \rho_\mathrm{dark matter}(r) = \rho_0 \left(1+{r\over r_\mathrm{s}}\right)^{-1} \left(1+[{r\over r_\mathrm{s}}]^2\right)^{-1}. The mass enclosed within radius :math:`r` is given by .. math:: M( r_\mathrm{core} \\ T^{-1} r_\mathrm{core}^{-1} & \hbox{ if } r \le r_\mathrm{core}, \end{array} \right. where the core radius, :math:`r_\mathrm{core}`, is set using the selected cored profile core radius method (see :galacticus-class:`hotHaloMassDistributionCoreRadius`). The profile is normalized such that the current mass in the hot gas profile is contained within the outer radius of the hot halo, :math:`r_\mathrm{hot, outer}`. Note that the :term:`ENZO` hydrostatic profile does not include this core, but without introducing this the profile mass can be divergent at small radii. **Methods** * ``normalizationDensity`` — Return the normalization of the density profile. **Parameters** * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. * ``[mass]`` (real) — The total mass (in :math:`\mathrm{M}_\odot`) of the hot gas distribution enclosed within ``radiusOuter``; used to normalize the Enzo hydrostatic density profile. * ``[radiusOuter]`` (real) — The outer radius of the mass distribution. * ``[radiusScale]`` (real) — The core radius of the mass distribution. * ``[truncateAtOuterRadius]`` (boolean; default ``.false.``) — If true then the mass distribution is truncated beyond the outer radius. .. _physics-massDistributionExponentialDisk: ``massDistributionExponentialDisk`` ----------------------------------- The exponential disk mass distribution: :math:`\rho(r,z)=\rho_0 \exp(-r/r_\mathrm{s}) \hbox{sech}^2(z/z_\mathrm{s})`. **Methods** * ``tabulate`` — Tabulates the potential for an exponential disk mass distribution. * ``besselFactorRotationCurve`` — Compute the Bessel function factor appearing in the exponential disk rotation curve. * ``besselFactorRotationCurveGradient`` — Compute the Bessel function factor appearing in the exponential disk rotation curve gradient. * ``besselFactorPotential`` — Compute the Bessel function factor appearing in the exponential disk potential. * ``accelerationTabulate`` — Tabulate the gravitational acceleration and tidal tensor due to the disk. * ``accelerationInterpolate`` — Interpolate in the tabulated gravitational acceleration and/or tidal tensor due to the disk. **Parameters** * ``[scaleHeight]`` (real; > 0.0; default ``0.137d0``) — The scale height of the exponential disk profile. * ``[scaleRadius]`` (real; default ``1.0d0``) — The scale radius of the exponential disk profile. * ``[mass]`` (real; default ``1.0d0``) — The mass of the exponential disk profile. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the exponential disk profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionGaussianEllipsoid: ``massDistributionGaussianEllipsoid`` ------------------------------------- A mass distribution class for triaxial Gaussian ellipsoids following the parameterization of :cite:t:`chandrasekhar_ellipsoidal_1987`. The density is a Gaussian function of the ellipsoidal radius, with independent scale lengths along each of the three principal axes, and the gravitational acceleration is computed via tabulated integrals. **Methods** * ``densityEllipsoidal`` — Compute the density on the isodensity surface defined by the parameter :math:`m^2`\ 2. * ``accelerationTabulate`` — Tabulate the gravitational acceleration due to the ellipsoid. * ``accelerationInterpolate`` — Interpolate in the tabulated gravitational acceleration due to the ellipsoid. * ``initialize`` — (Re)initialize the structural properties of the Gaussian ellispoid. **Parameters** * ``[mass]`` (real) — The total mass (in :math:`\mathrm{M}_\odot`) of the triaxial Gaussian ellipsoid, used together with the scale lengths to set the peak density normalization of the distribution. * ``[scaleLength]`` (real) — The scale lengths of the ellipsoid along each axis. * ``[axis1]`` (real; default ``[1.0d0,0.0d0,0.0d0]``) — The unit vector defining the first axis of the ellipsoid. * ``[axis2]`` (real; default ``[0.0d0,1.0d0,0.0d0]``) — The unit vector defining the second axis of the ellipsoid. * ``[axis3]`` (real; default ``[0.0d0,0.0d0,1.0d0]``) — The unit vector defining the third axis of the ellipsoid. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the Gaussian ellipsoid profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionGaussianSlab: ``massDistributionGaussianSlab`` -------------------------------- An infinite radial extent gas slab with a Gaussian vertical distribution: :math:`\rho(r,z)=\rho_0 \exp(z^2/2 z^2_\mathrm{s})`. **Parameters** * ``[scaleHeight]`` (real; > 0.0; default ``0.137d0``) — The scale height of the Gaussian slab profile. * ``[densityCentral]`` (real; default ``1.0d0``) — The gas density at the slab mid-plane (:math:`z=0`), :math:`\rho_0`, which sets the overall normalization of the Gaussian vertical profile :math:`\rho(z) = \rho_0 \exp(-z^2/2 z_\mathrm{s}^2)`. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the Gaussian slab profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionHernquist: ``massDistributionHernquist`` ----------------------------- A :cite:t:`hernquist_analytical_1990` mass distribution class. **Parameters** * ``[densityNormalization]`` (real; default ``0.5d0/Pi``) — The density normalization of the Hernquist profile. * ``[scaleLength]`` (real; default ``1.0d0``) — The scale radius of the Hernquist profile. * ``[mass]`` (real; default ``1.0d0``) — The total mass (in :math:`\mathrm{M}_\odot`) of the Hernquist profile, used to set the density normalization when ``densityNormalization`` is not supplied directly. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the Hernquist profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionIsothermal: ``massDistributionIsothermal`` ------------------------------ An isothermal mass distribution class in which the density profile is given by: .. math:: \rho(r) \propto r^{-2}. **Parameters** * ``[densityNormalization]`` (real; default ``0.25d0/Pi``) — The density normalization of the isothermal profile. * ``[lengthReference]`` (real; default ``1.0d0``) — The reference radius (in Mpc) of the isothermal profile at which ``densityNormalization`` is evaluated; sets the physical length scale of the :math:`\rho \propto r^{-2}` profile. * ``[mass]`` (real; default ``1.0d0``) — The total mass (in :math:`\mathrm{M}_\odot`) enclosed within the reference radius, used to normalize the :math:`\rho \propto r^{-2}` density profile when ``densityNormalization`` is not supplied. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the isothermal profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionMiyamotoNagai: ``massDistributionMiyamotoNagai`` --------------------------------- An Miyamoto-Nagai model :cite:p:`miyamoto_three-dimensional_1975` mass distribution class. **Methods** * ``surfaceDensityTabulate`` — Initialize the surface density tabulation. * ``massEnclosedTabulate`` — Initialize the enclosed mass tabulation. **Parameters** * ``[a]`` (real; default ``1.0d0``) — The :math:`a` parameter of the MiyamotoNagai profile. * ``[b]`` (real; default ``1.0d0``) — The :math:`b` parameter of the MiyamotoNagai profile. * ``[mass]`` (real; default ``1.0d0``) — The mass of the MiyamotoNagai profile. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the MiyamotoNagai profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionNFW: ``massDistributionNFW`` ----------------------- An NFW :cite:p:`navarro_structure_1996` mass distribution class. The density profile is given by: .. math:: \rho_\mathrm{dark matter}(r) \propto \left({r\over r_\mathrm{s}}\right)^{-1} \left[1 + \left({r\over r_\mathrm{s}}\right) \right]^{-2}. **Methods** * ``radiusEnclosingDensityTabulate`` — Tabulate the radius enclosing a given density as a function of density and core radius. * ``radiusEnclosingMassTabulate`` — Tabulate the radius enclosing a given mass as a function of density and core radius. * ``energyTabulate`` — Tabulate the energy as a function of concentration and core radius. * ``densityScaleFree`` — The density of the profile in units where the mass and scale length are both 1. * ``massEnclosedScaleFree`` — The mass enclosed of the profile in units where the mass and scale length are both 1. * ``storeDensityTable`` — Store the tabulated radius-enclosing-density to file. * ``restoreDensityTable`` — Attempt to restore the tabulated radius-enclosing-density from file, returning true if successful. * ``storeMassTable`` — Store the tabulated radius-enclosing-mass to file. * ``restoreMassTable`` — Attempt to restore the tabulated radius-enclosing-mass from file, returning true if successful. * ``storeEnergyTable`` — Store the tabulated energy to file. * ``restoreEnergyTable`` — Attempt to restore the tabulated energy from file, returning true if successful. * ``suffix`` — Return a file name suffix (containing a source code digest. **Parameters** * ``[densityNormalization]`` (real; default ``1.0d0/2.0d0/Pi/(log(4.0d0)-1.0d0)``) — The density normalization of the NFW profile. * ``[scaleLength]`` (real; default ``1.0d0``) — The NFW scale radius (in Mpc) :math:`r_\mathrm{s}` at which the density profile transitions from the inner :math:`\rho \propto r^{-1}` to the outer :math:`\rho \propto r^{-3}` slope. * ``[mass]`` (real; default ``1.0d0``) — The total mass (in :math:`\mathrm{M}_\odot`) enclosed within the virial radius, used together with ``radiusScale`` and ``radiusVirial`` to normalize the NFW density profile. * ``[concentration]`` (real; default ``1.0d0``) — The halo concentration parameter :math:`c = r_\mathrm{vir}/r_\mathrm{s}` of the NFW profile, controlling how centrally concentrated the dark matter density profile is. * ``[virialRadius]`` (real; default ``1.0d0``) — The virial radius (in Mpc) :math:`r_\mathrm{vir}` of the NFW halo, which defines the outer boundary of the profile at which the mean enclosed density equals the virial overdensity threshold. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the NFW profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionPatejLoeb2015: ``massDistributionPatejLoeb2015`` --------------------------------- A mass distribution for the :cite:t:`patej_simple_2015` model of the circumgalactic medium. **Methods** * ``radiusDarkMatter`` — Return the corresponding radius in the dark matter profile. * ``coordinatesDarkMatter`` — Return the corresponding coordinates in the dark matter profile. **Parameters** * ``[gamma]`` (real; default ``1.15d0``) — The parameter :math:`\Gamma` in the :cite:t:`patej_simple_2015` mass distribution. * ``[densityNormalization]`` (real; default ``0.0d0``) — The density normalization of the :cite:t:`patej_simple_2015` mass distribution. * ``[mass]`` (real; default ``0.0d0``) — The mass of the :cite:t:`patej_simple_2015` mass distribution. * ``[radiusOuter]`` (real; default ``0.0d0``) — The outer radius of the :cite:t:`patej_simple_2015` mass distribution. * ``[truncateAtOuterRadius]`` (boolean; default ``.false.``) — If true then the :cite:t:`patej_simple_2015` mass distribution is truncated beyond the outer radius. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSersic: ``massDistributionSersic`` -------------------------- A S\'ersic mass distribution class implementing the spherically deprojected form of the S\'ersic surface brightness profile :math:`I(R) \propto \exp(-b_n [(R/R_e)^{1/n}-1])`, where :math:`n` controls the profile shape. **Methods** * ``tabulate`` — Tabulate the Sersic profile. * ``radiusHalfMassProjected`` — Return the half mass radius of the profile in projection. **Parameters** * ``[index]`` (real; default ``4.0d0``) — The S\'ersic index :math:`n` that controls the shape of the surface brightness (or mass surface density) profile; :math:`n=1` gives an exponential profile, :math:`n=4` gives the de Vaucouleurs profile, and larger :math:`n` produces more centrally concentrated profiles. * ``[radiusHalfMass]`` (real; default ``1.0d0``) — The projected half-mass (effective) radius (in Mpc) of the S\'ersic profile, :math:`R_e`, within which half the total projected mass is enclosed. * ``[mass]`` (real; default ``1.0d0``) — The total mass (in :math:`\mathrm{M}_\odot`) of the S\'ersic profile, used together with ``index`` and ``radiusHalfMass`` to set the overall normalization of the density distribution. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the S\'ersic profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionShi2016: ``massDistributionShi2016`` --------------------------- A mass distribution for accretion flows using the framework of :cite:t:`shi_outer_2016`. **Methods** * ``solve`` — Solve for the structure of the accretion flow. **Parameters** * ``[mass]`` (real) — The virial mass (in :math:`\mathrm{M}_\odot`) of the halo used to set the normalization of the :cite:t:`shi_outer_2016` accretion flow density profile. * ``[massAccretionRate]`` (real) — The mass accretion rate (in :math:`\mathrm{M}_\odot`/Gyr) of the halo, used in the :cite:t:`shi_outer_2016` framework to set the amplitude of the outer accretion flow density profile. * ``[radiusVirial]`` (real) — The virial radius (in Mpc) of the halo, used together with the turnaround radius ratio to set the spatial scale of the :cite:t:`shi_outer_2016` accretion flow. * ``[ratioRadiusTurnaroundVirial]`` (real) — The ratio of the turnaround to virial radii of the halo. * ``[redshift]`` (real) — The cosmological redshift of the halo, used to evaluate the cosmic time and expansion factor for the :cite:t:`shi_outer_2016` accretion flow solution. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSIDMParametricProfile: ``massDistributionSIDMParametricProfile`` ----------------------------------------- A mass distribution class for the SIDM parametric profile of :cite:t:`yang_parametric_2024`. The density profile is given by: .. math:: \rho(r) = \rho_\mathrm{s} \left[ \left( \left[\frac{r}{r_\mathrm{s}}\right]^\beta + \left[\frac{r_\mathrm{c}}{r_\mathrm{s}}\right]^\beta \right)^{1/\beta} \left( 1 + \frac{r}{r_\mathrm{s}} \right)^2 \right]^{-1}. **Parameters** * ``[beta]`` (real; default ``4.0d0``) — The value :math:`\beta` in a SIDM parametric mass distribution. * ``[densityNormalization]`` (real; default ``0.0d0``) — The density normalization of a SIDM parametric mass distribution. * ``[radiusScale]`` (real; default ``0.0d0``) — The scale of a SIDM parametric mass distribution. * ``[radiusCore]`` (real; default ``0.0d0``) — The core radius of a SIDM parametric mass distribution. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSoliton: ``massDistributionSoliton`` --------------------------- A mass distribution class representing the solitonic core of fuzzy dark matter halos :cite:p:`schive_understanding_2014`. **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** * ``[radiusCore]`` (real) — The soliton core radius (in Mpc) characterizing the size of the quantum pressure-supported central core of the fuzzy dark matter halo; the density profile flattens inside this scale. * ``[densitySolitonCentral]`` (real) — The central density (in :math:`\mathrm{M}_\odot`/Mpc\ :math:`^3`) of the solitonic core at :math:`r=0`, which sets the overall normalization of the density profile :math:`\rho(r) = \rho_\mathrm{c} [1+(r/r_c)^2]^{-8}`. * ``[toleranceRelativePotential]`` (real; default ``1.0d-3``) — The maximum allowed relative tolerance to use in numerical solutions for the gravitational potential in dark-matter-only density profiles before aborting. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the soliton profile is treated as dimensionless (scale-free), allowing its radial and density quantities to be specified in arbitrary units. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSolitonNFW: ``massDistributionSolitonNFW`` ------------------------------ A mass distribution class for fuzzy dark matter halos :cite:p:`schive_understanding_2014` consisting of soliton core for small radii, transitioning to an :term:`NFW` profile at larger radii. **Methods** * ``computeProperties`` — Compute properties of the mass distribution. * ``calculationReset`` — Reset memoized calculations. **Parameters** * ``[radiusScale]`` (real) — The scale radius of the NFW component of the mass distribution. * ``[radiusCore]`` (real) — The soliton core radius (in Mpc) characterizing the size of the central quantum pressure-supported core of the fuzzy dark matter halo before the profile transitions to the outer NFW envelope. * ``[radiusSoliton]`` (real) — The transition radius (in Mpc) at which the solitonic core profile smoothly joins onto the outer NFW envelope; the density profile matches the NFW form beyond this radius. * ``[densitySolitonCentral]`` (real) — The central density (in :math:`\mathrm{M}_\odot`/Mpc\ :math:`^3`) of the solitonic core at :math:`r=0`, which sets the normalization of the soliton density profile :math:`\rho(r) = \rho_\mathrm{c} [1+(r/r_c)^2]^{-8}`. * ``[densityNormalizationNFW]`` (real) — The density normalization :math:`\rho_0` (in :math:`\mathrm{M}_\odot`/Mpc\ :math:`^3`) of the outer NFW component, setting the amplitude of the :math:`\rho(r) = \rho_0/[(r/r_\mathrm{s})(1+r/r_\mathrm{s})^2]` profile. * ``[concentration]`` (real) — The concentration parameter :math:`c = r_\mathrm{vir}/r_\mathrm{s}` of the outer NFW component, specifying how centrally concentrated the NFW halo is. * ``[radiusVirial]`` (real) — The virial radius (in Mpc) of the outer NFW component, defining the outer boundary of the halo at which the mean enclosed density equals the virial overdensity threshold. * ``[toleranceRelativePotential]`` (real; default ``1.0d-3``) — The relative tolerance used in numerical ODE solutions for the gravitational potential of the soliton-NFW composite profile. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the soliton-NFW profile is treated as dimensionless (scale-free), allowing its radial and density quantities to be specified in arbitrary units. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The galactic structure component type (e.g.\ dark matter halo, disk, spheroid) represented by this mass distribution, used for component-specific queries. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type (e.g.\ dark matter, baryonic, total) represented by this mass distribution, used for mass-type-specific queries. .. _physics-massDistributionSolitonNFWHeated: ``massDistributionSolitonNFWHeated`` ------------------------------------ A mass distribution class for fuzzy dark matter halos :cite:p:`schive_understanding_2014` consisting of soliton core for small radii, transitioning to a heated :term:`NFW` profile at larger radii. **Methods** * ``computeProperties`` — Compute properties of the mass distribution. * ``calculationReset`` — Reset memoized calculations. **Parameters** * ``[radiusCore]`` (real) — The soliton core radius (in Mpc) that characterizes the size of the central quantum pressure-supported core of the fuzzy dark matter halo; density is approximately constant within this radius. * ``[radiusSoliton]`` (real) — The outer radius (in Mpc) of the soliton region, beyond which the profile transitions from the soliton core to the heated NFW outer envelope. * ``[densitySolitonCentral]`` (real) — The central density (in :math:`\mathrm{M}_\odot`/Mpc\ :math:`^3`) of the solitonic core at :math:`r=0`, which sets the normalization of the soliton density profile :math:`\rho(r) = \rho_\mathrm{c} [1+(r/r_\mathrm{c})^2]^{-8}`. * ``[toleranceRelativePotential]`` (real; default ``1.0d-3``) — The relative tolerance used in numerical ODE solutions for the gravitational potential of the heated soliton-NFW composite profile. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the NFW profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSpherical: ``massDistributionSpherical`` ----------------------------- An abstract mass distribution class for spherically symmetric distributions. **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. .. _physics-massDistributionSphericalAccelerator: ``massDistributionSphericalAccelerator`` ---------------------------------------- Accelerates spherical mass distribution classes by storing previous results for the enclosed mass and interpolating where possible. **Methods** * ``tabulate`` — Tabulate the mass function. **Parameters** * ``[toleranceRelative]`` (real; default ``1.0d-2``) — The tolerance with which to accept accelerated estimates. * ``[factorRadiusMaximum]`` (real; default ``3.0d0``) — The maximum factor by which to interpolate in radius. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalAccretionFlow: ``massDistributionSphericalAccretionFlow`` ------------------------------------------ An implementation of a mass distribution which includes the accretion flow surrounding a halo. The density profile is modeled as .. math:: \rho(r) = f_\mathrm{trans}(r) \rho_\mathrm{halo}(r) + \rho_\mathrm{accretion}(r), where :math:`\rho_\mathrm{halo}(r)` is the halo mass distribution, :math:`\rho_\mathrm{accretion}(r)` is the accretion flow mass distribution, and .. math:: f_\mathrm{trans}(r) = \left( 1 + \left[\frac{r}{r_\mathrm{trans}}\right]^4 \right)^{-2}. **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** * ``[radiusTransition]`` (real) — The transition radius (in Mpc) at which the density profile smoothly switches from the halo profile to the accretion flow, controlled by the fourth-order transition function :math:`f_\mathrm{trans}(r)`. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalAdiabaticGnedin2004: ``massDistributionSphericalAdiabaticGnedin2004`` ------------------------------------------------ A dark matter profile class which applies adiabatic contraction to the halo as it responds to the presence of baryons. Adiabatic contraction follows the algorithm of :cite:t:`gnedin_response_2004`. The parameters :math:`A` and :math:`\omega` of that model are specified via input parameters ``A`` and ``omega`` respectively. Given the final radius, :math:`r_\mathrm{f}`, the corresponding initial radius, :math:`r_\mathrm{i}`, is found by solving: .. math:: :label: eq-adiabaticContractionGnedinSolution f_\mathrm{i} M_\mathrm{total,0}(\bar{r}_\mathrm{i}) r_\mathrm{i} = f_\mathrm{f} M_\mathrm{total,0}(\bar{r}_\mathrm{i}) r_\mathrm{f} + V^2_\mathrm{b}(\bar{r}_\mathrm{f}) \bar{r}_\mathrm{f} r_\mathrm{f}/ \mathrm{G}, where :math:`M_\mathrm{total,0}(r)` is the initial total matter profile, :math:`V_\mathrm{b}(r)` is the baryonic contribution to the rotation curve, :math:`f_\mathrm{i}`, is the fraction of mass within the virial radius compared to the node mass\footnoteIn Galacticus the "node mass" refers to the total mass of the node, assuming it has the universal complement of baryons. Since some halos may contain less than the complete complement of baryons it is possible that :math:`f_\mathrm{i}<1`., :math:`f_\mathrm{f}=(\Omega_\mathrm{M}-\Omega_\mathrm{b})/\Omega_\mathrm{M}+M_\mathrm{satellite, baryonic}/M_\mathrm{total}`, :math:`M_\mathrm{satellite, baryonic}` is the baryonic mass in any satellite halos, :math:`M_\mathrm{total}` is the node mass, and .. math:: :label: eq-adiabaticContractionGnedinPowerLaw {\bar{r} \over r_0} = A \left({r \over r_0}\right)^\omega, where the pivot radius :math:`r_0` is set to :math:`f_0 r_\mathrm{vir}` where :math:`f_0=`\ ``[radiusFractionalPivot]``, and :math:`r_\mathrm{vir}` is the virial radius. The original :cite:t:`gnedin_response_2004` assumed :math:`f_0=1`, but the revised model of :cite:t:`gnedin_halo_2011` found that :math:`f_0=0.03` lead to an improved model (less scatter in the best fit values of :math:`(A,\omega)` when comparing to N-body simulations). Note that we explicitly assume that the initial, uncontracted total density profile has the same shape as the initial dark matter density profile, that contraction of the halo occurs with no shell crossing, and that satellite halos trace the dark matter profile of their host halo. The derivative, :math:`\mathrm{d} r_\mathrm{f}/\mathrm{d}d_\mathrm{i}\equiv r^\prime_\mathrm{i}` is found by taking the derivative of eqn. (:eq:`eq-adiabaticContractionGnedinSolution`) to give: .. math:: & f_\mathrm{i} M_\mathrm{total,0}(\bar{r}_\mathrm{i}) r^\prime_\mathrm{i} + f_\mathrm{i} 4 \pi \bar{r}_\mathrm{i}^2 \rho_\mathrm{total,0}(\bar{r}_\mathrm{i}) {\mathrm{d} \bar{r}_\mathrm{i}\over\mathrm{d} r_\mathrm{i}} r_\mathrm{i} r^\prime_\mathrm{i} \nonumber \\ & = f_\mathrm{f} M_\mathrm{total,0}(\bar{r}_\mathrm{i}) + f_\mathrm{i} 4 \pi \bar{r}_\mathrm{i}^2 \rho_\mathrm{total,0}(\bar{r}_\mathrm{i}) {\mathrm{d} \bar{r}_\mathrm{i}\over\mathrm{d} r_\mathrm{i}} r_\mathrm{f} r^\prime_\mathrm{i} \nonumber \\ & + V^2_\mathrm{b}(\bar{r}_\mathrm{f}) \bar{r}_\mathrm{f} / \mathrm{G} + V^2_\mathrm{b}(\bar{r}_\mathrm{f}) {\mathrm{d}\bar{r}_\mathrm{f}\over \mathrm{d} r_\mathrm{f}} r_\mathrm{f}/ \mathrm{G} + {\mathrm{d}V^2_\mathrm{b}\over\mathrm{d} \bar{r}_\mathrm{f}}(\bar{r}_\mathrm{f}) {\mathrm{d}\bar{r}_\mathrm{f}\over \mathrm{d} r_\mathrm{f}} \bar{r}_\mathrm{f} r_\mathrm{f}/ \mathrm{G}, where .. math:: {\mathrm{d}\bar{r} \over \mathrm{d} r} = A \left({r \over r_0}\right)^{\omega-1}, and which can then be solved numerically for :math:`r^\prime_\mathrm{i}`. **Methods** * ``setBaryonicComponent`` — Set baryonic components in the mass distribution. * ``computeFactors`` — Compute factors needed for solving adiabatic contraction. * ``radiusOrbitalMean`` — Compute the orbit-averaged radius for dark matter. * ``radiusOrbitalMeanDerivative`` — Compute the derivative of the orbit-averaged radius for dark matter. * ``radiusInitial`` — Compute the initial radius in the dark matter profile. * ``radiusInitialDerivative`` — Compute the derivative of the initial radius in the dark matter profile. **Parameters** * ``[A]`` (real; default ``0.80d0``) — The parameter :math:`A` appearing in the :cite:t:`gnedin_response_2004` adiabatic contraction algorithm. * ``[omega]`` (real; default ``0.77d0``) — The parameter :math:`\omega` appearing in the :cite:t:`gnedin_response_2004` adiabatic contraction algorithm. * ``[radiusFractionalPivot]`` (real; default ``1.0d0``) — The pivot radius (in units of the virial radius), :math:`r_0`, appearing in equation (:eq:`eq-adiabaticContractionGnedinPowerLaw`). * ``[radiusVirial]`` (real) — The virial radius, :math:`r_\mathrm{v}`, appearing in equation (:eq:`eq-adiabaticContractionGnedinPowerLaw`). * ``[darkMatterFraction]`` (real) — The universal cosmic dark matter fraction :math:`\Omega_\mathrm{DM}/\Omega_\mathrm{M}`, used to define the initial dark matter fraction in the halo before adiabatic contraction. * ``[darkMatterDistributedFraction]`` (real) — The fraction of matter assumed to be distributed as the dark matter. * ``[massFractionInitial]`` (real) — The fraction of matter assumed to be initially distributed as the dark matter. * ``[toleranceRelative]`` (real; default ``1.0d-2``) — The relative tolerance to use in solving for the initial radius in the adiabatically-contracted dark matter profile. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalDecaying: ``massDistributionSphericalDecaying`` ------------------------------------- Decaying dark matter halo profiles. **Methods** * ``lifetime`` — Return the lifetime of the dark matter particle. * ``massSplitting`` — Return the mass splitting of the decay. * ``velocityKick`` — Return the velocity kick imparted by the decay. **Parameters** * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. * ``[toleranceRelativePotential]`` (real; default ``1.0d-3``) — The relative tolerance to use in numerical solutions for the gravitational potential. * ``[tolerateEnclosedMassIntegrationFailure]`` (boolean; default ``.false.``) — If ``true``, tolerate failures to find the mass enclosed as a function of radius. * ``[tolerateVelocityMaximumFailure]`` (boolean; default ``.false.``) — If ``true``, tolerate failures to find the radius of the maximum circular velocity. * ``[toleratePotentialIntegrationFailure]`` (boolean; default ``.false.``) — If ``true``, tolerate failures to compute the potential. * ``[radiusEscape]`` (real) — The radius beyond which a particle is assumed to have escaped the potential. * ``[time]`` (real) — The time at which decays should be evaluated. .. _physics-massDistributionSphericalDecorator: ``massDistributionSphericalDecorator`` -------------------------------------- An abstract mass distribution class for decorators of other mass distributions. "Fallthrough" functions are provided that all the decorated class or numerical solutions to be used. **Methods** * ``massEnclosedBySphereNonAnalytic`` — Compute mass enclosed by a sphere for non-analytic cases. * ``radiusEnclosingMassNonAnalytic`` — Compute radius enclosing a mass for non-analytic cases. * ``densityGradientRadialNonAnalytic`` — Compute radial density gradient for non-analytic cases. * ``densityRadialMomentNonAnalytic`` — Compute radial density moment for non-analytic cases. * ``radiusEnclosingDensityNonAnalytic`` — Compute radius enclosing a mean density for non-analytic cases. * ``radiusFromSpecificAngularMomentumNonAnalytic`` — Compute radius from specific angular momentum for non-analytic cases. * ``fourierTransformNonAnalytic`` — Compute Fourier transform for non-analytic cases. * ``radiusFreefallNonAnalytic`` — Compute freefall radius for non-analytic cases. * ``radiusFreefallIncreaseRateNonAnalytic`` — Compute freefall radius growth rate for non-analytic cases. * ``potentialNonAnalytic`` — Compute gravitational potential for non-analytic cases. * ``energyNonAnalytic`` — Compute total energy for non-analytic cases. * ``energyPotentialNonAnalytic`` — Compute gravitational potential energy for non-analytic cases. * ``energyKineticNonAnalytic`` — Compute kinetic energy for non-analytic cases. * ``useUndecorated`` — Return true if the undecorated solution (instead of a numerical solution) should be used. .. _physics-massDistributionSphericalFiniteResolution: ``massDistributionSphericalFiniteResolution`` --------------------------------------------- A mass distribution class which applies a finite resolution to some other mass distribution class, typically to mimic the effects of finite resolution in an N-body simulation. Specifically, the density profile is given by .. math:: \rho(r) = \rho^\prime(r) \left( 1 + \left[ \frac{\Delta x}{r} \right]^2 \right)^{-1/2}, where :math:`\Delta x` is the larger of the resolution length, ``[lengthResolution]``, and the radius in the original profile enclosing the mass resolution, ``[massResolution]``. Note that this choice was constructed to give a constant density core in an NFW density profile. For a density profile, :math:`\rho^\prime(r)`, which rises more steeply than :math:`r^{-1}` as :math:`r \rightarrow 0` we will still have a cuspy density profile under this model. **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** * ``[lengthResolution]`` (real) — The spatial resolution length scale (in Mpc) below which the underlying density profile is softened to a flat core, mimicking the finite force resolution of an N-body simulation. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalFiniteResolutionNFW: ``massDistributionSphericalFiniteResolutionNFW`` ------------------------------------------------ A mass distribution class which applies a finite resolution to an NFW density profile, typically to mimic the effects of finite resolution in an N-body simulation. Specifically, the density profile is given by .. math:: \rho(r) = \rho_\mathrm{NFW}(r) \left( 1 + \left[ \frac{\Delta x}{r} \right]^2 \right)^{-1/2}, where :math:`\Delta x` is the larger of the resolution length, ``[lengthResolution]``, and the radius in the original profile enclosing the mass resolution, ``[massResolution]``. **Methods** * ``radiusEnclosingDensityTabulate`` — Tabulate the radius enclosing a given density as a function of density and core radius. * ``radiusEnclosingMassTabulate`` — Tabulate the radius enclosing a given mass as a function of density and core radius. * ``energyTabulate`` — Tabulate the energy as a function of concentration and core radius. * ``densityScaleFree`` — The density of the profile in units where the mass and scale length are both 1. * ``massEnclosedScaleFree`` — The mass enclosed of the profile in units where the mass and scale length are both 1. * ``storeDensityTable`` — Store the tabulated radius-enclosing-density to file. * ``restoreDensityTable`` — Attempt to restore the tabulated radius-enclosing-density from file, returning true if successful. * ``storeMassTable`` — Store the tabulated radius-enclosing-mass to file. * ``restoreMassTable`` — Attempt to restore the tabulated radius-enclosing-mass from file, returning true if successful. * ``storeEnergyTable`` — Store the tabulated energy to file. * ``restoreEnergyTable`` — Attempt to restore the tabulated energy from file, returning true if successful. * ``suffix`` — Return a file name suffix (containing a source code digest. **Parameters** * ``[lengthResolution]`` (real) — The spatial resolution length scale (in Mpc) of the N-body simulation being modeled; sets the minimum effective radius below which the NFW density profile is softened. * ``[radiusScale]`` (real) — The NFW scale radius (in Mpc) at which the density profile transitions from the inner :math:`\rho \propto r^{-1}` slope to the outer :math:`\rho \propto r^{-3}` slope. * ``[radiusVirial]`` (real) — The virial radius (in Mpc) of the halo, defining the outer boundary of the NFW profile at which the mean enclosed density equals the virial overdensity threshold. * ``[mass]`` (real) — The total mass (in :math:`\mathrm{M}_\odot`) enclosed within the virial radius, used together with ``radiusScale`` and ``radiusVirial`` to normalize the NFW density profile. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalHeated: ``massDistributionSphericalHeated`` ----------------------------------- A mass distribution class in which the distribution starts out with a density profile defined by another ``massDistribution``. This profile is then modified by heating, under the assumption that the energy of a shell of mass before and after heating are related by .. math:: -{ \mathrm{G} M^\prime(r^\prime) \over r^\prime } = -{ \mathrm{G} M(r) \over r } + 2 \epsilon(r), where :math:`M(r)` is the mass enclosed within a radius :math:`r`, and :math:`\epsilon(r)` represents the specific heating in the shell initially at radius :math:`r`. Primes indicate values after heating, while unprimed variables indicate quantities prior to heating. With the assumption of no shell crossing, :math:`M^\prime(r^\prime)=M(r)` and this equation can be solved for :math:`r` given :math:`r^\prime` and :math:`\epsilon(r)`. Not all methods have analytic solutions for this profile. If ``[nonAnalyticSolver]``\ :math:`=`\ ``fallThrough`` then attempts to call these methods in heated profiles will simply return the result from the unheated profile, otherwise a numerical calculation is performed. **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** * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. * ``[tolerateVelocityMaximumFailure]`` (boolean; default ``.false.``) — If true, tolerate failures to find the radius of the peak in the rotation curve. * ``[tolerateEnclosedMassIntegrationFailure]`` (boolean; default ``.false.``) — If ``true``, tolerate failures to find the mass enclosed as a function of radius. * ``[toleratePotentialIntegrationFailure]`` (boolean; default ``.false.``) — If ``true``, tolerate failures to compute the potential. * ``[fractionRadiusFinalSmall]`` (real; default ``1.0d-3``) — The initial radius is limited to be no smaller than this fraction of the final radius. This can help avoid problems in profiles that are extremely close to being disrupted. * ``[toleranceRelativePotential]`` (real; default ``1.0d-3``) — The maximum allowed relative tolerance to use in numerical solutions for the gravitational potential in dark-matter-only density profiles before aborting. .. _physics-massDistributionSphericalHeatedMonotonic: ``massDistributionSphericalHeatedMonotonic`` -------------------------------------------- A mass distribution class in which dark matter halos start out with a density profile defined by another ``massDistributionClass``. This profile is then modified by heating, under the assumption that the energy of a shell of mass before and after heating are related by .. math:: -{ \mathrm{G} M^\prime(r^\prime) \over r^\prime } = -{ \mathrm{G} M(r) \over r } + 2 \epsilon(r), where :math:`M(r)` is the mass enclosed within a radius :math:`r`, and :math:`\epsilon(r)` represents the specific heating in the shell initially at radius :math:`r`. Primes indicate values after heating, while unprimed variables indicate quantities prior to heating. The above equation can be re-written as .. math:: -r^{\prime -1} = -r^{-1} + \xi(r), where :math:`\xi(r) = 2 \epsilon(r)/[\mathrm{G} M(r)/r]` measures the perturbation to the shell. To avoid shell crossing a monotonicity relation :math:`r_1 < r_2 \implies \xi(r_1) \le \xi(r_2)` is enforced by starting at large radius and stepping inward, enforcing the condition in the next innermost shell as necessary. Not all methods have analytic solutions for this profile. If ``[nonAnalyticSolver]``\ :math:`=`\ ``fallThrough`` then attempts to call these methods in heated profiles will simply return the result from the unheated profile, otherwise a numerical calculation is performed. **Methods** * ``computeSolution`` — Compute a solution for the heated profile. **Parameters** * ``[radiusVirial]`` (real) — The virial radius (in Mpc) of the halo, defining the outer boundary up to which the monotonic heating calculation tracks the energy-ordered shell mapping from the initial to heated density profile. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalScaler: ``massDistributionSphericalScaler`` ----------------------------------- A mass distribution class for scaling spherical mass distributions. Specifically, the density at position :math:`\mathbf{x}` is given by .. math:: \rho(\mathbf{x}) = \frac{f_\mathrm{M}}{f_\mathrm{r}^3} \rho^\prime(\mathbf{x}/f_\mathrm{r}), where :math:`\rho^\prime(\mathbf{x})` is the original mass distribution, and :math:`f_\mathrm{r}=`\ ``[factorScalingLength]``, and :math:`f_\mathrm{M}=`\ ``[factorScalingMass]``. **Methods** * ``initialize`` — (Re)initialize the scaling factors of the scaled mass distribution. **Parameters** * ``[factorScalingLength]`` (real) — The factor by which to scale lengths. * ``[factorScalingMass]`` (real) — The factor by which to scale the mass. .. _physics-massDistributionSphericalShellOverdensities: ``massDistributionSphericalShellOverdensities`` ----------------------------------------------- A mass distribution class which overlays overdense spherical shells on another mass distribution. The intent is to mimic the effects of a 3-D distribution of spherical clouds, but along a single sight-line from the center of a spherically symmetric mass distribution. This is useful in computing radiative transfer through cloudy media for spherically symmetric systems. In the 3-D case clouds are defined by a radius, :math:`r_\mathrm{c}`, a volume filling factor, :math:`f_\mathrm{v}`, and a density contrast, :math:`\Delta_\mathrm{c}`. For this case of spherical shells the same quantities are used, except that the radius is referred to as the "half-width" of the shell, but is still labeled :math:`r_\mathrm{c}`. In the 3-D case the number density of clouds is .. math:: n_\mathrm{c} = {f_\mathrm{v} \over (4 \pi / 3 ) r_\mathrm{c}^3}. Along a sightline of length :math:`l` (specified by the ``[radiusBoundary]`` parameter) the number of clouds intersected is .. math:: N_\mathrm{c} = n_\mathrm{c} l 4 \pi r_\mathrm{c}^2 = 3 f_\mathrm{v} {l \over r_\mathrm{c}}. This last relation is used to determine the number of spherical shells to generate. These shells are then placed randomly in radius between :math:`0` and :math:`l`. Each shell is also assigned an impact parameter, :math:`b`, meant to represent the distance of the center of the notional spherical cloud from the line of sight. The effective half-width of the shell is then :math:`\sqrt{r_\mathrm{c}^2-b^2}`. **Parameters** * ``[halfWidth]`` (real) — The half-width (in Mpc) of each overdense spherical shell, representing the effective radius of the notional spherical cloud projected along the line of sight after accounting for a random impact parameter. * ``[densityContrast]`` (real) — The density contrast of the overdense spherical shells relative to the smooth underlying mass distribution, i.e.\ :math:`\Delta_\mathrm{c} = \rho_\mathrm{shell} / \rho_\mathrm{background}`. * ``[volumeFillingFactor]`` (real) — The fraction of the total sightline volume occupied by overdense shells; together with ``halfWidth`` determines the number of shells :math:`N_\mathrm{c} = 3 f_\mathrm{v} l / r_\mathrm{c}` along the line of sight. * ``[radiusBoundary]`` (real) — The boundary radius within which to populate shells. * ``[dimensionless]`` (boolean; default ``.true.``) — If true the shell overdensities profile is considered to be dimensionless. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalSIDM: ``massDistributionSphericalSIDM`` --------------------------------- An abstract mass distribution class for spherical SIDM models. Provides a method to compute interaction radii. **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. .. _physics-massDistributionSphericalSIDMCoreNFW: ``massDistributionSphericalSIDMCoreNFW`` ---------------------------------------- A mass distribution class implementing a cored-NFW dark matter halo profile to approximate the effects of SIDM based on the model of :cite:t:`jiang_semi-analytic_2023`. The profile is defined by the enclosed mass, with :cite:p:`jiang_semi-analytic_2023`: .. math:: M(r) = M_\mathrm{NFW}(r) \mathrm{tanh}\left(\frac{r}{r_\mathrm{c}}\right), where :math:`r_\mathrm{c} = \alpha r_1` is a characteristic core size related to the interaction radius :math:`r_1` by a constant factor :math:`\alpha =`\ ``[factorRadiusCore]``. **Methods** * ``radiusCore`` — Computes the core radius of halo. **Parameters** * ``[timeAge]`` (real) — The age of the halo (in Gyr) since its formation, used to compute how long SIDM self-interactions have been active in determining the size of the dark matter core. * ``[velocityRelativeMean]`` (real) — Mean relative velocity to calculate self interaction cross section. * ``[factorRadiusCore]`` (real; default ``0.45d0``) — The factor :math:`\alpha` appearing in the definition of the core radius, :math:`r_\mathrm{c}=\alpha r_1` where :math:`r_1` is the radius at which an SIDM particle has had, on average, 1 interaction. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalSIDMIsothermal: ``massDistributionSphericalSIDMIsothermal`` ------------------------------------------- A mass distribution class for self-interacting dark matter following the "isothermal" model of :cite:t:`jiang_semi-analytic_2023`. This model assumes that the dark matter within the interaction radius, :math:`r_1`, has thermalized and can therefore be described by a constant velocity dispersion, :math:`\sigma_0`. Under this assumption the spherical Jeans equation has a solution of the form: .. math:: \rho(r) = \rho_0 \exp\left[-\frac{\phi(r)}{\sigma_0^2}\right], where :math:`\rho(r)` is the density :math:`\rho_0` is the density at :math:`r=0`, and the gravitational potential satisfies :cite:p:`jiang_semi-analytic_2023`: .. math:: \nabla^2 \phi(r) = 4 \pi \mathrm{G} \rho_0 \exp \left( - \frac{\phi(r)}{\sigma_0^2} \right). This second-order differential equation is solved using the boundary conditions :math:`\phi(r=0)=0` and :math:`\mathrm{d}\phi/\mathrm{d}r(r=0)=0`. The values of :math:`\rho_0` and :math:`\sigma_0` are then found by minimizing a function .. math:: \delta^2(\rho_0,\sigma_0) = \left[ \frac{\rho(r_1)}{\rho^\prime(r_1)} - 1 \right]^2 + \left[ \frac{M(r_1)}{M^\prime(r_1)} - 1 \right]^2, where :math:`M(r)` is the mass contained within radius :math:`r`, and primes indicate the profile prior to SIDM thermalization. This can be expressed in a convenient dimensionless form. We define :math:`x=r/r_1`, :math:`y=\rho/\rho_1`, :math:`z=\sigma/\sigma_1`, where .. math:: \sigma_1^2 = \frac{4 \pi}{3} \mathrm{G} \rho_1 r_1^2 \xi, and we define :math:`\xi` through the relation: .. math:: M_1 = \xi \frac{4 \pi}{3} \rho_1 r_1^3. Using these definitions we can define a dimensionless potential, :math:`\Phi(r) = \phi(r) / \sigma_1^2`. The above differential equation can then be written as .. math:: \nabla^{\prime 2} \Phi = \frac{3}{\xi} y_0 \exp\left[ - \frac{\Phi}{z_0^2} \right] , where :math:`\nabla^{\prime 2}` indicates the Laplacian with respect to coordinate :math:`x`. Written in this form it is straightforward to see that this equation has three parameters, :math:`\xi`, :math:`y_0`, and :math:`z_0`. The value of :math:`\xi` is determined from the initial (pre-thermalization) density profile. We then have two constraints at :math:`x=1`, namely :math:`y=1` and :math:`m=M/M_1=1`. We can solve for the values of :math:`y_0` and :math:`z_0` which satisfy these constraints for a given :math:`\xi`. As a result, we can tabulate solutions :math:`y_0(\xi)` and :math:`z_0(\xi)` which are applicable to any initial density profile and depend only on the effective slope of the density profile inside :math:`r_1`, since if :math:`\rho \propto r^\alpha` then :math:`\xi = 1/(1+\alpha/3)`, such that :math:`\alpha=0` (the largest physically-allowed value of :math:`\alpha`) implies :math:`\xi=1`. **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** * ``[timeAge]`` (real) — The age of the halo (in Gyr) since its formation, determining the total time available for SIDM self-interactions to thermalize the inner halo and produce an isothermal core. * ``[velocityRelativeMean]`` (real) — Mean relative velocity to calculate self interaction cross section. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalSIDMIsothermalBaryons: ``massDistributionSphericalSIDMIsothermalBaryons`` -------------------------------------------------- Mass distributions for self-interacting dark matter following the "isothermal" model of :cite:t:`jiang_semi-analytic_2023`. This model assumes that the dark matter within the interaction radius, :math:`r_1`, has thermalized and can therefore be described by a constant velocity dispersion, :math:`\sigma_0`. Under this assumption the spherical Jeans equation has a solution of the form: .. math:: \rho(r) = \rho_0 \exp\left[-\frac{\phi(r)}{\sigma_0^2}\right], where :math:`\rho(r)` is the density :math:`\rho_0` is the density at :math:`r=0`, and the gravitational potential satisfies :cite:p:`jiang_semi-analytic_2023`: .. math:: \nabla^2 \phi(r) = 4 \pi \mathrm{G} \left[ \rho_0 \exp \left( - \frac{\phi(r)}{\sigma_0^2} \right) + \rho_\mathrm{b}(r) \right], where :math:`\rho_\mathrm{b}(r)` is the density of the baryonic component. This second-order differential equation is solved using the boundary conditions :math:`\phi(r=0)=0` and :math:`\mathrm{d}\phi/\mathrm{d}r(r=0)=0`. The values of :math:`\rho_0` and :math:`\sigma_0` are then found by minimizing a function .. math:: \delta^2(\rho_0,\sigma_0) = \left[ \frac{\rho(r_1)}{\rho^\prime(r_1)} - 1 \right]^2 + \left[ \frac{M(r_1)}{M^\prime(r_1)} - 1 \right]^2, where :math:`M(r)` is the mass contained within radius :math:`r`, and primes indicate the profile prior to SIDM thermalization. **Methods** * ``setBaryonicComponent`` — Set baryonic components in the mass distribution. * ``computeSolution`` — Compute a solution for the isothermal core of a SIDM halo. **Parameters** * ``[timeAge]`` (real) — The age of the halo (in Gyr) since its formation, setting the time available for SIDM interactions to thermalize the dark matter core while the baryonic potential influences the resulting density profile. * ``[velocityRelativeMean]`` (real) — Mean relative velocity to calculate self interaction cross section. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalTabulated: ``massDistributionSphericalTabulated`` -------------------------------------- An abstract mass distribution class for tabulated spherically symmetric distributions. **Methods** * ``parameters`` — Return parameters of the current mass distribution. * ``factoryTabulation`` — Return an instance of the class with the given tabulation parameters. * ``suffix`` — Return a suffix to append to table file names. * ``fileRead`` — Read tabulation data from file. * ``fileWrite`` — Write tabulation data to file. * ``tabulate`` — (Re)tabulate the mass distribution. * ``interpolate`` — Interpolate in the mass distribution. * ``isTabulating`` — Return true if the thread associated with the object is tabulating. * ``velocityDispersion1D`` — Compute the 1D velocity dispersion at the given coordinates. * ``initialize`` — Initialize the container (specifically the number of parameters). * ``nameParameter`` — Return the name of the index parameter for a given tabulation. * ``countParameters`` — Return the number of parameters for a given tabulation. .. _physics-massDistributionSphericalTruncated: ``massDistributionSphericalTruncated`` -------------------------------------- Implements a mass distribution in which the density is given by .. math:: \rho(r) = \rho^\prime(r) \left\{ \begin{array}{ll} 1 & \hbox{ if } r < r_\mathrm{min}, \\ 0 & \hbox{ if } r > r_\mathrm{max}, \\ 1-3 x^2 + 2x^3 & \hbox{otherwise,} \end{array} \right. where .. math:: x=\frac{r-r_\mathrm{min}}{r_\mathrm{max}-r_\mathrm{min}}, :math:`\rho^\prime(r)` is some other density profile, :math:`r_\mathrm{min}=`\ ``[radiusTruncateMinimum]``, and :math:`r_\mathrm{max}=`\ ``[radiusTruncateMaximum]``. **Methods** * ``truncationFunction`` — Compute the truncation fraction (and related quantities) from the radius. **Parameters** * ``[radiusTruncateMinimum]`` (real) — The minimum radius to begin truncating the density profile. * ``[radiusTruncateMaximum]`` (real) — The maximum radius to finish truncating the density profile. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionSphericalTruncatedExponential: ``massDistributionSphericalTruncatedExponential`` ------------------------------------------------- Implements an exponentially truncated mass distribution :cite:t:`kazantzidis_2006` in which the density is given by .. math:: \rho(r) = \rho^\prime(r_\mathrm{min}) \left\{ \begin{array}{ll} 1 & \hbox{ if } r < r_\mathrm{min}, \\ \rho^\prime(r_\mathrm{min} x^\kappa \exp\left(-\frac{x-1}{x_\mathrm{max}}\right) & \hbox{otherwise,} \end{array} \right. where :math:`x = r/r_\mathrm{min}`, :math:`x_\mathrm{decay} = r_\mathrm{decay}/r_\mathrm{min}`, :math:`\rho^\prime(r)` is some other density profile, :math:`r_\mathrm{min}=`\ ``[radiusTruncateMinimum]``, :math:`r_\mathrm{decay}=`\ ``[radiusTruncateDecay]``, and .. math:: \kappa = \frac{r_\mathrm{min}}{r_\mathrm{decay}} + \frac{\mathrm{d}\log \rho^\prime}{\mathrm{d}\log r}(r_\mathrm{min}) is chosen to ensure that the logarithmic gradient of the density profile is continuous across :math:`r=r_\mathrm{min}`. **Parameters** * ``[radiusTruncateMinimum]`` (real) — The minimum radius to begin truncating the density profile. * ``[radiusTruncateDecay]`` (real) — The exponential decay scale for truncating the density profile. * ``[nonAnalyticSolver]`` (string; one of ``fallThrough``, ``numerical``; default ``fallThrough``) — Selects how solutions are computed when no analytic solution is available. * ``[componentType]`` (string; one of ``all``, ``disk``, ``spheroid``, ``hotHalo``, ``nuclearStarCluster``, ``coldHalo``, ``darkHalo``, ``blackHole``, ``darkMatterOnly``, ``none``, ``unknown``; default ``unknown``) — The component type that this mass distribution represents. * ``[massType]`` (string; one of ``all``, ``dark``, ``baryonic``, ``galactic``, ``gaseous``, ``stellar``, ``blackHole``, ``unknown``; default ``unknown``) — The mass type that this mass distribution represents. .. _physics-massDistributionZero: ``massDistributionZero`` ------------------------ A mass distribution class that returns zero density, zero enclosed mass, and zero potential everywhere; useful as a null placeholder when no mass component is present in a given region. **Parameters** * ``[dimensionless]`` (boolean; default ``.true.``) — If true the null profile is considered to be dimensionless. .. _physics-massDistributionZhao1996: ``massDistributionZhao1996`` ---------------------------- A mass distribution class which implements the :cite:p:`zhao_analytical_1996` density profile: .. math:: \rho_\mathrm{dark matter}(r) = \rho_0 \left({r\over r_\mathrm{s}}\right)^{-\gamma} \left(1+[{r\over r_\mathrm{s}}]^\alpha\right)^{-(\beta-\gamma)/\alpha}. The mass enclosed within radius :math:`r` is given by .. math:: M(