Kinematics Distributions¶
Class providing kinematics distributions for mass distribution components—the temperature, velocity dispersion, and mean radial velocity of particles (or fluid elements) as a function of position. For collisional (gaseous) components the temperature profile enters the cooling and feedback calculations; for collisionless (stellar and dark matter) components the velocity dispersion is computed by solving the spherical Jeans equation given the mass distribution and its potential.
Methods¶
isCollisional→logicalReturn true if the kinematics is collisional.
temperature→double precisionReturn the temperature of the distribution at the given coordinates.
class(coordinate), intent(in ) :: coordinates
temperatureGradientLogarithmic→double precisionReturn the logarithmic gradient of the temperature of the distribution at the given coordinates.
class(coordinate), intent(in ) :: coordinates
velocityRadial→double precisionReturn the mean radial velocity at the given coordinate.
class(coordinate ), intent(in ) :: coordinatesclass(massDistributionClass), intent(inout) :: massDistributionEmbedding
velocityDispersion1D→double precisionReturn the 1D velocity dispersion at the given coordinate.
class(coordinate ), intent(in ) :: coordinatesclass(massDistributionClass), intent(inout), target :: massDistribution_, massDistributionEmbedding
velocityDispersion1DNumerical→double precisionReturn the 1D velocity dispersion at the given coordinate by numerically solving the Jeans equation.
class(coordinate ), intent(in ) :: coordinatesclass(massDistributionClass), intent(inout), target :: massDistribution_, massDistributionEmbedding
jeansEquationRadius→double precisionReturn the radius variable used in solving the Jeans equation that corresponds to a given physical radius.
double precision , intent(in ) :: radiusclass (massDistributionClass), intent(inout) :: massDistributionEmbedding
jeansEquationIntegrand→double precisionEvaluate the integrand of the Jeans equation at the given
radius, returning \(\mathrm{G}M(r)\rho(r)/r^2\) needed for numerical integration of the spherical Jeans equation to obtain the line-of-sight velocity dispersion.double precision , intent(in ) :: radiusclass (massDistributionClass), intent(inout) :: massDistribution_, massDistributionEmbedding
solverSet→voidSet a sub-module scope pointers on a stack to allow recursive calls to functions.
class (massDistributionClass), intent(in ), target :: massDistribution_, massDistributionEmbedding
solverUnset→voidUnset a sub-module scope pointers on the stack.
reset→voidReset memoized (cached) velocity-dispersion state, so that a kinematics distribution attached to a re-initialized (e.g. pooled) mass distribution never returns stale results.
kinematicsDistributionBurkert¶
A kinematic distribution class for Burkert mass distributions.
Methods
timeFreefallTabulate— Tabulate the freefall time as a function of radius in a scale-free Burkert mass distribution.
kinematicsDistributionCollisionless¶
A kinematic distribution class for collisionless (dark matter or stellar) mass distributions that computes the 1D velocity dispersion by numerically solving the isotropic Jeans equation. Convergence tolerances for the velocity dispersion integral are controlled by [toleranceRelativeVelocityDispersion] and [toleranceRelativeVelocityDispersionMaximum].
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
[toleranceRelativeVelocityDispersion](real; default1.0d-6) — The relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles.[toleranceRelativeVelocityDispersionMaximum](real; default1.0d-3) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles.
kinematicsDistributionCollisionlessTabulated¶
A kinematic distribution base class for collisionless mass distributions that computes the 1D velocity dispersion by numerically solving the isotropic Jeans equation and caching the results in tabulated form. Numerical convergence is governed by [toleranceRelativeVelocityDispersion] and [toleranceRelativeVelocityDispersionMaximum].
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.
Parameters
[toleranceRelativeVelocityDispersion](real; default1.0d-6) — The relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles.[toleranceRelativeVelocityDispersionMaximum](real; default1.0d-3) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles.
kinematicsDistributionCuspNFW¶
A kinematic distribution class for the cusp-NFW dark matter profile of (Delos, 2025), which describes halos with a central density cusp transitioning to an NFW envelope. The 1D velocity dispersion is computed from tabulated solutions to the isotropic Jeans equation for this two-component density profile.
Parameters
[toleranceRelativeVelocityDispersion](real; default1.0d-6) — The relative tolerance to use in numerical solutions for the velocity dispersion.[toleranceRelativeVelocityDispersionMaximum](real; default1.0d-3) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion.
kinematicsDistributionEnzoHydrostatic¶
A kinematic class that implements the “hydrostatic” temperature profile available in the ENZO code. Specifically,
where \(M(<r)\) is the total mass enclosed within radius \(r\), \(\mu\) is the primordial mean atomic mass, and \(T_\mathrm{min}=100\) K is a temperature floor introduced so as to avoid the temperature reaching arbitrarily low values.
Methods
normalizationDensity— Return the normalization of the density profile.
kinematicsDistributionFiniteResolutionNFW¶
A kinematic distribution class for finite-resolution NFW mass distributions.
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.
kinematicsDistributionHeated¶
A kinematic distribution class for mass distributions subject to external heating. The 1D velocity dispersion is computed by solving the Jeans equation modified to account for the additional energy injected by the heating source. The [velocityDispersionApproximate] flag enables an approximate solver for improved performance.
Parameters
[velocityDispersionApproximate](boolean; default.true.) — Iftrue, radial velocity dispersion is computed using an approximate method in which we assume that \(\sigma_\mathrm{r}^2(r) \rightarrow \sigma_\mathrm{r}^2(r) - (2/3) \epsilon(r)\), where \(\epsilon(r)\) is the specific heating energy. Iffalsethen radial velocity dispersion is computed by numerically solving the Jeans equation.[toleranceRelativeVelocityDispersion](real; default1.0d-6) — The relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles.[toleranceRelativeVelocityDispersionMaximum](real; default1.0d-3) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles.[nonAnalyticSolver](string; one offallThrough,numerical; defaultfallThrough) — 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.
kinematicsDistributionIsothermal¶
An isothermal kinematic distribution class for collisional gas components in which all particles share a single uniform temperature. The 1D velocity dispersion is derived from the gas temperature [temperature] and mean atomic mass [massAtomicMean], appropriate for modelling thermally supported gas in hydrostatic equilibrium.
Parameters
[temperature](real) — The temperature (in Kelvin) of the isothermal gas distribution; used withmassAtomicMeanto compute the 1D velocity dispersion via \(\sigma^2 = k_\mathrm{B} T / (\mu m_\mathrm{H})\).[massAtomicMean](real) — The mean atomic mass (in atomic mass units) of the distribution.[velocityDispersion](real) — The 1D velocity dispersion (in km/s) of the isothermal distribution, used directly when notemperatureis specified; sets the thermally broadened line-of-sight velocity spread.
kinematicsDistributionLam2013¶
A kinematic distribution class implementing the Lam et al. (2013) model of radial velocity infall in halo accretion flows. The radial velocity profile is computed from the volume-averaged two-point correlation function and cosmological linear growth rate, encoding the infall dynamics around collapsed halos at a given redshift and virial mass.
Parameters
[scaleFactorVelocity](real; default1.0d0) — A scale factor to be applied to inflow velocities.[redshift](real) — The cosmological redshift of the halo, used to evaluate the cosmic time and the Lam et al. (2013) infall velocity profile at the appropriate epoch.[massVirial](real) — The virial mass (in \(\mathrm{M}_\odot\)) of the halo whose accretion flow kinematics are modeled by the Lam et al. (2013) framework.[radiusVirial](real) — The virial radius (in Mpc) of the halo, setting the spatial scale for the Lam et al. (2013) radial infall velocity profile.[overdensityCritical](real) — The critical linear overdensity threshold for collapse used in the Lam et al. (2013) accretion flow model to normalize the radial infall velocity.[rateLinearGrowth](real) — The logarithmic derivative of the linear growth factor with respect to expansion factor.[radius](real) — The radius in the tabulated volume-averaged correlation function.[correlationFunctionVolumeAveraged](real) — The correlation in the tabulated volume-averaged correlation function.
kinematicsDistributionLocal¶
A local kinematic distribution class in which the 1D velocity dispersion is given by
where \(r = |\mathbf{r}|\) and \(V_\mathrm{c}(r)\) is the rotation curve. Here, \(\alpha=\)[] is a parameter.
Parameters
[alpha](real; default1.0d0/sqrt(2.0d0)) — The parameter \(\alpha\) in the relation \(\sigma_\mathrm{1D}(\mathbf{r}) = \alpha V_\mathrm{c}(r)\).
kinematicsDistributionNFW¶
A kinematic distribution class that computes the collisionless 1D velocity dispersion profile for Navarro-Frenk-White (NFW) dark matter mass distributions by solving the Jeans equation. A series approximation for the velocity dispersion integral can be selected via [useSeriesApproximation] to improve numerical efficiency.
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
[useSeriesApproximation](boolean; default.true.) — If true, use a fast series approximation to the velocity dispersion profile in an NFW mass distribution. The approximation matches the exact (dilogarithm-based) form to better than \(5\times 10^{-6}\) in relative terms across \(r/r_\mathrm{s} \in [10^{-4},10^4]\) (seetests.kinematic_distributions.NFW).
kinematicsDistributionShi2016¶
A kinematic distribution class for the Shi (2016) model of halo accretion flows.
Methods
solve— Solve for the structure of the accretion flow.
kinematicsDistributionSIDMIsothermal¶
A kinematic distribution class implementing the “isothermal” approximation to the effects of SIDM based on the model of Jiang et al. (2023).
kinematicsDistributionSoliton¶
A kinematic distribution class for the solitonic core mass distribution found in fuzzy dark matter halos. The 1D velocity dispersion profile is computed from tabulated solutions to the isotropic Jeans equation applied to the soliton density profile, encoding the quantum pressure support of ultralight axion dark matter.
Methods
radiusMerge— Compute the radius at which the satellite will be merged in FDM models.
Parameters
[toleranceRelativeVelocityDispersion](real; default1.0d-6) — The relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles.[toleranceRelativeVelocityDispersionMaximum](real; default1.0d-3) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion in dark-matter-only density profiles.
kinematicsDistributionSolitonNFW¶
A kinematic distribution class for the soliton-NFW mass distribution. In the NFW region, the velocity dispersion is computed using the analytic solution of Łokas and Mamon (2001), plus a correction term which accounts for the difference in mass inside the soliton radius between the soliton and the NFW profile. Specifically, we solve the Jeans equation for a point mass (since outside of the soliton radius, the mass within it acts as a point mass) and the NFW density profile:
where \(\Delta M = M_\mathrm{soliton}(r_\mathrm{soliton}) - M_\mathrm{NFW}(r_\mathrm{soliton})\), and which has the solution:
Inside the soliton, the NFW solution is used as a boundary condition at \(r_\mathrm{soliton}\), and the Jeans equation is then solved using the soliton density profile, which results in a solution
where \(x = r/r_\mathrm{c}\) and \(y = a x^2\).
Methods
computeProperties— Compute properties of the mass distribution.calculationReset— Reset memoized calculations.
Parameters
[toleranceRelativeVelocityDispersion](real; default1.0d-6) — The relative tolerance to use in numerical solutions for the velocity dispersion.[toleranceRelativeVelocityDispersionMaximum](real; default1.0d-3) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion.
kinematicsDistributionSolitonNFWHeated¶
A kinematic distribution class for a composite soliton-NFW mass distribution subject to heating, as occurs in fuzzy dark matter halos with a quantum-pressure-supported solitonic core embedded in an NFW envelope. The 1D velocity dispersion is computed by solving the isotropic Jeans equation for the heated composite profile.
Methods
computeProperties— Compute properties of the mass distribution.calculationReset— Reset memoized calculations.
Parameters
[toleranceRelativeVelocityDispersion](real; default1.0d-6) — The relative tolerance to use in numerical solutions for the velocity dispersion.[toleranceRelativeVelocityDispersionMaximum](real; default1.0d-3) — The maximum relative tolerance to use in numerical solutions for the velocity dispersion.
kinematicsDistributionSphericalScaler¶
A kinematic distribution decorator class that rescales the velocity dispersion of an underlying spherical kinematic distribution by applying independent scaling factors to the length and mass dimensions. The scale factors [factorScalingLength] and [factorScalingMass] allow the kinematic profile to be mapped between systems of different physical size or mass.
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.
kinematicsDistributionTruncated¶
A kinematic distribution class for truncated mass distributions.
Methods
truncationFunction— Compute the truncation fraction (and related quantities) from the radius.
kinematicsDistributionUndecorator¶
A kinematic distribution class for decorated mass distributions, that uses the undecorated mass distribution.
kinematicsDistributionZhao1996¶
A kinematic distribution class for Zhao (1996) mass distributions.
Methods
timeFreefallTabulate— Tabulate the freefall time as a function of radius in a scale-free Zhao1996 mass distribution.