From cc8790908c3b86bf34b024517b82ef6f5ec1dfb4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 16 Aug 2023 22:01:20 +0200 Subject: [PATCH] there is no "crystal lattice", what we define are the 14 Bravais lattices --- python/damask/_crystal.py | 12 ++++++------ python/damask/_orientation.py | 4 ++-- python/damask/_typehints.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/damask/_crystal.py b/python/damask/_crystal.py index 9434515f5..e084f1eae 100644 --- a/python/damask/_crystal.py +++ b/python/damask/_crystal.py @@ -2,11 +2,11 @@ from typing import Optional, Union, Dict, List, Tuple import numpy as np -from ._typehints import FloatSequence, CrystalFamily, CrystalLattice, CrystalKinematics +from ._typehints import FloatSequence, CrystalFamily, BravaisLattice, CrystalKinematics from . import util from . import Rotation -lattice_symmetries: Dict[CrystalLattice, CrystalFamily] = { +lattice_symmetries: Dict[BravaisLattice, CrystalFamily] = { 'aP': 'triclinic', 'mP': 'monoclinic', @@ -27,7 +27,7 @@ lattice_symmetries: Dict[CrystalLattice, CrystalFamily] = { 'cF': 'cubic', } -orientation_relationships: Dict[str, Dict[CrystalLattice,np.ndarray]] = { +orientation_relationships: Dict[str, Dict[BravaisLattice,np.ndarray]] = { 'KS': { 'cF': np.array([ [[-1, 0, 1],[ 1, 1, 1]], @@ -323,7 +323,7 @@ class Crystal(): def __init__(self, *, family: Optional[CrystalFamily] = None, - lattice: Optional[CrystalLattice] = None, + lattice: Optional[BravaisLattice] = None, a: Optional[float] = None, b: Optional[float] = None, c: Optional[float] = None, alpha: Optional[float] = None, beta: Optional[float] = None, gamma: Optional[float] = None, degrees: bool = False): @@ -772,7 +772,7 @@ class Crystal(): Directions and planes of deformation mode families. """ - _kinematics: Dict[CrystalLattice, Dict[CrystalKinematics, List[np.ndarray]]] = { + _kinematics: Dict[BravaisLattice, Dict[CrystalKinematics, List[np.ndarray]]] = { 'cF': { 'slip': [np.array([ [+0,+1,-1, +1,+1,+1], @@ -1015,7 +1015,7 @@ class Crystal(): def relation_operations(self, - model: str) -> Tuple[CrystalLattice, Rotation]: + model: str) -> Tuple[BravaisLattice, Rotation]: """ Crystallographic orientation relationships for phase transformations. diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index 4db24bae5..cf6684458 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -3,7 +3,7 @@ from typing import Optional, Union, TypeVar import numpy as np -from ._typehints import FloatSequence, IntSequence, CrystalFamily, CrystalLattice +from ._typehints import FloatSequence, IntSequence, CrystalFamily, BravaisLattice from . import Rotation from . import Crystal from . import util @@ -73,7 +73,7 @@ class Orientation(Rotation,Crystal): rotation: Union[FloatSequence, Rotation] = np.array([1.,0.,0.,0.]), *, family: Optional[CrystalFamily] = None, - lattice: Optional[CrystalLattice] = None, + lattice: Optional[BravaisLattice] = None, a: Optional[float] = None, b: Optional[float] = None, c: Optional[float] = None, alpha: Optional[float] = None, beta: Optional[float] = None, gamma: Optional[float] = None, degrees: bool = False): diff --git a/python/damask/_typehints.py b/python/damask/_typehints.py index 5891e6305..29ab9f3ad 100644 --- a/python/damask/_typehints.py +++ b/python/damask/_typehints.py @@ -11,7 +11,7 @@ IntSequence = Union[np.ndarray,Sequence[int]] StrSequence = Union[np.ndarray,Sequence[str]] FileHandle = Union[TextIO, str, Path] CrystalFamily = Union[None,Literal['triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic']] -CrystalLattice = Union[None,Literal['aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hP', 'cP', 'cI', 'cF']] +BravaisLattice = Union[None,Literal['aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hP', 'cP', 'cI', 'cF']] CrystalKinematics = Literal['slip', 'twin'] NumpyRngSeed = Union[int, IntSequence, np.random.SeedSequence, np.random.Generator] # BitGenerator does not exists in older numpy versions