jaxdem.material_matchmakers#
Material mix rules and implementations.
Classes
Abstract base class for defining how to combine (mix) material properties. |
- class jaxdem.material_matchmakers.MaterialMatchmaker[source]#
Bases:
Factory
,ABC
Abstract base class for defining how to combine (mix) material properties.
Notes
These matchmakers are used by the
jaxdem.MaterialTable
to pre-compute interaction matrices.
Example
To define a custom matchmaker, inherit from
MaterialMatchmaker
and implement its abstract methods:>>> @MaterialMatchmaker.register("myCustomForce") >>> @jax.tree_util.register_dataclass >>> @dataclass(slots=True, frozen=True) >>> class MyCustomMatchmaker(MaterialMatchmaker): ...
- abstractmethod static get_effective_property(prop1: Array, prop2: Array) Array [source][source]#
Abstract method to compute the effective property value from two individual material properties.
Concrete implementations define the specific mixing rule
- Parameters:
prop1 (jax.Array) – The property value from the first material. Can be a scalar or an array.
prop2 (jax.Array) – The property value from the second material. Can be a scalar or an array.
- Returns:
A JAX array representing the effective property, computed from prop1 and prop2 according to the matchmaker’s specific rule.
- Return type:
jax.Array
- class jaxdem.material_matchmakers.HarmonicMaterialMatchmaker[source]#
Bases:
MaterialMatchmaker
A MaterialMatchmaker implementation that computes the effective property as the harmonic mean of two properties:
\[P_{eff} = \frac{2}{\frac{1}{P_1} + \frac{1}{P_2}}\]where \(P_1\) and \(P_2\) are the property values from the two materials.
- class jaxdem.material_matchmakers.LinearMaterialMatchmaker[source]#
Bases:
MaterialMatchmaker
A MaterialMatchmaker implementation that computes the effective property as the arithmetic mean (linear average) of two properties:
\[P_{eff} = \frac{P_1 + P_2}{2}\]where \(P_1\) and \(P_2\) are the property values from the two materials.
Modules