{
  "$defs": {
    "ExecSolver": {
      "description": "When Elmer executes a solver (the ``Exec Solver`` keyword).",
      "enum": [
        "Always",
        "Before simulation",
        "After simulation",
        "Before timestep",
        "After timestep",
        "Never"
      ],
      "title": "ExecSolver",
      "type": "string"
    },
    "IterativeMethod": {
      "description": "The Krylov method for an iterative linear solve (``Linear System Iterative Method``).",
      "enum": [
        "BiCGStab",
        "BiCGStabl",
        "CG",
        "CGS",
        "GMRES",
        "GCR",
        "TFQMR"
      ],
      "title": "IterativeMethod",
      "type": "string"
    },
    "LinearSolverType": {
      "description": "The ``Linear System Solver`` strategy: an iterative Krylov method or a direct factorization.",
      "enum": [
        "Iterative",
        "Direct"
      ],
      "title": "LinearSolverType",
      "type": "string"
    },
    "Preconditioning": {
      "description": "The ``Linear System Preconditioning`` for an iterative solve.",
      "enum": [
        "None",
        "Diagonal",
        "ILU0",
        "ILU1",
        "ILU2",
        "ILU",
        "ILUT"
      ],
      "title": "Preconditioning",
      "type": "string"
    }
  },
  "description": "Post-processing: recover B, H, fluxes and nodal forces from the computed A. Inherits ``Linear System *`` because\nnodal-field recovery solves an (SPD, hence CG) mass-matrix system \u2014 without a linear solver Elmer aborts.",
  "properties": {
    "linear_system_solver": {
      "anyOf": [
        {
          "$ref": "#/$defs/LinearSolverType"
        },
        {
          "type": "null"
        }
      ],
      "default": "Iterative",
      "description": "Iterative (Krylov) or Direct linear solve."
    },
    "linear_system_direct_method": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Factorization backend for a Direct solve (e.g. \"umfpack\"); None omits the keyword.",
      "title": "Linear System Direct Method"
    },
    "linear_system_iterative_method": {
      "anyOf": [
        {
          "$ref": "#/$defs/IterativeMethod"
        },
        {
          "type": "null"
        }
      ],
      "default": "CG",
      "description": "Krylov method when the solve is iterative."
    },
    "linear_system_max_iterations": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 500,
      "description": "Iteration cap for the linear solve.",
      "title": "Linear System Max Iterations"
    },
    "linear_system_convergence_tolerance": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": 1e-08,
      "description": "Residual tolerance for the linear solve.",
      "title": "Linear System Convergence Tolerance"
    },
    "linear_system_preconditioning": {
      "anyOf": [
        {
          "$ref": "#/$defs/Preconditioning"
        },
        {
          "type": "null"
        }
      ],
      "default": "ILU0",
      "description": "Preconditioner for the iterative solve."
    },
    "linear_system_residual_output": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Print the linear residual every N iterations; None omits it.",
      "title": "Linear System Residual Output"
    },
    "linear_system_abort_not_converged": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Abort the run if the linear solve doesn't converge; False lets a stalled gauge-non-unique AV solve proceed.",
      "title": "Linear System Abort Not Converged"
    },
    "bicgstabl_polynomial_degree": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Polynomial degree l for the BiCGStab(l) Krylov method.",
      "title": "Bicgstabl Polynomial Degree"
    },
    "extra_keywords": {
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "integer"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "description": "Escape hatch: verbatim sif keyword/value pairs merged (last, so they win) into [`to_elmer`][] \u2014 any Elmer\nkeyword the typed fields don't model yet stays authorable without subclassing.",
      "title": "Extra Keywords",
      "type": "object"
    },
    "kind": {
      "const": "MagnetoDynamicsCalcFields",
      "default": "MagnetoDynamicsCalcFields",
      "description": "Discriminator that names this solver, doubling as its sif Solver label.",
      "title": "Kind",
      "type": "string"
    },
    "equation": {
      "default": "MgDynCalc",
      "description": "Elmer equation/solver name.",
      "title": "Equation",
      "type": "string"
    },
    "procedure": {
      "default": "\"MagnetoDynamics\" \"MagnetoDynamicsCalcFields\"",
      "description": "Elmer Procedure: \"library\" \"function\".",
      "title": "Procedure",
      "type": "string"
    },
    "variable": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Primary solver variable; None for solvers that declare none.",
      "title": "Variable"
    },
    "variable_dofs": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Degrees of freedom per node; None lets Elmer infer.",
      "title": "Variable Dofs"
    },
    "exec_solver": {
      "$ref": "#/$defs/ExecSolver",
      "default": "Always",
      "description": "When Elmer runs this solver."
    },
    "stabilize": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Enable stabilization; None omits the keyword.",
      "title": "Stabilize"
    },
    "optimize_bandwidth": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": true,
      "description": "Reorder DOFs to reduce matrix bandwidth; None omits the keyword.",
      "title": "Optimize Bandwidth"
    },
    "potential_variable": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The vector-potential variable to post-process; None lets the solver pick up the (default-named) MgDyn variable.",
      "title": "Potential Variable"
    },
    "average_within_materials": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": true,
      "description": "Average recovered fields within each material so the B/H jump at a magnet surface is resolved cleanly.",
      "title": "Average Within Materials"
    },
    "calculate_magnetic_field_strength": {
      "default": true,
      "description": "Recover H.",
      "title": "Calculate Magnetic Field Strength",
      "type": "boolean"
    },
    "calculate_magnetic_flux_density": {
      "default": true,
      "description": "Recover B.",
      "title": "Calculate Magnetic Flux Density",
      "type": "boolean"
    },
    "calculate_nodal_forces": {
      "default": true,
      "description": "Recover nodal forces (drives the motor-force optimisation).",
      "title": "Calculate Nodal Forces",
      "type": "boolean"
    },
    "calculate_nodal_fields": {
      "default": false,
      "description": "Recover nodal field values.",
      "title": "Calculate Nodal Fields",
      "type": "boolean"
    },
    "calculate_joule_heating": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Recover the eddy/Joule loss field. Identically zero for a steady real-valued solve \u2014 set False there:\nthe zero-RHS projection it triggers when a Current Density body force is present segfaults CalcFields.",
      "title": "Calculate Joule Heating"
    },
    "calculate_electric_field": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Recover E = -dA/dt - grad V. Identically zero at steady state \u2014 set False for the chained coil solve,\nwhere its zero-RHS projection is what segfaults CalcFields after the B components.",
      "title": "Calculate Electric Field"
    },
    "calculate_magnetic_vector_potential": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Project the edge-element av onto a nodal A field; None keeps the solver default.",
      "title": "Calculate Magnetic Vector Potential"
    },
    "separate_magnetic_energy": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Export the magnetic field energy as SaveScalars-visible scalars (the ElmerCSC mgdyn_bh recipe) \u2014 the\nenergy-method inductance observable: L_eff = 2W/I\u00b2.",
      "title": "Separate Magnetic Energy"
    },
    "calculate_relative_permeability": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Recover the local relative permeability; the mgdyn_bh energy recipe enables it alongside the energy export.",
      "title": "Calculate Relative Permeability"
    },
    "calculate_elemental_fields": {
      "default": true,
      "description": "Recover elemental field values.",
      "title": "Calculate Elemental Fields",
      "type": "boolean"
    }
  },
  "title": "MagnetoDynamicsCalcFieldsSolver",
  "type": "object"
}
