ogr-slip2d-cli runs OGR Slip2D without its window. It summarises a project, computes it as the project describes and writes the results to HDF5, lists the methods and strength models, and writes the demo slope to a file. compute goes through the same analysis code as Analysis → Compute, so a run without options gives the numbers the window gives. The last section covers the options of the graphical program's launcher.
5.2.1Running it#
The command is installed with the package (Section 1.1); python -m ogr_cli is the same program. Every command accepts --help.
ogr-slip2d-cli.| Command | What it does |
|---|---|
info PROJECT | Shows a summary of a .ogr project. |
compute PROJECT [options] | Runs the analysis the project describes, prints the critical value of each method and saves the results to HDF5. |
methods | Lists the limit-equilibrium methods with the equilibrium each satisfies. |
strength-models | Lists the strength models with their parameters and units. |
new-demo OUTPUT | Writes the demo slope as a .ogr file. |
Besides --help, the command takes the two options of its command-line library, --install-completion and --show-completion, for shell completion.
5.2.2info#
ogr-slip2d-cli info slope.ogrPrints a table with the path, the author and company of the project summary, the number of boundaries, materials, supports, distributed loads and line loads, whether the pseudo-static seismic load is on, and the bounding box (xmin, ymin, xmax, ymax, in m). A second table lists each material with its strength model, its unit weight γ, its saturated unit weight γsat (shown only when the material uses it below the water surface) and its colour. A file that does not exist ends with exit code 1.
5.2.3compute#
ogr-slip2d-cli compute PROJECT [--method M] [--slices N] [--nx N] [--ny N]
[--dr N] [--search S] [--samples N] [--output FILE]Every option defaults to the value stored in the project; an option given overrides only that setting, and only for this run. The overrides are applied to the copy loaded in memory, so a calculation does not modify the .ogr file.
compute and the project setting each one overrides.| Option | Value | Overrides | Notes |
|---|---|---|---|
--method | text | methods.enabled_methods | One method id or alias (Table 5.2.3). Without it, the methods enabled in the project, or Bishop simplified if none is enabled. An unknown name ends with exit code 2. |
--slices | integer | methods.num_slices | Number of slices per surface. |
--nx | integer | search.grid_nx | Grid of centres: number of intervals along x (centres = nx + 1). |
--ny | integer | search.grid_ny | The same along y. |
--dr | number | search.radius_increment | Radius increment as a number of intervals (radii per centre = dr + 1); the grid search rounds it to a whole number. |
--search | text | search.search_method | grid, slope, auto_refine, block, path, simulated_annealing or particle_swarm. |
--samples | integer | search.num_surfaces, search.block_num_surfaces, search.path_num_surfaces | Number of surfaces of the Slope, Block and Path searches. |
--output | path | — | HDF5 results file; by default the project path with the extension .h5 (see Output files). |
The help text of --search lists six values; particle_swarm, the seventh search, is accepted too. A value that is not one of the seven is not rejected: the engine runs a Grid Search for any id it does not know, and no note says so. Spell the search exactly, or set it in the project.
--method. Case is ignored, and hyphens and spaces count as underscores.| Method id | Also accepted |
|---|---|
bishop_simplified | bishop |
janbu_simplified | janbu |
janbu_corrected | — |
ordinary_fellenius | ordinary, fellenius |
spencer | — |
gle_morgenstern_price | gle, morgenstern_price |
lowe_karafiath | lowe |
corps_engineers_1 | corps1, coe1, modified_swedish |
corps_engineers_2 | corps2, coe2 |
What compute does#
- Loads the project and applies the overrides in memory.
- Checks that the project can be analysed as configured. If it cannot, it prints every reason after
Cannot compute:and ends with exit code 3, instead of reporting a number computed from settings it would have to drop. Examples: materials that take their pore pressure from a finite-element field that has not been computed (the run would report everywhere, which looks like a dry slope), a rapid-drawdown setup that cannot apply, a Block Search without the objects it needs, seismic coefficients out of range, a strength model with invalid parameters, or a setting name that has been retired. - Runs the analysis through the same analysis runner as the window: the design-standard partial factors applied to a copy, rapid drawdown, the project's search with its filters, slope limits and focus objects, the convergence settings, the random seed and the admissibility checks (Section 5.3).
- Prints the notes of the run (lines starting
Note:), then one table row per method: the critical value, the numbers of valid, invalid and attempted surfaces, the surfaces removed by focus objects (a column shown only when a focus object removed some) and whether the critical surface converged. - Writes the results to HDF5 (see Output files).
compute holds.| Column heading | When | Value |
|---|---|---|
Critical FoS | no design standard, no seismic Ky mode | factor of safety of the critical surface |
Over-design factor | a design standard is active | the factor obtained with factored inputs; it must exceed 1. A line Design standard applied: … says so and lists the notes of the standard. |
Critical Ky | Compute Ky on | the lowest critical seismic coefficient of the surfaces searched |
Newmark disp. (cm) | Newmark analysis on | permanent displacement of the critical surface, in centimetres |
With a design standard and a seismic Ky or Newmark mode both on, the column is headed Over-design factor while the values printed are the critical seismic coefficients (or the displacements). The window and the operations layer caption them by the seismic quantity. The program's code declares this as a defect of the command line and leaves it unchanged in v0.1.235.
A run on the demo slope (Section 5.2.6), whose project enables Bishop simplified and Janbu simplified:
ogr-slip2d-cli new-demo demo
ogr-slip2d-cli compute demo.ogr
Note: The Failure Direction is set to Right to Left, which puts the crest on the right,
but the ground surface is higher on the left (y = 25 at the left end against y = 15 at
the right end). Tension-crack water thrust, support force direction and the Path Search
starting face all read this setting.
grid — 2 method(s)
┌───────────────────┬──────────────┬───────┬─────────┬───────────┬───────────┐
│ Method │ Critical FoS │ Valid │ Invalid │ Attempted │ Converged │
├───────────────────┼──────────────┼───────┼─────────┼───────────┼───────────┤
│ bishop_simplified │ 1.0914 │ 1366 │ 493 │ 1859 │ True │
│ janbu_simplified │ 1.0434 │ 1379 │ 480 │ 1859 │ True │
└───────────────────┴──────────────┴───────┴─────────┴───────────┴───────────┘
Results saved: demo_bishop_simplified.h5
Results saved: demo_janbu_simplified.h5The grid of the demo has 12 × 12 intervals and a radius increment of 10, so 13 × 13 × 11 = 1859 circles are attempted per method. The note about the failure direction appears because the demo is saved with the program's default direction (right to left) although its slope falls to the right; as the note says, that setting matters for tension-crack water, supports and the Path Search, none of which this run uses.
Output files#
- One method: the file given with
--output, or the project path with the extension.h5(slope.ogr→slope.h5). - Several methods: one file per method, named after the base file with the method id appended:
slope_bishop_simplified.h5,slope_spencer.h5… With--output results/run.h5the names areresults/run_<method_id>.h5. - A missing folder is created and an existing file of the same name is overwritten.
Each file holds one search: every surface analysed with its slices, and summary arrays. The layout is described in Section 5.4.5. When the window computes a project that has a file (opened or saved), it writes the first method's result to the same <project>.h5 name.
Exit codes#
ogr-slip2d-cli.| Code | Meaning |
|---|---|
| 0 | Success. A method that found no valid surface is reported as no valid surface in its row and still exits with 0. |
| 1 | The project file does not exist (info, compute). |
| 2 | Unknown method name in --method; also any usage error reported by the command-line library (a missing argument, an unknown option). |
| 3 | The project cannot be analysed as configured; the reasons are printed. |
| 4 | The run produced no result for any method. |
5.2.4methods#
Lists the nine registered methods with their id, display name and whether they satisfy force and moment equilibrium; the ids are those accepted by --method and by the operations layer (Section 3.2).
ogr-slip2d-cli methods
Registered LEM methods
┌───────────────────────┬─────────────────────────┬───────────┬────────────┐
│ ID │ Display Name │ Force eq. │ Moment eq. │
├───────────────────────┼─────────────────────────┼───────────┼────────────┤
│ bishop_simplified │ Bishop Simplified │ — │ ✓ │
│ gle_morgenstern_price │ GLE / Morgenstern-Price │ ✓ │ ✓ │
│ janbu_simplified │ Janbu Simplified │ ✓ │ — │
│ janbu_corrected │ Janbu Corrected │ ✓ │ — │
│ corps_engineers_1 │ Corps of Engineers #1 │ ✓ │ — │
│ corps_engineers_2 │ Corps of Engineers #2 │ ✓ │ — │
│ lowe_karafiath │ Lowe-Karafiath │ ✓ │ — │
│ ordinary_fellenius │ Ordinary / Fellenius │ — │ ✓ │
│ spencer │ Spencer │ ✓ │ ✓ │
└───────────────────────┴─────────────────────────┴───────────┴────────────┘5.2.5strength-models#
Lists the 22 registered strength models with their id, display name and parameters with units, for example mohr_coulomb (cohesion in kPa, friction angle in degrees), hoek_brown (sigci in kPa, mb, s, a) or barton_bandis (phi_r, JRC, JCS, max_total_friction). Models defined by a table or by other materials, such as shear_normal_function or generalized_anisotropic, show no parameters. The models are described in Section 3.5.
ogr-slip2d-cli strength-models5.2.6new-demo#
ogr-slip2d-cli new-demo demo # writes demo.ogrWrites the demo slope, the same model as File → Load Demo Slope in the window and project_new(template="demo") for an agent: a homogeneous slope 10 m high at 1V:1H, external boundary (0, 0)–(50, 0)–(50, 15)–(35, 15)–(25, 25)–(0, 25), one Mohr–Coulomb material "Silty clay" ( kPa, , kN/m³) and a horizontal water table at y = 8 m assigned to it. The extension .ogr is added when the name does not end with it, replacing any other extension.
5.2.7The graphical launcher#
The desktop program starts with ogr-slip2d or, equivalently, python -m ogr_gui. The launcher has one option of its own:
| Option | Meaning |
|---|---|
--no-agent-bridge | Start without the agent bridge, so that no MCP server can work on this window (Section 5.1.6). It can still be switched on later in Tools → Agent bridge (MCP). |
ogr-slip2d
python -m ogr_gui --no-agent-bridgeAny other argument is handed to the Qt application object. The launcher does not open a project given on the command line: the window starts with an empty project, and a file is opened with File → Open Project….
The command line, the window and the operations layer call one analysis runner, which is the single place where methods and searches are built from a project. It exists because, before v0.1.77, the command line read nothing from the project's settings and silently skipped rapid drawdown, the partial factors and most searches.
Source: ogr_cli/__main__.py · ogr_slip2d/analysis_runner.py · ogr_gui/__main__.py