.. _physics-computationalDomainVolumeIntegrator: Computational Domain Volume Integrators ======================================= Class providing numerical volume integrators over computational domains, computing the integral of a scalar function over the spatial domain. This is used e.g.\ to compute total emission or absorption from all cells, or to normalize radiative transfer solutions. Implementations provide the total domain volume and perform multi-dimensional quadrature using the domain's coordinate system (Cartesian, spherical, etc.). **Default implementation:** ``computationalDomainVolumeIntegratorCartesian3D`` Methods ------- ``volume`` → ``double precision`` Returns the total volume of the integration region defined by the domain boundaries, used for normalizing volume-averaged quantities in the radiative transfer calculation. ``integrate`` → ``double precision`` Numerically integrate a scalar function over the full extent of the computational domain using the appropriate coordinate system (Cartesian, cylindrical, or spherical), returning the total integral value. * ``procedure(computationalDomainVolumeIntegrand) :: integrand`` .. _physics-computationalDomainVolumeIntegratorCartesian3D: ``computationalDomainVolumeIntegratorCartesian3D`` -------------------------------------------------- Computes volume integrals over three-dimensional Cartesian grid cells, with the spatial extent of the domain defined by ``[xBoundaries]``, ``[yBoundaries]``, and ``[zBoundaries]``. Each cell volume is the product of its axis-aligned extents, enabling accurate integration of physical quantities over the full Cartesian domain. **(Default implementation)** **Parameters** * ``[xBoundaries]`` (default ``[-1.0d0,+1.0d0]``) — A two-element array :math:`[x_\mathrm{min}, x_\mathrm{max}]` specifying the extent of the 3D Cartesian integration domain along the :math:`x`-axis. * ``[yBoundaries]`` (default ``[-1.0d0,+1.0d0]``) — A two-element array :math:`[y_\mathrm{min}, y_\mathrm{max}]` specifying the extent of the 3D Cartesian integration domain along the :math:`y`-axis. * ``[zBoundaries]`` (default ``[-1.0d0,+1.0d0]``) — A two-element array :math:`[z_\mathrm{min}, z_\mathrm{max}]` specifying the extent of the 3D Cartesian integration domain along the :math:`z`-axis. .. _physics-computationalDomainVolumeIntegratorCylindrical: ``computationalDomainVolumeIntegratorCylindrical`` -------------------------------------------------- Computes volume integrals over cylindrical grid cells, accounting for the annular geometry of each cell. The radial and vertical extents of the domain are specified by ``[rBoundaries]`` and ``[zBoundaries]``, with cell volumes computed from the cylindrical shell geometry. **Methods** * ``sampleNode`` **Parameters** * ``[rBoundaries]`` (default ``[+0.0d0,+1.0d0]``) — A two-element array :math:`[r_\mathrm{min}, r_\mathrm{max}]` specifying the radial extent of the cylindrical computational domain, where :math:`r=0` is the cylinder axis. * ``[zBoundaries]`` (default ``[-1.0d0,+1.0d0]``) — A two-element array :math:`[z_\mathrm{min}, z_\mathrm{max}]` specifying the vertical extent of the cylindrical computational domain along the symmetry axis. * ``[countCells]`` (default ``[3_c_size_t,3_c_size_t]``) — A two-element integer array specifying the number of grid cells along the :math:`r` and :math:`z` dimensions of the cylindrical computational domain, controlling the spatial resolution of the radiative transfer calculation. * ``[convergencePercentile]`` (default ``0.99d0``) — The percentile of cells (between 0 and 1) used in assessing convergence; only this fraction of cells must satisfy the convergence threshold, allowing outlier cells to be excluded. * ``[convergenceThreshold]`` (default ``2.0d0``) — The threshold value for the convergence measure; the domain is considered converged when the specified percentile of cells has a convergence metric below this value. * ``[convergenceRatioThreshold]`` (default ``1.1d0``) — The threshold for the ratio of the convergence criterion between successive iterations; convergence is accepted when this ratio falls below the threshold, indicating the solution is no longer changing significantly. * ``[rBoundaries]`` (default ``[0.0d0,1.0d0]``) — A two-element array :math:`[r_\mathrm{min}, r_\mathrm{max}]` specifying the radial extent of the cylindrical integration domain. * ``[zBoundaries]`` (default ``[-1.0d0,+1.0d0]``) — A two-element array :math:`[z_\mathrm{min}, z_\mathrm{max}]` specifying the vertical extent of the cylindrical integration domain along the symmetry axis. * ``[radiusCylinderComoving]`` — The comoving radius of the cylinder to populate. * ``[radiusBufferComoving]`` (default ``1.0d0``) — The comoving buffer radius to add around the cylinder. This is used to ensure that the sample within the cylinder is complete. * ``[massHaloLens]`` (default ``-1.0d0``) — The mass of the primary lens halo (or a negative value for no lens). * ``[redshiftLens]`` (default ``-1.0d0``) — The redshift of the primary lens halo (or a negative value for no lens). .. _physics-computationalDomainVolumeIntegratorSpherical: ``computationalDomainVolumeIntegratorSpherical`` ------------------------------------------------ Computes volume integrals over spherical shell cells, with the radial boundaries of the domain specified by ``[boundaries]``. Cell volumes are computed from the difference of the enclosed spherical volumes at the inner and outer radial boundaries of each shell. **Methods** * ``next`` — Move to the next cell in the domain. **Parameters** * ``[boundaries]`` (default ``[+0.0d0,+1.0d0]``) — A two-element array :math:`[r_\mathrm{min}, r_\mathrm{max}]` specifying the radial extent of the spherically symmetric computational domain. * ``[countCells]`` (default ``3_c_size_t``) — The number of radial grid cells in the spherically symmetric computational domain, controlling the radial resolution of the radiative transfer calculation. * ``[convergencePercentile]`` (default ``0.99d0``) — The percentile of cells (between 0 and 1) used in assessing convergence; only this fraction of cells must satisfy the convergence threshold, allowing outlier cells to be excluded. * ``[convergenceThreshold]`` (default ``2.0d0``) — The threshold value for the convergence measure; the spherical domain is considered converged when the specified percentile of cells has a convergence metric below this value. * ``[convergenceRatioThreshold]`` (default ``1.1d0``) — The threshold for the ratio of the convergence criterion between successive iterations; convergence is accepted when this ratio falls below the threshold, indicating the solution is no longer changing significantly. * ``[boundaries]`` (default ``[0.0d0,1.0d0]``) — A two-element array :math:`[r_\mathrm{min}, r_\mathrm{max}]` specifying the radial extent of the spherically symmetric integration domain. * ``[variogramFitOption]`` (default ``var_str('median')``) — Option controlling how the binned semi-variance data are aggregated before fitting the spherical variogram model; allowed values are ``mean``, ``median`` (default), or ``maximum`` of the residuals within each separation bin. * ``[assumeZeroVarianceAtZeroLag]`` (default ``.false.``) — If true, the variogram model is forced to go to zero for states with zero separation (as expected if the likelihood model being emulated is fully deterministic). Otherwise, the variance at zero separation is treated as a free parameter.