CartesianGeometry.jl

Installation

using Pkg
Pkg.add("https://github.com/PenguinxCutCell/CartesianGeometry.jl.git")

Overview

CartesianGeometry.jl provides geometric operators on Cartesian grids, including cut-cell integration, centroids, cell typing, and mixture laws for shared face/staggered quantities.

Main capabilities:

  • Cartesian mesh helpers and canonical test geometry
  • First-kind moments (V, A) and second-kind moments (W, B)
  • Backend selection between Vofinit, VofiJul, VOFTools, and ImplicitIntegration
  • Mixture laws for shared apertures/staggered volumes

Quick Example

using CartesianGeometry

xyz = (
    collect(range(0.0, 1.0; length=17)),
    collect(range(0.0, 1.0; length=17)),
)
f = HyperSphere{2,Float64}(0.45, (0.5, 0.5))

V, bary, iface, cell_type, bary_iface = integrate(Tuple{0}, f, xyz, Float64, nan)
A = integrate(Tuple{1}, f, xyz, Float64, nan)

V = reshape(V, 17, 17)

# Arrays follow node-shaped indexing; halo slots are filled with `bc`.
17×17 Matrix{Float64}:
   0.0            0.0         …    0.0           0.0          NaN
   0.0            0.0              0.0           0.0          NaN
   0.0            0.0              0.0           0.0          NaN
   0.0            0.0              0.0           0.0          NaN
   0.0            0.00110742       0.00110742    0.0          NaN
   0.0            0.0029102   …    0.0029102     0.0          NaN
   0.000189627    0.00385657       0.00385657    0.000189627  NaN
   0.000690564    0.00390625       0.00390625    0.000690564  NaN
   0.000690564    0.00390625       0.00390625    0.000690564  NaN
   0.000189627    0.00385657       0.00385657    0.000189627  NaN
   0.0            0.0029102   …    0.0029102     0.0          NaN
   0.0            0.00110742       0.00110742    0.0          NaN
   0.0            0.0              0.0           0.0          NaN
   0.0            0.0              0.0           0.0          NaN
   0.0            0.0              0.0           0.0          NaN
   0.0            0.0         …    0.0           0.0          NaN
 NaN            NaN              NaN           NaN            NaN

Main Sections