Merge remote-tracking branch 'origin/development' into YAML-improvements
This commit is contained in:
commit
100215edb6
|
@ -1 +1 @@
|
|||
v3.0.0-alpha4-182-gac6d31b1f
|
||||
v3.0.0-alpha4-205-g5d0c0f428
|
||||
|
|
|
@ -139,10 +139,10 @@ subroutine DAMASK_interface_init
|
|||
print'(a)', ' Optional arguments:'
|
||||
print'(/,a)',' --workingdirectory PathToWorkingDirectory'
|
||||
print'(a)', ' Specifies the working directory and overwrites the default ./'
|
||||
print'(a)', ' Make sure the file "material.config" exists in the working'
|
||||
print'(a)', ' Make sure the file "material.yaml" exists in the working'
|
||||
print'(a)', ' directory.'
|
||||
print'(a)', ' For further configuration place "numerics.config"'
|
||||
print'(a)',' and "debug.config" in that directory.'
|
||||
print'(a)', ' For further configuration place "numerics.yaml"'
|
||||
print'(a)',' and "debug.yaml" in that directory.'
|
||||
print'(/,a)',' --restart N'
|
||||
print'(a)', ' Reads in increment N and continues with calculating'
|
||||
print'(a)', ' increment N+1 based on this.'
|
||||
|
|
|
@ -151,6 +151,7 @@ module element
|
|||
integer, dimension(NIPNEIGHBOR(CELLTYPE(1)),NIP(1)), parameter :: IPNEIGHBOR1 = &
|
||||
reshape([&
|
||||
-2,-3,-1 &
|
||||
! Note: This fix is for gfortran 9 only. gfortran 8 supports neither, gfortran > 9 both variants
|
||||
#if !defined(__GFORTRAN__)
|
||||
],shape(IPNEIGHBOR1))
|
||||
#else
|
||||
|
|
78
src/math.f90
78
src/math.f90
|
@ -90,12 +90,12 @@ subroutine math_init
|
|||
integer, dimension(:), allocatable :: randInit
|
||||
class(tNode), pointer :: &
|
||||
num_generic
|
||||
|
||||
|
||||
print'(/,a)', ' <<<+- math init -+>>>'; flush(IO_STDOUT)
|
||||
|
||||
num_generic => config_numerics%get('generic',defaultVal=emptyDict)
|
||||
randomSeed = num_generic%get_asInt('random_seed', defaultVal = 0)
|
||||
|
||||
|
||||
call random_seed(size=randSize)
|
||||
allocate(randInit(randSize))
|
||||
if (randomSeed > 0) then
|
||||
|
@ -233,7 +233,7 @@ end function math_range
|
|||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief second rank identity tensor of specified dimension
|
||||
!> @brief Rank two identity tensor of specified dimension.
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
pure function math_eye(d)
|
||||
|
||||
|
@ -250,21 +250,25 @@ end function math_eye
|
|||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief symmetric fourth rank identity tensor of specified dimension
|
||||
!> @brief Symmetric rank four identity tensor.
|
||||
! from http://en.wikipedia.org/wiki/Tensor_derivative_(continuum_mechanics)#Derivative_of_a_second-order_tensor_with_respect_to_itself
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
pure function math_identity4th(d)
|
||||
pure function math_identity4th()
|
||||
|
||||
real(pReal), dimension(3,3,3,3) :: math_identity4th
|
||||
|
||||
integer, intent(in) :: d !< tensor dimension
|
||||
integer :: i,j,k,l
|
||||
real(pReal), dimension(d,d,d,d) :: math_identity4th
|
||||
real(pReal), dimension(d,d) :: identity2nd
|
||||
|
||||
identity2nd = math_eye(d)
|
||||
do i=1,d; do j=1,d; do k=1,d; do l=1,d
|
||||
math_identity4th(i,j,k,l) = 0.5_pReal &
|
||||
*(identity2nd(i,k)*identity2nd(j,l)+identity2nd(i,l)*identity2nd(j,k))
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
do concurrent(i=1:3, j=1:3, k=1:3, l=1:3)
|
||||
math_identity4th(i,j,k,l) = 0.5_pReal*(math_I3(i,k)*math_I3(j,l)+math_I3(i,l)*math_I3(j,k))
|
||||
enddo
|
||||
#else
|
||||
do i=1,3; do j=1,3; do k=1,3; do l=1,3
|
||||
math_identity4th(i,j,k,l) = 0.5_pReal*(math_I3(i,k)*math_I3(j,l)+math_I3(i,l)*math_I3(j,k))
|
||||
enddo; enddo; enddo; enddo
|
||||
#endif
|
||||
|
||||
end function math_identity4th
|
||||
|
||||
|
@ -331,9 +335,16 @@ pure function math_outer(A,B)
|
|||
real(pReal), dimension(size(A,1),size(B,1)) :: math_outer
|
||||
integer :: i,j
|
||||
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
do concurrent(i=1:size(A,1), j=1:size(B,1))
|
||||
math_outer(i,j) = A(i)*B(j)
|
||||
enddo
|
||||
#else
|
||||
do i=1,size(A,1); do j=1,size(B,1)
|
||||
math_outer(i,j) = A(i)*B(j)
|
||||
enddo; enddo
|
||||
#endif
|
||||
|
||||
end function math_outer
|
||||
|
||||
|
@ -373,9 +384,16 @@ pure function math_mul3333xx33(A,B)
|
|||
real(pReal), dimension(3,3) :: math_mul3333xx33
|
||||
integer :: i,j
|
||||
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
do concurrent(i=1:3, j=1:3)
|
||||
math_mul3333xx33(i,j) = sum(A(i,j,1:3,1:3)*B(1:3,1:3))
|
||||
enddo
|
||||
#else
|
||||
do i=1,3; do j=1,3
|
||||
math_mul3333xx33(i,j) = sum(A(i,j,1:3,1:3)*B(1:3,1:3))
|
||||
enddo; enddo
|
||||
#endif
|
||||
|
||||
end function math_mul3333xx33
|
||||
|
||||
|
@ -390,9 +408,16 @@ pure function math_mul3333xx3333(A,B)
|
|||
real(pReal), dimension(3,3,3,3), intent(in) :: B
|
||||
real(pReal), dimension(3,3,3,3) :: math_mul3333xx3333
|
||||
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
do concurrent(i=1:3, j=1:3, k=1:3, l=1:3)
|
||||
math_mul3333xx3333(i,j,k,l) = sum(A(i,j,1:3,1:3)*B(1:3,1:3,k,l))
|
||||
enddo
|
||||
#else
|
||||
do i=1,3; do j=1,3; do k=1,3; do l=1,3
|
||||
math_mul3333xx3333(i,j,k,l) = sum(A(i,j,1:3,1:3)*B(1:3,1:3,k,l))
|
||||
enddo; enddo; enddo; enddo
|
||||
#endif
|
||||
|
||||
end function math_mul3333xx3333
|
||||
|
||||
|
@ -699,6 +724,7 @@ pure function math_6toSym33(v6,weighted)
|
|||
real(pReal), dimension(6) :: w
|
||||
integer :: i
|
||||
|
||||
|
||||
if(present(weighted)) then
|
||||
w = merge(INVNRMMANDEL,1.0_pReal,weighted)
|
||||
else
|
||||
|
@ -723,9 +749,16 @@ pure function math_3333to99(m3333)
|
|||
|
||||
integer :: i,j
|
||||
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
do concurrent(i=1:9, j=1:9)
|
||||
math_3333to99(i,j) = m3333(MAPPLAIN(1,i),MAPPLAIN(2,i),MAPPLAIN(1,j),MAPPLAIN(2,j))
|
||||
enddo
|
||||
#else
|
||||
do i=1,9; do j=1,9
|
||||
math_3333to99(i,j) = m3333(MAPPLAIN(1,i),MAPPLAIN(2,i),MAPPLAIN(1,j),MAPPLAIN(2,j))
|
||||
enddo; enddo
|
||||
#endif
|
||||
|
||||
end function math_3333to99
|
||||
|
||||
|
@ -740,9 +773,15 @@ pure function math_99to3333(m99)
|
|||
|
||||
integer :: i,j
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
do concurrent(i=1:9, j=1:9)
|
||||
math_99to3333(MAPPLAIN(1,i),MAPPLAIN(2,i),MAPPLAIN(1,j),MAPPLAIN(2,j)) = m99(i,j)
|
||||
enddo
|
||||
#else
|
||||
do i=1,9; do j=1,9
|
||||
math_99to3333(MAPPLAIN(1,i),MAPPLAIN(2,i),MAPPLAIN(1,j),MAPPLAIN(2,j)) = m99(i,j)
|
||||
enddo; enddo
|
||||
#endif
|
||||
|
||||
end function math_99to3333
|
||||
|
||||
|
@ -762,15 +801,22 @@ pure function math_sym3333to66(m3333,weighted)
|
|||
real(pReal), dimension(6) :: w
|
||||
integer :: i,j
|
||||
|
||||
|
||||
if(present(weighted)) then
|
||||
w = merge(NRMMANDEL,1.0_pReal,weighted)
|
||||
else
|
||||
w = NRMMANDEL
|
||||
endif
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
do concurrent(i=1:6, j=1:6)
|
||||
math_sym3333to66(i,j) = w(i)*w(j)*m3333(MAPNYE(1,i),MAPNYE(2,i),MAPNYE(1,j),MAPNYE(2,j))
|
||||
enddo
|
||||
#else
|
||||
do i=1,6; do j=1,6
|
||||
math_sym3333to66(i,j) = w(i)*w(j)*m3333(MAPNYE(1,i),MAPNYE(2,i),MAPNYE(1,j),MAPNYE(2,j))
|
||||
enddo; enddo
|
||||
#endif
|
||||
|
||||
end function math_sym3333to66
|
||||
|
||||
|
@ -790,6 +836,7 @@ pure function math_66toSym3333(m66,weighted)
|
|||
real(pReal), dimension(6) :: w
|
||||
integer :: i,j
|
||||
|
||||
|
||||
if(present(weighted)) then
|
||||
w = merge(INVNRMMANDEL,1.0_pReal,weighted)
|
||||
else
|
||||
|
@ -815,6 +862,7 @@ pure function math_Voigt66to3333(m66)
|
|||
real(pReal), dimension(6,6), intent(in) :: m66 !< 6x6 matrix
|
||||
integer :: i,j
|
||||
|
||||
|
||||
do i=1,6; do j=1, 6
|
||||
math_Voigt66to3333(MAPVOIGT(1,i),MAPVOIGT(2,i),MAPVOIGT(1,j),MAPVOIGT(2,j)) = m66(i,j)
|
||||
math_Voigt66to3333(MAPVOIGT(2,i),MAPVOIGT(1,i),MAPVOIGT(1,j),MAPVOIGT(2,j)) = m66(i,j)
|
||||
|
@ -868,10 +916,11 @@ subroutine math_eigh(w,v,error,m)
|
|||
real(pReal), dimension(size(m,1)), intent(out) :: w !< eigenvalues
|
||||
real(pReal), dimension(size(m,1),size(m,1)), intent(out) :: v !< eigenvectors
|
||||
logical, intent(out) :: error
|
||||
|
||||
|
||||
integer :: ierr
|
||||
real(pReal), dimension(size(m,1)**2) :: work
|
||||
|
||||
|
||||
v = m ! copy matrix to input (doubles as output) array
|
||||
call dsyev('V','U',size(m,1),v,size(m,1),w,work,size(work,1),ierr)
|
||||
error = (ierr /= 0)
|
||||
|
@ -1229,6 +1278,9 @@ subroutine selfTest
|
|||
if(dNeq(math_det33(math_symmetric33(t33)),math_detSym33(math_symmetric33(t33)),tol=1.0e-12_pReal)) &
|
||||
error stop 'math_det33/math_detSym33'
|
||||
|
||||
if(any(dNeq(t33+transpose(t33),math_mul3333xx33(math_identity4th(),t33+transpose(t33))))) &
|
||||
error stop 'math_mul3333xx33/math_identity4th'
|
||||
|
||||
if(any(dNeq0(math_eye(3),math_inv33(math_I3)))) &
|
||||
error stop 'math_inv33(math_I3)'
|
||||
|
||||
|
|
Loading…
Reference in New Issue