Physical¶
The physics domain model: region tags and their materials, boundary and body conditions, and the property functions their values come from.
femforge.physical
¶
The physics domain model: per-region tags and their materials, the boundary/body conditions, and the property functions those values are written as.
Modules:
-
conditions–Conditions attached to a region, each carrying its physics, its body or boundary target and its own Elmer sif emission.
-
domain–The simulation domain: the materials and per-region tag overrides shared by the mesh and FEA backends.
-
expressions–Typed expression AST over bare SI magnitudes for variable-dependent material properties: evaluates in Python, renders to Elmer MATC or Lua, serializes to JSON.
-
property_functions–Material properties as pint-aware callables (Static, Calibration, ClosedForm, Expression) behind the
PropertyFunctionprotocol. -
units–The shared pint unit registry, its typed quantity facades and the dimensionality-constrained quantity field types.
Classes:
-
CoilDrive–A driven coil under
COIL_MAGNETOSTATICS(body target): bodies sharing this condition become one massive CoilSolverComponentnormalized tocurrent. -
CoilTerminal–One end of an open coil's terminal pair, Elmer's
Coil StartorCoil Endmarker (COIL_MAGNETOSTATICS, boundary target). -
Condition–Base condition: subclasses pin
physics/targetdefaults and implementto_elmer. Never instantiated directly (nokinddiscriminator). -
ConditionTarget–Whether a condition attaches to a 3D body or a 2D boundary.
-
Convection–Convective (Newton-cooling) boundary condition (thermal, boundary target);
external_only— a film BC on an interior interface would bypass the conduction path. -
CurrentDensity–Uniform signed azimuthal current density J = N·I/A over a winding window (axisymmetric magnetostatics, body target), the homogenized stranded-coil drive.
-
FixedPotential–Dirichlet electric-potential boundary condition (current conduction, boundary target), one electrode of a phase's terminal pair.
-
FixedTemperature–Dirichlet temperature boundary condition (thermal, boundary target).
-
ForceComponent–An Elmer
Componentlumping CalcFields' magnetic force and torque over the bodies this condition's tag matches (magnetic physics, body target). -
HeatFlux–Prescribed heat flux boundary condition (thermal, boundary target).
-
HeatSource–Volumetric heat source in W/m³ (thermal, body target).
-
JouleHeat–Joule heat source body force (coupled current->thermal, body target): HeatSolve integrates StatCurrentSolve's loss density as the heat source.
-
Magnetization–Permanent-magnet body force (magnetostatics, body target).
-
DomainConfig–The materials the mesher matches to STEP parts, plus the per-region
EntityTagoverrides (conditions / mesh refinement). -
EntityTag–A per-region override matched to a mesh entity by its authored tags; carries the region's self-describing
conditions. -
Add–The sum of two subexpressions.
-
Const–A literal SI magnitude.
-
Div–The quotient of two subexpressions.
-
ExprNode–Base node: shared config + Python operator composition, so laws are authored as plain arithmetic.
-
Mul–The product of two subexpressions.
-
Neg–The negation of a subexpression.
-
Param–A named parameter (e.g.
temperature), bound at evaluation/render time. -
Pow–One subexpression raised to the power of another.
-
Sub–The difference of two subexpressions.
-
BasePropertyFunction–Pydantic base implementing parameter checking once; subclasses declare
parameters/result_dimensionalityand implement_evaluate. -
Calibration–A property defined by sample points and interpolated between them (1-D only for now).
-
CalibrationPoint–One measured sample: input quantities by name and the resulting output.
-
ClosedForm–A property defined by an explicit Python callable, pint-in / pint-out; the callable is code, not JSON-serializable.
-
Expression–A property defined by a serializable typed expression AST (
physical.expressions) —ClosedFormas data instead of code. -
PropertyDimensionError–A supplied parameter had the wrong dimensionality.
-
PropertyError–Base class for every property-function error.
-
PropertyFunction–A material property as a function of zero or more named pint quantities, returning a pint Quantity.
-
PropertyFunctionField–Annotated metadata for a
PropertyFunctionconstrained todimensionality. -
PropertyParameterError–A required parameter was not supplied when evaluating a property.
-
PropertyRangeError–A parameter fell outside the calibrated range and extrapolation is off.
-
Static–A constant property: zero parameters, always returns
value. -
Quantity–A pint quantity with a float magnitude.
-
Unit–A pint unit, typed so that arithmetic with units and numbers keeps its type.
-
VectorQuantity–A pint quantity with a
Vec3magnitude.
Functions:
-
conditions_for–The conditions on
tagsthat belong tophysicsand attach totarget. -
as_expr–Wrap a bare number into
Const; pass nodes through (the operator-composition coercion point). -
evaluate–Module-level convenience mirroring
expr.evaluate. -
render–Backend source for
exprwith parameter references substituted (e.g.{"temperature": "tx(0)"}). -
property_function_type–A
PropertyFunctionconstrained todimensionality, usable as a Pydantic field. -
quantity–Statically-typed face of
U.Quantity(...): afloatmagnitude yieldsQuantity, a Vec3 yieldsVectorQuantity.
Attributes:
-
ConditionUnion–Any concrete condition, discriminated by its
kind. -
Expr–Any expression node, discriminated by its
op. -
U–The shared pint unit registry, as in
5 * U.mmorU.Quantity(1.2, "T").
ConditionUnion
module-attribute
¶
ConditionUnion = Union[Magnetization, CurrentDensity, FixedTemperature, HeatFlux, Convection, HeatSource, FixedPotential, JouleHeat, CoilDrive, CoilTerminal, ForceComponent]
Any concrete condition, discriminated by its kind.
Expr
module-attribute
¶
Any expression node, discriminated by its op.
U
module-attribute
¶
U = cast('_TypedRegistry', pint.UnitRegistry(autoconvert_offset_to_baseunit=True))
The shared pint unit registry, as in 5 * U.mm or U.Quantity(1.2, "T").
CoilDrive
pydantic-model
¶
Bases: Condition
A driven coil under COIL_MAGNETOSTATICS (body target): bodies sharing this condition become one massive CoilSolver Component normalized to current.
Reverse the drive by swapping the terminal roles, not with a negative current.
Fields:
kind
pydantic-field
¶
kind: Literal['coil_drive'] = 'coil_drive'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
physics: Physics = Physics.COIL_MAGNETOSTATICS
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BODY
Whether the condition attaches to a body or a boundary.
current
pydantic-field
¶
I_coil [A]: The total coil current CoilSolver normalizes this coil's solved distribution to.
to_elmer
¶
The Desired Coil Current and the massive Coil Type.
Source code in src/femforge/physical/conditions.py
CoilTerminal
pydantic-model
¶
Bases: Condition
One end of an open coil's terminal pair, Elmer's Coil Start or Coil End marker (COIL_MAGNETOSTATICS, boundary target).
The electrode's end face must lie on the domain boundary (GeometryConfig.terminate_electrodes); positive coil current flows from start to end.
Fields:
-
kind(Literal['coil_terminal']) -
physics(Physics) -
target(ConditionTarget) -
role(Literal['start', 'end'])
kind
pydantic-field
¶
kind: Literal['coil_terminal'] = 'coil_terminal'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
physics: Physics = Physics.COIL_MAGNETOSTATICS
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BOUNDARY
Whether the condition attaches to a body or a boundary.
role
pydantic-field
¶
role: Literal['start', 'end']
Which end of the coil this electrode is; CoilSolver's normalized current flows start -> end.
to_elmer
¶
Condition
pydantic-model
¶
Bases: BaseModel
Base condition: subclasses pin physics/target defaults and implement to_elmer. Never instantiated directly (no kind discriminator).
Config:
arbitrary_types_allowed:Trueuse_attribute_docstrings:True
Fields:
external_only
class-attribute
¶
external_only: bool = False
Boundary-target conditions with this set land only on a body's external (domain-boundary) surface groups, not its interfaces — e.g. a coil terminal is the electrode's exposed end face, not its interior contacts.
target
pydantic-field
¶
target: ConditionTarget
Whether the condition attaches to a body or a boundary.
to_elmer
¶
This condition's Elmer sif keyword dict, reflected from each field's ElmerKeyword metadata.
Source code in src/femforge/physical/conditions.py
ConditionTarget
¶
Convection
pydantic-model
¶
Bases: Condition
Convective (Newton-cooling) boundary condition (thermal, boundary target); external_only — a film BC on an interior interface would bypass the conduction path.
Fields:
-
kind(Literal['convection']) -
physics(Physics) -
target(ConditionTarget) -
coefficient(HeatTransferCoefficient) -
ext_temperature(Temperature)
kind
pydantic-field
¶
kind: Literal['convection'] = 'convection'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BOUNDARY
Whether the condition attaches to a body or a boundary.
coefficient
pydantic-field
¶
h [W/(m²·K)]: Convective heat-transfer coefficient.
ext_temperature
pydantic-field
¶
T_amb [K]: External (ambient) temperature the boundary exchanges with.
CurrentDensity
pydantic-model
¶
Bases: Condition
Uniform signed azimuthal current density J = N·I/A over a winding window (axisymmetric magnetostatics, body target), the homogenized stranded-coil drive.
Requires frame=Axisymmetric().
Fields:
kind
pydantic-field
¶
kind: Literal['current_density'] = 'current_density'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
physics: Physics = Physics.MAGNETOSTATICS_2D
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BODY
Whether the condition attaches to a body or a boundary.
value
pydantic-field
¶
J [A/m²]: Azimuthal current density (signed) imposed uniformly over the body.
check_frame
¶
Raise unless frame is axisymmetric.
FixedPotential
pydantic-model
¶
Bases: Condition
Dirichlet electric-potential boundary condition (current conduction, boundary target), one electrode of a phase's terminal pair.
Fields:
kind
pydantic-field
¶
kind: Literal['fixed_potential'] = 'fixed_potential'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
physics: Physics = Physics.CURRENT_CONDUCTION
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BOUNDARY
Whether the condition attaches to a body or a boundary.
value
pydantic-field
¶
V [V]: Electric potential imposed on the electrode boundary; the keyword is the solver variable's name (Elmer Dirichlet semantics), single-sourced via the enum.
to_elmer
¶
The electrode potential plus the Save Scalars flag that makes SaveScalars integrate the electrode current.
Source code in src/femforge/physical/conditions.py
FixedTemperature
pydantic-model
¶
Bases: Condition
Dirichlet temperature boundary condition (thermal, boundary target).
Fields:
kind
pydantic-field
¶
kind: Literal['fixed_temperature'] = 'fixed_temperature'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BOUNDARY
Whether the condition attaches to a body or a boundary.
ForceComponent
pydantic-model
¶
Bases: Condition
An Elmer Component lumping CalcFields' magnetic force and torque over the bodies this condition's tag matches (magnetic physics, body target).
Fields:
-
kind(Literal['force_component']) -
physics(Physics) -
target(ConditionTarget) -
label(str | None) -
calculate_magnetic_force(bool) -
calculate_magnetic_torque(bool) -
torque_origin(Vec3Field | None) -
torque_axis(DirectionField | None)
kind
pydantic-field
¶
kind: Literal['force_component'] = 'force_component'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
physics: Physics = Physics.MAGNETOSTATICS
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BODY
Whether the condition attaches to a body or a boundary.
label
pydantic-field
¶
label: str | None = None
The Component's Name; None uses the authoring tag's name.
calculate_magnetic_force
pydantic-field
¶
calculate_magnetic_force: bool = True
Lump the nodal magnetic force over the master bodies.
calculate_magnetic_torque
pydantic-field
¶
calculate_magnetic_torque: bool = False
Also lump the magnetic torque (requires torque_origin/torque_axis).
to_elmer
¶
The CalcFields force and torque flags, plus the torque origin and axis when set.
Source code in src/femforge/physical/conditions.py
check_frame
¶
Raise when torque is requested under an axisymmetric frame.
Source code in src/femforge/physical/conditions.py
HeatFlux
pydantic-model
¶
Bases: Condition
Prescribed heat flux boundary condition (thermal, boundary target).
Fields:
kind
pydantic-field
¶
kind: Literal['heat_flux'] = 'heat_flux'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BOUNDARY
Whether the condition attaches to a body or a boundary.
HeatSource
pydantic-model
¶
Bases: Condition
Volumetric heat source in W/m³ (thermal, body target).
With temperature_coefficient set, the source scales linearly with the local temperature, the σ(T) Joule feedback of a prescribed-current winding.
Fields:
-
kind(Literal['heat_source']) -
physics(Physics) -
target(ConditionTarget) -
power_density(PowerDensity) -
temperature_coefficient(float | None) -
reference_temperature(Temperature | None)
kind
pydantic-field
¶
kind: Literal['heat_source'] = 'heat_source'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BODY
Whether the condition attaches to a body or a boundary.
power_density
pydantic-field
¶
q [W/m³]: Heat generation density at reference_temperature when a coefficient is set, else the constant source.
temperature_coefficient
pydantic-field
¶
temperature_coefficient: float | None = None
α [1/K]: Linear coefficient in q(T) = power_density·(1 + α·(T − reference_temperature)); None emits the constant.
reference_temperature
pydantic-field
¶
T_ref [K]: The temperature power_density holds at; required with temperature_coefficient.
to_elmer
¶
The Volumetric Heat Source keyword, a MATC expression in temperature when temperature_coefficient is set.
Source code in src/femforge/physical/conditions.py
JouleHeat
pydantic-model
¶
Bases: Condition
Joule heat source body force (coupled current->thermal, body target): HeatSolve integrates StatCurrentSolve's loss density as the heat source.
Carries no value — the magnitude is the solved current field itself.
Fields:
kind
pydantic-field
¶
kind: Literal['joule_heat'] = 'joule_heat'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
physics: Physics = Physics.JOULE_HEATING
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BODY
Whether the condition attaches to a body or a boundary.
Magnetization
pydantic-model
¶
Bases: Condition
Permanent-magnet body force (magnetostatics, body target).
The direction is per-region and lives here; the magnitude |M| = Bᵣ/μ₀ is a material property passed into to_elmer.
Fields:
-
kind(Literal['magnetization']) -
physics(Physics) -
target(ConditionTarget) -
direction(DirectionField | None)
kind
pydantic-field
¶
kind: Literal['magnetization'] = 'magnetization'
Discriminator that names this condition type in a serialized config.
physics
pydantic-field
¶
physics: Physics = Physics.MAGNETOSTATICS
The physics whose solve this condition feeds.
target
pydantic-field
¶
target: ConditionTarget = ConditionTarget.BODY
Whether the condition attaches to a body or a boundary.
direction
pydantic-field
¶
direction: DirectionField | None
Magnetization direction in the authored model's frame, None for an unmagnetized body; magnitude comes from the material.
to_elmer
¶
The Magnetization components of magnitude (A/m) along the direction, in frame's solve coordinates.
Source code in src/femforge/physical/conditions.py
check_frame
¶
Raise when an axisymmetric frame meets a direction off its symmetry axis.
Source code in src/femforge/physical/conditions.py
DomainConfig
pydantic-model
¶
Bases: ConfigArea
The materials the mesher matches to STEP parts, plus the per-region EntityTag overrides (conditions / mesh refinement).
Fields:
materials
pydantic-field
¶
materials: list[MaterialProperties]
The candidate materials; the mesher matches each STEP entity to one by tag.
tags
pydantic-field
¶
The per-region overrides, matched to mesh entities by name; each carries its conditions and optional mesh_size.
check_frame
¶
Raise when a condition here cannot drive a frame solve.
EntityTag
pydantic-model
¶
Bases: ConfigArea
A per-region override matched to a mesh entity by its authored tags; carries the region's self-describing conditions.
Fields:
-
selector(TagDict) -
conditions(list[ConditionUnion]) -
mesh_size(float | None)
selector
pydantic-field
¶
selector: TagDict
Compound-key selector: a mesh entity matches when its tag dict contains ALL of these key=value pairs (an empty selector matches every entity).
conditions
pydantic-field
¶
conditions: list[ConditionUnion]
Composable, self-describing conditions (body forces / boundary conditions) this region carries.
mesh_size
pydantic-field
¶
mesh_size: float | None = None
h [m]: Target mesh size for this region, such as a finer air gap; None inherits MeshConfig.global_mesh_size.
name
property
¶
name: str
Stable human-readable stem shared with gmsh/Elmer names: the uppercased part name for a lone Name selector, else sorted KeyValue pairs (CurrentDirEntry_Phase2).
matches
¶
Whether an entity's tag dict satisfies every selector pair.
print_tree
¶
Add this tag and its conditions to tree.
Source code in src/femforge/physical/domain.py
Add
pydantic-model
¶
Const
pydantic-model
¶
Div
pydantic-model
¶
ExprNode
pydantic-model
¶
Mul
pydantic-model
¶
Neg
pydantic-model
¶
Param
pydantic-model
¶
Bases: ExprNode
A named parameter (e.g. temperature), bound at evaluation/render time.
Fields:
op
pydantic-field
¶
op: Literal['param'] = 'param'
Discriminator that names this node type in serialized JSON.
evaluate
¶
The value env binds to this parameter.
Source code in src/femforge/physical/expressions.py
render
¶
The backend reference refs binds to this parameter.
Source code in src/femforge/physical/expressions.py
Pow
pydantic-model
¶
Bases: ExprNode
One subexpression raised to the power of another.
Fields:
Sub
pydantic-model
¶
BasePropertyFunction
pydantic-model
¶
Bases: BaseModel
Pydantic base implementing parameter checking once; subclasses declare parameters / result_dimensionality and implement _evaluate.
Extra keyword arguments are ignored, so an operating point may carry more quantities than a property needs.
Config:
arbitrary_types_allowed:Trueuse_attribute_docstrings:True
Calibration
pydantic-model
¶
Bases: BasePropertyFunction
A property defined by sample points and interpolated between them (1-D only for now).
Point inputs are validated against param_dims at construction; out-of-range raises unless extrapolate=True.
Fields:
-
kind(Literal['calibration']) -
param_dims(dict[str, str]) -
points(list[CalibrationPoint]) -
method(Literal['linear', 'nearest', 'cubic']) -
extrapolate(bool)
Validators:
-
_validate_points
kind
pydantic-field
¶
kind: Literal['calibration'] = 'calibration'
Discriminator that names this property kind in serialized JSON.
param_dims
pydantic-field
¶
The single parameter name and its expected dimensionality, as a pint string.
method
pydantic-field
¶
method: Literal['linear', 'nearest', 'cubic'] = 'linear'
Interpolation between samples: linear, nearest, or monotone cubic (PCHIP).
CalibrationPoint
pydantic-model
¶
Bases: BaseModel
One measured sample: input quantities by name and the resulting output.
Config:
arbitrary_types_allowed:Trueuse_attribute_docstrings:True
Fields:
Validators:
ClosedForm
pydantic-model
¶
Bases: BasePropertyFunction
A property defined by an explicit Python callable, pint-in / pint-out; the callable is code, not JSON-serializable.
Fields:
-
param_dims(dict[str, str]) -
result_dim(str) -
expression(Callable[..., Quantity])
Expression
pydantic-model
¶
Bases: BasePropertyFunction
A property defined by a serializable typed expression AST (physical.expressions) — ClosedForm as data instead of code.
body computes the result's SI magnitude in result_units from parameters bound as SI-base magnitudes, matching Elmer's tx.
Fields:
-
kind(Literal['expression']) -
param_dims(dict[str, str]) -
result_units(str) -
body(Expr)
Validators:
-
_validate_body_parameters
PropertyDimensionError
¶
Bases: PropertyError
A supplied parameter had the wrong dimensionality.
Parameters:
-
fn('PropertyFunction') –The property that rejected the call.
-
name(str) –The offending parameter, or
<result>for a closed form's return value. -
expected(str) –The dimensionality the parameter needs.
-
got(object) –The dimensionality, or the type, that was supplied.
Source code in src/femforge/physical/property_functions.py
PropertyFunction
¶
Bases: Protocol
A material property as a function of zero or more named pint quantities, returning a pint Quantity.
Methods:
-
__call__–Evaluate. Raises a typed error if a required parameter is missing or has the wrong dimensionality.
Attributes:
-
parameters(Mapping[str, str]) –Required parameter name -> expected dimensionality (pint string); this IS the call schema.
-
result_dimensionality(str) –Dimensionality of the returned quantity, e.g.
'[power]/[length]/[temperature]'.
parameters
property
¶
Required parameter name -> expected dimensionality (pint string); this IS the call schema.
result_dimensionality
property
¶
result_dimensionality: str
Dimensionality of the returned quantity, e.g. '[power]/[length]/[temperature]'.
__call__
¶
Evaluate. Raises a typed error if a required parameter is missing or has the wrong dimensionality.
PropertyFunctionField
¶
PropertyFunctionField(dimensionality: str)
Annotated metadata for a PropertyFunction constrained to dimensionality.
Coerces bare quantities/strings into Static, validates result dimensionality, and exports quantity_type's unit-annotated JSON schema.
Source code in src/femforge/physical/property_functions.py
PropertyParameterError
¶
Bases: PropertyError
A required parameter was not supplied when evaluating a property.
Source code in src/femforge/physical/property_functions.py
PropertyRangeError
¶
Bases: PropertyError
A parameter fell outside the calibrated range and extrapolation is off.
Parameters:
-
fn('PropertyFunction') –The calibration that rejected the call.
-
name(str) –The out-of-range parameter.
-
value(object) –The supplied value.
-
low(object) –The lowest calibrated value.
-
high(object) –The highest calibrated value.
Source code in src/femforge/physical/property_functions.py
Static
pydantic-model
¶
Bases: BasePropertyFunction
A constant property: zero parameters, always returns value.
Authored as Static(value="8.7 W/(m*K)"); ignores any operating-point arguments.
Fields:
Validators:
-
_coerce_value→value
Quantity
¶
Bases: PlainQuantity[float]
A pint quantity with a float magnitude.
Methods:
-
to–This quantity converted to the units
othernames.
to
¶
This quantity converted to the units other names.
Parameters:
-
other(object, default:None) –The target units, as a unit, a quantity or a unit string.
-
contexts(object, default:()) –The pint contexts, by name or object, that enable the conversion.
-
ctx_kwargs(object, default:{}) –The parameters those contexts take.
Source code in src/femforge/physical/units.py
Unit
¶
Bases: PlainUnit
A pint unit, typed so that arithmetic with units and numbers keeps its type.
VectorQuantity
¶
Bases: PlainQuantity[Vec3]
A pint quantity with a Vec3 magnitude.
Methods:
-
to–This vector quantity converted to the units
othernames.
to
¶
to(other: object = None, *contexts: object, **ctx_kwargs: object) -> VectorQuantity
This vector quantity converted to the units other names.
Parameters:
-
other(object, default:None) –The target units, as a unit, a quantity or a unit string.
-
contexts(object, default:()) –The pint contexts, by name or object, that enable the conversion.
-
ctx_kwargs(object, default:{}) –The parameters those contexts take.
Source code in src/femforge/physical/units.py
conditions_for
¶
conditions_for(tags: Iterable[EntityTag], physics: Physics | Iterable[Physics], target: ConditionTarget) -> list[Condition]
The conditions on tags that belong to physics and attach to target.
Parameters:
-
tags(Iterable[EntityTag]) –The region overrides that match the region.
-
physics(Physics | Iterable[Physics]) –One
Physics, or several, such as a coupled preset's constituents. -
target(ConditionTarget) –Whether to collect body or boundary conditions.
Source code in src/femforge/physical/domain.py
as_expr
¶
Wrap a bare number into Const; pass nodes through (the operator-composition coercion point).
Source code in src/femforge/physical/expressions.py
evaluate
¶
render
¶
Backend source for expr with parameter references substituted (e.g. {"temperature": "tx(0)"}).
property_function_type
¶
A PropertyFunction constrained to dimensionality, usable as a Pydantic field.
quantity
¶
quantity(value: Vec3, units: Unit | str | None = None) -> VectorQuantity
Statically-typed face of U.Quantity(...): a float magnitude yields Quantity, a Vec3 yields VectorQuantity.
Prefer a string for composite units ("newton * meter").