.. _physics-galacticStructureSolver: Galactic Structure Solver ========================= Class providing solvers for galactic structure---algorithms that determine the sizes (half-mass or scale radii) of galactic components (disc, bulge, nuclear star cluster), e.g. by finding the equilibrium configuration that satisfies the angular momentum conservation constraint, i.e. the radius at which the specific angular momentum of the component matches that of the infalling gas. Solving for the structure may require self-consistent accounting of the gravitational potential from all components including dark matter, gas, and stars. **Default implementation:** ``galacticStructureSolverEquilibrium`` Methods ------- ``solve`` → ``void`` Solves for the structure of components in the given ``node``. * ``type (treeNode), intent(inout), target :: node`` * ``logical , intent(in ), optional :: plausibilityOnly`` ``revert`` → ``void`` Revert the structure of components in the given ``node`` (if necessary to ensure that the structure solver will give the same result when called consecutively). * ``type(treeNode), intent(inout) :: node`` .. _physics-galacticStructureSolverEquilibrium: ``galacticStructureSolverEquilibrium`` -------------------------------------- An "equilibrium" solver for galactic structure that iteratively finds radii at which each galactic component is in equilibrium within the combined gravitational potential of dark matter and baryons. Convergence is controlled by ``[solutionTolerance]``, with optional inclusion of baryon self-gravity via ``[includeBaryonGravity]``. **(Default implementation)** **Parameters** * ``[convergenceFailureIsFatal]`` (boolean; default ``.true.``) — If true, failure to achieve convergence in radii results in a fatal error. * ``[includeBaryonGravity]`` (boolean; default ``.true.``) — Specifies whether or not gravity from baryons is included when solving for sizes of galactic components. * ``[useFormationHalo]`` (boolean; default ``.false.``) — Specifies whether or not the "formation halo" should be used when solving for the radii of galaxies. * ``[solveForInactiveProperties]`` (boolean; default ``.true.``) — If true, galactic structure is solved for during evaluation of inactive property integrals. Otherwise, structure is not solved for during this phase---this should only be used if the inactive property integrands *do not* depend on galactic structure. * ``[solutionTolerance]`` (real; default ``1.0d-2``) — Maximum allowed mean fractional error in the radii of all components when seeking equilibrium solutions for galactic structure. .. _physics-galacticStructureSolverFixed: ``galacticStructureSolverFixed`` -------------------------------- A galactic structure solver that determines the sizes of galactic components by assuming that radius equals .. math:: r = f_\mathrm{r} \lambda r_0 where :math:`r_0` is the virial or turnaround radius of the :term:`node` if ``[radiusFixed]``\ :math:`=`\ ``virialRadius`` or ``turnaround`` respectively, :math:`\lambda` is its spin parameter and :math:`f_\mathrm{r}=`\ ``[factor]`` is a parameter. Optionally, different values of :math:`f_\mathrm{r}` can be specified for disks and spheroids using the ``[factorDisk]`` and ``[factorSpheroid]`` parameters respectively---if either or both are not provided the value of ``[factor]`` will be used for the corresponding component. **Parameters** * ``[factor]`` (real; default ``sqrt(0.5d0)``) — The ratio of galaxy radius to :math:`\lambda r_\mathrm{vir}` in the "fixed" galactic structure radius solver algorithm. This will be applied to any component for which no component-specific value is provided. * ``[factorDisk]`` (real; default ``sqrt(0.5d0)``) — The ratio of galaxy radius to :math:`\lambda r_\mathrm{vir}` in the "fixed" galactic structure radius solver algorithm for disks. This will override the generic value supplied by ``[factor]`` for disks. * ``[factorSpheroid]`` (real; default ``sqrt(0.5d0)``) — The ratio of galaxy radius to :math:`\lambda r_\mathrm{vir}` in the "fixed" galactic structure radius solver algorithm for spheroids. This will override the generic value supplied by ``[factor]`` for spheroids. * ``[radiusFixed]`` (string; one of ``virial``, ``turnaround``; default ``virial``) — The radius to use in the "fixed" galactic structure radius solver algorithm. Allowed options are "virial" and "turnaround". .. _physics-galacticStructureSolverLinear: ``galacticStructureSolverLinear`` --------------------------------- A galactic structure solver class that determines the sizes of galactic components by assuming that radius scales linearly with specific angular momentum such that .. math:: r = r_\mathrm{vir} j/j_\mathrm{vir} where :math:`j` is the specific angular momentum of the :term:`component` (at whatever point in the profile is to be solved for), :math:`r` is radius, :math:`r_\mathrm{vir}` is the virial radius of the :term:`node` and :math:`j_\mathrm{vir}= r_\mathrm{vir} v_\mathrm{vir}` with :math:`v_\mathrm{vir}` being the virial velocity of the :term:`node`. .. _physics-galacticStructureSolverNull: ``galacticStructureSolverNull`` ------------------------------- A no-op galactic structure solver that performs no radius solving, useful as a placeholder when galactic structure calculations are not needed or as a baseline for testing. .. _physics-galacticStructureSolverSimple: ``galacticStructureSolverSimple`` --------------------------------- A galactic structure solver class that determines the sizes of galactic components by assuming that their self-gravity is negligible (i.e. that the gravitational potential well is dominated by dark matter) and that, therefore, baryons do not modify the dark matter density profile. The radius of a given :term:`component` is then found by solving .. math:: j = \sqrt{\G M_\mathrm{DM}(r) r}, where :math:`j` is the specific angular momentum of the :term:`component` (at whatever point in the profile is to be solved for), :math:`r` is radius and :math:`M(r)` is the mass of dark matter within radius :math:`r`. The parameter ``[useFormationHalo]`` controls whether the structure of the galaxy will be solved for using the properties of its present :term:`node` or those of its :term:`node` at the time of :term:`node` formation (which requires that "node formation" has been suitably defined and implemented by a component). **Methods** * ``calculationReset`` — Reset memoized calculations. **Parameters** * ``[useFormationHalo]`` (boolean; default ``.false.``) — Specifies whether or not the "formation halo" should be used when solving for the radii of galaxies. * ``[solveForInactiveProperties]`` (boolean; default ``.true.``) — If true, galactic structure is solved for during evaluation of inactive property integrals. Otherwise, structure is not solved for during this phase---this should only be used if the inactive property integrands *do not* depend on galactic structure.