tests working now

This commit is contained in:
Martin Diehl 2021-08-08 10:44:38 +02:00
parent 4e0b3abeec
commit b1dab5f398
2 changed files with 6 additions and 5 deletions

View File

@ -861,7 +861,7 @@ class Orientation(Rotation,Crystal):
Parameters
----------
N_slip|N_twin : iterable of int
Number of deformation systems per deformation system.
Number of deformation systems per family of the deformation system.
Use '*'. to select all.
Returns
@ -871,7 +871,7 @@ class Orientation(Rotation,Crystal):
Examples
--------
Schmid matrix (in lab frame) of first slip system of a face-centered
Schmid matrix (in lab frame) of first octahedral slip system of a face-centered
cubic crystal in "Goss" orientation.
>>> import damask
@ -889,7 +889,7 @@ class Orientation(Rotation,Crystal):
kinematics = self.kinematics('slip' if N_twin is None else 'twin')
active = N_slip if N_twin is None else N_twin
if active == '*': active = [len(a) for a in kinematics]
if active == '*': active = [len(a) for a in kinematics['direction']]
d = self.to_frame(uvw=np.vstack([kinematics['direction'][i][:n] for i,n in enumerate(active)]))
p = self.to_frame(hkl=np.vstack([kinematics['plane'][i][:n] for i,n in enumerate(active)]))

View File

@ -453,6 +453,7 @@ class TestOrientation:
def test_Schmid_vectorize(self,lattice):
O = Orientation.from_random(shape=4,lattice=lattice) # noqa
for mode in ['slip','twin']:
P = O.Schmid(N_slip='*') if mode == 'slip' else O.Schmid(N_twin='*')
Ps = O.Schmid(N_slip='*') if mode == 'slip' else O.Schmid(N_twin='*')
for i in range(4):
assert np.allclose(Orientation(rotation=O[i],lattice=lattice).Schmid(mode),P[:,i])
P = O[i].Schmid(N_slip='*') if mode == 'slip' else O[i].Schmid(N_twin='*')
assert np.allclose(P,Ps[:,i])