Swept-prism ferromagnet mesh¶
Last changes: Documentation changelog
Physical problem¶
The strict route extrudes a triangular source face into native prism6 layers. A qualified shared domain can use typed pyramid5 transitions to tet4; it does not split prisms into tetrahedra.
Governing equations¶
Symbols and SI units¶
Symbol |
Meaning |
SI unit |
|---|---|---|
\(n\) |
Requested element-layer count |
\(1\) |
\(N_{\mathrm{planes}}\) |
Resolved node-plane count |
\(1\) |
\(t_c\) |
Swept-body cell family |
\(1\) |
\(c\) |
Volume-cell ordinal |
\(1\) |
Assumptions and validity¶
The native body path is an axis-aligned Box, P1, fixed distribution, triangular source, and positive integer layers. Control Room additionally enables authoring only when all layered-prism capabilities are executable and supported counts equal [1,2,3].
Python API¶
# %%
import fullmag as fm
nm = 1e-9
study = fm.study("strict_prism")
study.engine("fem")
study.device("cpu", precision="double")
study.mode("strict")
study.universe(mode="manual", size=(100 * nm, 80 * nm, 65 * nm), center=(0.0, 0.0, 0.0))
study.universe.mesh(maximum_element_size=40 * nm, minimum_element_size=15 * nm, growth_rate=1.3, grading="geometric")
# %%
film = study.geometry(fm.Box(size=(24 * nm, 12 * nm, 1 * nm), name="film"), name="film")
film.mesh.thin_film(
maximum_element_size=3 * nm,
minimum_element_size=1 * nm,
layers=1,
topology="prismatic",
exact_layers=True,
transition="pyramid_to_tetrahedra",
order=1,
)
film.Ms = 800e3
film.Aex = 13e-12
film.m = fm.texture.uniform(1.0, 1e-4, 0.0)
study.exchange()
study.demag(realization="poisson_robin")
study.build_domain_mesh()
study.stages.add_relax(stage_id="equilibrium", algorithm="llg_overdamped", tolA=1e-4, max_steps=20_000, dt=1e-13)
Python |
Type |
Default |
SI unit |
Validation |
Meaning |
Backend support |
ProblemIR |
|---|---|---|---|---|---|---|---|
|
|
|
\(\mathrm{m}\) |
positive finite number or |
Compatibility maximum-size alias |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; overridden by |
Compatibility minimum-size alias |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive finite number or |
In-plane size ceiling |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; takes precedence over |
Lower size bound |
FEM capability-gated; FDM N/A |
|
|
|
|
\(1\) |
prismatic topology accepts only |
FEM polynomial order |
FEM capability-gated; FDM N/A |
|
|
|
|
\(1\) |
float-convertible; downstream recipe requires a positive value when set |
Curvature-refinement strength |
FEM capability-gated; FDM N/A |
|
|
|
|
\(1\) |
float-convertible; downstream recipe requires a positive value when set |
Narrow-region refinement strength |
FEM capability-gated; FDM N/A |
|
|
|
|
\(1\) |
bool rejected; integer at least 1 |
Requested element-layer count |
FEM capability-gated; FDM N/A |
|
|
|
|
\(1\) |
one of |
Thin-film topology |
FEM capability-gated; FDM N/A |
|
|
|
|
\(1\) |
Boolean; only valid with prismatic topology; strict prismatic rejects |
Strict layer-count intent |
FEM capability-gated; FDM N/A |
|
|
|
|
\(1\) |
only valid with prismatic topology; prismatic resolves or requires |
Shared-domain transition |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; used unless |
Interface size ceiling |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; takes precedence over |
Surface alias for interface size |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; used unless |
Interface refinement-shell thickness |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; takes precedence over |
Surface alias for interface shell |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
number at least 0 or |
Interface-to-core transition distance |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
number at least 0 or |
Surface alias for transition distance |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; must be paired with |
Edge size ceiling |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; paired with |
Edge refinement-shell thickness |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive number or |
Edge-to-core transition distance |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; paired with |
Corner size ceiling |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive; paired with |
Corner refinement extent |
FEM capability-gated; FDM N/A |
|
|
|
|
\(\mathrm{m}\) |
positive number or |
Corner-to-core transition distance |
FEM capability-gated; FDM N/A |
|
ProblemIR¶
For topology="prismatic", GeometryMeshHandle.thin_film() lowers to mesh_strategy="swept_prism", through_thickness_elements=layers, through_thickness_distribution="fixed", through_thickness_symmetric=False, sweep_face_meshing="triangular", topology="prismatic", sweep_direction="auto", element_family="prism", transition_policy="pyramid_to_tetrahedra", exact_layer_count=True, and order=1. PerObjectMeshRecipe itself accepts distributions None|fixed|linear|exponential and directions None|auto|x|y|z; thin_film() intentionally selects fixed and auto for strict prismatic authoring. The realization report separately records requested/resolved topology, axis, layers, order, and fallbacks.
All four transition-distance arguments accept the sentinels airbox_boundary, airbox-boundary, and auto_boundary; lowering canonicalizes each to airbox_boundary. Perimeter validation also enforces corner_hmax <= edge_hmax when both are active and, for a Box (including translated boxes), requires edge_thickness and corner_extent to be strictly smaller than half the shorter in-plane dimension.
Round-trip and failure semantics¶
Requested intent is the public thin_film() call and its lowered object policy. Resolved execution must report prism6, exact layers, P1, and no fallback. Validation errors reject zero/non-integer layers, non-P1 order, recipe distributions outside None|fixed|linear|exponential, recipe directions outside None|auto|x|y|z, wrong realized family, and wrong layer count. pyramid_to_tetrahedra is mandatory when topology="prismatic", not for every prism-family policy. Unsupported combinations include swept_hex and non-box geometry for explicit native prism strategy. A tet4 result is failure.
Discrete realization¶
generate_swept_mesh dispatches strict prism generation. Its extractor requires prism6-only volume cells and tri3/quad4 facets, validates orientation, and checks exact layer planes. Shared transitions retain pyramid5 and tet4 types.
Solver |
Device |
Status |
Reason |
|---|---|---|---|
FEM |
CPU |
source-backed, capability-gated |
No runtime receipt is claimed. |
FEM |
GPU |
source-backed, capability-gated |
No GPU identity or parity result is claimed. |
FDM |
CPU |
not applicable |
FEM meshing. |
FDM |
GPU |
not applicable |
FEM meshing. |
Implementation mapping¶
GeometryMeshHandle.thin_film owns public authoring and lowering; PerObjectMeshRecipe owns policy validation; generate_swept_mesh owns dispatch; resolveObjectMeshTopologyCapabilities implements the exact Control Room gate.
Validation¶
Focused tests assert exact planes, all axes, prism-only realization, strict wrong-family/layer rejection, no prism splitter, and no swept-hex fallback. They do not establish CPU/GPU runtime qualification or mesh convergence.
Limitations¶
This is not a general sweepability, higher-order, arbitrary UI layer-count, nonuniform exact-layer, GPU parity, or observable-convergence claim.
Scientific bibliography¶
C. Geuzaine and J.-F. Remacle, “Gmsh,” International Journal for Numerical Methods in Engineering 79 (2009), doi:10.1002/nme.2579.
C. Abert, “Micromagnetics and spintronics,” European Physical Journal B 92 (2019), doi:10.1140/epjb/e2019-90599-6.
Source-code index¶
Path |
Stable symbol |
Responsibility |
|---|---|---|
Public prismatic authoring and lowering |
||
Policy validation |
||
Native dispatch |
||
|
Capability gate |
|
Exact layers |