volumential.gaussian#
Gaussian source fixtures and exports for free-space volume-potential demos.
- class volumential.gaussian.GaussianComponent(amplitude: float, center: tuple[float, ...], alpha: float)[source]#
Bases:
objectOne isotropic Gaussian component
amplitude * exp(-alpha * |x-c|^2).
- class volumential.gaussian.GaussianMixture(name: str, components: tuple[GaussianComponent, ...])[source]#
Bases:
objectA named collection of compatible
GaussianComponentobjects.- components: tuple[GaussianComponent, ...]#
- volumential.gaussian.default_overlapping_gaussian_mixture(dim: int = 3) GaussianMixture[source]#
Return a deterministic positive overlapping mixture for smoke demos.
- volumential.gaussian.evaluate_gaussian_mixture(mixture: GaussianMixture, points: ndarray) ndarray[source]#
Evaluate the source density at
points.
- volumential.gaussian.evaluate_gaussian_laplacian_power(mixture: GaussianMixture, points: ndarray, *, order: int) ndarray[source]#
Evaluate
Delta**orderof an isotropic Gaussian mixture.Orders through three are provided because the fourth-order DMK residual effective-density correction needs
Delta rho,Delta**2 rho, andDelta**3 rhofor a Gaussian source.
- volumential.gaussian.dmk_gaussian_split_sigma(box_side_length: float, epsilon: float) float[source]#
Return the DMK-style Gaussian split scale for one box level.
Jiang–Greengard DMK chooses a Gaussian kernel-splitting scale proportional to
r_l / sqrt(log(1/epsilon))for box side lengthr_land requested precisionepsilon. This helper records that normalization for controlled diagnostics; it does not include the separate residual sum-of-Gaussians fit.
- volumential.gaussian.gaussian_filter_mixture(mixture: GaussianMixture, sigma: float) GaussianMixture[source]#
Convolve
mixturewith a normalized isotropic Gaussian filter.The filter is
gamma_sigma(x) = (2*pi*sigma**2)^(-d/2) exp(-|x|**2/(2*sigma**2))and has Fourier multiplier
exp(-sigma**2 |k|**2 / 2)under the convention where the 3D Laplace Green’s function1/(4*pi*r)has multiplier1/|k|**2. Convolving eachA exp(-alpha |x-c|^2)component preserves its mass and maps it to another Gaussian withalpha_eff = alpha / (1 + 2 alpha sigma**2).
- volumential.gaussian.laplace3d_gaussian_potential(mixture: GaussianMixture, points: ndarray, *, kernel_scale: float = 1.0) ndarray[source]#
Evaluate the full-space 3D Laplace potential of
mixture.The default
kernel_scale=1gives the unnormalized kernelK(x, y) = 1 / |x-y|. Usekernel_scale=1/(4*pi)for the classical Green’s function normalization used by Sumpy’s 3D Laplace global scaling.
- volumential.gaussian.gaussian_mixture_tail_report(mixture: GaussianMixture, bbox: ndarray) dict[str, Any][source]#
Report signed and absolute Gaussian mass omitted outside
bbox.
- class volumential.gaussian.SliceGrid(points: ndarray, shape: tuple[int, int], axes: tuple[int, int], fixed_axis: int, fixed_value: float, axis_values: tuple[ndarray, ndarray])[source]#
Bases:
objectA 2D Cartesian grid embedded in a 3D box, with its axis metadata.
- volumential.gaussian.axis_aligned_slice_grid(bbox: ndarray, *, fixed_axis: int = 2, fixed_value: float = 0.0, axes: tuple[int, int] | None = None, shape: tuple[int, int] = (64, 64)) SliceGrid[source]#
Create a 2D Cartesian slice grid embedded in a 3D bounding box.
- volumential.gaussian.nearest_axis_slice(points: ndarray, fields: dict[str, ndarray] | None = None, *, axis: int = 2, value: float = 0.0, atol: float | None = None) dict[str, Any][source]#
Extract nodes on the plane nearest to
points[:, axis] == value.
- volumential.gaussian.mesh_leaf_box_arrays(mesh: Any) dict[str, ndarray][source]#
Return host arrays describing the active leaf boxes of a Volumential mesh.