FDM Meshing API¶
Last changes: Documentation changelog
Problem statement¶
FDM(...) defines requested Cartesian-grid intent. The planner resolves integer dimensions,
origins, masks, optional per-magnet grids, common convolution-grid policy, boundary correction,
device, and precision.
Governing equations¶
This API introduces no independent physical equation. It selects the structured discrete space used by FDM interaction and time-integration operators.
Symbols and SI units¶
All cell and distance values are SI metres. Counts, masks, fractions, strategy names, and mode names are dimensionless.
Assumptions and validity¶
At least one default or per-magnet cell specification is required. Cell vectors have exactly three finite positive components. Conflicting aliases and common-grid specifications fail immediately. Boundary-correction support remains interaction/device capability-gated.
Python API¶
Python |
Type |
Default |
SI unit |
Validation |
Meaning |
Backend support |
ProblemIR |
|---|---|---|---|---|---|---|---|
|
|
|
m |
Three finite positive values; cannot be combined with default_cell. |
Legacy alias for the default native cell size. |
FDM CPU/GPU |
|
|
|
|
m |
Three finite positive values. |
Default native cell size inherited by magnets without an override. |
FDM CPU/GPU |
|
|
|
|
1 |
Nonempty names and FDMGrid values. |
Object-owned native grid overrides. |
FDM CPU/GPU; multilayer capability-gated |
|
|
|
|
1 |
Typed, internally consistent demag policy. |
Single-grid or multilayer common-grid request. |
FDM demagnetization lanes |
|
|
|
|
1 |
|
Projected-RK state constraint policy; |
FDM CPU/GPU; planner checks combinations |
|
|
|
|
1 |
|
Requested embedded-boundary correction. |
Interaction/device capability-gated |
|
|
|
|
1 |
Strictly between zero and one. |
Minimum stable partial-cell volume fraction. |
Boundary-correction lanes |
|
|
|
|
m |
Finite and nonnegative. |
Minimum geometric distance used by full correction. |
Boundary-correction lanes |
|
# %% Complete stage-first FDM mesh scenario
import fullmag as fm
nm = 1.0e-9
study = fm.study("fdm_meshing_api")
study.engine("fdm")
study.device("cpu", precision="double")
study.mode("strict")
study.objects.mesh.defaults(cell_size=(2 * nm, 2 * nm, 5 * nm))
film = study.geometry(fm.Box(100 * nm, 20 * nm, 5 * nm), name="film")
film.Ms = 800.0e3
film.Aex = 13.0e-12
film.alpha = 0.02
film.m = fm.texture.uniform(1.0, 0.0, 0.0)
study.exchange()
study.demag()
study.stages.add_run(stage_id="run", until=1.0e-12)
ProblemIR¶
The table gives canonical request destinations. Resolved execution adds integer shape, origin, spacing, masks/fractions, FFT padding, common-grid transfer, kernel digest, device, and precision.
Round-trip and failure semantics¶
Requested intent is preserved independently from resolved execution. Validation errors reject nonpositive cells, alias conflicts, invalid strategy/mode combinations, and invalid boundary parameters. Unsupported combinations fail capability checks without silent fallback.
Discrete realization¶
Solver |
Device |
Contract |
|---|---|---|
FDM |
CPU |
host Cartesian state, masks, stencils, and FFT resources |
FDM |
GPU |
identical semantic grid with device arrays and qualified CUDA kernels |
FEM |
CPU/GPU |
not applicable; FEM uses conforming elements |
Implementation mapping¶
The constructor and typed subpolicies lower in fullmag.model.discretization; runtime realization is
documented in the backend FDM meshing branch.
Validation¶
Verify coordinate reconstruction, magnetic volume, constant/affine stencil behavior, mask/fraction convergence, common-grid transfer, kernel cache identity, and CPU/GPU parity on one serialized grid.
Limitations¶
Cartesian grids staircase arbitrary curved boundaries, one thickness cell is a thickness-averaged model, and public boundary-correction fields do not establish universal kernel support.
Scientific bibliography¶
A. J. Newell, W. Williams, and D. J. Dunlop, “A generalization of the demagnetizing tensor for nonuniform magnetization,” J. Geophys. Res. 98, 9551–9555 (1993).
C. Abert, “Micromagnetics and spintronics: models and numerical methods,” Eur. Phys. J. B 92, 120 (2019).
Control Room crosswalk¶
Status: Frontend support is not implemented unless a named source-backed panel is added.
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 this API surface and its parameters.
See Control Room capability register for the support matrix and not implemented policy.
Frontend source owner: apps/control-room/src/modules/inspector/inspectorRouteCatalog.tsx (inspectorRouteCatalog).
Source-code index¶
Claim |
Path |
Stable symbol |
Responsibility |
Evidence |
|---|---|---|---|---|
constructor and lowering |
|
|
default/per-magnet grid and boundary policy |
signature and IR tests |
per-magnet grid |
|
|
positive cell triple |
validation tests |
demag grid policy |
|
|
strategy, mode, and common-grid consistency |
validation tests |
- FDM
- FDM Default Grid
- Python API
- Symbols and SI units
- Assumptions and validity
- 1. What it is and when to use it
- 2. Physical and mathematical explanation
- 3. Example - complete Python script
- 4. Exact API
- ProblemIR
- Round-trip and failure semantics
- Discrete realization
- 5. How to set it in Control Room
- 6. Backend and frontend support
- Validation
- 7. Limitations and known pitfalls
- 8. Scientific bibliography
- 9. Source-code index
- Source-code index
- FDM Per-Magnet Grids
- Python API
- Symbols and SI units
- Assumptions and validity
- 1. What it is and when to use it
- 2. Physical and mathematical explanation
- 3. Example - complete Python script
- 4. Exact API
- ProblemIR
- Round-trip and failure semantics
- Discrete realization
- 5. How to set it in Control Room
- 6. Backend and frontend support
- Validation
- 7. Limitations and known pitfalls
- 8. Scientific bibliography
- 9. Source-code index
- Source-code index
- FDM Boundary-Correction API
- Python API
- Symbols and SI units
- Assumptions and validity
- 1. What it is and when to use it
- 2. Physical and mathematical explanation
- 3. Example - complete Python script
- 4. Exact API
- ProblemIR
- Round-trip and failure semantics
- Discrete realization
- 5. How to set it in Control Room
- 6. Backend and frontend support
- Validation
- 7. Limitations and known pitfalls
- 8. Scientific bibliography
- 9. Source-code index
- Source-code index
- FDM multilayer convolution: Python, ProblemIR, and UI
- What this guide configures
- Authoring-to-grid relations
- Symbols and SI units
- Assumptions and validity
- Python API
- Canonical ProblemIR
- Round-trip, requested intent, and failure semantics
- Backend support and qualification
- Control Room workflow
- Validation checklist
- Limitations
- Scientific bibliography
- Source-code index