OpenGeoRock
5.4

The .ogr file format

Describes OGR Slip2D 0.1.235

An OGR Slip2D project is one plain JSON file with the extension .ogr: the geometry, the materials, the loads, the supports, every setting and, once computed, the finite-element groundwater field. It can be read, compared and kept under version control like any text file. The results of a search, which can run to thousands of surfaces with their slices, go to a separate HDF5 file. The keys of the first are listed below, followed by the layout of the second.

5.4.1A plain JSON document#

  • Encoding. UTF-8, indented with two spaces; non-ASCII characters are written as they are, not escaped.
  • Units. Values are stored in SI (m, kN per metre of slope, kPa, kN/m³, degrees), whatever unit system the window displays: units are converted only where the interface shows or reads them.
  • Identifiers. Objects carry UUID strings, and references between them use those ids: a material points at its water surface with water_surface_id, a region assignment at its material with material_id.
  • Regions are not stored as such. The regions are computed from the external and material boundaries; what the file keeps is each assignment as a point inside a region (region_assignments), which is re-located in the recomputed regions after every geometry change.
  • Shared by all components. The window, ogr-slip2d-cli, the operations layer and the MCP server read and write the same file; project_get returns one section of it to an agent (Section 5.1).

Saving writes the whole document, so a file saved by the current version carries every key below; a calculation does not modify the file.

An excerpt#

The beginning of a two-layer slope with a water table, as saved by v0.1.235; … marks lines left out.

{
  "format_version": "0.1",
  "id": "ed1d8a87-0f66-45c7-9027-1d689a44c66f",
  "name": "Two-layer slope with water table",
  "settings": {
    "units": {
      "system": "metric",
      "time": "d",
      "permeability": "m/s",
      "failure_direction": "L2R",
      "system_id": "metric_kpa"
    },
    "methods": {
      "enabled_methods": [
        "bishop_simplified",
        "spencer",
        "gle_morgenstern_price"
      ],
      "num_slices": 30,
      "tolerance": 0.005,
      "max_iterations": 50,
      "interslice_function": "half_sine",
      "interslice_forces": "total"
    },
    …
  },
  "boundaries": [
    {
      "id": "ea9a0c7f-a789-4ec7-84e8-1f58c319e9c3",
      "name": "External Boundary",
      "type": "EXTERNAL",
      …
      "polyline": {
        "id": "d8620e5a-bf0d-45ad-90e8-7cc9a4062aa1",
        "closed": true,
        "vertices": [
          [
            0.0,
            0.0
          ],
          …
  "materials": [
    {
      "id": "9c481951-90f0-4962-93f7-98cb59eae48d",
      "name": "Silty sand",
      "strength": {
        "model_id": "mohr_coulomb",
        "params": {
          "cohesion": 5.0,
          "friction_angle": 32.0
        }
      },
      "unit_weight": 19.0,
      "sat_unit_weight": 21.0,
      "use_sat_unit_weight": false,
      "pore_pressure": "water_table",
      …
  "user_surfaces": []
}

5.4.2Top-level keys#

Table 5.4.1 Top-level keys of a .ogr file, in the order they are written.
KeyContent
format_versionThe string "0.1" (Section 5.4.4).
id, nameUUID and name of the project.
settingsEvery analysis setting (Table 5.4.2).
boundariesEvery polyline of the model, each with id, name, type, color, line_width, visible, material_id, suppressed and polyline (id, closed, vertices as [x, y] pairs). type is one of EXTERNAL, MATERIAL, WATER_TABLE, PIEZOMETRIC, DRAWDOWN, TENSION_CRACK, BLOCK_SEARCH_OBJECT, WEAK_LAYER or ANISOTROPIC_SURFACE. A Block Search object also carries block_object (its kind and options) when one is set.
materialsEvery material: id, name, strength (model_id and its params), unit_weight, sat_unit_weight, use_sat_unit_weight, pore_pressure (none, water_table, piezometric, ru, constant or fem), ru, constant_u, water_surface_id, color, hatch, hydraulic (hydraulic properties), phi_b, air_entry_value, hu, auto_hu, undrained_behaviour, b_bar, drawdown_envelope, use_grid, weight_creates_excess and anisotropic_surface_id.
supports, support_typesThe supports placed in the model and the support types they refer to.
distributed_loads, line_loadsDistributed loads (kPa) and line loads (kN/m).
seismicThe pseudo-static load: kh, kv, enabled and creates_excess_pore_pressure.
seismic_recordsAcceleration records for the Newmark analysis.
region_assignmentsOne entry per assignment: the point (x, y), the material_id and the outline (footprint, and footprint_holes for a region with lenses) of the region it fell in.
tension_crack_propertiesWater in the tension crack: mode, percent_filled, elevation, depth, piezo_id.
water_pressure_gridThe water pressure grid, or null.
fem_mesh, seepage_bcsThe finite-element mesh and the seepage boundary conditions, or null.
seepage_result, transient_resultsThe computed steady groundwater field (or null) and the fields of the transient stages. Only the irreducible data are written; the derived fields are rebuilt when the file is read.
random_variablesThe inputs made random for the probabilistic and sensitivity analyses.
annotationsDrawings, texts and dimensions; the analysis does not read them.
focus_objectsFocus objects that restrict the search.
user_surfacesCircles defined by hand and analysed together with the search. Their ends where they meet the ground are not meaningful in the file: they are a result of the analysis, not an input.
The groundwater field is saved

Since v0.1.78 the computed seepage field is written with the mesh. Before that version a project whose materials take their pore pressure from the finite-element field reopened without it, and an analysis would have reported u=0u = 0 everywhere. A model whose materials use fem pore pressures and has no field is now refused by the analysis instead (Section 5.2).

5.4.3Settings keys#

Table 5.4.2 Keys of settings. Each section is written whole, so every field of every section is present in a saved file.
KeyContentSome of its fields
unitsDisplay units and failure directionsystem, time, permeability, failure_direction ("L2R" or "R2L"), system_id
methodsMethods and convergenceenabled_methods, num_slices, tolerance, max_iterations, interslice_function, interslice_forces
groundwaterHow pore pressure is obtainedmethod, pore_fluid_unit_weight, rapid_drawdown, rapid_drawdown_method, transient, transient_stages, default_hu, auto_hu
searchSurface type, search method and its options, slope limits, filterssurface_type, search_method, grid_nx, grid_ny, radius_increment, num_surfaces, slope_limit_left, slope_limit_right (71 fields in all)
statisticsProbabilistic and sensitivity analysesprobabilistic_analysis, sensitivity_analysis, sampling_method, num_samples, analysis_type, seed
back_analysisBack analysis of the support forceenabled, target_fos, elevation, method_id
random_numbersSeed of the random searches and of the samplingmethod, seed, lhs_correlate
design_standardPartial factorsenabled, standard, factor_permanent, factor_variable, factor_cohesion, factor_friction, factor_unit_weight, factor_resistance, factor_undrained, factor_shear_strength
advancedAdmissibility checks, iteration and parallel searchcheck_tensile_stresses, tensile_percent, check_m_alpha, initial_fos, min_lambda, max_lambda, iterate_steffensen, parallel_search, parallel_cpu_percent
seismicSeismic analysis beyond the factor of safetycompute_ky, ky_target_fos, newmark, record_id, polarity, allow_upslope, scale
summaryProject summarytitle, analysis, author, company, date_created, comments
max_materials, max_supportsLimits of the model20 each by default

The meaning of each setting is given where it is set: Section 2.1 for the window, and catalog("settings") or settings_get for the operations layer, which list every setting with its type and options.

5.4.4Versions and compatibility#

Every file carries "format_version": "0.1", the value of FILE_FORMAT_VERSION in the program. The reader does not consult it: an older file is recognised by the keys it carries, a key that is missing takes its default, and a few conventions that changed are converted when the file is read. Those conversions are documented in the code, for example:

  • a closed boundary that repeats its first vertex at the end, as every DXF import wrote before v0.1.197, is read without the repeated vertex (the same polygon);
  • a rapid-drawdown project saved before the B̄ fields existed (v0.1.62) gets back the behaviour it was computed with;
  • a B̄ rapid-drawdown project drawn with the drawdown convention used before v0.1.69 has its water table and drawdown line exchanged, so that the model means what it meant;
  • a water pressure grid that also declares its own value type sets the groundwater method accordingly (v0.1.202).

The conversion of v0.1.69 changes, on purpose, the factor of safety of the files it applies to, and the changelog of that version says so. An older version of the program is not guaranteed to open a file written by a newer one.

5.4.5Results in HDF5#

The results of a search are written to an HDF5 file, normally beside the project with the same name and the extension .h5. The window writes the result of the first method after each Compute once the project has a file; ogr-slip2d-cli compute writes one file per method (Section 5.2); a script uses save_results (Section 5.3). Each file holds one search; an existing file is replaced.

Table 5.4.3 Layout of a results file.
PathKindContent
/attributesformat_version ("0.1"), project_id, method, n_surfaces (surfaces stored under /surfaces), n_valid, n_invalid, n_attempts, objective ("fos" or "ky"); n_focus_rejected only when a focus object removed candidates, n_user_surfaces only when there are user surfaces.
/surfaces/surface_00000…group per surfaceAttributes fos (absent when there is no factor of safety), converged, iterations, method, is_valid, error, reason (Section 5.5.2), surface_type; for circular and composite surfaces centre_x, centre_y, radius and, when known, x_left, x_right; in seismic runs ky, ky_fos, newmark_displacement.
…/slicesdatasetOne row per slice: index, x_centre, width, base_y_left, base_y_right (m), base_angle_deg (°), base_length, height (m), weight (kN/m), pore_pressure at the base and surface_pressure of the distributed load on top (kPa). Compressed with gzip.
/user_surfaces/…groupsThe surfaces defined by hand, laid out as /surfaces; present only when there are any.
/summary/fos_arraydatasetFactor of safety of each surface of /surfaces, in the same order; NaN where there is no valid factor.
/summary/centres, /summary/radiidatasetsCentre (N × 2) and radius of each surface; NaN for surfaces that are not circles.

Surfaces rejected before they could be sliced are counted in n_valid + n_invalid and n_attempts but have no group, so n_surfaces can be smaller than the number attempted. The file stores one search, not the model: it is read together with the .ogr it came from.

In OGR Slip2D

A surface without a factor of safety gets no fos attribute, and its reason instead, so that a reader that forgets to check gets an error naming the surface rather than a number. The module's own header still draws the metadata as a group meta and the surfaces as surface_0000; the code writes the metadata as attributes of the root and numbers the surfaces with five digits, as this page shows.

Source: ogr_core/project/project.py · ogr_core/project/settings.py · ogr_core/project/results_io.py