From 0396332b7b69c7b25ec76923715392d23246d602 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Sep 2023 22:43:50 +0200 Subject: [PATCH 1/3] needed for fixed non-Schmid behavior --- src/crystal.f90 | 18 ++++++------- src/grid/spectral_utilities.f90 | 2 ++ src/math.f90 | 48 +++++++++++++++++++++++++++------ 3 files changed, 51 insertions(+), 17 deletions(-) diff --git a/src/crystal.f90 b/src/crystal.f90 index 7bf9dc2f7..437e45227 100644 --- a/src/crystal.f90 +++ b/src/crystal.f90 @@ -1445,10 +1445,10 @@ end function crystal_SchmidMatrix_slip !-------------------------------------------------------------------------------------------------- function crystal_SchmidMatrix_twin(Ntwin,lattice,cOverA) result(SchmidMatrix) - integer, dimension(:), intent(in) :: Ntwin !< number of active twin systems per family - character(len=*), intent(in) :: lattice !< Bravais lattice (Pearson symbol) - real(pREAL), intent(in) :: cOverA !< c/a ratio - real(pREAL), dimension(3,3,sum(Ntwin)) :: SchmidMatrix + integer, dimension(:), intent(in) :: Ntwin !< number of active twin systems per family + character(len=*), intent(in) :: lattice !< Bravais lattice (Pearson symbol) + real(pREAL), intent(in) :: cOverA !< c/a ratio + real(pREAL), dimension(3,3,sum(Ntwin)) :: SchmidMatrix real(pREAL), dimension(3,3,sum(Ntwin)) :: coordinateSystem real(pREAL), dimension(:,:), allocatable :: twinSystems @@ -1521,10 +1521,10 @@ end function crystal_SchmidMatrix_trans !-------------------------------------------------------------------------------------------------- function crystal_SchmidMatrix_cleavage(Ncleavage,lattice,cOverA) result(SchmidMatrix) - integer, dimension(:), intent(in) :: Ncleavage !< number of active cleavage systems per family - character(len=*), intent(in) :: lattice !< Bravais lattice (Pearson symbol) - real(pREAL), intent(in) :: cOverA !< c/a ratio - real(pREAL), dimension(3,3,3,sum(Ncleavage)) :: SchmidMatrix + integer, dimension(:), intent(in) :: Ncleavage !< number of active cleavage systems per family + character(len=*), intent(in) :: lattice !< Bravais lattice (Pearson symbol) + real(pREAL), intent(in) :: cOverA !< c/a ratio + real(pREAL), dimension(3,3,3,sum(Ncleavage)) :: SchmidMatrix real(pREAL), dimension(3,3,sum(Ncleavage)) :: coordinateSystem real(pREAL), dimension(:,:), allocatable :: cleavageSystems @@ -1904,7 +1904,7 @@ end function buildInteraction !-------------------------------------------------------------------------------------------------- function buildCoordinateSystem(active,potential,system,lattice,cOverA) result(coordinateSystem) - integer, dimension(:), intent(in) :: & + integer, dimension(:), intent(in) :: & active, & !< # of active systems per family potential !< # of potential systems per family real(pREAL), dimension(:,:), intent(in) :: & diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index 03d945bee..de9518b8c 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -674,6 +674,7 @@ function utilities_maskedCompliance(rot_BC,mask_stress,C) logical :: errmatinv character(len=pSTRLEN):: formatString + mask_stressVector = .not. reshape(transpose(mask_stress), [9]) size_reduced = count(mask_stressVector) if (size_reduced > 0) then @@ -696,6 +697,7 @@ function utilities_maskedCompliance(rot_BC,mask_stress,C) write(formatString, '(i2)') size_reduced formatString = '(/,1x,a,/,'//trim(formatString)//'('//trim(formatString)//'(2x,es9.2,1x)/))' print trim(formatString), 'C * S (load) ', transpose(matmul(c_reduced,s_reduced)) + print trim(formatString), 'C (load) ', transpose(c_reduced) print trim(formatString), 'S (load) ', transpose(s_reduced) if (errmatinv) error stop 'matrix inversion error' end if diff --git a/src/math.f90 b/src/math.f90 index 4122f5170..24141f4e9 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -24,6 +24,12 @@ module math implicit none(type,external) public + + interface math_expand + module procedure math_expand_int + module procedure math_expand_real + end interface math_expand + #if __INTEL_COMPILER >= 1900 ! do not make use of associated entities available to other modules private :: & @@ -136,7 +142,7 @@ end subroutine math_init pure recursive subroutine math_sort(a, istart, iend, sortDim) integer, dimension(:,:), intent(inout) :: a - integer, intent(in),optional :: istart,iend, sortDim + integer, optional, intent(in) :: istart,iend, sortDim integer :: ipivot,s,e,d @@ -199,11 +205,11 @@ end subroutine math_sort !> @details takes a set of numbers (a,b,c,...) and corresponding multiples (x,y,z,...) !> to return a vector of x times a, y times b, z times c, ... !-------------------------------------------------------------------------------------------------- -pure function math_expand(what,how) +pure function math_expand_int(what,how) - real(pREAL), dimension(:), intent(in) :: what - integer, dimension(:), intent(in) :: how - real(pREAL), dimension(sum(how)) :: math_expand + integer, dimension(:), intent(in) :: what + integer, dimension(:), intent(in) :: how + integer, dimension(sum(how)) :: math_expand_int integer :: i @@ -211,10 +217,33 @@ pure function math_expand(what,how) if (sum(how) == 0) return do i = 1, size(how) - math_expand(sum(how(1:i-1))+1:sum(how(1:i))) = what(mod(i-1,size(what))+1) + math_expand_int(sum(how(1:i-1))+1:sum(how(1:i))) = what(mod(i-1,size(what))+1) end do -end function math_expand +end function math_expand_int + + +!-------------------------------------------------------------------------------------------------- +!> @brief vector expansion +!> @details takes a set of numbers (a,b,c,...) and corresponding multiples (x,y,z,...) +!> to return a vector of x times a, y times b, z times c, ... +!-------------------------------------------------------------------------------------------------- +pure function math_expand_real(what,how) + + real(pREAL), dimension(:), intent(in) :: what + integer, dimension(:), intent(in) :: how + real(pREAL), dimension(sum(how)) :: math_expand_real + + integer :: i + + + if (sum(how) == 0) return + + do i = 1, size(how) + math_expand_real(sum(how(1:i-1))+1:sum(how(1:i))) = what(mod(i-1,size(what))+1) + end do + +end function math_expand_real !-------------------------------------------------------------------------------------------------- @@ -1309,7 +1338,10 @@ subroutine math_selfTest() if (any(abs([1.0_pREAL,2.0_pREAL,2.0_pREAL,1.0_pREAL,1.0_pREAL,1.0_pREAL] - & math_expand([1.0_pREAL,2.0_pREAL],[1,2,3])) > tol_math_check)) & - error stop 'math_expand [1,2] by [1,2,3] => [1,2,2,1,1,1]' + error stop 'math_expand_real [1,2] by [1,2,3] => [1,2,2,1,1,1]' + + if (any(abs([1,2,2,1,1,1] - math_expand([1,2],[1,2,3])) /= 0)) & + error stop 'math_expand_int [1,2] by [1,2,3] => [1,2,2,1,1,1]' call math_sort(sort_in_,1,3,2) if (any(sort_in_ /= sort_out_)) & From a2b571c1fc8f0148087de6ed141801d069d542c0 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 14 Sep 2023 16:45:24 -0400 Subject: [PATCH 2/3] corrected sign definition of <111>{110} slip systems Breaking change: Sign of shear differs --- PRIVATE | 2 +- python/damask/_crystal.py | 196 +++++++++--------- .../tests/resources/Orientation/cI_slip.txt | 24 +-- python/tests/test_Orientation.py | 7 +- src/crystal.f90 | 17 +- 5 files changed, 123 insertions(+), 123 deletions(-) diff --git a/PRIVATE b/PRIVATE index 9623d3d50..b13ed2628 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 9623d3d50e11a086e456b7fddc25fae67266911d +Subproject commit b13ed2628e2ece45bcf433ce88483759b02c946e diff --git a/python/damask/_crystal.py b/python/damask/_crystal.py index adcaf610e..b2fb4edd7 100644 --- a/python/damask/_crystal.py +++ b/python/damask/_crystal.py @@ -785,25 +785,25 @@ class Crystal(): _kinematics: Dict[BravaisLattice, Dict[CrystalKinematics, List[np.ndarray]]] = { 'cF': { 'slip': [np.array([ - [+0,+1,-1, +1,+1,+1], - [-1,+0,+1, +1,+1,+1], - [+1,-1,+0, +1,+1,+1], - [+0,-1,-1, -1,-1,+1], - [+1,+0,+1, -1,-1,+1], - [-1,+1,+0, -1,-1,+1], - [+0,-1,+1, +1,-1,-1], - [-1,+0,-1, +1,-1,-1], - [+1,+1,+0, +1,-1,-1], - [+0,+1,+1, -1,+1,-1], - [+1,+0,-1, -1,+1,-1], - [-1,-1,+0, -1,+1,-1]]), + [ 0,+1,-1, +1,+1,+1], + [-1, 0,+1, +1,+1,+1], + [+1,-1, 0, +1,+1,+1], + [ 0,-1,-1, -1,-1,+1], + [+1, 0,+1, -1,-1,+1], + [-1,+1, 0, -1,-1,+1], + [ 0,-1,+1, +1,-1,-1], + [-1, 0,-1, +1,-1,-1], + [+1,+1, 0, +1,-1,-1], + [ 0,+1,+1, -1,+1,-1], + [+1, 0,-1, -1,+1,-1], + [-1,-1, 0, -1,+1,-1]]), np.array([ - [+1,+1,+0, +1,-1,+0], - [+1,-1,+0, +1,+1,+0], - [+1,+0,+1, +1,+0,-1], - [+1,+0,-1, +1,+0,+1], - [+0,+1,+1, +0,+1,-1], - [+0,+1,-1, +0,+1,+1]])], + [+1,+1, 0, +1,-1, 0], + [+1,-1, 0, +1,+1, 0], + [+1, 0,+1, +1, 0,-1], + [+1, 0,-1, +1, 0,+1], + [ 0,+1,+1, 0,+1,-1], + [ 0,+1,-1, 0,+1,+1]])], 'twin': [np.array([ [-2, 1, 1, 1, 1, 1], [ 1,-2, 1, 1, 1, 1], @@ -820,18 +820,18 @@ class Crystal(): }, 'cI': { 'slip': [np.array([ - [+1,-1,+1, +0,+1,+1], - [-1,-1,+1, +0,+1,+1], - [+1,+1,+1, +0,-1,+1], - [-1,+1,+1, +0,-1,+1], - [-1,+1,+1, +1,+0,+1], - [-1,-1,+1, +1,+0,+1], - [+1,+1,+1, -1,+0,+1], - [+1,-1,+1, -1,+0,+1], - [-1,+1,+1, +1,+1,+0], - [-1,+1,-1, +1,+1,+0], - [+1,+1,+1, -1,+1,+0], - [+1,+1,-1, -1,+1,+0]]), + [+1,-1,+1, 0,+1,+1], + [-1,-1,+1, 0,-1,-1], + [+1,+1,+1, 0,+1,-1], + [-1,+1,+1, 0,-1,+1], + [-1,+1,+1, -1, 0,-1], + [-1,-1,+1, +1, 0,+1], + [+1,+1,+1, -1, 0,+1], + [+1,-1,+1, +1, 0,-1], + [-1,+1,+1, +1,+1, 0], + [+1,-1,+1, -1,-1, 0], + [+1,+1,+1, +1,-1, 0], + [-1,-1,+1, -1,+1, 0]]), np.array([ [-1,+1,+1, +2,+1,+1], [+1,+1,+1, -2,+1,+1], @@ -886,33 +886,33 @@ class Crystal(): }, 'hP': { 'slip': [np.array([ - [+2,-1,-1,+0, +0,+0,+0,+1], - [-1,+2,-1,+0, +0,+0,+0,+1], - [-1,-1,+2,+0, +0,+0,+0,+1]]), + [+2,-1,-1, 0, 0, 0, 0,+1], + [-1,+2,-1, 0, 0, 0, 0,+1], + [-1,-1,+2, 0, 0, 0, 0,+1]]), np.array([ - [+2,-1,-1,+0, +0,+1,-1,+0], - [-1,+2,-1,+0, -1,+0,+1,+0], - [-1,-1,+2,+0, +1,-1,+0,+0]]), + [+2,-1,-1, 0, 0,+1,-1, 0], + [-1,+2,-1, 0, -1, 0,+1, 0], + [-1,-1,+2, 0, +1,-1, 0, 0]]), np.array([ - [-1,+2,-1,+0, +1,+0,-1,+1], - [-2,+1,+1,+0, +0,+1,-1,+1], - [-1,-1,+2,+0, -1,+1,+0,+1], - [+1,-2,+1,+0, -1,+0,+1,+1], - [+2,-1,-1,+0, +0,-1,+1,+1], - [+1,+1,-2,+0, +1,-1,+0,+1]]), + [-1,+2,-1, 0, +1, 0,-1,+1], + [-2,+1,+1, 0, 0,+1,-1,+1], + [-1,-1,+2, 0, -1,+1, 0,+1], + [+1,-2,+1, 0, -1, 0,+1,+1], + [+2,-1,-1, 0, 0,-1,+1,+1], + [+1,+1,-2, 0, +1,-1, 0,+1]]), np.array([ - [-2,+1,+1,+3, +1,+0,-1,+1], - [-1,-1,+2,+3, +1,+0,-1,+1], - [-1,-1,+2,+3, +0,+1,-1,+1], - [+1,-2,+1,+3, +0,+1,-1,+1], - [+1,-2,+1,+3, -1,+1,+0,+1], - [+2,-1,-1,+3, -1,+1,+0,+1], - [+2,-1,-1,+3, -1,+0,+1,+1], - [+1,+1,-2,+3, -1,+0,+1,+1], - [+1,+1,-2,+3, +0,-1,+1,+1], - [-1,+2,-1,+3, +0,-1,+1,+1], - [-1,+2,-1,+3, +1,-1,+0,+1], - [-2,+1,+1,+3, +1,-1,+0,+1]]), + [-2,+1,+1,+3, +1, 0,-1,+1], + [-1,-1,+2,+3, +1, 0,-1,+1], + [-1,-1,+2,+3, 0,+1,-1,+1], + [+1,-2,+1,+3, 0,+1,-1,+1], + [+1,-2,+1,+3, -1,+1, 0,+1], + [+2,-1,-1,+3, -1,+1, 0,+1], + [+2,-1,-1,+3, -1, 0,+1,+1], + [+1,+1,-2,+3, -1, 0,+1,+1], + [+1,+1,-2,+3, 0,-1,+1,+1], + [-1,+2,-1,+3, 0,-1,+1,+1], + [-1,+2,-1,+3, +1,-1, 0,+1], + [-2,+1,+1,+3, +1,-1, 0,+1]]), np.array([ [-1,-1,+2,+3, +1,+1,-2,+2], [+1,-2,+1,+3, -1,+2,-1,+2], @@ -951,61 +951,61 @@ class Crystal(): }, 'tI': { 'slip': [np.array([ - [+0,+0,+1, +1,+0,+0], - [+0,+0,+1, +0,+1,+0]]), + [ 0, 0,+1, +1, 0, 0], + [ 0, 0,+1, 0,+1, 0]]), np.array([ - [+0,+0,+1, +1,+1,+0], - [+0,+0,+1, -1,+1,+0]]), + [ 0, 0,+1, +1,+1, 0], + [ 0, 0,+1, -1,+1, 0]]), np.array([ - [+0,+1,+0, +1,+0,+0], - [+1,+0,+0, +0,+1,+0]]), + [ 0,+1, 0, +1, 0, 0], + [+1, 0, 0, 0,+1, 0]]), np.array([ - [+1,-1,+1, +1,+1,+0], - [+1,-1,-1, +1,+1,+0], - [-1,-1,-1, -1,+1,+0], - [-1,-1,+1, -1,+1,+0]]), + [+1,-1,+1, +1,+1, 0], + [+1,-1,-1, +1,+1, 0], + [-1,-1,-1, -1,+1, 0], + [-1,-1,+1, -1,+1, 0]]), np.array([ - [+1,-1,+0, +1,+1,+0], - [+1,+1,+0, +1,-1,+0]]), + [+1,-1, 0, +1,+1, 0], + [+1,+1, 0, +1,-1, 0]]), np.array([ - [+0,+1,+1, +1,+0,+0], - [+0,-1,+1, +1,+0,+0], - [-1,+0,+1, +0,+1,+0], - [+1,+0,+1, +0,+1,+0]]), + [ 0,+1,+1, +1, 0, 0], + [ 0,-1,+1, +1, 0, 0], + [-1, 0,+1, 0,+1, 0], + [+1, 0,+1, 0,+1, 0]]), np.array([ - [+0,+1,+0, +0,+0,+1], - [+1,+0,+0, +0,+0,+1]]), + [ 0,+1, 0, 0, 0,+1], + [+1, 0, 0, 0, 0,+1]]), np.array([ - [+1,+1,+0, +0,+0,+1], - [-1,+1,+0, +0,+0,+1]]), + [+1,+1, 0, 0, 0,+1], + [-1,+1, 0, 0, 0,+1]]), np.array([ - [+0,+1,-1, +0,+1,+1], - [+0,-1,-1, +0,-1,+1], - [-1,+0,-1, -1,+0,+1], - [+1,+0,-1, +1,+0,+1]]), + [ 0,+1,-1, 0,+1,+1], + [ 0,-1,-1, 0,-1,+1], + [-1, 0,-1, -1, 0,+1], + [+1, 0,-1, +1, 0,+1]]), np.array([ - [+1,-1,+1, +0,+1,+1], - [+1,+1,-1, +0,+1,+1], - [+1,+1,+1, +0,+1,-1], - [-1,+1,+1, +0,+1,-1], - [+1,-1,-1, +1,+0,+1], - [-1,-1,+1, +1,+0,+1], - [+1,+1,+1, +1,+0,-1], - [+1,-1,+1, +1,+0,-1]]), + [+1,-1,+1, 0,+1,+1], + [+1,+1,-1, 0,+1,+1], + [+1,+1,+1, 0,+1,-1], + [-1,+1,+1, 0,+1,-1], + [+1,-1,-1, +1, 0,+1], + [-1,-1,+1, +1, 0,+1], + [+1,+1,+1, +1, 0,-1], + [+1,-1,+1, +1, 0,-1]]), np.array([ - [+1,+0,+0, +0,+1,+1], - [+1,+0,+0, +0,+1,-1], - [+0,+1,+0, +1,+0,+1], - [+0,+1,+0, +1,+0,-1]]), + [+1, 0, 0, 0,+1,+1], + [+1, 0, 0, 0,+1,-1], + [ 0,+1, 0, +1, 0,+1], + [ 0,+1, 0, +1, 0,-1]]), np.array([ - [+0,+1,-1, +2,+1,+1], - [+0,-1,-1, +2,-1,+1], - [+1,+0,-1, +1,+2,+1], - [-1,+0,-1, -1,+2,+1], - [+0,+1,-1, -2,+1,+1], - [+0,-1,-1, -2,-1,+1], - [-1,+0,-1, -1,-2,+1], - [+1,+0,-1, +1,-2,+1]]), + [ 0,+1,-1, +2,+1,+1], + [ 0,-1,-1, +2,-1,+1], + [+1, 0,-1, +1,+2,+1], + [-1, 0,-1, -1,+2,+1], + [ 0,+1,-1, -2,+1,+1], + [ 0,-1,-1, -2,-1,+1], + [-1, 0,-1, -1,-2,+1], + [+1, 0,-1, +1,-2,+1]]), np.array([ [-1,+1,+1, +2,+1,+1], [-1,-1,+1, +2,-1,+1], diff --git a/python/tests/resources/Orientation/cI_slip.txt b/python/tests/resources/Orientation/cI_slip.txt index 0f8db6c21..c4430fcef 100644 --- a/python/tests/resources/Orientation/cI_slip.txt +++ b/python/tests/resources/Orientation/cI_slip.txt @@ -1,23 +1,23 @@ 3x3:1_Schmid 3x3:2_Schmid 3x3:3_Schmid 3x3:4_Schmid 3x3:5_Schmid 3x3:6_Schmid 3x3:7_Schmid 3x3:8_Schmid 3x3:9_Schmid 0.0 0.4082482904638631 0.408248290463863 0.0 -0.408248290463863 -0.40824829046386296 0.0 0.4082482904638631 0.408248290463863 -0.0 -0.408248290463863 -0.40824829046386296 0.0 -0.408248290463863 -0.40824829046386296 0.0 0.4082482904638631 0.408248290463863 -0.0 -0.408248290463863 0.408248290463863 0.0 -0.408248290463863 0.408248290463863 0.0 -0.408248290463863 0.408248290463863 +0.0 0.408248290463863 0.40824829046386296 0.0 0.408248290463863 0.40824829046386296 0.0 -0.4082482904638631 -0.408248290463863 +0.0 0.408248290463863 -0.408248290463863 0.0 0.408248290463863 -0.408248290463863 0.0 0.408248290463863 -0.408248290463863 0.0 0.40824829046386285 -0.40824829046386285 0.0 -0.408248290463863 0.408248290463863 0.0 -0.408248290463863 0.408248290463863 --0.40824829046386296 2.4997998108697434e-17 -0.40824829046386285 0.4082482904638631 -2.4997998108697446e-17 0.408248290463863 0.4082482904638631 -2.4997998108697446e-17 0.408248290463863 +0.40824829046386296 -2.4997998108697434e-17 0.40824829046386285 -0.4082482904638631 2.4997998108697446e-17 -0.408248290463863 -0.4082482904638631 2.4997998108697446e-17 -0.408248290463863 -0.408248290463863 2.499799810869744e-17 -0.40824829046386296 -0.408248290463863 2.499799810869744e-17 -0.40824829046386296 0.4082482904638631 -2.4997998108697446e-17 0.408248290463863 -0.408248290463863 2.499799810869744e-17 0.408248290463863 -0.408248290463863 2.499799810869744e-17 0.408248290463863 -0.408248290463863 2.499799810869744e-17 0.408248290463863 --0.408248290463863 2.499799810869744e-17 0.408248290463863 0.40824829046386296 -2.4997998108697437e-17 -0.40824829046386296 -0.408248290463863 2.499799810869744e-17 0.408248290463863 +0.408248290463863 -2.499799810869744e-17 -0.408248290463863 -0.40824829046386296 2.4997998108697437e-17 0.40824829046386296 0.408248290463863 -2.499799810869744e-17 -0.408248290463863 -0.40824829046386296 -0.40824829046386285 4.999599621739487e-17 0.4082482904638631 0.408248290463863 -4.999599621739489e-17 0.4082482904638631 0.408248290463863 -4.999599621739489e-17 -0.4082482904638631 -0.408248290463863 4.999599621739489e-17 0.408248290463863 0.40824829046386296 -4.999599621739488e-17 -0.4082482904638631 -0.408248290463863 4.999599621739489e-17 --0.408248290463863 0.408248290463863 0.0 -0.408248290463863 0.408248290463863 0.0 -0.408248290463863 0.408248290463863 0.0 --0.40824829046386296 0.40824829046386296 0.0 -0.40824829046386296 0.40824829046386296 0.0 0.408248290463863 -0.408248290463863 0.0 +0.408248290463863 -0.408248290463863 0.0 0.408248290463863 -0.408248290463863 0.0 0.408248290463863 -0.408248290463863 0.0 +0.40824829046386296 -0.40824829046386296 0.0 0.40824829046386296 -0.40824829046386296 0.0 -0.408248290463863 0.408248290463863 0.0 -0.4714045207910316 -0.23570226039551578 -0.23570226039551576 0.4714045207910318 0.23570226039551587 0.23570226039551584 0.4714045207910318 0.23570226039551587 0.23570226039551584 --0.4714045207910318 0.23570226039551595 0.2357022603955159 -0.4714045207910318 0.23570226039551595 0.2357022603955159 -0.4714045207910318 0.23570226039551595 0.2357022603955159 -0.47140452079103173 -0.2357022603955159 0.23570226039551584 0.47140452079103173 -0.2357022603955159 0.23570226039551584 -0.4714045207910318 0.23570226039551595 -0.23570226039551587 +-0.4714045207910318 0.23570226039551595 0.23570226039551595 -0.4714045207910318 0.23570226039551595 0.23570226039551595 -0.4714045207910318 0.23570226039551595 0.23570226039551595 +0.47140452079103173 -0.2357022603955159 0.23570226039551587 0.47140452079103173 -0.2357022603955159 0.23570226039551587 -0.4714045207910318 0.23570226039551595 -0.2357022603955159 0.4714045207910318 0.23570226039551587 -0.23570226039551595 -0.47140452079103173 -0.23570226039551584 0.2357022603955159 0.4714045207910318 0.23570226039551587 -0.23570226039551595 0.2357022603955159 0.4714045207910318 0.23570226039551584 -0.23570226039551587 -0.47140452079103173 -0.23570226039551578 0.2357022603955159 0.4714045207910318 0.23570226039551584 --0.23570226039551587 0.47140452079103173 0.23570226039551587 -0.23570226039551587 0.47140452079103173 0.23570226039551587 0.2357022603955159 -0.4714045207910318 -0.2357022603955159 -0.2357022603955159 -0.4714045207910318 0.23570226039551595 0.2357022603955159 -0.4714045207910318 0.23570226039551595 0.2357022603955159 -0.4714045207910318 0.23570226039551595 +-0.23570226039551587 0.47140452079103173 0.23570226039551584 -0.23570226039551587 0.47140452079103173 0.23570226039551584 0.2357022603955159 -0.4714045207910318 -0.23570226039551587 +0.2357022603955159 -0.4714045207910318 0.2357022603955159 0.2357022603955159 -0.4714045207910318 0.2357022603955159 0.2357022603955159 -0.4714045207910318 0.2357022603955159 -0.2357022603955158 -0.4714045207910316 0.23570226039551584 0.2357022603955159 0.4714045207910318 -0.23570226039551595 0.2357022603955159 0.4714045207910318 -0.23570226039551595 0.23570226039551587 0.23570226039551584 0.47140452079103173 0.23570226039551587 0.23570226039551584 0.47140452079103173 -0.2357022603955159 -0.23570226039551587 -0.4714045207910318 -0.2357022603955159 0.2357022603955159 0.4714045207910318 0.23570226039551587 -0.23570226039551587 -0.47140452079103173 -0.2357022603955159 0.2357022603955159 0.4714045207910318 @@ -36,7 +36,7 @@ -0.30860669992418377 0.1543033499620919 -0.46291004988627565 0.3086066999241839 -0.15430334996209197 0.4629100498862758 0.3086066999241839 -0.15430334996209197 0.4629100498862758 0.3086066999241839 0.1543033499620919 -0.4629100498862758 0.3086066999241839 0.1543033499620919 -0.4629100498862758 0.3086066999241839 0.1543033499620919 -0.4629100498862758 0.3086066999241839 0.4629100498862758 0.15430334996209188 -0.3086066999241838 -0.4629100498862757 -0.15430334996209186 0.3086066999241839 0.4629100498862758 0.15430334996209188 --0.3086066999241838 0.4629100498862757 0.15430334996209188 -0.3086066999241838 0.4629100498862757 0.15430334996209188 0.3086066999241839 -0.4629100498862758 -0.1543033499620919 +-0.3086066999241838 0.4629100498862757 0.1543033499620919 -0.3086066999241838 0.4629100498862757 0.1543033499620919 0.3086066999241839 -0.4629100498862758 -0.15430334996209194 0.3086066999241839 -0.4629100498862758 0.15430334996209194 0.3086066999241839 -0.4629100498862758 0.15430334996209194 0.3086066999241839 -0.4629100498862758 0.15430334996209194 -0.30860669992418377 -0.46291004988627565 0.15430334996209194 0.3086066999241839 0.4629100498862758 -0.154303349962092 0.3086066999241839 0.4629100498862758 -0.154303349962092 -0.46291004988627565 -0.15430334996209186 -0.3086066999241837 0.4629100498862758 0.1543033499620919 0.3086066999241838 0.4629100498862758 0.1543033499620919 0.3086066999241838 @@ -45,5 +45,5 @@ 0.4629100498862758 0.1543033499620919 -0.3086066999241839 -0.4629100498862757 -0.15430334996209188 0.3086066999241838 0.4629100498862758 0.1543033499620919 -0.3086066999241839 -0.46291004988627565 -0.3086066999241837 -0.1543033499620918 0.4629100498862758 0.3086066999241838 0.15430334996209188 0.4629100498862758 0.3086066999241838 0.15430334996209188 -0.4629100498862758 0.3086066999241839 0.15430334996209194 -0.4629100498862758 0.3086066999241839 0.15430334996209194 -0.4629100498862758 0.3086066999241839 0.15430334996209194 -0.4629100498862757 -0.3086066999241838 0.1543033499620919 0.4629100498862757 -0.3086066999241838 0.1543033499620919 -0.4629100498862758 0.3086066999241839 -0.15430334996209194 +0.4629100498862757 -0.3086066999241838 0.15430334996209188 0.4629100498862757 -0.3086066999241838 0.15430334996209188 -0.4629100498862758 0.3086066999241839 -0.1543033499620919 0.4629100498862758 0.3086066999241838 -0.154303349962092 -0.4629100498862757 -0.30860669992418377 0.15430334996209197 0.4629100498862758 0.3086066999241838 -0.154303349962092 diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index a45444908..8346397cc 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -319,9 +319,7 @@ class TestOrientation: eu = o.related(model).as_Euler_angles(degrees=True) if update: coords = np.array([(1,i+1) for i,x in enumerate(eu)]) - Table(eu,{'Eulers':(3,)})\ - .add('pos',coords)\ - .save(reference) + Table({'Eulers':(3,)},eu).set('pos',coords).save(reference) assert np.allclose(eu,Table.load(reference).get('Eulers')) def test_basis_real(self): @@ -369,8 +367,7 @@ class TestOrientation: reference = res_path/f'{lattice}_{mode}.txt' P = O.Schmid(N_slip='*') if mode == 'slip' else O.Schmid(N_twin='*') if update: - table = Table(P.reshape(-1,9),{'Schmid':(3,3,)}) - table.save(reference) + Table({'Schmid':(3,3,)},P.reshape(-1,9)).save(reference) assert np.allclose(P,Table.load(reference).get('Schmid')) def test_Schmid_invalid(self): diff --git a/src/crystal.f90 b/src/crystal.f90 index 437e45227..9fa19f04a 100644 --- a/src/crystal.f90 +++ b/src/crystal.f90 @@ -123,18 +123,21 @@ module crystal real(pREAL), dimension(3+3,CI_NSLIP), parameter :: & CI_SYSTEMSLIP = reshape(real([& ! <111>{110} systems + ! Sign convention follows Table 1 of 10.1016/j.ijplas.2020.102733 + ! to allow for universal calculation of non-glide plane normal n1 = Rot(-m,60°) @ n + ! The choice matters since Rot(-m,60°) @ n ≠ Rot(m,60°) @ -n ..! 1,-1, 1, 0, 1, 1, & - -1,-1, 1, 0, 1, 1, & - 1, 1, 1, 0,-1, 1, & + -1,-1, 1, 0,-1,-1, & + 1, 1, 1, 0, 1,-1, & -1, 1, 1, 0,-1, 1, & - -1, 1, 1, 1, 0, 1, & + -1, 1, 1, -1, 0,-1, & -1,-1, 1, 1, 0, 1, & 1, 1, 1, -1, 0, 1, & - 1,-1, 1, -1, 0, 1, & + 1,-1, 1, 1, 0,-1, & -1, 1, 1, 1, 1, 0, & - -1, 1,-1, 1, 1, 0, & - 1, 1, 1, -1, 1, 0, & - 1, 1,-1, -1, 1, 0, & + 1,-1, 1, -1,-1, 0, & + 1, 1, 1, 1,-1, 0, & + -1,-1, 1, -1, 1, 0, & ! <111>{112} systems -1, 1, 1, 2, 1, 1, & 1, 1, 1, -2, 1, 1, & From 4de21b5f8692f3c27b3d1dc100104040728dbcf4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Sep 2023 00:06:00 +0200 Subject: [PATCH 3/3] more systematic name --- PRIVATE | 2 +- examples/config/phase/mechanical/plastic/dislotungsten_W.yaml | 2 +- src/phase_mechanical_plastic_dislotungsten.f90 | 2 +- src/phase_mechanical_plastic_kinehardening.f90 | 2 +- src/phase_mechanical_plastic_nonlocal.f90 | 2 +- src/phase_mechanical_plastic_phenopowerlaw.f90 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PRIVATE b/PRIVATE index b13ed2628..ed4e161d4 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit b13ed2628e2ece45bcf433ce88483759b02c946e +Subproject commit ed4e161d4302852a31c59a1d1d9b11d49f1a5427 diff --git a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml index 42aebec22..d20e82413 100644 --- a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml +++ b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml @@ -26,7 +26,7 @@ h_sl-sl: [0.009, 0.72, 0.009, 0.05, 0.05, 0.06, 0.09] w: [2.992e-09] # 11b # values in Cereceda et al. are high, using parameters from Gröger et al. -a_nonSchmid: [0.0, 0.56, 0.75] # Tab. 2 +a_nonSchmid_110: [0.0, 0.56, 0.75] # Tab. 2 # (almost) no annhilation, adjustment needed for simulations beyond the yield point i_sl: [1] # c, eq. (25) diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index a3567efe4..b11d9e95b 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -153,7 +153,7 @@ module function plastic_dislotungsten_init() result(myPlasticity) prm%P_sl = crystal_SchmidMatrix_slip(N_sl,phase_lattice(ph),phase_cOverA(ph)) if (phase_lattice(ph) == 'cI') then - a = pl%get_as1dReal('a_nonSchmid',defaultVal = emptyRealArray) + a = pl%get_as1dReal('a_nonSchmid_110',defaultVal = emptyRealArray) prm%P_nS_pos = crystal_nonSchmidMatrix(N_sl,a,+1) prm%P_nS_neg = crystal_nonSchmidMatrix(N_sl,a,-1) else diff --git a/src/phase_mechanical_plastic_kinehardening.f90 b/src/phase_mechanical_plastic_kinehardening.f90 index 81fa188c8..9ecbde9c0 100644 --- a/src/phase_mechanical_plastic_kinehardening.f90 +++ b/src/phase_mechanical_plastic_kinehardening.f90 @@ -144,7 +144,7 @@ module function plastic_kinehardening_init() result(myPlasticity) prm%P = crystal_SchmidMatrix_slip(N_sl,phase_lattice(ph),phase_cOverA(ph)) if (phase_lattice(ph) == 'cI') then - a = pl%get_as1dReal('a_nonSchmid',defaultVal=emptyRealArray) + a = pl%get_as1dReal('a_nonSchmid_110',defaultVal=emptyRealArray) prm%nonSchmidActive = size(a) > 0 prm%P_nS_pos = crystal_nonSchmidMatrix(N_sl,a,+1) prm%P_nS_neg = crystal_nonSchmidMatrix(N_sl,a,-1) diff --git a/src/phase_mechanical_plastic_nonlocal.f90 b/src/phase_mechanical_plastic_nonlocal.f90 index e90dcae3c..28107f54e 100644 --- a/src/phase_mechanical_plastic_nonlocal.f90 +++ b/src/phase_mechanical_plastic_nonlocal.f90 @@ -253,7 +253,7 @@ module function plastic_nonlocal_init() result(myPlasticity) prm%P_sl = crystal_SchmidMatrix_slip(ini%N_sl,phase_lattice(ph), phase_cOverA(ph)) if (phase_lattice(ph) == 'cI') then - a = pl%get_as1dReal('a_nonSchmid',defaultVal = emptyRealArray) + a = pl%get_as1dReal('a_nonSchmid_110',defaultVal = emptyRealArray) if (size(a) > 0) prm%nonSchmidActive = .true. prm%P_nS_pos = crystal_nonSchmidMatrix(ini%N_sl,a,+1) prm%P_nS_neg = crystal_nonSchmidMatrix(ini%N_sl,a,-1) diff --git a/src/phase_mechanical_plastic_phenopowerlaw.f90 b/src/phase_mechanical_plastic_phenopowerlaw.f90 index 4091e0f76..00f072780 100644 --- a/src/phase_mechanical_plastic_phenopowerlaw.f90 +++ b/src/phase_mechanical_plastic_phenopowerlaw.f90 @@ -160,7 +160,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity) prm%P_sl = crystal_SchmidMatrix_slip(N_sl,phase_lattice(ph),phase_cOverA(ph)) if (phase_lattice(ph) == 'cI') then - a = pl%get_as1dReal('a_nonSchmid',defaultVal=emptyRealArray) + a = pl%get_as1dReal('a_nonSchmid_110',defaultVal=emptyRealArray) if (size(a) > 0) prm%nonSchmidActive = .true. prm%P_nS_pos = crystal_nonSchmidMatrix(N_sl,a,+1) prm%P_nS_neg = crystal_nonSchmidMatrix(N_sl,a,-1)