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.
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 for a series of tolerances on the drag coefficient, each level continued from the one below.
Horizontal lines are the tolerances; the selected degree is the first whose estimated error lies below the line.
Data table
| series | polynomial degree p | error of cd |
|---|---|---|
| |estimated error| | 1 | 0.0113855 |
| |estimated error| | 2 | 0.00518866 |
| |estimated error| | 3 | 7.7704e-05 |
| |cd − cd at p + 2| | 1 | 0.0175867 |
| |cd − cd at p + 2| | 2 | 0.00563334 |
| |cd − cd at p + 2| | 3 | 1.2357e-04 |
| tolerance 0.02 | 1 | 0.02 |
| tolerance 0.02 | 3 | 0.02 |
| tolerance 0.008 | 1 | 0.008 |
| tolerance 0.008 | 3 | 0.008 |
| tolerance 0.001 | 1 | 0.001 |
| tolerance 0.001 | 3 | 0.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.
| tolerance | p | DOF | cd | |estimated error| | |cd − cd at p + 2| | actual / estimated | Newton steps | outcome |
|---|---|---|---|---|---|---|---|---|
| 0.02 | 1 | 768 | 0.0177275 | 0.0113855 | 0.0175867 | 1.54466 | 9 | selected |
| 0.008 | 1 | 768 | 0.0177275 | 0.0113855 | 0.0175867 | 1.54466 | 9 | error above the tolerance |
| 0.008 | 2 | 1728 | 0.00569478 | 0.00518866 | 0.00563334 | 1.0857 | 6 | selected |
| 0.001 | 1 | 768 | 0.0177275 | 0.0113855 | 0.0175867 | 1.54466 | 9 | error above the tolerance |
| 0.001 | 2 | 1728 | 0.00569478 | 0.00518866 | 0.00563334 | 1.0857 | 6 | error above the tolerance |
| 0.001 | 3 | 3072 | 1.4077e-04 | 7.7704e-05 | 1.2357e-04 | 1.59032 | 6 | selected |
| 1.0000e-06 | 1 | 768 | 0.0177275 | 0.0113855 | 0.0175867 | 1.54466 | 9 | error above the tolerance |
| 1.0000e-06 | 2 | 1728 | 0.00569478 | 0.00518866 | 0.00563334 | 1.0857 | 6 | last 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.
| p | DOF | cd | Newton steps |
|---|---|---|---|
| 1 | 768 | 0.0177275 | 9 |
| 2 | 1728 | 0.00569478 | 10 |
| 3 | 3072 | 1.4077e-04 | 10 |
| 4 | 4800 | 6.1441e-05 | 11 |
| 5 | 6912 | 1.7195e-05 | 11 |
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 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.
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.