Problem¶
Last changes: Documentation changelog
Contract¶
Problem is the canonical aggregate of magnets, interactions, studies, transport, mechanics,
selections, magnetization constraints, discretization, and requested runtime intent. Stage-first
scripts normally produce this object through the loader; direct construction remains the exact
class API and serialization contract.
Governing equations¶
Problem introduces no independent equation. It preserves a typed multiphysics graph whose
individual modules own their equations, signs, units, boundary conditions, and qualification.
Symbols and SI units¶
Each nested module retains its declared SI units. Names, IDs, policies, selections, activation rules, and runtime choices are dimensionless semantic/provenance data.
Assumptions and validity¶
At least one magnet and one active interaction/material anisotropy are required. Exactly one canonical study or a compatible legacy dynamics/output route must be supplied. All named graph, selection, constraint, torque, transport, geometry, material, stage, and interface references are validated before execution.
Frozen-spin constraints¶
Problem.magnetization_constraints carries FrozenSpins intent as stage-first, typed contract
data:
selector: geometry/object/region selection used for the frozen region.membership: static freeze or snapshot-at-activation behavior.reference: source orientation mode (capture_current_at_activation,initial_state,explicit_field_asset).stage_ids/activation: stage-scoped applicability controls.
Constraint definitions are validated before planning. Unsupported runtime/lane combinations must fail closed rather than silently rewrite intent.
Standard entry: Frozen-spins (source-first, argument-complete)¶
Wprowadzenie¶
Problem.magnetization_constraints przechowuje instancje FrozenSpins jako część intencji
kontrakcyjnej problemu. Kontrakt pozostaje typowany aż do warstwy planera i nie jest
redukowany do masek backendowych wcześniej.
Bezpośredni dowód z kodu¶
class FrozenSpins(packages/fullmag-py/src/fullmag/model/constraints.py) waliduje wejście w__init__i normalizujereference/activation.ObjectRegion.freeze_spins(...)(packages/fullmag-py/src/fullmag/model/structure.py) budujeFrozenSpinsdla regionu (in_region_selection).Ferromagnet.freeze_spins(...)(packages/fullmag-py/src/fullmag/model/structure.py) budujeFrozenSpinsdla obiektu (in_object_selection), wymagaobject_id.Problem(packages/fullmag-py/src/fullmag/model/problem.py) serializuje constrainty do IR.
Implementacja w Pythonie (source-first)¶
from fullmag.model.constraints import FrozenSpins
from fullmag.model.selection import in_object_selection
constraint = FrozenSpins(
id="film_frozen_capture",
selector=in_object_selection("film"),
reference="capture_current_at_activation",
membership="snapshot_at_activation",
stage_ids=("run",),
empty_selection="error",
inactive_selection="warn_and_intersect",
)
Funkcje i argumenty (z podpisów)¶
Funkcja |
Argumenty |
|---|---|
|
W pełnym kontrakcie źródłowym z walidacją polityk i domyślnymi wartościami. |
|
Wrapper regionowy: domyślny |
|
Wrapper obiektowy: selector to |
|
Przenosi constraints do pola problem-level i potem do IR ( |
Referencje kodowe¶
packages/fullmag-py/src/fullmag/model/constraints.py:137packages/fullmag-py/src/fullmag/model/constraints.py:148packages/fullmag-py/src/fullmag/model/structure.py:516packages/fullmag-py/src/fullmag/model/structure.py:769packages/fullmag-py/src/fullmag/model/problem.py
Bibliografia¶
Abert, C. “Micromagnetics and spintronics: models and numerical methods,” European Physical Journal B 92, 120 (2019), doi:10.1140/epjb/e2019-90599-6.
Python API¶
Python |
Type |
Default |
SI unit |
Meaning / validation |
ProblemIR |
|---|---|---|---|---|---|
|
|
required |
\(1\) |
non-empty problem identity |
|
|
|
required |
mixed |
non-empty magnetic objects with unique identities |
|
|
|
required |
mixed |
interaction list; duplicate legality checked |
|
|
study or |
|
mixed |
canonical study; conflicts with incompatible legacy route |
|
|
|
|
mixed |
legacy dynamics input |
|
|
sequence or |
|
mixed |
legacy outputs requiring legacy dynamics |
|
|
|
|
mixed |
FDM/FEM/hybrid authoring hints |
|
|
|
|
\(1\) |
optional human description |
|
|
|
factory default |
\(1\) |
requested backend/device/precision/mode |
|
|
mapping |
|
\(1\) |
user/runtime provenance |
|
|
sequence |
|
mixed |
nonmagnetic/helper geometries |
|
|
mapping |
|
\(1\) |
role mapping; unknown geometry rejected |
|
|
sequence |
|
mixed |
current and Oersted source modules |
|
|
sequence |
|
mixed |
regional/time-dependent field drives |
|
|
sequence |
|
mixed |
explicit coupling graph |
|
|
sequence |
|
mixed |
planar monitor definitions |
|
|
analysis or |
|
mixed |
optional excitation analysis |
|
|
mapping |
|
\(1\) |
internal deterministic asset cache |
generated |
|
legacy torque or |
|
mixed |
legacy single-torque input; exclusive with canonical list |
normalized torque modules |
|
sequence |
|
mixed |
canonical torque modules |
|
|
mapping |
|
\(1\) |
stage-local activation; unknown IDs rejected |
stage torque activation |
|
sequence |
|
mixed |
canonical spin drift-diffusion modules |
|
|
|
|
K |
non-negative compatibility temperature; thermal-term consistency checked |
|
|
sequence |
|
mixed |
elastic constitutive records |
|
|
sequence |
|
mixed |
elastic body assignments |
|
|
sequence |
|
mixed |
magnetostriction laws |
|
|
sequence |
|
mixed |
mechanical boundary conditions |
|
|
sequence |
|
mixed |
mechanical loads |
|
|
|
|
\(1\) |
unique definitions; reference existence, cycles, and complexity validated |
canonical selection definitions |
|
|
|
\(1\) |
typed constraints; selection/object/region/stage references validated |
canonical magnetization constraints |
|
|
|
\(1\) |
requested periodic axes and demag policy |
|
ProblemIR¶
Requested intent remains distinct from planner resolution and execution evidence. The serializer preserves selections and frozen-spin constraints as typed graph data; it must not flatten them to backend masks before planning.
Round-trip and failure semantics¶
Requested intent preserves module identities, signs, units, formula/operator versions, selection graphs, constraint policies, stage activation, and requested runtime. Resolved execution records the chosen planner realization, concrete meshes/masks, solver, device, precision, and capability decisions without replacing requested intent. Validation errors reject unknown references, cycles, duplicates, malformed data, and stale source identities. Unsupported combinations fail closed and are not silently omitted, converted, or executed on a fallback lane.
Discrete realization¶
Planners resolve the same ProblemIR into FDM/FEM and CPU/GPU execution plans. Representation in
Problem is not evidence that every nested module executes on every lane.
Implementation mapping¶
packages/fullmag-py/src/fullmag/model/problem.py, class Problem, owns aggregate validation,
legacy migration, canonical lowering, geometry assets, selections, constraints, and multiphysics
reference integrity.
Validation¶
The documentation ownership test compares this inventory and source map with the live constructor signature. Runtime qualification remains module- and lane-specific.
Limitations¶
Some fields are compatibility or internal build inputs. The stage-first API should remain the primary user surface while direct construction stays fully documented for reproducibility.
Scientific bibliography¶
No independent physical equation is introduced.
Control Room crosswalk¶
Status: The Control Room authors a study and lowers it to ProblemIR; direct Problem/IR editing is not exposed.
Python/API surface |
Control Room path |
Status |
Transaction |
|---|---|---|---|
Parameters documented on this page |
|
|
No supported frontend transaction |
Parameters without a named UI field |
|
|
Python-only until implemented |
frontend support is not implemented for standalone Problem/ProblemIR authoring.
See Control Room capability register for the support matrix and not implemented policy.
Frontend source owner: apps/control-room/src/modules/inspector/panels/StudyInspectorPanel.tsx (StudyInspectorPanel).
Source-code index¶
Claim |
Path |
Stable symbol |
Responsibility |
Evidence |
|---|---|---|---|---|
aggregate API and IR |
|
|
graph validation and lowering |
signature/source-map/round-trip tests |
selections |
|
|
canonical selection graph |
selection validation tests |
constraints |
|
|
magnetization constraint semantics |
constraint tests |