Cut-cell fractions
The equations of simgeometry.fractions, declared on the code that implements them and checked by the tests.
cell_fractions
functionsourceEstimate cell and face occupancy using a regular subcell sample lattice.
- samples
- fraction
- Assumes
- midpoint quadrature of the membership indicator,
samples_per_axisper axis: a fraction is a multiple of , not a reconstructed interface - features smaller than a sample spacing can be missed
- periodic axes wrap the sample points and have cells; face arrays carry both periodic boundary copies
- midpoint quadrature of the membership indicator,
yee_fractions
functionsourceEdge-length and face-area fractions of a Yee grid cut by geometry.
- edge
- gauss
- face
- trace
- trace sum
- Assumes
- edges whose midpoint is farther than half their length from the surface take the midpoint's membership; near ones get all crossings (repeated
crossings, at mostmax_hits) - a face is cut if one of its edges is crossed or its centre is within half a diagonal of the surface; lines across a cut face at the Gauss points of each piece between the face's edge crossings, in both in-plane directions
- corners: where the in-plane normals of neighbouring lines turn by a sine above 0.05, the tangents' intersection becomes an extra breakpoint
- fractions within of 0 or 1 are snapped; a wall lying in a grid plane counts as inside (a staircase)
- exact for planes up to the crossings' accuracy; second order or better for curved surfaces (docstring and tests), without a single clean order
- 2D or 3D grids with at least one cell per axis
- edges whose midpoint is farther than half their length from the surface take the midpoint's membership; near ones get all crossings (repeated
- References
- Built from