Merge branch 'development' into grid-filters

This commit is contained in:
Martin Diehl 2019-12-07 10:52:00 +01:00
commit 0b04f6a3bb
17 changed files with 181 additions and 606 deletions

@ -1 +1 @@
Subproject commit 66d562c755cd9aa4bbb8280c509383014acd52db
Subproject commit 524e86c117d816e3bd873eed7663e258a6f2e139

View File

@ -1 +1 @@
v2.0.3-1133-gfede8225
v2.0.3-1177-ga41871e2

View File

@ -4,58 +4,23 @@ elasticity hooke
plasticity nonlocal
/nonlocal/
(output) rho
(output) rho_edge
(output) rho_screw
(output) rho_sgl
(output) rho_sgl_edge_pos
(output) rho_sgl_edge_neg
(output) rho_sgl_screw_pos
(output) rho_sgl_screw_neg
(output) rho_sgl_edge_pos_mobile
(output) rho_sgl_edge_neg_mobile
(output) rho_sgl_screw_pos_mobile
(output) rho_sgl_screw_neg_mobile
(output) rho_sgl_edge_pos_immobile
(output) rho_sgl_edge_neg_immobile
(output) rho_sgl_screw_pos_immobile
(output) rho_sgl_screw_neg_immobile
(output) rho_dip_edge
(output) rho_dip_screw
(output) rho_sgl_mob_edg_pos
(output) rho_sgl_imm_edg_pos
(output) rho_sgl_mob_edg_neg
(output) rho_sgl_imm_edg_neg
(output) rho_sgl_mob_scr_pos
(output) rho_sgl_imm_scr_pos
(output) rho_sgl_mob_scr_neg
(output) rho_sgl_imm_scr_neg
(output) rho_dip_edg
(output) rho_dip_scr
(output) rho_forest
(output) delta
(output) delta_sgl
(output) delta_dip
(output) shearrate
(output) resolvedstress
(output) resolvedstress_back
(output) resolvedstress_external
(output) resistance
(output) rho_dot
(output) rho_dot_sgl
(output) rho_dot_sgl_mobile
(output) rho_dot_dip
(output) rho_dot_gen_edge
(output) rho_dot_gen_screw
(output) rho_dot_sgl2dip_edge
(output) rho_dot_sgl2dip_screw
(output) rho_dot_ann_ath
(output) rho_dot_ann_the
(output) rho_dot_ann_the_edge
(output) rho_dot_ann_the_screw
(output) rho_dot_edgejogs
(output) rho_dot_flux
(output) rho_dot_flux_mobile
(output) rho_dot_flux_edge
(output) rho_dot_flux_screw
(output) velocity_edge_pos
(output) velocity_edge_neg
(output) velocity_screw_pos
(output) velocity_screw_neg
(output) maximumDipoleHeight_edge
(output) maximumDipoleHeight_screw
(output) accumulated_shear
(output) dislocationstress
(output) gamma
(output) tau_pass
(output) v_edg_pos
(output) v_edg_neg
(output) v_scr_pos
(output) v_scr_neg
lattice_structure fcc
Nslip 12 # number of slip systems

View File

@ -3,31 +3,24 @@
elasticity hooke
plasticity nonlocal
/nonlocal/
(output) rho
(output) rho_sgl_mobile
(output) rho_sgl_immobile
(output) rho_sgl_edge_pos
(output) rho_sgl_edge_neg
(output) rho_sgl_screw_pos
(output) rho_sgl_screw_neg
(output) rho_dip_edge
(output) rho_dip_screw
(output) rho_sgl_mob_edg_pos
(output) rho_sgl_imm_edg_pos
(output) rho_sgl_mob_edg_neg
(output) rho_sgl_imm_edg_neg
(output) rho_sgl_mob_scr_pos
(output) rho_sgl_imm_scr_pos
(output) rho_sgl_mob_scr_neg
(output) rho_sgl_imm_scr_neg
(output) rho_dip_edg
(output) rho_dip_scr
(output) rho_forest
(output) accumulatedshear
(output) shearrate
(output) resolvedstress
(output) resistance
(output) velocity_edge_pos
(output) rho_dot_gen
(output) rho_dot_sgl2dip_edge
(output) rho_dot_sgl2dip_screw
(output) rho_dot_ann_ath
(output) rho_dot_ann_the_edge
(output) rho_dot_ann_the_screw
(output) rho_dot_edgejogs
(output) rho_dot_flux_edge
(output) rho_dot_flux_screw
(output) gamma
(output) tau_pass
(output) v_edg_pos
(output) v_edg_neg
(output) v_scr_pos
(output) v_scr_neg
lattice_structure fcc
Nslip 12 # number of slip systems per family

View File

@ -49,7 +49,7 @@ Phase_types = {'Primary': 0} #further additions to these can be done by looking
# --------------------------------------------------------------------
parser = argparse.ArgumentParser(description='Creating a file for DREAM3D from DAMASK data')
parser.add_argument('filenames',nargs='+',help='HDF5 based output file')
parser.add_argument('--inc',nargs='+',help='Increment for which DREAM3D to be used, eg. 00025',type=int)
parser.add_argument('--inc',nargs='+',help='Increment for which DREAM3D to be used, eg. 25',type=int)
parser.add_argument('-d','--dir', dest='dir',default='postProc',metavar='string',
help='name of subdirectory to hold output')
@ -59,15 +59,13 @@ options = parser.parse_args()
# loop over input files
for filename in options.filenames:
f = damask.DADF5(filename) #DAMASK output file
count = 0
for increment in f.increments:
if int(increment[3:]) not in options.inc:
count = count + 1
for increment in options.inc:
f.set_by_increment(increment,increment)
if len(f.visible['increments']) == 0:
continue
#-------output file creation-------------------------------------
dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir))
print(dirname)
try:
os.mkdir(dirname)
except FileExistsError:
@ -90,11 +88,10 @@ for filename in options.filenames:
# Phase information of DREAM.3D is constituent ID in DAMASK
o[cell_data_label + '/Phases'] = f.get_constituent_ID().reshape(tuple(f.grid)+(1,))
# Data quaternions
DAMASK_quaternion = f.read_dataset(f.get_dataset_location('orientation'),0)
DREAM_3D_quaternion = np.empty((np.prod(f.grid),4),dtype=np.float32)
DAMASK_quaternion = f.read_dataset(f.get_dataset_location('orientation'))
# Convert: DAMASK uses P = -1, DREAM.3D uses P = +1. Also change position of imagninary part
DREAM_3D_quaternion = np.hstack((-DAMASK_quaternion['x'],-DAMASK_quaternion['y'],-DAMASK_quaternion['z'],
DAMASK_quaternion['w']))
DAMASK_quaternion['w'])).astype(np.float32)
o[cell_data_label + '/Quats'] = DREAM_3D_quaternion.reshape(tuple(f.grid)+(4,))
# Attributes to CellData group
@ -109,12 +106,14 @@ for filename in options.filenames:
# phase attributes
o[cell_data_label + '/Phases'].attrs['ComponentDimensions'] = np.array([1],np.uint64)
o[cell_data_label + '/Phases'].attrs['ObjectType'] = 'DataArray<int32_t>'
o[cell_data_label + '/Phases'].attrs['TupleDimensions'] = f.grid.astype(np.uint64)
# Quats attributes
o[cell_data_label + '/Quats'].attrs['ComponentDimensions'] = np.array([4],np.uint64)
o[cell_data_label + '/Quats'].attrs['ObjectType'] = 'DataArray<float>'
# Create EnsembleAttributeMatrix
o[cell_data_label + '/Quats'].attrs['TupleDimensions'] = f.grid.astype(np.uint64)
# Create EnsembleAttributeMatrix
ensemble_label = data_container_label + '/EnsembleAttributeMatrix'
# Data CrystalStructures

View File

@ -275,7 +275,6 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt
if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0_pInt) &
write(6,'(a,i8,1x,i2)') '<< CPFEM >> calculation for elFE ip ',elFE,ip
call materialpoint_stressAndItsTangent(updateJaco, dt) ! calculate stress and its tangent
call materialpoint_postResults()
!* parallel computation and calulation not yet done
@ -284,7 +283,6 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt
write(6,'(a,i8,a,i8)') '<< CPFEM >> calculation for elements ',FEsolving_execElem(1),&
' to ',FEsolving_execElem(2)
call materialpoint_stressAndItsTangent(updateJaco, dt) ! calculate stress and its tangent (parallel execution inside)
call materialpoint_postResults()
CPFEM_calc_done = .true.
endif

View File

@ -36,7 +36,6 @@ module constitutive
private
integer, public, protected :: &
constitutive_plasticity_maxSizePostResults, &
constitutive_plasticity_maxSizeDotState, &
constitutive_source_maxSizePostResults, &
constitutive_source_maxSizeDotState
@ -72,8 +71,7 @@ subroutine constitutive_init
integer, dimension(:,:), pointer :: thisSize
character(len=64), dimension(:,:), pointer :: thisOutput
character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready
logical :: knownPlasticity, knownSource, nonlocalConstitutionPresent
nonlocalConstitutionPresent = .false.
logical :: knownSource
!--------------------------------------------------------------------------------------------------
! initialized plasticity
@ -111,64 +109,11 @@ subroutine constitutive_init
call IO_write_jobFile(FILEUNIT,'outputConstitutive')
PhaseLoop: do ph = 1,material_Nphase
activePhase: if (any(material_phaseAt == ph)) then
ins = phase_plasticityInstance(ph)
knownPlasticity = .true. ! assume valid
plasticityType: select case(phase_plasticity(ph))
case (PLASTICITY_NONE_ID) plasticityType
outputName = PLASTICITY_NONE_label
thisOutput => null()
thisSize => null()
case (PLASTICITY_ISOTROPIC_ID) plasticityType
outputName = PLASTICITY_ISOTROPIC_label
thisOutput => null()
thisSize => null()
case (PLASTICITY_PHENOPOWERLAW_ID) plasticityType
outputName = PLASTICITY_PHENOPOWERLAW_label
thisOutput => null()
thisSize => null()
case (PLASTICITY_KINEHARDENING_ID) plasticityType
outputName = PLASTICITY_KINEHARDENING_label
thisOutput => null()
thisSize => null()
case (PLASTICITY_DISLOTWIN_ID) plasticityType
outputName = PLASTICITY_DISLOTWIN_label
thisOutput => null()
thisSize => null()
case (PLASTICITY_DISLOUCLA_ID) plasticityType
outputName = PLASTICITY_DISLOUCLA_label
thisOutput => null()
thisSize => null()
case (PLASTICITY_NONLOCAL_ID) plasticityType
outputName = PLASTICITY_NONLOCAL_label
thisOutput => plastic_nonlocal_output
thisSize => plastic_nonlocal_sizePostResult
case default plasticityType
knownPlasticity = .false.
end select plasticityType
write(FILEUNIT,'(/,a,/)') '['//trim(config_name_phase(ph))//']'
if (knownPlasticity) then
write(FILEUNIT,'(a)') '(plasticity)'//char(9)//trim(outputName)
if (associated(thisOutput)) then
OutputPlasticityLoop: do o = 1,size(thisOutput(:,ins))
if(len_trim(thisOutput(o,ins)) > 0) &
write(FILEUNIT,'(a,i4)') trim(thisOutput(o,ins))//char(9),thisSize(o,ins)
enddo OutputPlasticityLoop
endif
endif
SourceLoop: do s = 1, phase_Nsources(ph)
knownSource = .true. ! assume valid
knownSource = .true. ! assume valid
sourceType: select case (phase_source(s,ph))
case (SOURCE_thermal_dissipation_ID) sourceType
ins = source_thermal_dissipation_instance(ph)
outputName = SOURCE_thermal_dissipation_label
thisOutput => source_thermal_dissipation_output
thisSize => source_thermal_dissipation_sizePostResult
case (SOURCE_thermal_externalheat_ID) sourceType
ins = source_thermal_externalheat_instance(ph)
outputName = SOURCE_thermal_externalheat_label
thisOutput => source_thermal_externalheat_output
thisSize => source_thermal_externalheat_sizePostResult
case (SOURCE_damage_isoBrittle_ID) sourceType
ins = source_damage_isoBrittle_instance(ph)
outputName = SOURCE_damage_isoBrittle_label
@ -206,7 +151,6 @@ subroutine constitutive_init
endif mainProcess
constitutive_plasticity_maxSizeDotState = 0
constitutive_plasticity_maxSizePostResults = 0
constitutive_source_maxSizeDotState = 0
constitutive_source_maxSizePostResults = 0
@ -223,8 +167,6 @@ subroutine constitutive_init
! determine max size of state and output
constitutive_plasticity_maxSizeDotState = max(constitutive_plasticity_maxSizeDotState, &
plasticState(ph)%sizeDotState)
constitutive_plasticity_maxSizePostResults = max(constitutive_plasticity_maxSizePostResults, &
plasticState(ph)%sizePostResults)
constitutive_source_maxSizeDotState = max(constitutive_source_maxSizeDotState, &
maxval(sourceState(ph)%p(:)%sizeDotState))
constitutive_source_maxSizePostResults = max(constitutive_source_maxSizePostResults, &
@ -706,42 +648,21 @@ function constitutive_postResults(S, Fi, ipc, ip, el)
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), dimension(plasticState(material_phaseAt(ipc,el))%sizePostResults + &
sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: &
real(pReal), dimension(sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: &
constitutive_postResults
real(pReal), intent(in), dimension(3,3) :: &
Fi !< intermediate deformation gradient
real(pReal), intent(in), dimension(3,3) :: &
S !< 2nd Piola Kirchhoff stress
real(pReal), dimension(3,3) :: &
Mp !< Mandel stress
integer :: &
startPos, endPos
integer :: &
ho, & !< homogenization
tme, & !< thermal member position
i, of, instance !< counter in source loop
constitutive_postResults = 0.0_pReal
Mp = matmul(matmul(transpose(Fi),Fi),S)
ho = material_homogenizationAt(el)
tme = thermalMapping(ho)%p(ip,el)
startPos = 1
endPos = plasticState(material_phaseAt(ipc,el))%sizePostResults
of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phaseAt(ipc,el))
plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_NONLOCAL_ID) plasticityType
constitutive_postResults(startPos:endPos) = &
plastic_nonlocal_postResults (material_phaseAt(ipc,el),instance,of)
end select plasticityType
endPos = 0
SourceLoop: do i = 1, phase_Nsources(material_phaseAt(ipc,el))
startPos = endPos + 1

View File

@ -76,17 +76,6 @@ module crystallite
crystallite_todo, & !< flag to indicate need for further computation
crystallite_localPlasticity !< indicates this grain to have purely local constitutive law
enum, bind(c)
enumerator :: undefined_ID, &
orientation_ID, &
defgrad_ID, &
fp_ID, &
p_ID, &
elasmatrix_ID
end enum
integer(kind(undefined_ID)),dimension(:,:), allocatable :: &
crystallite_outputID !< ID of each post result output
type :: tOutput !< new requested output (per phase)
character(len=65536), allocatable, dimension(:) :: &
label
@ -136,15 +125,10 @@ subroutine crystallite_init
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e, & !< counter in element loop
o = 0, & !< counter in output loop
r, &
cMax, & !< maximum number of integration point components
iMax, & !< maximum number of integration points
eMax, & !< maximum number of elements
myNcomponents, & !< number of components at current IP
mySize
character(len=65536), dimension(:), allocatable :: str
myNcomponents !< number of components at current IP
write(6,'(/,a)') ' <<<+- crystallite init -+>>>'
@ -759,21 +743,17 @@ function crystallite_postResults(ipc, ip, el)
ipc !< grain index
real(pReal), dimension(1+ &
1+plasticState(material_phaseAt(ipc,el))%sizePostResults + &
sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: &
1+sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: &
crystallite_postResults
integer :: &
o, &
c, &
mySize, &
n
c
crystallite_postResults = 0.0_pReal
crystallite_postResults(1) = 0.0_pReal ! header-like information (length)
c = 1
crystallite_postResults(c+1) = real(plasticState(material_phaseAt(ipc,el))%sizePostResults,pReal) ! size of constitutive results
crystallite_postResults(c+1) = real(sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults),pReal) ! size of constitutive results
c = c + 1
if (size(crystallite_postResults)-c > 0) &
crystallite_postResults(c+1:size(crystallite_postResults)) = &

View File

@ -255,16 +255,15 @@ subroutine homogenization_init
thermal_maxSizePostResults = 0
damage_maxSizePostResults = 0
do p = 1,size(config_homogenization)
thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState (p)%sizePostResults)
damage_maxSizePostResults = max(damage_maxSizePostResults ,damageState (p)%sizePostResults)
thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState(p)%sizePostResults)
damage_maxSizePostResults = max(damage_maxSizePostResults, damageState (p)%sizePostResults)
enddo
materialpoint_sizeResults = 1 & ! grain count
+ 1 + thermal_maxSizePostResults &
+ damage_maxSizePostResults &
+ homogenization_maxNgrains * (1 & ! crystallite size
+ 1 + constitutive_plasticity_maxSizePostResults & ! constitutive size & constitutive results
+ constitutive_source_maxSizePostResults)
+ homogenization_maxNgrains * ( 1 & ! crystallite size
+ 1 + constitutive_source_maxSizePostResults)
allocate(materialpoint_results(materialpoint_sizeResults,discretization_nIP,discretization_nElem))
write(6,'(/,a)') ' <<<+- homogenization init -+>>>'
@ -617,8 +616,8 @@ subroutine materialpoint_postResults
grainLooping :do g = 1,myNgrains
theSize = 1 + &
1 + plasticState (material_phaseAt(g,e))%sizePostResults + &
sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults)
1 + &
sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults)
materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results
thePos = thePos + theSize
enddo grainLooping

View File

@ -749,9 +749,6 @@ subroutine material_allocatePlasticState(phase,NofMyPhase,&
plasticState(phase)%sizeDotState = sizeDotState
plasticState(phase)%sizeDeltaState = sizeDeltaState
plasticState(phase)%offsetDeltaState = sizeState-sizeDeltaState ! deltaState occupies latter part of state by definition
plasticState(phase)%Nslip = Nslip
plasticState(phase)%Ntwin = Ntwin
plasticState(phase)%Ntrans= Ntrans
allocate(plasticState(phase)%aTolState (sizeState), source=0.0_pReal)
allocate(plasticState(phase)%state0 (sizeState,NofMyPhase), source=0.0_pReal)

View File

@ -840,6 +840,7 @@ end function math_Voigt66to3333
!--------------------------------------------------------------------------------------------------
!> @brief action of a quaternion on a vector (rotate vector v with Q)
!> @details deprecated
!--------------------------------------------------------------------------------------------------
pure function math_qRot(Q,v)
@ -1329,6 +1330,7 @@ end function math_areaTriangle
!--------------------------------------------------------------------------------------------------
!> @brief rotate 33 tensor forward
!> @details deprecated
!--------------------------------------------------------------------------------------------------
pure function math_rotate_forward33(tensor,R)
@ -1342,6 +1344,7 @@ end function math_rotate_forward33
!--------------------------------------------------------------------------------------------------
!> @brief rotate 33 tensor backward
!> @details deprecated
!--------------------------------------------------------------------------------------------------
pure function math_rotate_backward33(tensor,R)
@ -1355,6 +1358,7 @@ end function math_rotate_backward33
!--------------------------------------------------------------------------------------------------
!> @brief rotate 3333 tensor C'_ijkl=g_im*g_jn*g_ko*g_lp*C_mnop
!> @details deprecated
!--------------------------------------------------------------------------------------------------
pure function math_rotate_forward3333(tensor,R)

View File

@ -30,7 +30,7 @@ module plastic_disloUCLA
dot_gamma_sl_ID, &
gamma_sl_ID, &
Lambda_sl_ID, &
thresholdstress_ID
tau_pass_ID
end enum
type, private :: tParameters
@ -274,7 +274,7 @@ subroutine plastic_disloUCLA_init()
case ('mfp','mfp_slip')
outputID = merge(Lambda_sl_ID,undefined_ID,prm%sum_N_sl>0)
case ('threshold_stress','threshold_stress_slip')
outputID = merge(thresholdstress_ID,undefined_ID,prm%sum_N_sl>0)
outputID = merge(tau_pass_ID,undefined_ID,prm%sum_N_sl>0)
end select
@ -480,12 +480,12 @@ subroutine plastic_disloUCLA_results(instance,group)
call results_writeDataset(group,stt%rho_dip,'rho_dip',&
'dislocation dipole density''1/m²')
case (dot_gamma_sl_ID)
call results_writeDataset(group,stt%gamma_sl,'dot_gamma_sl',&
call results_writeDataset(group,stt%gamma_sl,'dot_gamma_sl',& ! this is not dot!!
'plastic shear','1')
case (Lambda_sl_ID)
call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',&
'mean free path for slip','m')
case (thresholdstress_ID)
case (tau_pass_ID)
call results_writeDataset(group,dst%threshold_stress,'tau_pass',&
'threshold stress for slip','Pa')
end select

View File

@ -33,7 +33,7 @@ module plastic_dislotwin
gamma_sl_ID, &
Lambda_sl_ID, &
resolved_stress_slip_ID, &
threshold_stress_slip_ID, &
tau_pass_ID, &
edge_dipole_distance_ID, &
f_tw_ID, &
Lambda_tw_ID, &
@ -477,7 +477,7 @@ subroutine plastic_dislotwin_init
outputID = merge(Lambda_sl_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl
case ('tau_pass')
outputID= merge(threshold_stress_slip_ID,undefined_ID,prm%sum_N_sl > 0)
outputID= merge(tau_pass_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl
case ('f_tw')
@ -948,7 +948,7 @@ subroutine plastic_dislotwin_results(instance,group)
case (Lambda_sl_ID)
call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',&
'mean free path for slip','m')
case (threshold_stress_slip_ID)
case (tau_pass_ID)
call results_writeDataset(group,dst%tau_pass,'tau_pass',&
'passing stress for slip','Pa')

View File

@ -26,13 +26,9 @@ module plastic_nonlocal
private
real(pReal), parameter, private :: &
KB = 1.38e-23_pReal !< Physical parameter, Boltzmann constant in J/Kelvin
integer, dimension(:,:), allocatable, target, public :: &
plastic_nonlocal_sizePostResult !< size of each post result output
character(len=64), dimension(:,:), allocatable, target, public :: &
plastic_nonlocal_output !< name of each post result output
! storage order of dislocation types
integer, dimension(8), parameter :: &
@ -81,28 +77,16 @@ module plastic_nonlocal
rho_dip_edg_ID, &
rho_dip_scr_ID, &
rho_forest_ID, &
shearrate_ID, &
resolvedstress_back_ID, &
resistance_ID, &
tau_pass_ID, &
rho_dot_sgl_ID, &
rho_dot_sgl_mobile_ID, &
rho_dot_dip_ID, &
rho_dot_gen_edge_ID, &
rho_dot_gen_screw_ID, &
rho_dot_sgl2dip_edge_ID, &
rho_dot_sgl2dip_screw_ID, &
rho_dot_ann_ath_ID, &
rho_dot_ann_the_edge_ID, &
rho_dot_ann_the_screw_ID, &
rho_dot_edgejogs_ID, &
rho_dot_flux_mobile_ID, &
rho_dot_flux_edge_ID, &
rho_dot_flux_screw_ID, &
velocity_edge_pos_ID, &
velocity_edge_neg_ID, &
velocity_screw_pos_ID, &
velocity_screw_neg_ID, &
accumulatedshear_ID
v_edg_pos_ID, &
v_edg_neg_ID, &
v_scr_pos_ID, &
v_scr_neg_ID, &
gamma_ID
end enum
type, private :: tParameters !< container type for internal constitutive parameters
@ -178,22 +162,10 @@ module plastic_nonlocal
type, private :: tNonlocalMicrostructure
real(pReal), allocatable, dimension(:,:) :: &
tau_Threshold, &
tau_pass, &
tau_Back
end type tNonlocalMicrostructure
type, private :: tOutput !< container type for storage of output results
real(pReal), dimension(:,:), allocatable, private :: &
rhoDotEdgeJogs
real(pReal), dimension(:,:,:), allocatable, private :: &
rhoDotFlux, &
rhoDotMultiplication, &
rhoDotSingle2DipoleGlide, &
rhoDotAthermalAnnihilation, &
rhoDotThermalAnnihilation
end type tOutput
type, private :: tNonlocalState
real(pReal), pointer, dimension(:,:) :: &
rho, & ! < all dislocations
@ -212,8 +184,12 @@ module plastic_nonlocal
rho_dip_edg, &
rho_dip_scr, &
rho_forest, &
accumulatedshear, &
v
gamma, &
v, &
v_edg_pos, &
v_edg_neg, &
v_scr_pos, &
v_scr_neg
end type tNonlocalState
type(tNonlocalState), allocatable, dimension(:), private :: &
@ -223,7 +199,6 @@ module plastic_nonlocal
type(tParameters), dimension(:), allocatable, private :: param !< containers of constitutive parameters (len Ninstance)
type(tOutput), dimension(:), allocatable, private :: results
type(tNonlocalMicrostructure), dimension(:), allocatable, private :: microstructure
integer(kind(undefined_ID)), dimension(:,:), allocatable, private :: &
@ -236,7 +211,6 @@ module plastic_nonlocal
plastic_nonlocal_dotState, &
plastic_nonlocal_deltaState, &
plastic_nonlocal_updateCompatibility, &
plastic_nonlocal_postResults, &
plastic_nonlocal_results
private :: &
@ -289,9 +263,7 @@ subroutine plastic_nonlocal_init
allocate(dotState(maxNinstances))
allocate(deltaState(maxNinstances))
allocate(microstructure(maxNinstances))
allocate(results(maxNinstances))
allocate(plastic_nonlocal_sizePostResult(maxval(phase_Noutput), maxNinstances), source=0)
allocate(plastic_nonlocal_output(maxval(phase_Noutput), maxNinstances))
plastic_nonlocal_output = ''
allocate(plastic_nonlocal_outputID(maxval(phase_Noutput), maxNinstances), source=undefined_ID)
@ -305,7 +277,6 @@ subroutine plastic_nonlocal_init
dot => dotState(phase_plasticityInstance(p)), &
stt => state(phase_plasticityInstance(p)), &
del => deltaState(phase_plasticityInstance(p)), &
res => results(phase_plasticityInstance(p)), &
dst => microstructure(phase_plasticityInstance(p)), &
config => config_phase(p))
@ -476,77 +447,52 @@ subroutine plastic_nonlocal_init
do i=1, size(outputs)
outputID = undefined_ID
select case(trim(outputs(i)))
case ('rho_sgl_edge_pos_mobile')
case ('rho_sgl_mob_edg_pos')
outputID = merge(rho_sgl_mob_edg_pos_ID,undefined_ID,prm%totalNslip>0)
case ('rho_sgl_edge_neg_mobile')
case ('rho_sgl_mob_edg_neg')
outputID = merge(rho_sgl_mob_edg_neg_ID,undefined_ID,prm%totalNslip>0)
case ('rho_sgl_screw_pos_mobile')
case ('rho_sgl_mob_scr_pos')
outputID = merge(rho_sgl_mob_scr_pos_ID,undefined_ID,prm%totalNslip>0)
case ('rho_sgl_screw_neg_mobile')
case ('rho_sgl_mob_scr_neg')
outputID = merge(rho_sgl_mob_scr_neg_ID,undefined_ID,prm%totalNslip>0)
case ('rho_sgl_edge_pos_immobile')
case ('rho_sgl_imm_edg_pos')
outputID = merge(rho_sgl_imm_edg_pos_ID,undefined_ID,prm%totalNslip>0)
case ('rho_sgl_edge_neg_immobile')
case ('rho_sgl_imm_edg_neg')
outputID = merge(rho_sgl_imm_edg_neg_ID,undefined_ID,prm%totalNslip>0)
case ('rho_sgl_screw_pos_immobile')
case ('rho_sgl_imm_scr_pos')
outputID = merge(rho_sgl_imm_scr_pos_ID,undefined_ID,prm%totalNslip>0)
case ('rho_sgl_screw_neg_immobile')
case ('rho_sgl_imm_scr_neg')
outputID = merge(rho_sgl_imm_scr_neg_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dip_edge')
case ('rho_dip_edg')
outputID = merge(rho_dip_edg_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dip_screw')
case ('rho_dip_scr')
outputID = merge(rho_dip_scr_ID,undefined_ID,prm%totalNslip>0)
case ('rho_forest')
outputID = merge(rho_forest_ID,undefined_ID,prm%totalNslip>0)
case ('shearrate')
outputID = merge(shearrate_ID,undefined_ID,prm%totalNslip>0)
case ('resolvedstress_back')
outputID = merge(resolvedstress_back_ID,undefined_ID,prm%totalNslip>0)
case ('resistance')
outputID = merge(resistance_ID,undefined_ID,prm%totalNslip>0)
case ('tau_pass')
outputID = merge(tau_pass_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_sgl')
outputID = merge(rho_dot_sgl_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_sgl_mobile')
outputID = merge(rho_dot_sgl_mobile_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_dip')
outputID = merge(rho_dot_dip_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_gen_edge')
outputID = merge(rho_dot_gen_edge_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_gen_screw')
outputID = merge(rho_dot_gen_screw_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_sgl2dip_edge')
outputID = merge(rho_dot_sgl2dip_edge_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_sgl2dip_screw')
outputID = merge(rho_dot_sgl2dip_screw_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_ann_ath')
outputID = merge(rho_dot_ann_ath_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_ann_the_edge')
outputID = merge(rho_dot_ann_the_edge_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_ann_the_screw')
outputID = merge(rho_dot_ann_the_screw_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_edgejogs')
outputID = merge(rho_dot_edgejogs_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_flux_mobile')
outputID = merge(rho_dot_flux_mobile_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_flux_edge')
outputID = merge(rho_dot_flux_edge_ID,undefined_ID,prm%totalNslip>0)
case ('rho_dot_flux_screw')
outputID = merge(rho_dot_flux_screw_ID,undefined_ID,prm%totalNslip>0)
case ('velocity_edge_pos')
outputID = merge(velocity_edge_pos_ID,undefined_ID,prm%totalNslip>0)
case ('velocity_edge_neg')
outputID = merge(velocity_edge_neg_ID,undefined_ID,prm%totalNslip>0)
case ('velocity_screw_pos')
outputID = merge(velocity_screw_pos_ID,undefined_ID,prm%totalNslip>0)
case ('velocity_screw_neg')
outputID = merge(velocity_screw_neg_ID,undefined_ID,prm%totalNslip>0)
case ('accumulatedshear','accumulated_shear')
outputID = merge(accumulatedshear_ID,undefined_ID,prm%totalNslip>0)
case ('v_edg_pos')
outputID = merge(v_edg_pos_ID,undefined_ID,prm%totalNslip>0)
case ('v_edg_neg')
outputID = merge(v_edg_neg_ID,undefined_ID,prm%totalNslip>0)
case ('v_scr_pos')
outputID = merge(v_scr_pos_ID,undefined_ID,prm%totalNslip>0)
case ('v_scr_neg')
outputID = merge(v_scr_neg_ID,undefined_ID,prm%totalNslip>0)
case ('gamma')
outputID = merge(gamma_ID,undefined_ID,prm%totalNslip>0)
end select
if (outputID /= undefined_ID) then
plastic_nonlocal_output(i,phase_plasticityInstance(p)) = outputs(i)
plastic_nonlocal_sizePostResult(i,phase_plasticityInstance(p)) = prm%totalNslip
prm%outputID = [prm%outputID , outputID]
endif
@ -560,7 +506,7 @@ subroutine plastic_nonlocal_init
'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', &
'rhoSglScrewPosImmobile','rhoSglScrewNegImmobile', &
'rhoDipEdge ','rhoDipScrew ', &
'accumulatedshear ' ]) * prm%totalNslip !< "basic" microstructural state variables that are independent from other state variables
'gamma ' ]) * prm%totalNslip !< "basic" microstructural state variables that are independent from other state variables
sizeDependentState = size([ 'rhoForest ']) * prm%totalNslip !< microstructural state variables that depend on other state variables
sizeState = sizeDotState + sizeDependentState &
+ size([ 'velocityEdgePos ','velocityEdgeNeg ', &
@ -572,7 +518,6 @@ subroutine plastic_nonlocal_init
prm%totalNslip,0,0)
plasticState(p)%nonlocal = .true.
plasticState(p)%offsetDeltaState = 0 ! ToDo: state structure does not follow convention
plasticState(p)%sizePostResults = sum(plastic_nonlocal_sizePostResult(:,phase_plasticityInstance(p)))
totalNslip(phase_plasticityInstance(p)) = prm%totalNslip
@ -597,67 +542,63 @@ subroutine plastic_nonlocal_init
dot%rho_sgl_mob_edg_neg => plasticState(p)%dotState (1*prm%totalNslip+1: 2*prm%totalNslip,:)
del%rho_sgl_mob_edg_neg => plasticState(p)%deltaState (1*prm%totalNslip+1: 2*prm%totalNslip,:)
stt%rho_sgl_mob_scr_pos => plasticState(p)%state (2*prm%totalNslip+1: 3*prm%totalNslip,:)
dot%rho_sgl_mob_scr_pos => plasticState(p)%dotState (2*prm%totalNslip+1: 3*prm%totalNslip,:)
del%rho_sgl_mob_scr_pos => plasticState(p)%deltaState (2*prm%totalNslip+1: 3*prm%totalNslip,:)
stt%rho_sgl_mob_scr_pos => plasticState(p)%state (2*prm%totalNslip+1: 3*prm%totalNslip,:)
dot%rho_sgl_mob_scr_pos => plasticState(p)%dotState (2*prm%totalNslip+1: 3*prm%totalNslip,:)
del%rho_sgl_mob_scr_pos => plasticState(p)%deltaState (2*prm%totalNslip+1: 3*prm%totalNslip,:)
stt%rho_sgl_mob_scr_neg => plasticState(p)%state (3*prm%totalNslip+1: 4*prm%totalNslip,:)
dot%rho_sgl_mob_scr_neg => plasticState(p)%dotState (3*prm%totalNslip+1: 4*prm%totalNslip,:)
del%rho_sgl_mob_scr_neg => plasticState(p)%deltaState (3*prm%totalNslip+1: 4*prm%totalNslip,:)
stt%rho_sgl_mob_scr_neg => plasticState(p)%state (3*prm%totalNslip+1: 4*prm%totalNslip,:)
dot%rho_sgl_mob_scr_neg => plasticState(p)%dotState (3*prm%totalNslip+1: 4*prm%totalNslip,:)
del%rho_sgl_mob_scr_neg => plasticState(p)%deltaState (3*prm%totalNslip+1: 4*prm%totalNslip,:)
stt%rhoSglImmobile => plasticState(p)%state (4*prm%totalNslip+1: 8*prm%totalNslip,:)
dot%rhoSglImmobile => plasticState(p)%dotState (4*prm%totalNslip+1: 8*prm%totalNslip,:)
del%rhoSglImmobile => plasticState(p)%deltaState (4*prm%totalNslip+1: 8*prm%totalNslip,:)
del%rhoSglImmobile => plasticState(p)%deltaState (4*prm%totalNslip+1: 8*prm%totalNslip,:)
stt%rho_sgl_imm_edg_pos => plasticState(p)%state (4*prm%totalNslip+1: 5*prm%totalNslip,:)
dot%rho_sgl_imm_edg_pos => plasticState(p)%dotState (4*prm%totalNslip+1: 5*prm%totalNslip,:)
stt%rho_sgl_imm_edg_pos => plasticState(p)%state (4*prm%totalNslip+1: 5*prm%totalNslip,:)
dot%rho_sgl_imm_edg_pos => plasticState(p)%dotState (4*prm%totalNslip+1: 5*prm%totalNslip,:)
del%rho_sgl_imm_edg_pos => plasticState(p)%deltaState (4*prm%totalNslip+1: 5*prm%totalNslip,:)
stt%rho_sgl_imm_edg_neg => plasticState(p)%state (5*prm%totalNslip+1: 6*prm%totalNslip,:)
dot%rho_sgl_imm_edg_neg => plasticState(p)%dotState (5*prm%totalNslip+1: 6*prm%totalNslip,:)
stt%rho_sgl_imm_edg_neg => plasticState(p)%state (5*prm%totalNslip+1: 6*prm%totalNslip,:)
dot%rho_sgl_imm_edg_neg => plasticState(p)%dotState (5*prm%totalNslip+1: 6*prm%totalNslip,:)
del%rho_sgl_imm_edg_neg => plasticState(p)%deltaState (5*prm%totalNslip+1: 6*prm%totalNslip,:)
stt%rho_sgl_imm_scr_pos => plasticState(p)%state (6*prm%totalNslip+1: 7*prm%totalNslip,:)
dot%rho_sgl_imm_scr_pos => plasticState(p)%dotState(6*prm%totalNslip+1: 7*prm%totalNslip,:)
del%rho_sgl_imm_scr_pos => plasticState(p)%deltaState(6*prm%totalNslip+1: 7*prm%totalNslip,:)
stt%rho_sgl_imm_scr_pos => plasticState(p)%state (6*prm%totalNslip+1: 7*prm%totalNslip,:)
dot%rho_sgl_imm_scr_pos => plasticState(p)%dotState (6*prm%totalNslip+1: 7*prm%totalNslip,:)
del%rho_sgl_imm_scr_pos => plasticState(p)%deltaState (6*prm%totalNslip+1: 7*prm%totalNslip,:)
stt%rho_sgl_imm_scr_neg => plasticState(p)%state (7*prm%totalNslip+1: 8*prm%totalNslip,:)
dot%rho_sgl_imm_scr_neg => plasticState(p)%dotState(7*prm%totalNslip+1: 8*prm%totalNslip,:)
del%rho_sgl_imm_scr_neg => plasticState(p)%deltaState(7*prm%totalNslip+1: 8*prm%totalNslip,:)
stt%rho_sgl_imm_scr_neg => plasticState(p)%state (7*prm%totalNslip+1: 8*prm%totalNslip,:)
dot%rho_sgl_imm_scr_neg => plasticState(p)%dotState (7*prm%totalNslip+1: 8*prm%totalNslip,:)
del%rho_sgl_imm_scr_neg => plasticState(p)%deltaState (7*prm%totalNslip+1: 8*prm%totalNslip,:)
stt%rhoDip => plasticState(p)%state (8*prm%totalNslip+1:10*prm%totalNslip,:)
dot%rhoDip => plasticState(p)%dotState (8*prm%totalNslip+1:10*prm%totalNslip,:)
del%rhoDip => plasticState(p)%deltaState (8*prm%totalNslip+1:10*prm%totalNslip,:)
del%rhoDip => plasticState(p)%deltaState (8*prm%totalNslip+1:10*prm%totalNslip,:)
stt%rho_dip_edg => plasticState(p)%state (8*prm%totalNslip+1: 9*prm%totalNslip,:)
dot%rho_dip_edg => plasticState(p)%dotState (8*prm%totalNslip+1: 9*prm%totalNslip,:)
del%rho_dip_edg => plasticState(p)%deltaState (8*prm%totalNslip+1: 9*prm%totalNslip,:)
stt%rho_dip_edg => plasticState(p)%state (8*prm%totalNslip+1: 9*prm%totalNslip,:)
dot%rho_dip_edg => plasticState(p)%dotState (8*prm%totalNslip+1: 9*prm%totalNslip,:)
del%rho_dip_edg => plasticState(p)%deltaState (8*prm%totalNslip+1: 9*prm%totalNslip,:)
stt%rho_dip_scr => plasticState(p)%state (9*prm%totalNslip+1:10*prm%totalNslip,:)
dot%rho_dip_scr => plasticState(p)%dotState (9*prm%totalNslip+1:10*prm%totalNslip,:)
del%rho_dip_scr => plasticState(p)%deltaState (9*prm%totalNslip+1:10*prm%totalNslip,:)
del%rho_dip_scr => plasticState(p)%deltaState (9*prm%totalNslip+1:10*prm%totalNslip,:)
stt%accumulatedshear => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
dot%accumulatedshear => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
del%accumulatedshear => plasticState(p)%deltaState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
stt%gamma => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
dot%gamma => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
del%gamma => plasticState(p)%deltaState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
plasticState(p)%aTolState(10*prm%totalNslip + 1:11*prm%totalNslip ) = prm%aTolShear
plasticState(p)%slipRate => plasticState(p)%dotState(10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
plasticState(p)%accumulatedSlip => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
plasticState(p)%slipRate => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
plasticState(p)%accumulatedSlip => plasticState(p)%state(10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
stt%rho_forest => plasticState(p)%state (11*prm%totalNslip + 1:12*prm%totalNslip ,1:NofMyPhase)
stt%v => plasticState(p)%state (12*prm%totalNslip + 1:16*prm%totalNslip ,1:NofMyPhase)
stt%rho_forest => plasticState(p)%state (11*prm%totalNslip + 1:12*prm%totalNslip ,1:NofMyPhase)
stt%v => plasticState(p)%state (12*prm%totalNslip + 1:16*prm%totalNslip ,1:NofMyPhase)
stt%v_edg_pos => plasticState(p)%state (12*prm%totalNslip + 1:13*prm%totalNslip ,1:NofMyPhase)
stt%v_edg_neg => plasticState(p)%state (13*prm%totalNslip + 1:14*prm%totalNslip ,1:NofMyPhase)
stt%v_scr_pos => plasticState(p)%state (14*prm%totalNslip + 1:15*prm%totalNslip ,1:NofMyPhase)
stt%v_scr_neg => plasticState(p)%state (15*prm%totalNslip + 1:16*prm%totalNslip ,1:NofMyPhase)
allocate(dst%tau_Threshold(prm%totalNslip,NofMyPhase),source=0.0_pReal)
allocate(dst%tau_Back(prm%totalNslip,NofMyPhase),source=0.0_pReal)
allocate(res%rhoDotFlux(prm%totalNslip,8,NofMyPhase),source=0.0_pReal)
allocate(res%rhoDotMultiplication(prm%totalNslip,2,NofMyPhase),source=0.0_pReal)
allocate(res%rhoDotSingle2DipoleGlide(prm%totalNslip,2,NofMyPhase),source=0.0_pReal)
allocate(res%rhoDotAthermalAnnihilation(prm%totalNslip,2,NofMyPhase),source=0.0_pReal)
allocate(res%rhoDotThermalAnnihilation(prm%totalNslip,2,NofMyPhase),source=0.0_pReal)
allocate(res%rhoDotEdgeJogs(prm%totalNslip,NofMyPhase),source=0.0_pReal)
allocate(dst%tau_pass(prm%totalNslip,NofMyPhase),source=0.0_pReal)
allocate(dst%tau_Back(prm%totalNslip,NofMyPhase), source=0.0_pReal)
end associate
if (NofMyPhase > 0) call stateInit(p,NofMyPhase)
plasticState(p)%state0 = plasticState(p)%state
@ -902,7 +843,7 @@ subroutine plastic_nonlocal_dependentState(Fe, Fp, ip, el)
endif
forall (s = 1:ns) &
dst%tau_threshold(s,of) = prm%mu * prm%burgers(s) &
dst%tau_pass(s,of) = prm%mu * prm%burgers(s) &
* sqrt(dot_product(sum(abs(rho),2), myInteractionMatrix(1:ns,s)))
@ -1019,7 +960,7 @@ subroutine plastic_nonlocal_dependentState(Fe, Fp, ip, el)
.or. .not. iand(debug_level(debug_constitutive),debug_levelSelective) /= 0)) then
write(6,'(/,a,i8,1x,i2,1x,i1,/)') '<< CONST >> nonlocal_microstructure at el ip ',el,ip
write(6,'(a,/,12x,12(e10.3,1x))') '<< CONST >> rhoForest', stt%rho_forest(:,of)
write(6,'(a,/,12x,12(f10.5,1x))') '<< CONST >> tauThreshold / MPa', dst%tau_threshold(:,of)*1e-6
write(6,'(a,/,12x,12(f10.5,1x))') '<< CONST >> tauThreshold / MPa', dst%tau_pass(:,of)*1e-6
write(6,'(a,/,12x,12(f10.5,1x),/)') '<< CONST >> tauBack / MPa', dst%tau_back(:,of)*1e-6
endif
#endif
@ -1218,7 +1159,7 @@ subroutine plastic_nonlocal_LpAndItsTangent(Lp, dLp_dMp, &
of = material_phasememberAt(1,ip,el)
instance = phase_plasticityInstance(ph)
associate(prm => param(instance),dst=>microstructure(instance))
associate(prm => param(instance),dst=>microstructure(instance),stt=>state(instance))
ns = prm%totalNslip
!*** shortcut to state variables
@ -1249,7 +1190,7 @@ subroutine plastic_nonlocal_LpAndItsTangent(Lp, dLp_dMp, &
! edges
call plastic_nonlocal_kinetics(v(1:ns,1), dv_dtau(1:ns,1), dv_dtauNS(1:ns,1), &
tau(1:ns), tauNS(1:ns,1), dst%tau_Threshold(1:ns,of), &
tau(1:ns), tauNS(1:ns,1), dst%tau_pass(1:ns,of), &
1, Temperature, instance, of)
v(1:ns,2) = v(1:ns,1)
dv_dtau(1:ns,2) = dv_dtau(1:ns,1)
@ -1265,15 +1206,12 @@ subroutine plastic_nonlocal_LpAndItsTangent(Lp, dLp_dMp, &
else
do t = 3,4
call plastic_nonlocal_kinetics(v(1:ns,t), dv_dtau(1:ns,t), dv_dtauNS(1:ns,t), &
tau(1:ns), tauNS(1:ns,t), dst%tau_Threshold(1:ns,of), &
tau(1:ns), tauNS(1:ns,t), dst%tau_pass(1:ns,of), &
2 , Temperature, instance, of)
enddo
endif
!*** store velocity in state
forall (t = 1:4) &
plasticState(ph)%state(iV(1:ns,t,instance),of) = v(1:ns,t)
stt%v(:,of) = pack(v,.true.)
!*** Bauschinger effect
forall (s = 1:ns, t = 5:8, rhoSgl(s,t) * v(s,t-4) < 0.0_pReal) &
@ -1515,7 +1453,10 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
ph = material_phaseAt(1,el)
instance = phase_plasticityInstance(ph)
associate(prm => param(instance),dst => microstructure(instance),dot => dotState(instance),stt => state(instance))
associate(prm => param(instance), &
dst => microstructure(instance), &
dot => dotState(instance), &
stt => state(instance))
ns = totalNslip(instance)
tau = 0.0_pReal
@ -1665,11 +1606,11 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
endif
enteringFlux: if (considerEnteringFlux) then
forall (s = 1:ns, t = 1:4)
neighbor_v(s,t) = plasticState(np)%state(iV (s,t,neighbor_instance),no)
neighbor_rhoSgl(s,t) = max(plasticState(np)%state(iRhoU(s,t,neighbor_instance),no), &
forall (s = 1:ns, t = 1:4)
neighbor_v(s,t) = plasticState(np)%state(iV (s,t,neighbor_instance),no)
neighbor_rhoSgl(s,t) = max(plasticState(np)%state(iRhoU(s,t,neighbor_instance),no), &
0.0_pReal)
endforall
endforall
where (neighbor_rhoSgl * IPvolume(neighbor_ip,neighbor_el) ** 0.667_pReal < prm%significantN &
.or. neighbor_rhoSgl < prm%significantRho) &
@ -1817,14 +1758,6 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
+ rhoDotSingle2DipoleGlide &
+ rhoDotAthermalAnnihilation &
+ rhoDotThermalAnnihilation
results(instance)%rhoDotFlux(1:ns,1:8,o) = rhoDotFlux(1:ns,1:8)
results(instance)%rhoDotMultiplication(1:ns,1:2,o) = rhoDotMultiplication(1:ns,[1,3])
results(instance)%rhoDotSingle2DipoleGlide(1:ns,1:2,o) = rhoDotSingle2DipoleGlide(1:ns,9:10)
results(instance)%rhoDotAthermalAnnihilation(1:ns,1:2,o) = rhoDotAthermalAnnihilation(1:ns,9:10)
results(instance)%rhoDotThermalAnnihilation(1:ns,1:2,o) = rhoDotThermalAnnihilation(1:ns,9:10)
results(instance)%rhoDotEdgeJogs(1:ns,o) = 2.0_pReal * rhoDotThermalAnnihilation(1:ns,1)
#ifdef DEBUG
if (iand(debug_level(debug_constitutive),debug_levelExtensive) /= 0 &
@ -1860,14 +1793,9 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
#endif
plasticState(p)%dotState = IEEE_value(1.0_pReal,IEEE_quiet_NaN)
else
forall (s = 1:ns, t = 1:4)
plasticState(p)%dotState(iRhoU(s,t,instance),o) = rhoDot(s,t)
plasticState(p)%dotState(iRhoB(s,t,instance),o) = rhoDot(s,t+4)
endforall
forall (s = 1:ns, c = 1:2) &
plasticState(p)%dotState(iRhoD(s,c,instance),o) = rhoDot(s,c+8)
dot%rho(:,o) = pack(rhoDot,.true.)
forall (s = 1:ns) &
dot%accumulatedshear(s,o) = sum(gdot(s,1:4))
dot%gamma(s,o) = sum(gdot(s,1:4))
endif
end associate
@ -2020,206 +1948,6 @@ subroutine plastic_nonlocal_updateCompatibility(orientation,i,e)
end subroutine plastic_nonlocal_updateCompatibility
!--------------------------------------------------------------------------------------------------
!> @brief return array of constitutive results
!--------------------------------------------------------------------------------------------------
function plastic_nonlocal_postResults(ph,instance,of) result(postResults)
integer, intent(in) :: &
ph, &
instance, &
of
real(pReal), dimension(sum(plastic_nonlocal_sizePostResult(:,instance))) :: &
postResults
integer :: &
ns, & !< short notation for the total number of active slip systems
c, & !< character of dislocation
cs, & !< constitutive result index
o, & !< index of current output
t, & !< type of dislocation
s !< index of my current slip system
real(pReal), dimension(param(instance)%totalNslip,8) :: &
rhoSgl, &
rhoDotSgl !< evolution rate of single dislocation densities (positive/negative screw and edge without dipoles)
real(pReal), dimension(param(instance)%totalNslip,4) :: &
gdot, & !< shear rates
v !< velocities
real(pReal), dimension(param(instance)%totalNslip,2) :: &
rhoDotDip !< evolution rate of dipole dislocation densities (screw and edge dipoles)
ns = param(instance)%totalNslip
cs = 0
associate(prm => param(instance),dst => microstructure(instance),stt=>state(instance),dot => dotState(instance))
forall (s = 1:ns, t = 1:4)
rhoSgl(s,t+4) = plasticState(ph)%State(iRhoB(s,t,instance),of)
v(s,t) = plasticState(ph)%State(iV(s,t,instance),of)
rhoDotSgl(s,t+4) = plasticState(ph)%dotState(iRhoB(s,t,instance),of)
endforall
forall (s = 1:ns, c = 1:2)
rhoDotDip(s,c) = plasticState(ph)%dotState(iRhoD(s,c,instance),of)
endforall
!* Calculate shear rate
forall (t = 1:4) &
gdot(1:ns,t) = rhoSgl(1:ns,t) * prm%burgers(1:ns) * v(1:ns,t)
!* calculate limits for stable dipole height
outputsLoop: do o = 1,size(param(instance)%outputID)
select case(param(instance)%outputID(o))
case (rho_sgl_mob_edg_pos_ID)
postResults(cs+1:cs+ns) = stt%rho_sgl_mob_edg_pos(:,of)
cs = cs + ns
case (rho_sgl_imm_edg_pos_ID)
postResults(cs+1:cs+ns) = stt%rho_sgl_imm_edg_pos(:,of)
cs = cs + ns
case (rho_sgl_mob_edg_neg_ID)
postResults(cs+1:cs+ns) = stt%rho_sgl_mob_edg_neg(:,of)
cs = cs + ns
case (rho_sgl_imm_edg_neg_ID)
postResults(cs+1:cs+ns) = stt%rho_sgl_imm_edg_neg(:,of)
cs = cs + ns
case (rho_dip_edg_ID)
postResults(cs+1:cs+ns) = stt%rho_dip_edg(:,of)
cs = cs + ns
case (rho_sgl_mob_scr_pos_ID)
postResults(cs+1:cs+ns) = stt%rho_sgl_mob_scr_pos(:,of)
cs = cs + ns
case (rho_sgl_imm_scr_pos_ID)
postResults(cs+1:cs+ns) = stt%rho_sgl_imm_scr_pos(:,of)
cs = cs + ns
case (rho_sgl_mob_scr_neg_ID)
postResults(cs+1:cs+ns) = stt%rho_sgl_mob_scr_neg(:,of)
cs = cs + ns
case (rho_sgl_imm_scr_neg_ID)
postResults(cs+1:cs+ns) = stt%rho_sgl_imm_scr_neg(:,of)
cs = cs + ns
case (rho_dip_scr_ID)
postResults(cs+1:cs+ns) = stt%rho_dip_scr(:,of)
cs = cs + ns
case (rho_forest_ID)
postResults(cs+1:cs+ns) = stt%rho_forest(:,of)
cs = cs + ns
case (shearrate_ID)
postResults(cs+1:cs+ns) = sum(gdot,2)
cs = cs + ns
case (resolvedstress_back_ID)
postResults(cs+1:cs+ns) = dst%tau_back(:,of)
cs = cs + ns
case (resistance_ID)
postResults(cs+1:cs+ns) = dst%tau_Threshold(:,of)
cs = cs + ns
case (rho_dot_sgl_ID)
postResults(cs+1:cs+ns) = sum(rhoDotSgl(1:ns,1:4),2) &
+ sum(rhoDotSgl(1:ns,5:8)*sign(1.0_pReal,rhoSgl(1:ns,5:8)),2)
cs = cs + ns
case (rho_dot_sgl_mobile_ID)
postResults(cs+1:cs+ns) = sum(rhoDotSgl(1:ns,1:4),2)
cs = cs + ns
case (rho_dot_dip_ID)
postResults(cs+1:cs+ns) = sum(rhoDotDip,2)
cs = cs + ns
case (rho_dot_gen_edge_ID)
postResults(cs+1:cs+ns) = results(instance)%rhoDotMultiplication(1:ns,1,of)
cs = cs + ns
case (rho_dot_gen_screw_ID)
postResults(cs+1:cs+ns) = results(instance)%rhoDotMultiplication(1:ns,2,of)
cs = cs + ns
case (rho_dot_sgl2dip_edge_ID)
postResults(cs+1:cs+ns) = results(instance)%rhoDotSingle2DipoleGlide(1:ns,1,of)
cs = cs + ns
case (rho_dot_sgl2dip_screw_ID)
postResults(cs+1:cs+ns) = results(instance)%rhoDotSingle2DipoleGlide(1:ns,2,of)
cs = cs + ns
case (rho_dot_ann_ath_ID)
postResults(cs+1:cs+ns) = results(instance)%rhoDotAthermalAnnihilation(1:ns,1,of) &
+ results(instance)%rhoDotAthermalAnnihilation(1:ns,2,of)
cs = cs + ns
case (rho_dot_ann_the_edge_ID)
postResults(cs+1:cs+ns) = results(instance)%rhoDotThermalAnnihilation(1:ns,1,of)
cs = cs + ns
case (rho_dot_ann_the_screw_ID)
postResults(cs+1:cs+ns) = results(instance)%rhoDotThermalAnnihilation(1:ns,2,of)
cs = cs + ns
case (rho_dot_edgejogs_ID)
postResults(cs+1:cs+ns) = results(instance)%rhoDotEdgeJogs(1:ns,of)
cs = cs + ns
case (rho_dot_flux_mobile_ID)
postResults(cs+1:cs+ns) = sum(results(instance)%rhoDotFlux(1:ns,1:4,of),2)
cs = cs + ns
case (rho_dot_flux_edge_ID)
postResults(cs+1:cs+ns) = sum(results(instance)%rhoDotFlux(1:ns,1:2,of),2) &
+ sum(results(instance)%rhoDotFlux(1:ns,5:6,of)*sign(1.0_pReal,rhoSgl(1:ns,5:6)),2)
cs = cs + ns
case (rho_dot_flux_screw_ID)
postResults(cs+1:cs+ns) = sum(results(instance)%rhoDotFlux(1:ns,3:4,of),2) &
+ sum(results(instance)%rhoDotFlux(1:ns,7:8,of)*sign(1.0_pReal,rhoSgl(1:ns,7:8)),2)
cs = cs + ns
case (velocity_edge_pos_ID)
postResults(cs+1:cs+ns) = v(1:ns,1)
cs = cs + ns
case (velocity_edge_neg_ID)
postResults(cs+1:cs+ns) = v(1:ns,2)
cs = cs + ns
case (velocity_screw_pos_ID)
postResults(cs+1:cs+ns) = v(1:ns,3)
cs = cs + ns
case (velocity_screw_neg_ID)
postResults(cs+1:cs+ns) = v(1:ns,4)
cs = cs + ns
case(accumulatedshear_ID)
postResults(cs+1:cs+ns) = stt%accumulatedshear(:,of)
cs = cs + ns
end select
enddo outputsLoop
end associate
end function plastic_nonlocal_postResults
!--------------------------------------------------------------------------------------------------
!> @brief returns copy of current dislocation densities from state
!> @details raw values is rectified
@ -2233,7 +1961,7 @@ function getRho(instance,of,ip,el)
getRho = reshape(state(instance)%rho(:,of),[prm%totalNslip,10])
! ensure mobile densities (not for imm, they have a sign)
! ensure positive densities (not for imm, they have a sign)
getRho(:,mob) = max(getRho(:,mob),0.0_pReal)
getRho(:,dip) = max(getRho(:,dip),0.0_pReal)
@ -2257,7 +1985,7 @@ subroutine plastic_nonlocal_results(instance,group)
character(len=*) :: group
integer :: o
associate(prm => param(instance), stt => state(instance))
associate(prm => param(instance),dst => microstructure(instance),stt=>state(instance))
outputsLoop: do o = 1,size(prm%outputID)
select case(prm%outputID(o))
case (rho_sgl_mob_edg_pos_ID)
@ -2293,6 +2021,24 @@ subroutine plastic_nonlocal_results(instance,group)
case (rho_forest_ID)
call results_writeDataset(group,stt%rho_forest, 'rho_forest',&
'forest density','1/m²')
case (v_edg_pos_ID)
call results_writeDataset(group,stt%v_edg_pos, 'v_edg_pos',&
'positive edge velocity','m/s')
case (v_edg_neg_ID)
call results_writeDataset(group,stt%v_edg_neg, 'v_edg_neg',&
'negative edge velocity','m/s')
case (v_scr_pos_ID)
call results_writeDataset(group,stt%v_scr_pos, 'v_scr_pos',&
'positive srew velocity','m/s')
case (v_scr_neg_ID)
call results_writeDataset(group,stt%v_scr_neg, 'v_scr_neg',&
'negative screw velocity','m/s')
case(gamma_ID)
call results_writeDataset(group,stt%gamma,'gamma',&
'plastic shear','1')
case (tau_pass_ID)
call results_writeDataset(group,dst%tau_pass,'tau_pass',&
'passing stress for slip','Pa')
end select
enddo outputsLoop
end associate

View File

@ -62,10 +62,6 @@ module prec
end type
type, extends(tState), public :: tPlasticState
integer :: &
nSlip = 0, &
nTwin = 0, &
nTrans = 0
logical :: &
nonlocal = .false.
real(pReal), pointer, dimension(:,:) :: &

View File

@ -18,12 +18,6 @@ module source_thermal_dissipation
source_thermal_dissipation_offset, & !< which source is my current thermal dissipation mechanism?
source_thermal_dissipation_instance !< instance of thermal dissipation source mechanism
integer, dimension(:,:), allocatable, target, public :: &
source_thermal_dissipation_sizePostResult !< size of each post result output
character(len=64), dimension(:,:), allocatable, target, public :: &
source_thermal_dissipation_output !< name of each post result output
type :: tParameters !< container type for internal constitutive parameters
real(pReal) :: &
kappa
@ -68,10 +62,6 @@ subroutine source_thermal_dissipation_init
enddo
enddo
allocate(source_thermal_dissipation_sizePostResult(maxval(phase_Noutput),Ninstance),source=0)
allocate(source_thermal_dissipation_output (maxval(phase_Noutput),Ninstance))
source_thermal_dissipation_output = ''
do p=1, size(config_phase)
if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle
instance = source_thermal_dissipation_instance(p)

View File

@ -15,17 +15,8 @@ module source_thermal_externalheat
private
integer, dimension(:), allocatable, public, protected :: &
source_thermal_externalheat_offset, & !< which source is my current thermal dissipation mechanism?
source_thermal_externalheat_instance !< instance of thermal dissipation source mechanism
integer, dimension(:,:), allocatable, target, public :: &
source_thermal_externalheat_sizePostResult !< size of each post result output
character(len=64), dimension(:,:), allocatable, target, public :: &
source_thermal_externalheat_output !< name of each post result output
integer, dimension(:), allocatable, target, public :: &
source_thermal_externalheat_Noutput !< number of outputs per instance of this source
source_thermal_externalheat_offset, & !< which source is my current thermal dissipation mechanism?
source_thermal_externalheat_instance !< instance of thermal dissipation source mechanism
type :: tParameters !< container type for internal constitutive parameters
real(pReal), dimension(:), allocatable :: &
@ -73,11 +64,6 @@ subroutine source_thermal_externalheat_init
enddo
enddo
allocate(source_thermal_externalheat_sizePostResult(maxval(phase_Noutput),maxNinstance),source=0)
allocate(source_thermal_externalheat_output (maxval(phase_Noutput),maxNinstance))
source_thermal_externalheat_output = ''
allocate(source_thermal_externalheat_Noutput(maxNinstance), source=0)
allocate(param(maxNinstance))
do p=1, size(config_phase)
@ -117,6 +103,7 @@ subroutine source_thermal_externalheat_dotState(phase, of)
end subroutine source_thermal_externalheat_dotState
!--------------------------------------------------------------------------------------------------
!> @brief returns local heat generation rate
!--------------------------------------------------------------------------------------------------