{
  "$defs": {
    "CalculateMagneticForce": {
      "description": "Lumps the magnetic force, and optionally the torque, over the bodies its tag matches into one Elmer ``Component``.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "magnetostatics",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "body",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "calculate_magnetic_force",
          "default": "calculate_magnetic_force",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The Component's ``Name``; None uses the authoring tag's name.",
          "title": "Label"
        },
        "calculate_magnetic_force": {
          "default": true,
          "description": "Lump the nodal magnetic force over the master bodies.",
          "title": "Calculate Magnetic Force",
          "type": "boolean"
        },
        "calculate_magnetic_torque": {
          "default": false,
          "description": "Also lump the magnetic torque (requires ``torque_origin``/``torque_axis``).",
          "title": "Calculate Magnetic Torque",
          "type": "boolean"
        },
        "torque_origin": {
          "anyOf": [
            {
              "description": "3D vector {x, y, z}",
              "properties": {
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "z": {
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y",
                "z"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "`r_0` `[m]`: Torque pivot point.",
          "title": "Torque Origin"
        },
        "torque_axis": {
          "anyOf": [
            {
              "description": "Unit direction {x, y, z}, normalized on load",
              "properties": {
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "z": {
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y",
                "z"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Torque axis direction.",
          "title": "Torque Axis"
        }
      },
      "title": "CalculateMagneticForce",
      "type": "object"
    },
    "CoilDrive": {
      "description": "A driven massive coil: the bodies that share one ``CoilDrive`` form one coil that carries ``current``.\n\nReverse the drive by swapping the terminal roles, not with a negative current.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "coil_magnetostatics",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "body",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "coil_drive",
          "default": "coil_drive",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "current": {
          "description": "`I_coil` `[A]`: The total coil current CoilSolver normalizes this coil's solved distribution to.",
          "title": "Current",
          "type": "string",
          "x-unit-dimensionality": "[current]"
        }
      },
      "required": [
        "current"
      ],
      "title": "CoilDrive",
      "type": "object"
    },
    "CoilTerminal": {
      "description": "One end of an open coil, its start or end electrode.\n\nThe electrode's end face must lie on the domain boundary (``GeometryConfig.terminate_electrodes``); positive coil current flows from start to end.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "coil_magnetostatics",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "boundary",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "coil_terminal",
          "default": "coil_terminal",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "role": {
          "description": "Which end of the coil this electrode is; CoilSolver's normalized current flows start -> end.",
          "enum": [
            "start",
            "end"
          ],
          "title": "Role",
          "type": "string"
        }
      },
      "required": [
        "role"
      ],
      "title": "CoilTerminal",
      "type": "object"
    },
    "ConditionRecord": {
      "description": "One emission into a group: the condition and tag it came from, the sif block it landed in and the keywords it contributed.",
      "properties": {
        "kind": {
          "description": "The condition kind, or the pseudo-kind of a block femforge emits on its own, such as ``far_field``.",
          "title": "Kind",
          "type": "string"
        },
        "condition": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "calculate_magnetic_force": "#/$defs/CalculateMagneticForce",
                  "coil_drive": "#/$defs/CoilDrive",
                  "coil_terminal": "#/$defs/CoilTerminal",
                  "convection": "#/$defs/Convection",
                  "current_density": "#/$defs/CurrentDensity",
                  "fixed_displacement": "#/$defs/FixedDisplacement",
                  "fixed_temperature": "#/$defs/FixedTemperature",
                  "fixed_voltage": "#/$defs/FixedVoltage",
                  "heat_flux": "#/$defs/HeatFlux",
                  "heat_source": "#/$defs/HeatSource",
                  "joule_heat": "#/$defs/JouleHeat",
                  "magnetization": "#/$defs/Magnetization",
                  "surface_force": "#/$defs/SurfaceForce"
                },
                "propertyName": "kind"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/Magnetization"
                },
                {
                  "$ref": "#/$defs/CurrentDensity"
                },
                {
                  "$ref": "#/$defs/FixedTemperature"
                },
                {
                  "$ref": "#/$defs/HeatFlux"
                },
                {
                  "$ref": "#/$defs/Convection"
                },
                {
                  "$ref": "#/$defs/HeatSource"
                },
                {
                  "$ref": "#/$defs/FixedVoltage"
                },
                {
                  "$ref": "#/$defs/JouleHeat"
                },
                {
                  "$ref": "#/$defs/CoilDrive"
                },
                {
                  "$ref": "#/$defs/CoilTerminal"
                },
                {
                  "$ref": "#/$defs/CalculateMagneticForce"
                },
                {
                  "$ref": "#/$defs/FixedDisplacement"
                },
                {
                  "$ref": "#/$defs/SurfaceForce"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The authored condition; None for a block femforge emits on its own, such as a far field, a symmetry axis or the force Component of a magnet.",
          "title": "Condition"
        },
        "tag": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The index of the authoring tag in the domain tags of the run config; None for a block femforge emits on its own.",
          "title": "Tag"
        },
        "selector": {
          "$ref": "#/$defs/TagDict",
          "description": "The selector of the authoring tag; empty for a block femforge emits on its own."
        },
        "section": {
          "$ref": "#/$defs/SifSection",
          "description": "The sif section of the block."
        },
        "block": {
          "description": "The block number within its sif section.",
          "title": "Block",
          "type": "integer"
        },
        "block_name": {
          "description": "The block name, as the ``!`` comment above it in the sif records it.",
          "title": "Block Name",
          "type": "string"
        },
        "keywords": {
          "description": "The keywords this emission contributed, in the solve frame.",
          "items": {
            "$ref": "#/$defs/SifKeyword"
          },
          "title": "Keywords",
          "type": "array"
        },
        "solve_components": {
          "description": "The solve-frame components of the condition vector: held coordinates, a force share or a magnetization direction.",
          "items": {
            "$ref": "#/$defs/SolveComponent"
          },
          "title": "Solve Components",
          "type": "array"
        },
        "dropped": {
          "description": "The authored fields the frame has no solve coordinate for, such as ``[\"z\"]`` under a Cartesian 2D frame normal to Z.",
          "items": {
            "type": "string"
          },
          "title": "Dropped",
          "type": "array"
        }
      },
      "required": [
        "kind",
        "section",
        "block",
        "block_name"
      ],
      "title": "ConditionRecord",
      "type": "object"
    },
    "ConditionTarget": {
      "description": "Whether a condition attaches to a 3D body or a 2D boundary.",
      "enum": [
        "body",
        "boundary"
      ],
      "title": "ConditionTarget",
      "type": "string"
    },
    "Convection": {
      "description": "Newton cooling of an outer surface to an ambient temperature.\n\nIt lands on the outer shell only, since a film coefficient on an interior interface would bypass the conduction path.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "thermal",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "boundary",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "convection",
          "default": "convection",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "coefficient": {
          "description": "`h` `[W/(m\u00b2\u00b7K)]`: Convective heat-transfer coefficient.",
          "title": "Coefficient",
          "type": "string",
          "x-unit-dimensionality": "[power]/[length]**2/[temperature]"
        },
        "ext_temperature": {
          "description": "`T_amb` `[K]`: External (ambient) temperature the boundary exchanges with.",
          "title": "Ext Temperature",
          "type": "string",
          "x-unit-dimensionality": "[temperature]"
        }
      },
      "required": [
        "coefficient",
        "ext_temperature"
      ],
      "title": "Convection",
      "type": "object"
    },
    "CurrentDensity": {
      "description": "A uniform signed out-of-plane current density J = N\u00b7I/A over a winding window, the homogenized drive of a stranded coil in a 2D solve.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "magnetostatics_2d",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "body",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "current_density",
          "default": "current_density",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "value": {
          "description": "`J` `[A/m\u00b2]`: Signed out-of-plane current density imposed uniformly over the body: azimuthal under Axisymmetric, along +normal under Cartesian2D.",
          "title": "Value",
          "type": "string",
          "x-unit-dimensionality": "[current]/[length]**2"
        }
      },
      "required": [
        "value"
      ],
      "title": "CurrentDensity",
      "type": "object"
    },
    "FixedDisplacement": {
      "description": "A prescribed displacement on a boundary, clamped to zero in every direction by default.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "linear_elasticity",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "boundary",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "fixed_displacement",
          "default": "fixed_displacement",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "x": {
          "anyOf": [
            {
              "description": "pint quantity with dimensionality [length]",
              "type": "string",
              "x-unit-dimensionality": "[length]"
            },
            {
              "type": "null"
            }
          ],
          "description": "`u_x` `[m]`: Prescribed displacement along the authored X axis; None leaves it free.",
          "title": "X"
        },
        "y": {
          "anyOf": [
            {
              "description": "pint quantity with dimensionality [length]",
              "type": "string",
              "x-unit-dimensionality": "[length]"
            },
            {
              "type": "null"
            }
          ],
          "description": "`u_y` `[m]`: Prescribed displacement along the authored Y axis; None leaves it free.",
          "title": "Y"
        },
        "z": {
          "anyOf": [
            {
              "description": "pint quantity with dimensionality [length]",
              "type": "string",
              "x-unit-dimensionality": "[length]"
            },
            {
              "type": "null"
            }
          ],
          "description": "`u_z` `[m]`: Prescribed displacement along the authored Z axis; None leaves it free.",
          "title": "Z"
        }
      },
      "title": "FixedDisplacement",
      "type": "object"
    },
    "FixedTemperature": {
      "description": "A fixed temperature on a boundary.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "thermal",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "boundary",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "fixed_temperature",
          "default": "fixed_temperature",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "value": {
          "description": "`T` `[K]`: Fixed temperature imposed on the boundary.",
          "title": "Value",
          "type": "string",
          "x-unit-dimensionality": "[temperature]"
        }
      },
      "required": [
        "value"
      ],
      "title": "FixedTemperature",
      "type": "object"
    },
    "FixedVoltage": {
      "description": "A fixed voltage potential on an electrode, one end of a phase's terminal pair.\n\nThe run also integrates the current through the electrode.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "current_conduction",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "boundary",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "fixed_voltage",
          "default": "fixed_voltage",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "value": {
          "description": "`V` `[V]`: The voltage potential held on the boundary.",
          "title": "Value",
          "type": "string",
          "x-unit-dimensionality": "[mass]*[length]**2/[current]/[time]**3"
        }
      },
      "required": [
        "value"
      ],
      "title": "FixedVoltage",
      "type": "object"
    },
    "GroupConditions": {
      "description": "Every emission one body or boundary group received; an empty list when it received none.",
      "properties": {
        "group": {
          "description": "The group name, shared by the mesh and the sif.",
          "title": "Group",
          "type": "string"
        },
        "conditions": {
          "description": "The emissions in sif order.",
          "items": {
            "$ref": "#/$defs/ConditionRecord"
          },
          "title": "Conditions",
          "type": "array"
        }
      },
      "required": [
        "group"
      ],
      "title": "GroupConditions",
      "type": "object"
    },
    "HeatFlux": {
      "description": "A prescribed heat flux through a boundary.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "thermal",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "boundary",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "heat_flux",
          "default": "heat_flux",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "value": {
          "description": "`q_s` `[W/m\u00b2]`: Heat flux through the boundary.",
          "title": "Value",
          "type": "string",
          "x-unit-dimensionality": "[power]/[length]**2"
        }
      },
      "required": [
        "value"
      ],
      "title": "HeatFlux",
      "type": "object"
    },
    "HeatSource": {
      "description": "A volumetric heat source in a body.\n\nWith ``temperature_coefficient`` set, the source scales linearly with the local temperature, the \u03c3(T) Joule feedback of a prescribed-current winding.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "thermal",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "body",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "heat_source",
          "default": "heat_source",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "power_density": {
          "description": "`q` `[W/m\u00b3]`: Heat generation density at ``reference_temperature`` when a coefficient is set, else the constant source.",
          "title": "Power Density",
          "type": "string",
          "x-unit-dimensionality": "[power]/[length]**3"
        },
        "temperature_coefficient": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "`\u03b1` `[1/K]`: Linear coefficient in q(T) = power_density\u00b7(1 + \u03b1\u00b7(T \u2212 reference_temperature)); None emits the constant.",
          "title": "Temperature Coefficient"
        },
        "reference_temperature": {
          "anyOf": [
            {
              "description": "pint quantity with dimensionality [temperature]",
              "type": "string",
              "x-unit-dimensionality": "[temperature]"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "`T_ref` `[K]`: The temperature ``power_density`` holds at; required with ``temperature_coefficient``.",
          "title": "Reference Temperature"
        }
      },
      "required": [
        "power_density"
      ],
      "title": "HeatSource",
      "type": "object"
    },
    "JouleHeat": {
      "description": "Heats a body with the Joule losses of its solved current.\n\nIt takes no value: HeatSolve integrates the loss density StatCurrentSolve solves for.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "joule_heating",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "body",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "joule_heat",
          "default": "joule_heat",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        }
      },
      "title": "JouleHeat",
      "type": "object"
    },
    "Magnetization": {
      "description": "The magnetization direction of a permanent magnet.\n\nThe magnitude ``|M| = B\u1d63/\u03bc\u2080`` comes from the magnet's material.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "magnetostatics",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "body",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "magnetization",
          "default": "magnetization",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "direction": {
          "anyOf": [
            {
              "description": "Unit direction {x, y, z}, normalized on load",
              "properties": {
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "z": {
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y",
                "z"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "description": "Magnetization direction in the authored model's frame, None for an unmagnetized body; magnitude comes from the material.",
          "title": "Direction"
        }
      },
      "required": [
        "direction"
      ],
      "title": "Magnetization",
      "type": "object"
    },
    "Physics": {
      "description": "Which physics preset the sif writer wires; the string values double as the serialized spelling.",
      "enum": [
        "magnetostatics",
        "magnetostatics_2d",
        "thermal",
        "electrostatics",
        "current_conduction",
        "joule_heating",
        "coil_magnetostatics",
        "linear_elasticity"
      ],
      "title": "Physics",
      "type": "string"
    },
    "SifKeyword": {
      "description": "One keyword an emission put into a sif block.",
      "properties": {
        "name": {
          "description": "The sif keyword, such as ``Force 1``.",
          "title": "Name",
          "type": "string"
        },
        "value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ],
          "description": "`[?]`: The emitted value, in the SI unit Elmer reads the keyword in; loads of one kind in one block add up to the value the sif holds.",
          "title": "Value"
        }
      },
      "required": [
        "name",
        "value"
      ],
      "title": "SifKeyword",
      "type": "object"
    },
    "SifSection": {
      "description": "One kind of sif section block, valued by its Elmer header spelling.",
      "enum": [
        "Equation",
        "Solver",
        "Material",
        "Body",
        "Boundary Condition",
        "Body Force",
        "Component"
      ],
      "title": "SifSection",
      "type": "string"
    },
    "SolveComponent": {
      "description": "One solve-frame component of a condition vector.",
      "properties": {
        "index": {
          "description": "The 1-based solve coordinate.",
          "title": "Index",
          "type": "integer"
        },
        "value": {
          "description": "`[?]`: The component, in the SI unit of the condition vector.",
          "title": "Value",
          "type": "number"
        }
      },
      "required": [
        "index",
        "value"
      ],
      "title": "SolveComponent",
      "type": "object"
    },
    "SurfaceForce": {
      "description": "A total force spread uniformly over a named face as a traction.\n\nAttach it to a ``TaggedFace``'s tag: the traction is the force over the face's measured area, which an adjacency group does not carry.",
      "properties": {
        "physics": {
          "$ref": "#/$defs/Physics",
          "default": "linear_elasticity",
          "description": "The physics whose solve this condition feeds."
        },
        "target": {
          "$ref": "#/$defs/ConditionTarget",
          "default": "boundary",
          "description": "Whether the condition attaches to a body or a boundary."
        },
        "kind": {
          "const": "surface_force",
          "default": "surface_force",
          "description": "Discriminator that names this condition type in a serialized config.",
          "title": "Kind",
          "type": "string"
        },
        "force": {
          "description": "`F\u20d7` `[N]`: Total force spread uniformly over the face, in the authored frame.",
          "properties": {
            "x": {
              "type": "number"
            },
            "y": {
              "type": "number"
            },
            "z": {
              "type": "number"
            },
            "units": {
              "type": "string"
            }
          },
          "required": [
            "x",
            "y",
            "z",
            "units"
          ],
          "title": "Force",
          "type": "object",
          "x-unit-dimensionality": "[force]"
        }
      },
      "required": [
        "force"
      ],
      "title": "SurfaceForce",
      "type": "object"
    },
    "TagDict": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object"
    }
  },
  "description": "``conditions.json``: the emissions of every body and boundary group of a run.",
  "properties": {
    "bodies": {
      "description": "Every body group, in mesher order.",
      "items": {
        "$ref": "#/$defs/GroupConditions"
      },
      "title": "Bodies",
      "type": "array"
    },
    "boundaries": {
      "description": "Every boundary group, in mesher order.",
      "items": {
        "$ref": "#/$defs/GroupConditions"
      },
      "title": "Boundaries",
      "type": "array"
    }
  },
  "title": "ConditionsFile",
  "type": "object"
}
