graintrace.slip_systems#
Slip-system definitions for the NEML2 crystal-plasticity decks.
The CPFE deck (cpfe_base/neml2_cpfe.i) and the Taylor/calibration deck
(cpfe_base/neml2_cpfe_calibration.i) describe slip with NEML2’s
CubicCrystal: one or more slip families, each a Miller direction and a
Miller plane normal. NEML2 expands every family over the cubic point group, so
(<110>, {111}) gives the 12 FCC systems. The two deck lines that hold the
families carry # @SLIP directions / # @SLIP planes markers;
SlipSystems.apply_to_deck() rewrites them.
Pass a preset name (SLIP_SYSTEM_PRESETS) or the families directly:
SlipSystems.resolve("bcc") # {110}<111>, 12 systems
SlipSystems.resolve([((1, 1, 1), (1, 1, 0)),
((1, 1, 1), (1, 1, 2))]) # 24 systems
SlipSystems.resolve([{"direction": [1, 1, 1], "plane": [1, 2, 3]}])
Only the cubic crystal class is supported: NEML2 v3 exposes CubicCrystal as
its only crystal-geometry input block (HCP and other classes need upstream
support).
- graintrace.slip_systems.SLIP_SYSTEM_PRESETS = {'bcc': (((1, 1, 1), (1, 1, 0)),), 'bcc_110_112': (((1, 1, 1), (1, 1, 0)), ((1, 1, 1), (1, 1, 2))), 'bcc_110_112_123': (((1, 1, 1), (1, 1, 0)), ((1, 1, 1), (1, 1, 2)), ((1, 1, 1), (1, 2, 3))), 'bcc_112': (((1, 1, 1), (1, 1, 2)),), 'fcc': (((1, 1, 0), (1, 1, 1)),)}#
name -> tuple of (direction, plane) families.
- Type:
Named slip-system sets
- graintrace.slip_systems.DEFAULT_SLIP_SYSTEMS = 'fcc'#
Preset used when nothing is specified (the shipped decks’ historical slip).
- class graintrace.slip_systems.SlipSystems(families, name='custom', crystal='cubic')[source]#
Bases:
objectSlip families for a cubic crystal, as written into the NEML2 decks.
- Variables:
- Parameters:
- classmethod resolve(spec=None)[source]#
Build a
SlipSystemsfrom a preset name, families, or itself.- Parameters:
spec (None | str | SlipSystems | Iterable[Any]) –
None(the default preset,"fcc"), a preset name fromSLIP_SYSTEM_PRESETS, aSlipSystems, or an iterable of families, each(direction, plane)or{"direction": [...], "plane": [...]}.- Returns:
The validated
SlipSystems.- Raises:
ValueError – unknown preset, malformed family, or a direction not in its plane.
- Return type:
- apply_to_deck(text)[source]#
Rewrite the
# @SLIPlines of a NEML2 deck with these families.- Parameters:
text (str) – deck source containing exactly one
# @SLIP directionsand one# @SLIP planesMillerIndexline.- Returns:
The deck text with both lines replaced.
- Raises:
RuntimeError – if a marker is missing or duplicated.
- Return type: