Axisymmetric bodies, radiation and nonlocal values
Axisymmetric (bodies of revolution)
jNO applies no ring measure for you — you write it in the weak form. A meridional (r, z) mesh is
an ordinary 2-D mesh; what makes a form axisymmetric is the measure you put in it.
For a scalar field that is exactly the Cartesian integrand times 2πr:
so nothing is missing — write the factor and you have it:
d = jno.domain(box(a, 0, b, h), mesh_size=0.05) # just a 2-D mesh
d.tag("inner", lambda x, y: jnp.abs(x - a) < 1e-9)
d.tag("outer", lambda x, y: jnp.abs(x - b) < 1e-9)
u, v = d.fem_symbols()
r, z, _ = d.variable("interior", split=True)
ui, vi = u.bind(x=r, y=z), v.bind(x=r, y=z)
ra, za, _ = d.variable("inner", split=True)
rb, zb, _ = d.variable("outer", split=True)
dV = 2 * jnp.pi * r # the ring measure, written once
fem = jno.fem([k * (ui.x * vi.x + ui.y * vi.y) * dV,
-g * v.bind(x=rb, y=zb) * (2 * jnp.pi * rb), # boundary terms carry it too
u(ra, za) - T_a])
T = fem.solve() # logarithmic in r, and Q = 2πk ΔT/ln(b/a) comes out right
Every term needs it — volume terms, source terms and Neumann/Robin terms alike. Miss one and the
answer is wrong by exactly that factor with no error raised, so bind dV once at the top and reuse it.
Vector fields need more than the measure
Axisymmetric elasticity carries a hoop strain
ε_θθ = u_r/r, and divergence picks up u_r/r. Neither can be produced by weighting the Cartesian
form by anything — they are extra terms you must write out. This is precisely why jNO does not offer
to apply the weighting automatically: it would be exact for scalars and quietly wrong for vectors.
The vector recipe, written out
A displacement u = (u_r, u_z) on the meridian strains four components, not three:
The last one is the whole difference, and it is ordinary arithmetic in the term list:
u, v = d.fem_symbols(value_shape=(2,), order=2) # (u_r, u_z)
r, z, _ = d.variable("interior", split=True)
ub, vb = u.bind(x=r, y=z), v.bind(x=r, y=z)
def strains(w):
return w.x[0], w.y[1], w[0] / r, 0.5 * (w.y[0] + w.x[1]) # rr, zz, THETA-THETA, rz
e_rr, e_zz, e_qq, e_rz = strains(ub)
f_rr, f_zz, f_qq, f_rz = strains(vb)
tr_u, tr_v = e_rr + e_zz + e_qq, f_rr + f_zz + f_qq # the trace carries it too
energy = lam * tr_u * tr_v + 2 * mu * (e_rr*f_rr + e_zz*f_zz + e_qq*f_qq + 2*e_rz*f_rz)
fem = jno.fem([energy * (2 * np.pi * r), ...]) # and then the ring measure
For flow the same four components appear, and the divergence is
\(\nabla\!\cdot\!\mathbf u=\partial_r u_r+u_r/r+\partial_z u_z\) — so div_u = e_rr + e_qq + e_zz, which is
what the continuity equation and the pressure term must both use.
Both halves are pinned by tests/test_fem_axisymmetric_vector.py
Lamé thick-walled cylinder under internal pressure (plane strain), exact
\(u_r = \frac{(1+\nu)pa^2}{E(b^2-a^2)}\left[(1-2\nu)r + b^2/r\right]\): the form above reproduces it to
under 1 %, with \(u_z\) vanishing. Drop ε_θθ from that same form and the error is over 10 %
and the cylinder measurably softer — with no error raised, which is what makes it worth a test.
Poiseuille pipe (\(u_z = G(R^2-r^2)/4\eta\)) on a meridian that includes the axis, Taylor–Hood
P2/P1: machine precision, since P2 represents the parabola exactly. Two details matter — a
traction-free pipe end is not what fully developed flow satisfies (the parabola carries a shear
traction \(\eta u_z'\) on a z-face), and on the axis u_r/r is harmless because quadrature points sit
strictly inside cells and \(u_r=0\) is imposed there.
This applies to vector EM too, and there is no guard
An axisymmetric (r, z) vector Maxwell / eddy-current form — the natural geometry for a coil, a
solenoid, a tokamak vessel — is not the Cartesian curl-curl weighted by 2πr. In cylindrical
coordinates the curl of a vector field picks up its own 1/r terms — (∇×E)_z = (1/r)∂(rE_θ)/∂r —
and for an axisymmetric (m=0) problem the meridional (E_r, E_z) and azimuthal (E_θ) components
decouple into two different operators that must each be written out.
The azimuthal one reduces to a scalar equation (in E_θ, or in rA_θ for the
vector-potential/eddy-current form), not a component of the Cartesian form, and it needs care on the
axis where 1/r is singular. Weighting an "N1E" form by 2πr therefore produces a silently
wrong answer, not an approximate one.
Nothing raises: multiplying by r is ordinary arithmetic, and the assembler cannot tell it apart
from a legitimate radial coefficient — so this limit is stated here, where you choose the geometry,
rather than enforced at assembly. Use a full 3-D mesh for vector Maxwell (3-D N1E is wired and
validated), or derive and write the cylindrical operator yourself as an ordinary scalar/coupled form.
jNO ships no axisymmetric H(curl)/H(div) element and no meridional/azimuthal split.
Radiation carries the same factor
On an axisymmetric domain the radiating faces of d.irradiation are rings: write the term with
dS = 2πr, as the volume terms carry dV = 2πr, or the two sides differ by exactly that factor.
Enclosure radiation
Grey-body radiation between surfaces is nonlinear (T⁴) and nonlocal (every face exchanges with every
other through the view-factor matrix F), so it is not a local integrand. It is still written as the equation:
d.irradiation(T) is the incident radiation G on every radiating face, and jno.fem integrates a term that
contains it over those faces (below). There is no radiation helper, enclosure handle or residual function to
write.
How the view factors are computed
F is computed purely from geometry (occlusion + orientation) by double-area Gauss quadrature of
the diffuse kernel — so a concave surface keeps its self-view. The radiating faces are found from
the transparent medium (attached kappa == 0): every face between a connected medium and the regions
next to it, one enclosure per connected medium.
Element tags (the solid regions) only group faces for their emissivity; they never block exchange.
Closure is enforced on each enclosure. The view factors are cached on disk by a hash of the mesh, the
regions and the options ($JNO_CACHE/enclosures, ~/.cache/jno by default).
What blocks a ray
Every meshed region that is not transparent is opaque — including a solid that carries no radiating face of its own. The occluder set is resolved once from the region list, not inferred from face tags, and is shared by the visibility test and the near-field refinement: a chord through a solid is never counted as visible.
Axisymmetric near field
The ring kernel's azimuthal integrand peaks at φ = 0 with width d/r, so a uniform n_phi rule
overshoots every near-touching pair (two surfaces meeting in a wedge, and every face's own ring
self-view) by roughly dφ/(d/r). A graded azimuthal rule fixes it and restores closure to ~1e-3; its
occlusion test is the true 3-D chord per azimuth, against the solid polygons.
Radiation written as the equation — d.irradiation(T)
Mark the regions radiation crosses with kappa = 0, give the surfaces their emissivity eps (a number or a law of
T), and write the radiation term as on paper:
d = (... .attach(k=..., eps=0.8) # opaque parts
+ gas.name("Gas").attach(k=0.19, eps=1.0, kappa=0.0) # a medium radiation crosses
).sized(h).domain(axisymmetric=True) # (r, z) meridian plane: the enclosure revolves it
T, v = d.fem_symbols(names=("T", "v"))
dS = 2 * np.pi * r # ring measure on a face (r of the interior variables)
fem = jno.fem([d.k(T) * (Ti.r * vi.r + Ti.z * vi.z) * dV - d.q * vi * dV,
d.eps(T) * (SIGMA * T**4 - d.irradiation(T)) * v * dS, # ∫ ε(σT⁴ − G) v dS
...])
d.irradiation(T) is the incident radiation G on every radiating face: the faces between a connected
region with kappa == 0 and its neighbours, one diffuse-grey enclosure per connected medium (J = (I −
diag(1 − ε) F)⁻¹ εσT⁴, G = F J; Modest, Radiative Heat Transfer, Ch. 5). eps and kappa are this
operator's documented property names.
A term that contains d.irradiation is integrated over the radiating faces: every factor is evaluated
per face (the field and G at the face's mean temperature, a coordinate at two Gauss points along it, so
dS = 2πr is integrated exactly against each node's hat function) and the term enters with an exact
dense tangent on the radiating nodes.
That tangent is formed analytically, without differentiating through the radiosity solve: with M = I − diag(1 − ε) F, dG/dT = F M⁻¹ diag(h), h = d(εσT⁴)/dT − ε′(T) G, and the term's own partials in T and G (it is pointwise per face).
It equals forward-mode autodiff of the residual to round-off (the test below, with an ε(T) law). F and
the radiosity solve are dense (the tangent block on the radiating nodes is dense anyway). Write it with
the field and test function themselves (T, v), not their bound views, and without derivatives; it
must be linear in v.
Pinned in tests/test_fem_radiation_term.py: two concentric cylinders and two concentric spheres (axisymmetric)
against the analytic exchange and the energy balance, a coupled conduction-radiation solve against its series
solution, and the analytic tangent against jax.jacfwd. A radiation term cannot hold a trainable parameter yet
(an emissivity to calibrate): jno.fem refuses it with a message.
Semi-transparent and optically thick media need no operator. P1 for κ > 0 is one more field with local terms (measured: P1 approaches the Rosseland limit, 189 → 45 → 1.7 K as τ = 1 → 10 → 100):
G, g = d.fem_symbols(names=("G", "g"))
p1 = [(Gi.x * gi.x + Gi.y * gi.y) / (3 * d.kappa) + d.kappa * (Gi - 4 * d.n**2 * SIGMA * Ti**4) * gi,
d.eps / (2 * (2 - d.eps)) * (G - 4 * d.n**2 * SIGMA * T**4) * g] # Marshak, on the medium's walls
heat += [d.kappa * (4 * d.n**2 * SIGMA * Ti**4 - Gi) * vi]
and Rosseland for τ ≫ 1 is a conductivity law, .attach(k=lambda T: k0 + 16 * n**2 * SIGMA * T**3 / (3 * kappa)).
Nonlocal values — jno.derived
Enclosure radiation is one instance of a shape that recurs: gather → operate → scatter, where the
"operate" is not a local integrand. d.irradiation is the residual side of it: its term adds a nonlocal
residual R(u) += c(u) whose tangent jno.fem assembles exactly. jno.derived(fn, inputs=[...], on=u) is the
value side: a nodal field d = f(u) usable inside any term, with a lagged (Picard) tangent that stays
local and sparse, so it converges linearly and can stall on a strong coupling.
Reach for derived when the nonlocal quantity is needed inside a term, which is the case a residual
vector simply cannot express. A laser's Beer–Lambert attenuation is the clean example: the depth
τ(x) = ∫α ds depends on the whole chord behind each point, and exp(−τ) multiplies the source:
from jno.utils.optics import beam_paths, optical_depth # the beam GEOMETRY (private; host-side, once)
nodes, w = beam_paths(pts, cells, direction, pts, n_samples=600)
alpha = lambda T: a0 * (1.0 + beta * T) # a hotter body absorbs more
tau = jno.derived(lambda T: optical_depth(alpha(T), nodes, w), inputs=[u], on=u)
Q = a0 * I0 * jno.np.exp(-tau) # tau reads as an ordinary field
fem = jno.fem([k * (ui.x * vi.x + ui.y * vi.y) - Q * vi, u(xb, yb) - 0.0])
The rule is pure JAX on the input fields' nodal values. Everything host-side — ray tables, view
factors, neighbour lists — is built once outside and closed over; a numpy/scipy rule is refused at
jno.fem build, with the fix named. Non-traceability, a wrong output length and an unknown on= field
all fail there rather than inside a Newton step.
What lagging does and does not change. The values are computed inside the residual from
stop_gradient(u), so the linearization sees them as data and the nonlinear solver is the fixed-point
loop — no extra solver slot, no outer driver.
- The converged root is exact:
R(u) = 0does not depend on gradient markers, so lagging changed the path, not the answer (the same argumentjno.lagmakes). Convergence is checked on the true coupled residual, so a fixed point that does not converge raises rather than returning a plausible field. - Convergence is linear, at a rate set by the coupling strength. Past a critical strength it does not
converge at all;
fem.solve(nonlinear=jno.solve.picard(damping=...))ornewton(line_search=True)is the remedy. - Gradients are the Picard adjoint — descent-worthy and trainable through
jno.core, but not exact; a finite-difference check will not agree to machine precision. Aparams=[...]value inside the rule is not lagged, so the direct sensitivity through it is exact.
Cadence. every="residual" (default) re-evaluates the rule at every residual evaluation, so a
transient step is fully implicit in the coupling. every="step" evaluates it once per step of a march
from the previous step's state — cheaper, but an operator splitting with its own O(dt) error that no
residual check can see, because the step converges, just to a slightly different problem.
Host geometry is frozen at build
Ray tables and view factors closed over by the rule are fixed for the life of the jno.fem. On a
moving mesh they go stale silently — a rebuild means a new jno.fem. This is the same caveat the
enclosure carries, and it is the open edge of droplet-plus-laser work.
What stays on its own path — contact
Contact is not written with either mechanism, and deliberately. The gap value is a weighted gather
inside the differentiated residual, so the secondary–main coupling is exact in the tangent; only the
pairing is lagged, by a host-side search between rounds. Routing it through derived would
stop_gradient the gap value itself, turning a quadratic Newton contact into a Picard iteration on a
penalty interface — the regime where Picard is worst. The gap also lives at face quadrature points rather
than on nodes, so there is nothing for on= to name.
What contact does share is the delivery contract: host-frozen shapes, per-round values threaded on
args. __gap_tables__, __loadpath__ (load-path fields, previous states, the mesh velocity) and
derived fields are all that one idea. Anything that writes to those channels must merge, never assign
— a march can carry a mesh velocity and a derived field at once.