{
  "$defs": {
    "GmshOptions": {
      "description": "Typed gmsh meshing options; a knob left at None keeps gmsh's own default.",
      "properties": {
        "import_labels": {
          "default": true,
          "description": "Import STEP/OpenCASCADE entity labels (Geometry.OCCImportLabels); the mesher needs these to match parts to materials.",
          "title": "Import Labels",
          "type": "boolean"
        },
        "terminal_output": {
          "default": false,
          "description": "Print gmsh's progress to the terminal (General.Terminal); never changes the mesh, so it stays out of every identity.",
          "title": "Terminal Output",
          "type": "boolean"
        },
        "algorithm_2d": {
          "$ref": "#/$defs/MeshAlgorithm2D",
          "default": 6,
          "description": "2D meshing algorithm (Mesh.Algorithm); the default Frontal-Delaunay gives the all-triangle surface mesh HXT needs and meshes the bodies of a 2D model."
        },
        "algorithm_3d": {
          "$ref": "#/$defs/MeshAlgorithm3D",
          "default": 10,
          "description": "3D meshing algorithm (Mesh.Algorithm3D); the default HXT runs on ``num_threads`` and needs the all-triangle surface mesh ``recombine_all=False`` keeps."
        },
        "recombine_all": {
          "default": false,
          "description": "Recombine the simplex mesh into quads and hexes (Mesh.RecombineAll); keep it False, since WhitneyAVSolver needs tetrahedra and recombining makes 3D meshing fail.",
          "title": "Recombine All",
          "type": "boolean"
        },
        "mesh_size_min": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "`h_min` `[m]`: Lower clamp on element size (Mesh.MeshSizeMin); None inherits gmsh's default.",
          "title": "Mesh Size Min"
        },
        "mesh_size_max": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "`h_max` `[m]`: Upper clamp on element size (Mesh.MeshSizeMax); None inherits gmsh's default.",
          "title": "Mesh Size Max"
        },
        "optimize": {
          "default": true,
          "description": "Run mesh optimization after generation (Mesh.Optimize).",
          "title": "Optimize",
          "type": "boolean"
        },
        "smoothing": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Number of mesh smoothing steps (Mesh.Smoothing); None inherits gmsh's default.",
          "title": "Smoothing"
        },
        "num_threads": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Meshing threads (General.NumThreads): every physical core by default, None for gmsh's own default of one, and never part of an identity.",
          "title": "Num Threads"
        },
        "target_units": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "M",
          "description": "Length unit OpenCASCADE converts the imported STEP to (Geometry.OCCTargetUnit): ``\"M\"`` keeps the pipeline in metres, None keeps the STEP's own unit.",
          "title": "Target Units"
        }
      },
      "title": "GmshOptions",
      "type": "object"
    },
    "MeshAlgorithm2D": {
      "description": "A gmsh 2D meshing algorithm, valued as the integer ``Mesh.Algorithm`` takes.",
      "enum": [
        1,
        2,
        5,
        6
      ],
      "title": "MeshAlgorithm2D",
      "type": "integer"
    },
    "MeshAlgorithm3D": {
      "description": "A gmsh 3D meshing algorithm, valued as the integer ``Mesh.Algorithm3D`` takes.",
      "enum": [
        1,
        4,
        7,
        10
      ],
      "title": "MeshAlgorithm3D",
      "type": "integer"
    },
    "TagDict": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object"
    },
    "TagSelectorSpec": {
      "description": "The grouping-relevant half of an ``EntityTag``: its selector and per-region size, never its conditions.",
      "properties": {
        "selector": {
          "$ref": "#/$defs/TagDict",
          "description": "The key=value pairs an entity must carry to join the group."
        },
        "mesh_size": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "`h` `[m]`: The per-region element size, when set.",
          "title": "Mesh Size"
        }
      },
      "title": "TagSelectorSpec",
      "type": "object"
    }
  },
  "description": "Everything that decides the Elmer mesh files and their group names, and nothing that only decides the solve.",
  "properties": {
    "step_key": {
      "description": "The geometry identity (``step_key``).",
      "title": "Step Key",
      "type": "string"
    },
    "model_dim": {
      "description": "Body dimension of the STEP, from the frame: 2D cross-section or 3D solids.",
      "enum": [
        2,
        3
      ],
      "title": "Model Dim",
      "type": "integer"
    },
    "global_mesh_size": {
      "description": "`h` `[m]`: Domain-wide target element size.",
      "title": "Global Mesh Size",
      "type": "number"
    },
    "gmsh_options": {
      "$ref": "#/$defs/GmshOptions",
      "description": "The gmsh knobs (thread count and terminal output are ``HashExclude`` and drop out)."
    },
    "deterministic": {
      "description": "Whether meshing was pinned to one thread for reproducibility.",
      "title": "Deterministic",
      "type": "boolean"
    },
    "tags": {
      "description": "The domain's tags in domain order (an unnamed body's group name concatenates tag names in that order).",
      "items": {
        "$ref": "#/$defs/TagSelectorSpec"
      },
      "title": "Tags",
      "type": "array"
    },
    "materials": {
      "description": "The sorted material tags; an unnamed body's group name starts with its material tag.",
      "items": {
        "type": "string"
      },
      "title": "Materials",
      "type": "array"
    }
  },
  "required": [
    "step_key",
    "model_dim",
    "global_mesh_size",
    "gmsh_options",
    "deterministic"
  ],
  "title": "MeshSpec",
  "type": "object"
}
