ndiffusion.nearby_qoi¶
- ndiffusion.nearby_qoi(result, mats, mesh, bc, numerator, denominator)[source]¶
Discretization error of normalized quantities of interest.
A quantity of interest here is a ratio of two reaction-rate integrals,
J(phi) = int a . phi dV / int b . phi dV,
with per-unit-volume weights
a(numerator) andb(denominator) per cell and group, e.g. the absorption cross section in one region over the production cross section everywhere (a normalized region power or absorption rate). The ratio makesJindependent of the eigenvector’s arbitrary normalization.The one-shot estimate solves the generalized adjoint problem
(M - F/k)^T Gamma = dJ/dphiwith<Gamma, F phi> = 0on the exact discrete operator (unstructured_operator()) and returns<Gamma, V r> + J(phi_h) - J(fit), the linearization of the nearby estimateJ(phi_nearby) - J(fit). It needs the exact transpose: a solver run on adjoint cross sections does not transpose the non-orthogonal correction and leaves a bias of 1-2% on triangles and hexagons.- Parameters:
result (NearbyKResult) – From
nearby_k_eigenvalue()with the constrained spline fit (bc=given). Itsoperatoris reused when present (method="direct").mats – As passed to
nearby_k_eigenvalue().mesh – As passed to
nearby_k_eigenvalue().bc – As passed to
nearby_k_eigenvalue().numerator (array-like) – Weights
aandb, shaped(n_cells, G), or(n_q, n_cells, G)to evaluate several quantities with one factorization.denominator (array-like) – Weights
aandb, shaped(n_cells, G), or(n_q, n_cells, G)to evaluate several quantities with one factorization.
- Returns:
valueJ(phi_h),fit_valueJ(fit) (by degree-4 quadrature of the fit over each cell),error_adjointthe one-shot estimate ofJ(phi_h) - J(phi_exact),error_nearbythe nearby-solve estimateJ(phi_nearby) - J(fit)(None without a nearby solve), andcells, the per-cell contributionsGamma . V r(n_q, n_cells), a goal-oriented error map for adaptation. Arrays have a leadingn_qaxis only when the weights do.- Return type: