CartesianOperators.jl

CartesianOperators.jl assembles Cartesian cut-cell operators from CartesianGeometry.GeometricMoments and provides convenient apply APIs for gradient/divergence-based formulations.

Scope

The package is the operator/capacity layer used by higher-level solvers.

Main responsibilities:

  • build and update assembled capacities (V, A, B, W, Γ) on a node-shaped lattice with explicit halo convention
  • assemble sparse operators (G, H, Winv) and directional finite-difference lifts
  • provide operator bundles (DiffusionOps, ConvectionOps, AdvectionOps)
  • apply assembled operators to field vectors via:
    • gradient / gradient!
    • divergence / divergence!

Quick Start

using CartesianGeometry
using CartesianOperators
using CartesianGeometry: nan

grid = (0.0:0.5:1.0, 0.0:0.5:1.0)
levelset(x, y, _=0) = x + y - 1.0

moms = geometric_moments(levelset, grid, Float64, nan; method=:vofijul)
cap = assembled_capacity(moms; bc=0.0)
ops = DiffusionOps(cap)

nt = size(ops.G, 2)
xω = rand(nt)
xγ = rand(nt)

q = gradient(ops, xω, xγ)
d = divergence(ops, q, q)

Core Equations

\[\operatorname{grad}(x^\omega, x^\gamma) = W^{-1}(Gx^\omega + Hx^\gamma)\]

\[\operatorname{div}(q^\omega, q^\gamma) = -(G^\top + H^\top)q^\omega + H^\top q^\gamma\]

Documentation Map

Build Notes

Local docs build:

julia --project=docs docs/make.jl

Package tests:

julia --project=. -e 'using Pkg; Pkg.test()'