API reference

Base.append! — Method

Append every moment of other to l (IRL takes other non-const).

source
Base.resize! — Method
resize!(b::ByteBuffer, n) -> b

Set the buffer's size to n bytes. Use before unpacking into b from an external source (e.g. after an MPI receive tells you the incoming length).

source
InterfaceReconstructionLibrary.addpath! — Method
addpath!(g::PlanarSeparatorPathGroup, p::PlanarSeparatorPath[, id]) -> g

Add p to the group. With id, the path is registered under that phase id (IRL's addPlanarSeparatorPath overload taking an explicit tag).

source
InterfaceReconstructionLibrary.adjust_cap_to_match_volume! — Function
adjust_cap_to_match_volume!(p, signed_volume) -> p

Move the "cap" vertex of a capped polytope so volume(p) equals signed_volume.

This is what makes a semi-Lagrangian flux volume conservative: build the flux polyhedron from back-projected face vertices, then pin its volume to the exact face flux u·n A Δt. Available on the capped/symmetric polytopes (CappedDodecahedron*, CappedOctahedron_*, Polyhedron24*, SymmetricHexahedron, SymmetricTriangularPrism).

source
InterfaceReconstructionLibrary.interface_polygon — Function
interface_polygon(cell, sep::PlanarSeparator; plane = 1) -> Polygon

The polygon where sep's plane-th interface plane (1-based) cuts cell.

Cells: RectangularCuboid, Tet, Hexahedron. Returns an empty polygon (npts == 0) when the plane misses the cell — a cell that is entirely liquid or entirely gas has no interface. The result's plane of existence is set, so volume (signed area), centroid, and normal are immediately valid.

source
InterfaceReconstructionLibrary.is_point_internal — Function
is_point_internal(pt, sep::PlanarSeparator) -> Bool
is_point_internal(pt, loc::PlanarLocalizer) -> Bool

Whether pt lies on the internal side of every plane — inside the separator's liquid region, or inside the localizer's cell.

source
InterfaceReconstructionLibrary.locate_point — Function
locate_point(pt, link) -> Int

Walk the link graph from link and return the id of the node whose localizer contains pt (the id set with setid!).

This is the lookup a semi-Lagrangian scheme needs after back-projecting a point: given a departure point, which cell did it come from? Works on LocalizedSeparatorLink and LocalizedSeparatorGroupLink. The walk starts at link, so pass a node near pt to keep it short.

`pt` must be reachable

At each node IRL steps to neighbour(n) for the first plane n that pt lies outside of. If that neighbour was never connected, IRL dereferences a null pointer — its only guard is an assert, which a Release build of libirl_c compiles out, so the result is a segfault, not an exception. Every link on the path from link to pt's cell must be wired with connect!, and pt must lie inside the connected region.

For a localizer built by localizer_from_cuboid the edge index is the plane index, ordered -x, +x, -y, +y, -z, +z — so a cell's +x neighbour is edge 1, not 0.

source
InterfaceReconstructionLibrary.match_group_volume_fraction! — Function
match_group_volume_fraction!(group::PlanarSeparatorPathGroup, cell, vfracs;
                             tolerance = nothing) -> group

Multi-phase volume-fraction matching: set every separator in group so that cell's phase fractions equal vfracs (one entry per phase, in the group's priority order). Cells: Tet, Hexahedron, Pyramid, TriangularPrism.

source
InterfaceReconstructionLibrary.match_volume_fraction! — Function
match_volume_fraction!(sep::PlanarSeparator, cell, vfrac; tolerance = nothing) -> sep

Adjust sep's plane distance so cell's internal fraction equals vfrac. With tolerance, IRL's iterative distance search stops at that volume-fraction error instead of the library default.

source
InterfaceReconstructionLibrary.moments_at_tag — Method
moments_at_tag(c, tag) -> SeparatedMoments

The moments accumulated against region tag — for a flux-volume cut, the liquid and gas contributed by the donor cell with that id. Unlike c[i], the lookup is by IRL's raw tag, so you can ask for a specific donor without scanning tags(c). The result aliases into c, which it retains.

source
InterfaceReconstructionLibrary.print_to_screen — Function
print_to_screen(x) -> x

Dump x using IRL's internal C++ printer. Output goes to the process's stdout directly, bypassing Julia's IO — it will not appear in a redirected IOBuffer. Defined for the types whose C interface provides printToScreen.

source
InterfaceReconstructionLibrary.reconstruct_advected_normals — Method
reconstruct_advected_normals(moments::ListedVolumeMoments, n::R2PNeighborhood,
                             two_plane_threshold; debug = false) -> PlanarSeparator

Reconstruct from transported interface normals rather than from volume fractions alone. moments holds the advected VolumeMomentsAndNormal entries (typically the output of a doubles3 / VMAN flux-volume cut); two_plane_threshold decides when the result becomes a two-plane (R2P) separator instead of a single plane.

source
InterfaceReconstructionLibrary.reconstruct_lvira — Function
reconstruct_lvira(neigh, guess_or_center_moments; dims=3) -> PlanarSeparator

Non-mutating LVIRA. Pass either an explicit PlanarSeparator guess, or the centre cell's SeparatedMoments — in which case IRL's barycentre initial guess (normalize(gas_centroid − liquid_centroid), then match VF) is built, exactly as IRL's own driver does. Requires set_center_of_stencil! for the latter.

source
InterfaceReconstructionLibrary.reconstruct_mof — Function
reconstruct_mof(cell, moments::SeparatedMoments; dims = 3) -> PlanarSeparator
reconstruct_mof(cell, moments, w_internal, w_external; dims = 3) -> PlanarSeparator

Moment-of-Fluid reconstruction: the single-plane separator for cell whose internal region reproduces moments. The 4-arg form is the geometrically- weighted (GW) variant.

Cells depend on dims: 3D takes Tet, Hexahedron, RectangularCuboid; 2D takes RectangularCuboid and Triangle (IRL's planar MOF, which constrains the interface normal to the x–y plane).

source
InterfaceReconstructionLibrary.reconstruct_r2p! — Method
reconstruct_r2p!(guess::PlanarSeparator, n::R2PNeighborhood; dims=3,
                 weighting=nothing, behavior=nothing) -> guess

R2P reconstruction — like LVIRA, an optimizer that refines an initial-guess separator in place against the neighborhood's separated moments. With a weighting::R2PWeighting (and optionally a behavior::OptimizationBehavior) the weighted 3D solver is used.

source
InterfaceReconstructionLibrary.reconstruct_r2p — Method
reconstruct_r2p(n::R2PNeighborhood[, guess]; dims=3, kwargs...) -> PlanarSeparator

Non-mutating R2P. With no guess, IRL's barycentre initial guess is built from the centre cell's stored moments (requires set_center_of_stencil!).

source
InterfaceReconstructionLibrary.separated_moments — Method
separated_moments(poly, sep::PlanarSeparator) -> SeparatedMoments

Cut poly by sep and return internal & external volume + centroid. Available for shapes with a *_PlanarSep_SepVM cutter (RectangularCuboid, Hexahedron, Dodecahedron).

source
InterfaceReconstructionLibrary.setmember! — Function
setmember!(neigh, index_or_ijk..., cell, value) -> neigh

Place a stencil member. Stencil indices are 0-based (IRL convention): a linear index in 0:N-1 for LVIRA/R2P, or (i, j, k) ∈ {-1,0,1} for ELVIRA.

source
InterfaceReconstructionLibrary.setplane! — Function
setplane!(sep_or_loc, i, normal, distance) -> sep_or_loc

Overwrite the i-th plane (1-based) in place, rather than appending as addplane! does. The plane count must already cover i — grow it first with set_nplanes!. Reusing a separator this way avoids reallocating one per cell per timestep.

source
InterfaceReconstructionLibrary.setpt! — Function
setpt!(p, i, pt) -> p

Overwrite vertex i (1-based) in place. Defined for the polytopes whose C interface exposes a point setter (Polyhedron24, and the doubles3 types) — useful to avoid reallocating a flux volume every timestep.

source
InterfaceReconstructionLibrary.@wrap — Macro
@wrap JuliaName c_prefix

Define mutable struct JuliaName wrapping Ref{c_prefix} with a zero-argument constructor that calls c_prefix_new, a finalizer calling c_prefix_delete, and registration in _JLTYPE. Zero-arg construction fits the many IRL objects that are created empty and then filled by a cutter.

source