Gyredocs
Depth Practice
API

Gyre/Verification

Order selection

In one minuteOutput-driven order selection raises the polynomial degree until the estimated error of an output meets a tolerance. The study checks the selection rule itself, compares the estimate with solutions two degrees higher, and cross-checks every continued level against an independent solve.

Written at L2 Practice goes to L3 Mechanics 1182 words Markdown
PassedOutput-driven order selection13 of 13 checks passed · 364.4 s · quick suite

The polynomial degree of the inviscid bump-channel case (12 x 4 elements) is raised from p = 1, each level continued from the one below, until the adjoint-based estimate of the error of the drag coefficient meets a tolerance. The checks are those of the contract: when the result says the tolerance is met, the estimated error of the selected degree is within it and that of every lower degree is not; a tighter tolerance never selects a lower degree; a tolerance that cannot be met within the allowed degrees is reported as not met. The estimate itself is compared with the difference to an independent solution two degrees higher, and every level with an independent solve at its degree.

  • independent solves from the free stream at p = 1 to 5: converged5 of 5expected allpass
  • tolerance 0.02: met, and |estimated error| at the selected degree p = 10.01139expected <= 0.02pass
  • tolerance 0.008: met, and |estimated error| at the selected degree p = 20.005189expected <= 0.008pass
  • tolerance 0.008: smallest |estimated error| of the degrees below the selected one0.01139expected > 0.008 (the lowest sufficient degree is selected)pass
  • tolerance 0.001: met, and |estimated error| at the selected degree p = 37.77e-05expected <= 0.001pass
  • tolerance 0.001: smallest |estimated error| of the degrees below the selected one0.005189expected > 0.001 (the lowest sufficient degree is selected)pass
  • selected degrees for tolerances 0.02, 0.008, 0.0011, 2, 3expected non-decreasing as the tolerance is tightenedpass
  • tolerance 1e-06 with at most degree 2: reported as not met, |estimated error| at degree 20.005189expected > 1e-06, met = false, degree = 2pass
  • cd of a degree reached by continuation versus an independent solve from the free stream (largest difference)8.42e-15expected < 1e-10 (both converged to a relative residual of 1e-12)pass
  • Newton steps of a level continued from the degree below, relative to a solve from the free stream (largest)0.6expected < 1pass
  • p = 1: |cd − cd at p + 2| / |estimated error|1.545expected 0.4 … 2.5 (regression bound, not a guarantee of the estimator; the ratios measured in this run are in the notes)pass
  • p = 2: |cd − cd at p + 2| / |estimated error|1.086expected 0.4 … 2.5 (regression bound, not a guarantee of the estimator; the ratios measured in this run are in the notes)pass
  • p = 3: |cd − cd at p + 2| / |estimated error|1.59expected 0.4 … 2.5 (regression bound, not a guarantee of the estimator; the ratios measured in this run are in the notes)pass

Run notes Measured in this run: tolerances 0.02, 0.008, 0.001 selected degrees 1, 2, 3. The difference to the solution two degrees higher was 1.09 to 1.59 times the estimated error (degrees 1 to 3); the estimate predicts the output one degree higher, so a ratio of one is not expected exactly. Levels continued from the degree below needed at most 0.60 of the Newton steps of a solve from the free stream. The exact drag of this inviscid subsonic flow is zero.

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

The test case is the inviscid bump channel on 12 × 4 elements, the case of the output-error study. The exact drag of this subsonic inviscid flow is zero, so the drag coefficient is pure discretization error. The degree is raised from p=1p = 1 for a series of tolerances on the drag coefficient, each level continued from the one below.

Estimated and actual error of the drag coefficient by degreeOutput-driven order selection

Horizontal lines are the tolerances; the selected degree is the first whose estimated error lies below the line.

Data table
seriespolynomial degree perror of cd
|estimated error|10.0113855
|estimated error|20.00518866
|estimated error|37.7704e-05
|cd − cd at p + 2|10.0175867
|cd − cd at p + 2|20.00563334
|cd − cd at p + 2|31.2357e-04
tolerance 0.0210.02
tolerance 0.0230.02
tolerance 0.00810.008
tolerance 0.00830.008
tolerance 0.00110.001
tolerance 0.00130.001

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

  • The rule. When the result says the tolerance is met, the estimated error at the selected degree is within the tolerance and that of every lower degree is not: the lowest sufficient degree is selected.
  • Monotonicity. A tighter tolerance never selects a lower degree.
  • Honest failure. A tolerance that cannot be met within the allowed degrees is reported as not met, with the highest allowed degree and its estimate.
  • Continuation changes cost, not the answer. The drag of every degree reached by continuation must equal that of an independent solve from the free stream at the same degree to solver tolerance, and a continued level must need fewer Newton steps than the solve from the free stream.
Levels of each selectionOutput-driven order selection
tolerancepDOFcd|estimated error||cd − cd at p + 2|actual / estimatedNewton stepsoutcome
0.0217680.01772750.01138550.01758671.544669selected
0.00817680.01772750.01138550.01758671.544669error above the tolerance
0.008217280.005694780.005188660.005633341.08576selected
0.00117680.01772750.01138550.01758671.544669error above the tolerance
0.001217280.005694780.005188660.005633341.08576error above the tolerance
0.001330721.4077e-047.7704e-051.2357e-041.590326selected
1.0000e-0617680.01772750.01138550.01758671.544669error above the tolerance
1.0000e-06217280.005694780.005188660.005633341.08576last allowed degree, tolerance not met

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

For each degree the table compares the estimated error with the difference to an independent solution two degrees higher. The estimate predicts the output one degree higher, and the comparison is with two degrees higher, so a ratio of exactly one is not expected. The check accepts ratios between 0.4 and 2.5. That interval is a regression bound around the ratios measured when the study was introduced; it is not a guarantee of the estimator. The ratios of the run are in the notes under the status.

Independent solves from the free streamOutput-driven order selection
pDOFcdNewton steps
17680.01772759
217280.0056947810
330721.4077e-0410
448006.1441e-0511
569121.7195e-0511

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

  • One case, one output. A smooth subsonic flow on a mesh that resolves the geometry is where p-enrichment works best. Nothing here covers a singular or shocked flow, where the estimate relative to the next degree captures less of the true error.
  • Estimated, not true, error. The selection rule is checked against the estimate. That the true error is within the tolerance is not asserted; the comparison with degree p+2p + 2 shows how far the two were apart in this run.
  • The retry path. A degree that fails from the interpolated solution is tried again with the full continuation and from the free stream. The study has no check on that path; it is covered by unit tests in tests/test_adapt.py.
  • No statement about cost in general. The Newton-step ratio is measured on this case.
bash
gyre verify --only order_selection
gyre run bump_euler --set discretization.order=1 --target-error cd=1e-3 --max-order 4

The quick suite uses three tolerances; --suite full adds a fourth, tighter one and with it one more degree. Usage of order selection is described in Gradients and error estimates, its limits in Output error estimation.

    ↑ ↓ moveEnter open[ ] change depthResults show section and depth level