When OGR Slip2D cannot give a factor of safety, it says why, in a form a program can read as well as a person. A rejected surface carries one of four negative codes in place of its factor of safety, with a failure reason behind it. The admissibility checks, the errors of the operations layer and the MCP server, and the exit codes of the command-line programs follow.
5.5.1Surface error codes#
A surface that has no admissible factor of safety keeps its place among the results, and a negative code is written where its factor would be. How the checks behind −120 and −112 work is explained in Section 3.3.
| Code | Meaning | When |
|---|---|---|
| −120 | Tensile stress at a slice base | The Tensile Stress Check is on and rejected the surface. |
| −112 | m-alpha below its limit | The m-alpha check rejected the surface: on a slice of a method it applies to. |
| −111 | No converged factor of safety | The calculation ended without a converged factor, whatever the reason: the iteration limit, a λ that could not be bracketed or closed, a collapsed or , a mass that does not slide, a surface to which rapid drawdown does not apply… The reason is recorded separately (Section 5.5.2). |
| −101 | Any other rejection | A converged factor rejected by another criterion, such as a Spencer or GLE answer whose interslice thrust is inadmissible, or a surface the checks could not evaluate. |
One function gives the code of every rejected evaluation, in this order:
- a valid surface that passed the checks has no code;
- rejected by the Tensile Stress Check: −120 (tension is tested first, so a surface failing both checks is a tensile rejection);
- the checks themselves could not be evaluated: −101;
- rejected by the m-alpha check: −112;
- no converged factor: −111;
- anything else: −101.
Because −111 covers every calculation that produced no converged factor, it is not only a convergence problem: circles whose mass does not slide (zero_driving) and, in a rapid-drawdown analysis, candidates to which the procedure does not apply (drawdown_not_applicable) are −111 too, as are the surfaces Sarma's method refuses (sarma_refused), and the reason tells them apart. A surface rejected before it could be sliced has no result and no row. Since v0.1.445 the census of the Interpret window counts some of these rejections with a code, each with its own reason: −101 when an end of a polyline is not on the ground, its base rises above the ground, an end daylights outside the Slope Limits or a circle does not cut the ground twice, and −103 when a circle leaves the External Boundary between its crossings with the ground. The rest count as not sliced. No surface carries −103, because such a circle is never sliced.
The codes appear in the Interpret window (Data → Export Raw Data…, whose last column holds the factor of safety or the code; Data → Summary of Invalid Surfaces…; Query → Query Invalid Surfaces, which shows the code of grid centres with no valid surface; and the Surfaces with error code option of the surface filter), and in the MCP tool results_query (views error_codes, invalid_summary, raw_data and filter). The HDF5 results file stores no code: a surface without a factor has no fos attribute and carries its reason (Section 5.4.5).
The four codes are the constants ERROR_TENSILE, ERROR_M_ALPHA, ERROR_NOT_CONVERGED and ERROR_OTHER, and error_code() is the single mapping used by the raw-data export, the census of the Interpret window and the MCP server. The fifth, ERROR_LEAVES_EXTERNAL (−103), is counted on the search result, never by error_code().
5.5.2Failure reasons#
An evaluation that produced no factor of safety has fos = None (never NaN), an error_message written for a person and a reason written for a program: one of the strings below, so that a run can be summarised as "this reason, so many surfaces" without parsing prose. The reason is the reason attribute of a surface in the HDF5 results file and the reason key of a surface in the answers of the operations layer and the MCP server.
| Reason | Meaning |
|---|---|
no_slices | The surface produced no slices at all. |
no_shear_strength | No slice base offers any shear resistance. |
zero_driving | The total driving moment (or force) vanishes: the mass does not slide, so there is no factor of safety to report. It keeps extremely high factors from being computed when the driving force is very small. |
active_support_exceeds_driving | Active support alone exceeds the driving moment. |
m_alpha_collapsed | collapsed towards zero on a slice base. |
n_alpha_collapsed | collapsed towards zero on a slice base (the analogue in Janbu's methods). |
non_physical_fos | The arithmetic produced a factor that is not a physical one: zero or negative, or not a finite number. |
not_converged | The iteration ran out of passes before the factor settled. There is a number, the last iterate, but it is not a converged value; the iteration limit is the setting to look at. |
all_lambda_diverged | Every sampled interslice ratio λ diverged, leaving no branch to solve on (Spencer, GLE). |
no_lambda_bracket | The sampled range of λ never changed sign, so the root is not bracketed. |
divergent_at_lambda | The solution diverged at the λ finally chosen. |
lambda_not_closed | The bracket on λ was found and refined, but is still above the tolerance at the λ returned. |
no_force_bracket | The force balance of the prescribed-inclination methods (Lowe–Karafiath, Corps of Engineers #1 and #2) found no bracket; what it has is the sampled factor of smallest residual, a fallback, not a solution. |
force_balance_diverged | That force balance produced no usable factor. |
drawdown_not_applicable | The rapid-drawdown procedure does not apply to this surface. Not an engine failure: in a search most candidates are like this. |
unsliceable_at_drawdown | The surface could not be sliced at the drawn-down level. |
envelope_not_converged | The strength envelope depends on the normal stress, and the stress it was read at never settled on the stress the method resolved, so the factor is not that of the envelope (since v0.1.213). |
sarma_refused | Sarma's method refused the surface: its wedges could not be built, a face is parallel to a base, or the surface crosses a support (since v0.1.464). The message_code of the result says which (Table 5.5.3). |
Sarma's method#
Besides its reason, a result without a factor carries a finer code, message_code, with its values in message_args; the answers of the operations layer and the MCP server include both. For Sarma's method with non-vertical slices the codes are these:
| Message code | Reason | When |
|---|---|---|
lem.sarma_supports | sarma_refused | The surface crosses a support; the method does not take supports. |
lem.sarma_face_parallel | sarma_refused | A face is parallel to the base of a wedge. |
lem.sarma_face_horizontal | sarma_refused | The angle given to a face is horizontal. |
lem.sarma_face_no_exit | sarma_refused | A face does not reach the ground inside the model. |
lem.sarma_faces_cross | sarma_refused | Two faces cross inside the sliding mass. |
lem.sarma_wedge_invalid | sarma_refused | A wedge is not a polygon inside the sliding mass: one of its faces leaves the mass through the slip surface. |
lem.sarma_wedge_outside | sarma_refused | Part of a wedge lies in no region with a material. |
lem.sarma_face_strength | sarma_refused | The face takes its strength from the materials and crosses one whose strength model is not Mohr–Coulomb; the face then needs its own c and φ. |
lem.sarma_excess_pore_pressure | sarma_refused | The excess pore pressure of undrained loading (B̄) is on; the method does not compute it. |
lem.sarma_no_driving | zero_driving | Kc reaches the applied kh only with the strength divided by more than 106, or never: the surface does not slide. |
lem.sarma_no_root | non_physical_fos | Kc stays below the applied kh for every factor of safety down to 0.01. |
lem.not_converged | not_converged | The iteration on F ran out of passes. |
lem.sarma_drawdown | drawdown_not_applicable | The method was reached in a rapid-drawdown analysis by a route that does not skip it first. |
Like every result with no converged factor, these surfaces have the code −111. Two conditions of the whole run are not reported surface by surface: with rapid drawdown, or with the excess pore pressure of loading, the method is not computed at all and the run says so once (notes method.sarma_drawdown and method.sarma_excess), and a value of settings.sarma it cannot take skips it with method.sarma_bad_setting, naming the field. Other notes of the run keep the factor and qualify it: method.sarma_near_pole when the least |q| of the faces is under 0.2, so that the factor is a root of Kc(F) = kh next to a pole (v0.1.466), method.sarma_near_pair when such a factor also lies close to a pole of Kc, giving the next root down (v0.1.470), method.sarma_tension when a base or a face carries an effective normal force in tension, method.sarma_verticalized for faces made vertical, and method.sarma_vertex_data_unused for data given at vertices that did not reach the surface analysed. In the notes of a run each one keeps its code beside the sentence.
The sentence and its code are written together, by one function, so they cannot disagree; the reasons stay coarser on purpose, because they group the census of invalid surfaces. A refusal comes back as a result with no factor and its code, never as NaN or as an exception that stops the run.
Source: ogr_slip2d/messages.py · ogr_slip2d/methods/sarma.py · ogr_slip2d/sarma/wedges.py · ogr_slip2d/method_note_messages.pyThe reasons are the REASON_* constants, and ALL_REASONS is the set every method's reason must belong to, so that a new reason cannot be introduced as a loose string. They are deliberately not translated: the interface translates the message where it shows it.
5.5.3Admissibility checks#
A surface that fails an admissibility check has not failed to compute: its factor converged and is kept, because the searches that steer by the factor of safety need it. The surface is judged inadmissible afterwards and is not reported as the critical one, unless every valid surface is inadmissible; in that case the checks are ignored and the result says so. The verdict is recorded in admissible, admissibility_note and admissibility_reason, with these values:
| Reason | Code | Check | Default |
|---|---|---|---|
tensile_stress | −120 | Tensile Stress Check: the effective normal stress of the method's own solution on a tested slice base is a tension larger than the material's tensile strength, which is zero except for the two Hoek–Brown models (). Only a percentage of the slices, counted from the toe, is tested (95 % by default), because the slices at the crest are legitimately in tension. | off |
m_alpha | −112 | m-alpha check: on any slice at the final iteration (Whitman & Bailey, 1967), with Bishop's denominator, for Bishop simplified, Janbu simplified and corrected, Spencer and GLE; Sarma's method divides by a denominator of its own and is not screened. A value below the limit does not by itself mean the factor is wrong; it screens out surfaces whose arithmetic has become untrustworthy. | on |
screen_error | −101 | The checks themselves raised an error, so the surface could not be judged; it is rejected rather than let through (since v0.1.211). | — |
Both checks are set in Analysis → Project Settings → Advanced (Tensile stress check with its Percentage of slices, and Check m-alpha < 0.2).
5.5.4Errors of the operations layer and the MCP server#
An operation of ogr_api that fails on purpose raises an OgrApiError with a stable code, a message, a hint where there is one and, sometimes, details. An MCP client receives it as [E_CODE] message Hint: hint; a Python script catches it and reads code, message, hint and details. The codes are stable; the wording of the messages is not. An unknown name always comes with the closest known names (Did you mean …?).
| Code | Raised when |
|---|---|
E_NOT_FOUND | A handle, id or name that does not exist: a project_id, result_id or job_id, an operation, a file to open; also no model open at all. |
E_INVALID_ARGUMENT | A value of the wrong type, out of range or not one of the choices, a setting that does not exist; also a relative path when no working folder was given, or several models open and no project_id. |
E_CONFLICT | A valid request that the current model does not allow (a second water table, a factor on a design standard that is not custom…); an existing file without overwrite=true; unsaved changes, for project_close and, in the window, for project_new and project_open; a window that closed while answering a call. |
E_NOT_CONFIGURED | The model cannot be analysed as configured; details["problems"] lists every reason. Also every call of a server started with --attach while no window is open. |
E_BUSY | Another operation holds the model (after waiting 30 s for it), the window is computing, or the maximum number of jobs is already running. |
E_JOB_FAILED | A background job failed or crashed; the message carries its error. |
E_INTERNAL | Default code of the base class; also what the server and the bridge to the window report for an unexpected exception, with its type and message. |
E_UNAUTHORIZED | The bridge to the window refused a connection with the wrong protocol or token. |
Since v0.1.438, an exception that is not an OgrApiError reaches an MCP client as [E_INTERNAL] followed by its type and message, with a window open or without one. Over HTTP, the server itself answers 401 to a missing or wrong bearer token, 421 to a Host that is not its own and 403 to a foreign Origin (Section 5.1.11).
The reader of these messages is very often a language model, and what lets it recover is being told what was wrong and what to do instead; hence the hint, and the suggestions for every unknown name.
Source: ogr_api/errors.py · ogr_api/workspace.py · ogr_gui/agent_bridge.py5.5.5Exit codes#
| Program | Code | Meaning |
|---|---|---|
ogr-slip2d-cli | 0 | Success, also when a method found no valid surface. |
| 1 | Project file not found. | |
| 2 | Unknown method name, or a usage error. | |
| 3 | The project cannot be analysed as configured. | |
| 4 | No result for any method. | |
ogr-slip2d-mcp | 0 | Normal end. |
| 2 | A configuration the server refuses to run with. | |
| 3 | The MCP SDK is not installed. |
The cases behind each code are listed in Section 5.2 and Section 5.1.3.
5.5.6References#
- Whitman, R.V. & Bailey, W.A. (1967). Use of computers for slope stability analysis. Journal of the Soil Mechanics and Foundations Division, ASCE, 93(SM4), 475–498.