Config¶
The composed simulation config that ties the mesh, the domain and the Elmer physics together, and the solve frame it maps the authored model into.
femforge.config
¶
The composed simulation config: the composition root that ties the gmsh mesh, the domain and the Elmer physics areas together.
Classes:
-
RunMeta–Searchable run metadata: a description and free key=value tags, recorded verbatim in the bundle manifest and
-
SimulationConfig–The single config spanning the whole pipeline, one area model per concern;
solved_physics/resolved_stackgive what the run solves underframe.
RunMeta
pydantic-model
¶
Bases: ConfigArea
Searchable run metadata: a description and free key=value tags, recorded verbatim in the bundle manifest and NEVER part of the run identity — editing them re-labels a run without re-solving it.
Config:
arbitrary_types_allowed:Trueuse_attribute_docstrings:True
Fields:
-
description(str | None) -
tags(TagDict)
description
pydantic-field
¶
description: str | None = None
One line on what this run is for (shown in the driver log, searchable via run.find_runs).
tags
pydantic-field
¶
tags: TagDict
Free key=value labels (the same tag-dict shape the geometry uses); find_runs matches by subset.
matches
¶
Whether these tags satisfy every selector pair (the same containment rule as EntityTag.matches).
SimulationConfig
pydantic-model
¶
Bases: ConfigArea
The single config spanning the whole pipeline, one area model per concern; solved_physics / resolved_stack give what the run solves under frame.
Config:
validate_assignment:True
Fields:
-
geometry(SerializeAsAny[GeometryArea] | None) -
frame(Frame) -
mesh(MeshConfig) -
domain(DomainConfig) -
physics(PhysicsSelection) -
meta(RunMeta)
Validators:
geometry
pydantic-field
¶
geometry: SerializeAsAny[GeometryArea] | None = None
Optional parametric geometry: when set, the driver calls its build_step into the run directory before
meshing and repoints mesh.step at it — the STEP is derived output, and the run identity comes from these
parameters rather than an authored file.
frame
pydantic-field
¶
How the authored model maps onto the solve: as-is in 3D, or its axisymmetric r–z half-plane.
mesh
pydantic-field
¶
mesh: MeshConfig
The gmsh mesh settings: STEP source, global element size, gmsh options.
meta
pydantic-field
¶
meta: RunMeta
Searchable description + tags; excluded from cache_key, so labeling never re-identifies a run.
frame_fits_inputs
pydantic-validator
¶
frame_fits_inputs(frame: Frame, info: ValidationInfo) -> Frame
On reassignment, reject a frame the domain or the physics selection cannot solve.
Source code in src/femforge/config.py
domain_fits_frame
pydantic-validator
¶
domain_fits_frame(domain: DomainConfig, info: ValidationInfo) -> DomainConfig
Reject conditions the frame cannot solve.
Source code in src/femforge/config.py
physics_fits_frame
pydantic-validator
¶
physics_fits_frame(physics: PhysicsSelection, info: ValidationInfo) -> PhysicsSelection
Reject a selection the frame cannot solve.
Source code in src/femforge/config.py
solved_physics
¶
solved_physics() -> Physics
The physics the selection solves as under frame (MAGNETOSTATICS becomes MAGNETOSTATICS_2D when axisymmetric).
resolved_stack
¶
resolved_stack() -> PhysicsConfig
The solver stack the run solves: the authored physics.overrides, else the solved physics' preset in frame.
Source code in src/femforge/config.py
customize_physics
¶
customize_physics() -> PhysicsConfig
Materialize the resolved stack into physics.overrides (idempotent) and return it for typed editing.
Source code in src/femforge/config.py
femforge.common.frame
¶
The solve frame: how an authored model maps onto the frame Elmer solves in.
Classes:
-
Axis–A line through
originalongdirection, in the authored model's frame. -
Solid–Solve the authored 3D model as-is.
-
Axisymmetric–Solve the r–z half-plane of a model symmetric about
axis: X = radial, Y = along the axis, Z = 0.
Attributes:
-
ALIGNMENT_TOLERANCE–[-]: The largest transverse share of a unit direction still counted as parallel to an axis.
ALIGNMENT_TOLERANCE
module-attribute
¶
[-]: The largest transverse share of a unit direction still counted as parallel to an axis.
Axis
pydantic-model
¶
Bases: ConfigArea
A line through origin along direction, in the authored model's frame.
Config:
frozen:True
Fields:
direction
pydantic-field
¶
direction: DirectionField
[-]: The axis direction; a scaled direction is the same axis.
label
property
¶
label: str
Z or -X for a coordinate axis through the origin, else its direction and origin.
along
¶
The cosine between direction and this axis (±1), or None when they are not parallel within ALIGNMENT_TOLERANCE.
Source code in src/femforge/common/frame.py
Solid
pydantic-model
¶
Axisymmetric
pydantic-model
¶
Bases: ConfigArea
Solve the r–z half-plane of a model symmetric about axis: X = radial, Y = along the axis, Z = 0.
Config:
frozen:True
Fields:
Validators:
kind
pydantic-field
¶
kind: Literal['axisymmetric'] = 'axisymmetric'
Discriminator that names this frame in a serialized config.
radial
pydantic-field
¶
radial: DirectionField | None = None
[-]: The direction from the axis toward the sectioned half-plane, stored as its unit part perpendicular to the
axis; None picks the world axis least aligned with the symmetry axis.
perpendicular
pydantic-validator
¶
perpendicular(radial: Direction | None, info: ValidationInfo) -> Direction | None
Reject an axis-parallel radial and store its unit component perpendicular to the axis.