Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
b66a9a3527
|
@ -0,0 +1,25 @@
|
||||||
|
[Air]
|
||||||
|
|
||||||
|
## Isotropic Material model to simulate free surfaces ##
|
||||||
|
## For more information see paper Maiti+Eisenlohr2018, Scripta Materialia,
|
||||||
|
## "Fourier-based spectral method solution to finite strain crystal plasticity with free surfaces"
|
||||||
|
|
||||||
|
elasticity hooke
|
||||||
|
plasticity isotropic
|
||||||
|
|
||||||
|
/dilatation/
|
||||||
|
|
||||||
|
(output) flowstress
|
||||||
|
(output) strainrate
|
||||||
|
|
||||||
|
lattice_structure isotropic
|
||||||
|
c11 110.9e9
|
||||||
|
c12 0.0
|
||||||
|
taylorfactor 3
|
||||||
|
tau0 31e6
|
||||||
|
gdot0 0.001
|
||||||
|
n 20
|
||||||
|
h0 75e6
|
||||||
|
tausat 63e6
|
||||||
|
w0 2.25
|
||||||
|
atol_resistance 1
|
|
@ -22,7 +22,13 @@ parser.add_option('-t','--tensor',
|
||||||
dest = 'tensor',
|
dest = 'tensor',
|
||||||
action = 'extend', metavar = '<string LIST>',
|
action = 'extend', metavar = '<string LIST>',
|
||||||
help = 'heading of columns containing tensor field values')
|
help = 'heading of columns containing tensor field values')
|
||||||
|
parser.add_option('--no-check',
|
||||||
|
dest = 'rh',
|
||||||
|
action = 'store_false',
|
||||||
|
help = 'skip check for right-handed eigenvector basis')
|
||||||
|
|
||||||
|
parser.set_defaults(rh = True,
|
||||||
|
)
|
||||||
(options,filenames) = parser.parse_args()
|
(options,filenames) = parser.parse_args()
|
||||||
|
|
||||||
if options.tensor is None:
|
if options.tensor is None:
|
||||||
|
@ -57,8 +63,10 @@ for name in filenames:
|
||||||
if dim != data['dim']: remarks.append('column {} is not a {}...'.format(what,type))
|
if dim != data['dim']: remarks.append('column {} is not a {}...'.format(what,type))
|
||||||
else:
|
else:
|
||||||
items[type]['column'].append(table.label_index(what))
|
items[type]['column'].append(table.label_index(what))
|
||||||
table.labels_append(['{}_eigval({})'.format(i+1,what) for i in range(3)]) # extend ASCII header with new labels
|
for order in ['Min','Mid','Max']:
|
||||||
table.labels_append(['{}_eigvec({})'.format(i+1,what) for i in range(9)]) # extend ASCII header with new labels
|
table.labels_append(['eigval{}({})'.format(order,what)]) # extend ASCII header with new labels
|
||||||
|
for order in ['Min','Mid','Max']:
|
||||||
|
table.labels_append(['{}_eigvec{}({})'.format(i+1,order,what) for i in range(3)]) # extend ASCII header with new labels
|
||||||
|
|
||||||
if remarks != []: damask.util.croak(remarks)
|
if remarks != []: damask.util.croak(remarks)
|
||||||
if errors != []:
|
if errors != []:
|
||||||
|
@ -78,10 +86,10 @@ for name in filenames:
|
||||||
for type, data in items.iteritems():
|
for type, data in items.iteritems():
|
||||||
for column in data['column']:
|
for column in data['column']:
|
||||||
(u,v) = np.linalg.eigh(np.array(map(float,table.data[column:column+data['dim']])).reshape(data['shape']))
|
(u,v) = np.linalg.eigh(np.array(map(float,table.data[column:column+data['dim']])).reshape(data['shape']))
|
||||||
if np.dot(np.cross(v[:,0], v[:,1]), v[:,2]) < 0.0 : v[:, 2] *= -1.0 # ensure right-handed coordinate system
|
if options.rh and np.dot(np.cross(v[:,0], v[:,1]), v[:,2]) < 0.0 : v[:, 2] *= -1.0 # ensure right-handed eigenvector basis
|
||||||
table.data_append(list(u))
|
table.data_append(list(u)) # vector of max,mid,min eigval
|
||||||
table.data_append(list(v.transpose().reshape(data['dim'])))
|
table.data_append(list(v.transpose().reshape(data['dim']))) # 3x3=9 combo vector of max,mid,min eigvec coordinates
|
||||||
outputAlive = table.data_write() # output processed line
|
outputAlive = table.data_write() # output processed line in accordance with column labeling
|
||||||
|
|
||||||
# ------------------------------------------ output finalization -----------------------------------
|
# ------------------------------------------ output finalization -----------------------------------
|
||||||
|
|
||||||
|
|
|
@ -1581,7 +1581,7 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg)
|
||||||
case (601_pInt)
|
case (601_pInt)
|
||||||
msg = 'Ping-Pong needed when using non-local plasticity'
|
msg = 'Ping-Pong needed when using non-local plasticity'
|
||||||
case (602_pInt)
|
case (602_pInt)
|
||||||
msg = 'invalid element/IP/component (grain) selected for debug'
|
msg = 'invalid selection for debug'
|
||||||
|
|
||||||
!-------------------------------------------------------------------------------------------------
|
!-------------------------------------------------------------------------------------------------
|
||||||
! DAMASK_marc errors
|
! DAMASK_marc errors
|
||||||
|
|
|
@ -471,7 +471,7 @@ subroutine homogenization_init
|
||||||
flush(6)
|
flush(6)
|
||||||
|
|
||||||
if (debug_g < 1 .or. debug_g > homogenization_Ngrains(mesh_element(3,debug_e))) &
|
if (debug_g < 1 .or. debug_g > homogenization_Ngrains(mesh_element(3,debug_e))) &
|
||||||
call IO_error(602_pInt,ext_msg='component (grain)')
|
call IO_error(602_pInt,ext_msg='component (grain)', el=debug_e, g=debug_g)
|
||||||
|
|
||||||
end subroutine homogenization_init
|
end subroutine homogenization_init
|
||||||
|
|
||||||
|
|
44
src/math.f90
44
src/math.f90
|
@ -3,7 +3,7 @@
|
||||||
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
|
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
|
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
!> @brief Mathematical library, including random number generation and tensor represenations
|
!> @brief Mathematical library, including random number generation and tensor representations
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module math
|
module math
|
||||||
use prec, only: &
|
use prec, only: &
|
||||||
|
@ -173,10 +173,8 @@ contains
|
||||||
subroutine math_init
|
subroutine math_init
|
||||||
|
|
||||||
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
|
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
|
||||||
use prec, only: tol_math_check
|
use numerics, only: fixedSeed
|
||||||
use numerics, only: &
|
use IO, only: IO_timeStamp
|
||||||
fixedSeed
|
|
||||||
use IO, only: IO_error, IO_timeStamp
|
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt) :: i
|
integer(pInt) :: i
|
||||||
|
@ -226,12 +224,10 @@ end subroutine math_init
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine math_check
|
subroutine math_check
|
||||||
|
|
||||||
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
|
|
||||||
use prec, only: tol_math_check
|
use prec, only: tol_math_check
|
||||||
use numerics, only: &
|
use IO, only: IO_error
|
||||||
fixedSeed
|
|
||||||
use IO, only: IO_error, IO_timeStamp
|
|
||||||
|
|
||||||
|
implicit none
|
||||||
character(len=64) :: error_msg
|
character(len=64) :: error_msg
|
||||||
|
|
||||||
real(pReal), dimension(3,3) :: R,R2
|
real(pReal), dimension(3,3) :: R,R2
|
||||||
|
@ -268,7 +264,7 @@ subroutine math_check
|
||||||
if ( any(abs( q-q2) > tol_math_check) .and. &
|
if ( any(abs( q-q2) > tol_math_check) .and. &
|
||||||
any(abs(-q-q2) > tol_math_check) ) then
|
any(abs(-q-q2) > tol_math_check) ) then
|
||||||
write (error_msg, '(a,e14.6)' ) &
|
write (error_msg, '(a,e14.6)' ) &
|
||||||
'quat -> euler -> quatmaximum deviation ',min(maxval(abs( q-q2)),maxval(abs(-q-q2)))
|
'quat -> euler -> quat maximum deviation ',min(maxval(abs( q-q2)),maxval(abs(-q-q2)))
|
||||||
call IO_error(401_pInt,ext_msg=error_msg)
|
call IO_error(401_pInt,ext_msg=error_msg)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -373,7 +369,7 @@ end subroutine math_qsort
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief vector expansion
|
!> @brief vector expansion
|
||||||
!> @details takes a set of numbers (a,b,c,...) and corresponding multipliers (x,y,z,...)
|
!> @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, ...
|
!> to return a vector of x times a, y times b, z times c, ...
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
pure function math_expand(what,how)
|
pure function math_expand(what,how)
|
||||||
|
@ -382,14 +378,10 @@ pure function math_expand(what,how)
|
||||||
real(pReal), dimension(:), intent(in) :: what
|
real(pReal), dimension(:), intent(in) :: what
|
||||||
integer(pInt), dimension(:), intent(in) :: how
|
integer(pInt), dimension(:), intent(in) :: how
|
||||||
real(pReal), dimension(sum(how)) :: math_expand
|
real(pReal), dimension(sum(how)) :: math_expand
|
||||||
integer(pInt) :: i,j,o
|
integer(pInt) :: i
|
||||||
|
|
||||||
o = 0_pInt
|
do i = 1_pInt, size(how)
|
||||||
do i = 1, size(how)
|
math_expand(sum(how(1:i-1))+1:sum(how(1:i))) = what(mod(i-1_pInt,size(what))+1_pInt)
|
||||||
do j = 1, how(i)
|
|
||||||
o = o + 1_pInt
|
|
||||||
math_expand(o) = what(1+mod(i-1,size(what)))
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
end function math_expand
|
end function math_expand
|
||||||
|
@ -709,22 +701,20 @@ end function math_mul66x6
|
||||||
pure function math_exp33(A,n)
|
pure function math_exp33(A,n)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt) :: i,order
|
integer(pInt) :: i
|
||||||
integer(pInt), intent(in), optional :: n
|
integer(pInt), intent(in), optional :: n
|
||||||
real(pReal), dimension(3,3), intent(in) :: A
|
real(pReal), dimension(3,3), intent(in) :: A
|
||||||
real(pReal), dimension(3,3) :: B,math_exp33
|
real(pReal), dimension(3,3) :: B, math_exp33
|
||||||
real(pReal) :: invfac
|
real(pReal) :: invFac
|
||||||
|
|
||||||
order = merge(n,5_pInt,present(n))
|
|
||||||
|
|
||||||
B = math_I3 ! init
|
B = math_I3 ! init
|
||||||
invfac = 1.0_pReal ! 0!
|
invFac = 1.0_pReal ! 0!
|
||||||
math_exp33 = B ! A^0 = eye2
|
math_exp33 = B ! A^0 = eye2
|
||||||
|
|
||||||
do i = 1_pInt,n
|
do i = 1_pInt, merge(n,5_pInt,present(n))
|
||||||
invfac = invfac/real(i,pReal) ! invfac = 1/i!
|
invFac = invFac/real(i,pReal) ! invfac = 1/i!
|
||||||
B = math_mul33x33(B,A)
|
B = math_mul33x33(B,A)
|
||||||
math_exp33 = math_exp33 + invfac*B ! exp = SUM (A^i)/i!
|
math_exp33 = math_exp33 + invFac*B ! exp = SUM (A^i)/i!
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
end function math_exp33
|
end function math_exp33
|
||||||
|
|
Loading…
Reference in New Issue