StructureFunctions.jl

StructureFunctions computes structure functions: averages over pairs of points of a polynomial in the increment δu = u(x + r) − u(x), binned in the separation |r|. It takes vector and scalar fields on point lists, batches of snapshots, structured grids and the sphere, and derives spectra, fluxes, covariances, fits and the third-order exact laws from the results.

Second-order structure function of a synthetic 2-D field

What it computes

CapabilityWhere
Second- and third-order, longitudinal, transverse, scalar, mixed and cross-field momentsMathematical definitions
The six isotropic invariants and the Helmholtz split in one pass over the pairsCalculations
Joint histograms in separation and operator value, or separation and angleCalculations
Moment tensors of any orderCalculations
Batches of snapshots over shared or varying positionsCalculations
Exact routes: cell culling, the sorted line, grid lag sweeps and grid transformsCalculations
Scattered points through a non-uniform FFTCalculations
Pair weights, masks, multi-fields and the sphereData and geometry
Spectra, Helmholtz spectra, covariances, spectral fluxes and fitsSpectra, fluxes and fitting
The four-fifths, four-thirds and Yaglom lawsExact laws
Serial, threaded, Distributed, MPI and GPU executionExecution backends

Installation

Julia 1.12 or later is required.

using Pkg
Pkg.add(url="https://github.com/jbphyswx/StructureFunctions.jl.git")

Extensions load with the packages they need: threading with OhMyThreads, GPUs with KernelAbstractions and CUDA, grids with FlowGeometries, transforms with an AbstractFFTs provider such as FFTW, and the spectral kernels with Bessels.

Start with Getting started.