jaxdem.material_matchmakers#

Material mix rules and implementations.

Classes

MaterialMatchmaker()

Abstract base class for material property mixing rules.

class jaxdem.material_matchmakers.MaterialMatchmaker#

Bases: Factory, ABC

Abstract base class for material property mixing rules.

Notes

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)
... class MyCustomMatchmaker(MaterialMatchmaker):
...     ...
abstractmethod static get_effective_property(prop1: Array, prop2: Array) → Array[source]#

Compute the effective property from two 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:

The effective property, computed from prop1 and prop2 with the matchmaker’s mixing rule.

Return type:

jax.Array

Modules

harmonic

Harmonic averaging material matchmaker.

linear

Linear averaging material matchmaker.