# Materials

The material property model, the concrete materials and the tag-keyed registry the domain config resolves.

## femforge.materials

Material library: the property model every material fills in, the concrete materials, and the tag-keyed registry the domain config resolves against.

Modules:

- **`air`** –

  Dry air as a material.
- **`copper`** –

  Annealed copper with a temperature-dependent conductivity.
- **`neodymium`** –

  Sintered NdFeB magnets with temperature-dependent remanence and coercivity.
- **`pcb`** –

  FR4, the glass-epoxy laminate of printed circuit boards.
- **`properties`** –

  The material property model: four property groups whose fields map onto Elmer material keywords.
- **`registry`** –

  The single material registry, keyed by each material's `tag` — the one source both the CAD/mesh stage and the sif writer read.
- **`steel`** –

  Carbon and stainless steels.

Classes:

- **`MaterialProperties`** –

  A named material: its registry tag and its mechanical, thermal, magnetic and electrical properties.
- **`MechanicalProperties`** –

  The mechanical properties of a material.
- **`ThermalProperties`** –

  The thermal properties of a material.
- **`MagneticProperties`** –

  The magnetic properties of a material.
- **`ElectricalProperties`** –

  The electrical properties of a material.
- **`Air`** –

  Dry air at room temperature.
- **`Copper`** –

  Annealed copper whose resistivity rises linearly with temperature.
- **`FR4`** –

  FR4 glass-epoxy laminate, the substrate of printed circuit boards.
- **`Neodymium`** –

  Sintered NdFeB magnet; grades supply B\_r and H\_cb at the reference temperature, authored as Expressions so a hot magnet's weakened drive falls out of the operating point.
- **`N42`** –

  N42 neodymium magnet.
- **`N52`** –

  N52 neodymium magnet.
- **`Steel_1080`** –

  1080 High-carbon steel.
- **`Steel_316`** –

  316 austenitic stainless steel, annealed.

Functions:

- **`material`** –

  Construct a fresh registered material by its tag (e.g. `"N52"`).
- **`all_materials`** –

  A fresh instance of every registered material.
- **`available_materials`** –

  The tags of every registered material.
- **`register_material`** –

  Add or replace the material registered under `tag`.

### MaterialProperties

Bases: `_PropertyModel`

A named material: its registry tag and its mechanical, thermal, magnetic and electrical properties.

Fields:

- `name` (`str`)
- `tag` (`str`)
- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)

#### name

```python
name: str = ''
```

The display name.

#### tag

```python
tag: str = ''
```

The registry key that a body's `material` tag names.

#### mechanical

```python
mechanical: MechanicalProperties
```

The mechanical properties.

#### thermal

```python
thermal: ThermalProperties
```

The thermal properties.

#### magnetic

```python
magnetic: MagneticProperties
```

The magnetic properties.

#### electrical

```python
electrical: ElectricalProperties
```

The electrical properties.

#### is\_magnet

```python
is_magnet: bool
```

Whether the material has a remanence, which marks it as a permanent magnet.

#### to\_elmer

```python
to_elmer(*, at: Mapping[str, Quantity], runtime: frozenset[str] = frozenset(), backend: Backend = 'matc') -> dict[str, float | str]
```

The sif keyword/value pairs of all four property groups.

Parameters:

- **`at`** (`Mapping[str, Quantity]`) –

  The operating point the other properties are evaluated at, each stripped to a bare SI float.
- **`runtime`** (`frozenset[str]`, default: `frozenset()` ) –

  The parameters Elmer supplies at solve time; a property of only these emits as a MATC/Lua expression or table.
- **`backend`** (`Backend`, default: `'matc'` ) –

  The sif expression language for runtime properties.

#### is\_conductor

```python
is_conductor(at: Mapping[str, Quantity]) -> bool
```

Whether this material conducts current for solver purposes: σ(at) ≥ `CONDUCTOR_CONDUCTIVITY_FLOOR`.

#### print\_tree

```python
print_tree(tree: Tree | None = None) -> Tree
```

A rich tree of this material's properties, added under `tree` when one is given.

### MechanicalProperties

Bases: `_PropertyModel`

The mechanical properties of a material.

Fields:

- `density` (`Optional[_DensityPF]`)
- `elastic_modulus` (`Optional[_PressurePF]`)
- `yield_strength` (`Optional[_PressurePF]`)
- `ultimate_tensile_strength` (`Optional[_PressurePF]`)

#### density

```python
density: Optional[_DensityPF] = None
```

`ρ` `[kg/m³]`: Mass density.

#### elastic\_modulus

```python
elastic_modulus: Optional[_PressurePF] = None
```

`E` `[Pa]`: Elastic (Young's) modulus.

#### yield\_strength

```python
yield_strength: Optional[_PressurePF] = None
```

`σ_y` `[Pa]`: Yield strength.

#### ultimate\_tensile\_strength

```python
ultimate_tensile_strength: Optional[_PressurePF] = None
```

`σ_u` `[Pa]`: Ultimate tensile strength.

### ThermalProperties

Bases: `_PropertyModel`

The thermal properties of a material.

Fields:

- `conductivity` (`Optional[_ThermalConductivityPF]`)
- `specific_heat_capacity` (`Optional[_SpecificHeatPF]`)
- `convective_heat_transfer_coefficient` (`Optional[_HeatTransferCoefficientPF]`)
- `glass_transition_temperature` (`Optional[_TemperaturePF]`)

#### conductivity

```python
conductivity: Optional[_ThermalConductivityPF] = None
```

`k` `[W/(m·K)]`: Thermal conductivity.

#### specific\_heat\_capacity

```python
specific_heat_capacity: Optional[_SpecificHeatPF] = None
```

`c_p` `[J/(kg·K)]`: Specific heat capacity.

#### convective\_heat\_transfer\_coefficient

```python
convective_heat_transfer_coefficient: Optional[_HeatTransferCoefficientPF] = None
```

`h` `[W/(m²·K)]`: Convective heat transfer coefficient.

#### glass\_transition\_temperature

```python
glass_transition_temperature: Optional[_TemperaturePF] = None
```

`T_g` `[K]`: Glass transition temperature.

### MagneticProperties

Bases: `_PropertyModel`

The magnetic properties of a material.

Fields:

- `rel_permeability` (`Optional[_DimensionlessPF]`)
- `remanence` (`Optional[_FluxDensityPF]`)
- `coercivity` (`Optional[_FieldStrengthPF]`)
- `bh_curve` (`Optional[_FieldStrengthPF]`)

#### rel\_permeability

```python
rel_permeability: Optional[_DimensionlessPF] = None
```

`μ_r` `[-]`: Relative permeability.

#### remanence

```python
remanence: Optional[_FluxDensityPF] = None
```

`B_r` `[T]`: Remanent flux density.

#### coercivity

```python
coercivity: Optional[_FieldStrengthPF] = None
```

`H_c` `[A/m]`: Coercivity.

#### bh\_curve

```python
bh_curve: Optional[_FieldStrengthPF] = None
```

`H(B)` `[A/m]`: Magnetization curve, a 1-D Calibration over `flux_density` emitted as Elmer's `H-B Curve` table.

#### to\_elmer

```python
to_elmer(*, at: Mapping[str, Quantity], runtime: frozenset[str] = frozenset(), backend: Backend = 'matc') -> dict[str, float | str]
```

The sif keyword/value pairs of the magnetic fields, plus the `H-B Curve` table when `bh_curve` is set.

Parameters:

- **`at`** (`Mapping[str, Quantity]`) –

  The operating point the other properties are evaluated at, each stripped to a bare SI float.
- **`runtime`** (`frozenset[str]`, default: `frozenset()` ) –

  The parameters Elmer supplies at solve time; a property of only these emits as a MATC/Lua expression or table.
- **`backend`** (`Backend`, default: `'matc'` ) –

  The sif expression language for runtime properties.

#### magnetization\_magnitude

```python
magnetization_magnitude(*, at: Mapping[str, Quantity]) -> Optional[float]
```

|M| = Bᵣ/μ₀ in A/m, evaluating the remanence at operating point `at`; None for a non-magnet (no remanence).

### ElectricalProperties

Bases: `_PropertyModel`

The electrical properties of a material.

Fields:

- `conductivity` (`Optional[_ElectricalConductivityPF]`)
- `resistivity` (`Optional[_ResistivityPF]`)
- `permittivity` (`Optional[_PermittivityPF]`)
- `permeability` (`Optional[_PermeabilityPF]`)

#### conductivity

```python
conductivity: Optional[_ElectricalConductivityPF] = None
```

`σ` `[S/m]`: Electrical conductivity.

#### resistivity

```python
resistivity: Optional[_ResistivityPF] = None
```

`ρ_e` `[Ω·m]`: Electrical resistivity.

#### permittivity

```python
permittivity: Optional[_PermittivityPF] = None
```

`ε` `[F/m]`: Absolute permittivity, emitted to Elmer as the relative ε/ε₀.

#### permeability

```python
permeability: Optional[_PermeabilityPF] = None
```

`μ` `[H/m]`: Absolute magnetic permeability.

### Air

```python
Air()
```

Bases: `MaterialProperties`

Dry air at room temperature.

Fields:

- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)
- `name` (`str`)
- `tag` (`str`)

### Copper

```python
Copper()
```

Bases: `MaterialProperties`

Annealed copper whose resistivity rises linearly with temperature.

Fields:

- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)
- `name` (`str`)
- `tag` (`str`)

### FR4

```python
FR4()
```

Bases: `MaterialProperties`

FR4 glass-epoxy laminate, the substrate of printed circuit boards.

Fields:

- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)
- `name` (`str`)
- `tag` (`str`)

### Neodymium

```python
Neodymium(*, name: str, tag: str, remanence_at_reference: float, coercivity_at_reference: float)
```

Bases: `MaterialProperties`

Sintered NdFeB magnet; grades supply B\_r and H\_cb at the reference temperature, authored as Expressions so a hot magnet's weakened drive falls out of the operating point.

Parameters:

- **`name`** (`str`) –

  The display name.
- **`tag`** (`str`) –

  The registry key that a body's `material` tag names.
- **`remanence_at_reference`** (`float`) –

  The remanence B\_r at the reference temperature, in T.
- **`coercivity_at_reference`** (`float`) –

  The coercivity H\_cb at the reference temperature, in A/m.

Config:

- `arbitrary_types_allowed`: `True`
- `validate_assignment`: `True`
- `use_attribute_docstrings`: `True`

Fields:

- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)
- `name` (`str`)
- `tag` (`str`)

### N42

```python
N42()
```

Bases: `Neodymium`

N42 neodymium magnet.

Fields:

- `name` (`str`)
- `tag` (`str`)
- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)

### N52

```python
N52()
```

Bases: `Neodymium`

N52 neodymium magnet.

Fields:

- `name` (`str`)
- `tag` (`str`)
- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)

### Steel\_1080

```python
Steel_1080(rel_permeability: float | None = None)
```

Bases: `MaterialProperties`

1080 High-carbon steel.

Fields:

- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)
- `name` (`str`)
- `tag` (`str`)

### Steel\_316

```python
Steel_316()
```

Bases: `MaterialProperties`

316 austenitic stainless steel, annealed.

Fields:

- `mechanical` (`MechanicalProperties`)
- `thermal` (`ThermalProperties`)
- `magnetic` (`MagneticProperties`)
- `electrical` (`ElectricalProperties`)
- `name` (`str`)
- `tag` (`str`)

### material

```python
material(tag: str) -> MaterialProperties
```

Construct a fresh registered material by its tag (e.g. `"N52"`).

### all\_materials

```python
all_materials() -> list[MaterialProperties]
```

A fresh instance of every registered material.

### available\_materials

```python
available_materials() -> list[str]
```

The tags of every registered material.

### register\_material

```python
register_material(tag: str, factory: type[MaterialProperties]) -> None
```

Add or replace the material registered under `tag`.
