Public API

The public API is organized by workflow rather than as a single flat reference page.

Main Entry Points

Core Names

The most commonly used public names are:

  • Particle containers: Particles, PassiveMarkers, MarkerChain
  • Particle initialization and management: init_particles, init_passive_markers, move_particles!, inject_particles!, inject_particles_phase!, clean_particles!, force_injection!
  • Interpolation: grid2particle!, grid2particle_flip!, particle2grid!, centroid2particle!, particle2centroid!
  • Advection: advection!, advection_LinP!, advection_MQS!, semilagrangian_advection!, semilagrangian_advection_LinP!, semilagrangian_advection_MQS!
  • Marker-chain utilities: init_markerchain, fill_chain_from_chain!, fill_chain_from_vertices!, advect_markerchain!, semilagrangian_advection_markerchain!, interpolate_velocity_to_markerchain!, compute_topography_vertex!, compute_rock_fraction!, resample!
  • Phase ratios and diffusion: PhaseRatios, update_phase_ratios!, SubgridDiffusionCellArrays, subgrid_diffusion!, subgrid_diffusion_centroid!
  • Backends and allocation helpers: KernelAbstractions' CPU (and the vendor backends CUDA.CUDABackend, AMDGPU.ROCBackend, Metal.MetalBackend), plus TA, cell_array
  • Integrators: Euler, RungeKutta2, RungeKutta4
  • Checkpointing: checkpointing_particles

Backend Helpers

JustPIC dispatches on KernelAbstractions backend types directly — CPU for the CPU path and the vendor backends CUDA.CUDABackend, AMDGPU.ROCBackend, Metal.MetalBackend (introduced by the respective package extensions). It no longer defines its own backend tags.

JustPIC.TAFunction
TA()
TA(backend)

Return the plain array type associated with backend (a KernelAbstractions backend type such as CPU).

For CPU this is Array. Loading CUDA.jl / AMDGPU.jl / Metal.jl extends this for CUDA.CUDABackend, AMDGPU.ROCBackend, and Metal.MetalBackend, respectively.

source
JustPIC.cell_arrayFunction
cell_array(backend, x, ncells::NTuple, ni::NTuple)
cell_array(x, ncells::NTuple, ni::NTuple)

Allocate a CellArray on backend (a KernelAbstractions backend type such as CPU), with ncells entries per grid cell over a grid of size ni, and fill every entry with x.

The backend form is the preferred allocation path for particle storage and phase-ratio arrays. The backend-less form allocates on CPU.

Examples

index = cell_array(CPU, false, (24,), (64, 64))
field = cell_array(CPU, 0.0, (3,), (64, 64))
source

Finding Method Docs

For exact signatures and the most up-to-date method documentation, use Julia help mode:

?init_particles
?advection!
?checkpointing_particles