Results leave the program as a PDF report, images, prints and DXF drawings. The program can also be run without the mouse, from the Python terminal inside the window, the command line, the Python API or an AI agent connected through the MCP server. The last three have their own reference chapters; here they are introduced from the point of view of the desktop program.
2.12.1The PDF report#
File → Generate Report… writes an A4 PDF of the last Compute, with every method it ran; without a Compute it refuses, with a message. It first opens the Generate Report dialog, which chooses the figures (Figures of the report), and then asks for the file name. The file name proposed is the project's name followed by _report.pdf, and the report is written in the language of the interface. It has these sections:
- Project Summary: title, file, author, company, dates and comments;
- General Settings: units, time and permeability units, failure direction;
- Analysis Options: the methods, number of slices, tolerance and maximum iterations, and the surface options; with Sarma among the methods, also its own settings; with a design standard applied, also the standard and what it factored;
- Material Properties;
- Global Minimums: for each method, the factor of safety and the critical surface (centre and radius for a circle, the two end points, the total slice area), followed by the vertices of a non-circular critical surface; when the critical surface is one drawn by the user, the report says so;
- Critical Surface by Method, the drawings, when they were asked for;
- Valid / Invalid Surfaces: the counts per method, with the generation attempts;
- Slice Data of the critical surface of each method, and for Sarma a table of the faces of its wedges;
- List of Coordinates of the boundaries.
Figures of the report#
The Generate Report dialog (since version 0.1.339) has three options, and its Generate button goes on to the file name:
- Critical surface of each method (ticked by default): one figure per method with a critical surface, in the section Critical Surface by Method. It draws the model and that method's critical surface and, when the search had a grid of slip centres, colours each centre by the number the run reports there: the minimum factor of safety, or the minimum over-design factor with a design standard applied; on a run that computes Ky or the Newmark displacement, the minimum Ky or the maximum displacement. The critical centre is marked. A non-circular search has no centres, so its figures show the surface alone. Unticked, the report has no figures and the other two options are greyed out.
- Framing: Model (the default) frames each figure on the model; Model and search area frames it on the model and every slip centre the searches evaluated, valid or not. Every figure of a report has the same frame, so that they can be compared. Model and search area is greyed out when no search of the run has a grid of slip centres.
- Annotations (ticked by default): draws the lines, texts, dimensions, axes and images of the Tools menu on the figures. It is greyed out when the model has no visible annotation.
The words drawn on the figures (the scale and the legend) are in the language of the report. The same three options are the parameters figures, framing (model or search_area) and annotations of the MCP tool report_generate, so a script and the window produce the same report.
The window and report_generate build the figures with the same function, method_figures. A figure is 1400 × 900 pixels and its frame has a margin of 5 % of its larger side. The coloured centres are those of the interpretation window: the value of the most critical valid surface of each centre; on a run of factors of safety they are drawn only when at least three centres have one.
The title, author and company come from Analysis → Project Settings → Project Summary.
- A new project carries the program author's name and institution as its default Author and Company in Project Summary. Replace them, or the report will name someone else.
- It does not include the analysis notes, apart from those of a design standard (Analysis → Analysis Notes…).
2.12.2Images#
- File → Export Image… writes a PNG of everything drawn in the model view (the whole extent, not only the part on screen) on a white background. It asks for the Width in pixels (1920 by default; 200 to 12 000); the height follows from the proportions of the model.
- Edit → Copy Image copies the view as it is on screen to the clipboard, as a bitmap.
- The Interpret window has its own File → Export Image… (PNG or JPEG of its view) and Edit → Copy Image (Section 2.8).
Edit → Picture Format offers Bitmap and Vector (SVG), but in version 0.1.481 the choice has no effect: Copy Image always places a bitmap on the clipboard.
2.12.3Printing#
File → Page Setup… chooses the paper and margins, and File → Print Preview… shows the whole model drawn on that page; print from the preview window. In version 0.1.481 File → Print… (Ctrl+P) only displays a message.
2.12.4DXF drawings#
File → Export DXF… writes the model to a DXF drawing for CAD. The dialog sets the unit of the coordinates (m, cm, mm, km, ft or in; the model is in metres and the unit is recorded in the file), the Load arrow size as a percentage of the model diagonal (2 %), and what to include: Boundaries (geometry), Supports, Loads (as arrows), Finite element mesh (off by default, as it writes one line per element edge), Critical slip surface (after a Compute), Labels (title, factor of safety) and Annotation layer (what was drawn with the Tools menu). The geometry goes to the layers the DXF importer recognises, so the drawing can be edited and imported back; loads, mesh, slip surface, labels and annotation layer go to separate layers whose names start with OGR_X_, which the importer ignores, so a load arrow cannot come back as a boundary. Importing a DXF is described in Section 2.2.
2.12.5The Python terminal#
Window → Terminal (Ctrl+`) opens a Python console inside the window, connected to the live model. These names are defined in it:
| Name | What it is |
|---|---|
project | The project open in the window, which is the same object you are editing. It follows New Project, Open Project and Load Demo Slope. |
canvas | The model view. |
mainwindow | The main window. |
ogr_core, ogr_slip2d | The model and analysis packages. |
np | NumPy. |
help_ogr() | Prints these names, a few examples and the keys. |
Enter runs the input, Shift+Enter starts a new line of the same input, Ctrl+↑ and Ctrl+↓ move through the history, and Ctrl+L clears the console. To run the analysis as the project is configured, as Compute does, use the analysis runner:
>>> [m.name for m in project.materials]
>>> from ogr_slip2d.analysis_runner import run_analysis
>>> out = run_analysis(project) # the methods enabled in the project
>>> {mid: r.critical.fos for mid, r in out.results.items() if r.critical}
>>> out.warnings # the analysis notesSince version 0.1.305 a command that changes project is one step of Edit → Undo, named Python script, and the view is redrawn after it. A change to the finite-element mesh or its results is not part of that step; after one, call canvas.refresh_scene(). A calculation started here runs in the window's own thread, so the window waits until it ends. A search built by hand from its class, as in the example of help_ogr(), uses that class's defaults, not the project's settings; run_analysis uses the project's.
2.12.6The command line#
ogr-slip2d-cli runs a saved project without opening the window. It computes the analysis the project describes, through the same runner as the desktop program; each option overrides one setting of the project in memory, and the file is not modified.
ogr-slip2d-cli. The full reference is Section 5.2.| Command | What it does |
|---|---|
info project.ogr | A summary of the project and its materials. |
compute project.ogr | Runs the analysis, prints every note and a table of the critical value of each method, and saves each method's result as HDF5 (project.h5, or one file per method). Options: --method, --slices, --sarma-slices (the number of wedges asked of Sarma's method; Table 5.2.2), --nx, --ny (grid intervals), --dr (Radius Increment), --search, --samples (Number of Surfaces of the Slope, Block and Path searches) and --output. |
methods | The ten methods with the equilibrium each satisfies. |
strength-models | The strength models and their parameters. |
new-demo out.ogr | Saves the demo slope as a project. |
A project the analysis cannot honour is refused with its reasons and exit code 3, as Compute refuses it in the window. Version 0.1.481 has no command-line command for the statistical analyses. --search takes the search ids grid, slope, auto_refine, block, path, simulated_annealing and particle_swarm; an id it does not recognise is not refused, and the run falls back to a Grid Search.
2.12.7Python API#
The packages of the program can be imported from Python. The shortest way to analyse a saved project is the same runner the window and the command line use:
from ogr_core.project import Project
from ogr_slip2d.analysis_runner import run_analysis
project = Project.load("slope.ogr")
out = run_analysis(project) # refuses, with reasons, what Compute refuses
for method_id, result in out.results.items():
crit = result.critical
print(method_id, crit.fos if crit else "no valid surface")
for note in out.warnings:
print("Note:", note)For building and editing models from code, the operations layer ogr_api offers the same operations as the tools of the MCP server, with validation, undo and long runs as background jobs; the repository's examples/ folder has a worked script. The Python API is described in Section 5.3.
2.12.8AI agents#
The MCP server, ogr-slip2d-mcp, lets an AI agent build, run and read models through the same operations (it needs the [mcp] extra; see Section 1.1). When it starts, the desktop program opens an agent bridge (Tools → Agent bridge (MCP)) that accepts local connections only and requires a token, so that a server started with ogr-slip2d-mcp --attach works on the open window: every edit the agent makes appears on screen and can be undone. Start the program with ogr-slip2d --no-agent-bridge, or untick the menu item, to keep agents out. How to connect an agent is explained on the AI & MCP page, and every tool is listed in Section 5.1.