Merge branch 'lattice-structure-rename' into 'development'

Lattice structure rename

See merge request damask/DAMASK!292
This commit is contained in:
Sharan Roongta 2020-12-01 15:50:09 +01:00
commit 1c29a517a5
24 changed files with 277 additions and 269 deletions

View File

@ -292,33 +292,6 @@ Phenopowerlaw_singleSlip:
################################################################################################### ###################################################################################################
Hex_elastic:
stage: marc
script:
- module load $IntelMarc $HDF5Marc $MSC
- Hex_elastic/test.py
except:
- master
- release
CubicFCC_elastic:
stage: marc
script:
- module load $IntelMarc $HDF5Marc $MSC
- CubicFCC_elastic/test.py
except:
- master
- release
CubicBCC_elastic:
stage: marc
script:
- module load $IntelMarc $HDF5Marc $MSC
- CubicBCC_elastic/test.py
except:
- master
- release
J2_plasticBehavior: J2_plasticBehavior:
stage: marc stage: marc
script: script:

@ -1 +1 @@
Subproject commit 73cb2f63397dfb8551fa5d8cb444eb89b2d3712a Subproject commit 751f96155294e449b31c5d4913fea7bc02ce81b1

View File

@ -1,9 +1,9 @@
# Kuo, J. C., Mikrostrukturmechanik von Bikristallen mit Kippkorngrenzen. Shaker-Verlag 2004. http://edoc.mpg.de/204079 # Kuo, J. C., Mikrostrukturmechanik von Bikristallen mit Kippkorngrenzen. Shaker-Verlag 2004. http://edoc.mpg.de/204079
Aluminum: Aluminum:
mechanics:
lattice: aP
elasticity: {C_11: 110.9e9, C_12: 58.34e9, type: hooke} elasticity: {C_11: 110.9e9, C_12: 58.34e9, type: hooke}
generic:
output: [F, P, Fe, Fp, Lp] output: [F, P, Fe, Fp, Lp]
lattice: iso
plasticity: plasticity:
type: isotropic type: isotropic
output: [xi] output: [xi]

View File

@ -1,9 +1,9 @@
# Maiti and Eisenlohr 2018 Scripta Materialia # Maiti and Eisenlohr 2018 Scripta Materialia
Air: Air:
mechanics:
lattice: aP
elasticity: {C_11: 10e9, C_12: 0.0, type: hooke} elasticity: {C_11: 10e9, C_12: 0.0, type: hooke}
generic:
output: [F, P, Fe, Fp, Lp] output: [F, P, Fe, Fp, Lp]
lattice: iso
plasticity: plasticity:
type: isotropic type: isotropic
output: [xi] output: [xi]

View File

@ -2,8 +2,9 @@
# Tasan et.al. 2015 International Journal of Plasticity # Tasan et.al. 2015 International Journal of Plasticity
# Diehl et.al. 2015 Meccanica # Diehl et.al. 2015 Meccanica
Ferrite: Ferrite:
mechanics:
lattice: cI
elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke} elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke}
lattice: bcc
plasticity: plasticity:
N_sl: [12, 12] N_sl: [12, 12]
a_sl: 2.0 a_sl: 2.0

View File

@ -2,8 +2,9 @@
# Tasan et.al. 2015 International Journal of Plasticity # Tasan et.al. 2015 International Journal of Plasticity
# Diehl et.al. 2015 Meccanica # Diehl et.al. 2015 Meccanica
Martensite: Martensite:
mechanics:
lattice: cI
elasticity: {C_11: 417.4e9, C_12: 242.4e9, C_44: 211.1e9, type: hooke} elasticity: {C_11: 417.4e9, C_12: 242.4e9, C_44: 211.1e9, type: hooke}
lattice: bcc
plasticity: plasticity:
N_sl: [12, 12] N_sl: [12, 12]
a_sl: 2.0 a_sl: 2.0

View File

@ -1,14 +1,14 @@
homogenization: homogenization:
SX: SX:
N_constituents: 1 N_constituents: 1
mech: {type: none} mechanics: {type: none}
phase: phase:
Aluminum: Aluminum:
mechanics:
lattice: cF
output: [F, P, F_e, F_p, L_p]
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
generic:
output: [F, P, Fe, Fp, Lp]
lattice: fcc
plasticity: plasticity:
N_sl: [12] N_sl: [12]
a_sl: 2.25 a_sl: 2.25

View File

@ -108,7 +108,7 @@ material:
phase: phase:
Aluminum: Aluminum:
lattice: fcc lattice: cF
mechanics: mechanics:
output: [F, P, F_e, F_p, L_p, O] output: [F, P, F_e, F_p, L_p, O]
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}

View File

@ -46,7 +46,7 @@ class Result:
self.version_major = f.attrs['DADF5_version_major'] self.version_major = f.attrs['DADF5_version_major']
self.version_minor = f.attrs['DADF5_version_minor'] self.version_minor = f.attrs['DADF5_version_minor']
if self.version_major != 0 or not 7 <= self.version_minor <= 8: if self.version_major != 0 or not 7 <= self.version_minor <= 9:
raise TypeError(f'Unsupported DADF5 version {self.version_major}.{self.version_minor}') raise TypeError(f'Unsupported DADF5 version {self.version_major}.{self.version_minor}')
self.structured = 'grid' in f['geometry'].attrs.keys() self.structured = 'grid' in f['geometry'].attrs.keys()
@ -121,6 +121,10 @@ class Result:
True is equivalent to [*], False is equivalent to [] True is equivalent to [*], False is equivalent to []
""" """
def natural_sort(key):
convert = lambda text: int(text) if text.isdigit() else text
return [ convert(c) for c in re.split('([0-9]+)', key) ]
# allow True/False and string arguments # allow True/False and string arguments
if datasets is True: if datasets is True:
datasets = ['*'] datasets = ['*']
@ -154,11 +158,11 @@ class Result:
self.selection[what] = valid self.selection[what] = valid
elif action == 'add': elif action == 'add':
add = existing.union(valid) add = existing.union(valid)
add_sorted = sorted(add, key=lambda x: int("".join([i for i in x if i.isdigit()]))) add_sorted = sorted(add, key=natural_sort)
self.selection[what] = add_sorted self.selection[what] = add_sorted
elif action == 'del': elif action == 'del':
diff = existing.difference(valid) diff = existing.difference(valid)
diff_sorted = sorted(diff, key=lambda x: int("".join([i for i in x if i.isdigit()]))) diff_sorted = sorted(diff, key=natural_sort)
self.selection[what] = diff_sorted self.selection[what] = diff_sorted
@ -329,9 +333,6 @@ class Result:
raise PermissionError('Rename operation not permitted') raise PermissionError('Rename operation not permitted')
# def datamerger(regular expression to filter groups into one copy)
def place(self,datasets,constituent=0,tagged=False,split=True): def place(self,datasets,constituent=0,tagged=False,split=True):
""" """
Distribute datasets onto geometry and return Table or (split) dictionary of Tables. Distribute datasets onto geometry and return Table or (split) dictionary of Tables.
@ -501,20 +502,6 @@ class Result:
return path return path
def get_constituent_ID(self,c=0):
"""Pointwise constituent ID."""
with h5py.File(self.fname,'r') as f:
names = f['/mapping/phase']['Name'][:,c].astype('str')
return np.array([int(n.split('_')[0]) for n in names.tolist()],dtype=np.int32)
def get_crystal_structure(self): # ToDo: extension to multi constituents/phase
"""Info about the crystal structure."""
with h5py.File(self.fname,'r') as f:
return f[self.get_dataset_location('O')[0]].attrs['Lattice'] if h5py3 else \
f[self.get_dataset_location('O')[0]].attrs['Lattice'].decode()
def enable_user_function(self,func): def enable_user_function(self,func):
globals()[func.__name__]=func globals()[func.__name__]=func
print(f'Function {func.__name__} enabled in add_calculation.') print(f'Function {func.__name__} enabled in add_calculation.')
@ -795,11 +782,11 @@ class Result:
@staticmethod @staticmethod
def _add_IPF_color(q,l): def _add_IPF_color(q,l):
m = util.scale_to_coprime(np.array(l)) m = util.scale_to_coprime(np.array(l))
try:
o = Orientation(rotation = (rfn.structured_to_unstructured(q['data'])), lattice = {'fcc':'cF','bcc':'cI','hex':'hP'}[q['meta']['Lattice']]
lattice = {'fcc':'cF', except KeyError:
'bcc':'cI', lattice = q['meta']['Lattice']
'hex':'hP'}[q['meta']['Lattice']]) o = Orientation(rotation = (rfn.structured_to_unstructured(q['data'])),lattice=lattice)
return { return {
'data': np.uint8(o.IPF_color(l)*255), 'data': np.uint8(o.IPF_color(l)*255),

View File

@ -2,12 +2,12 @@
homogenization: homogenization:
SX: SX:
N_constituents: 1 N_constituents: 1
mech: {type: none} mechanics: {type: none}
phase: phase:
pheno_fcc: pheno_fcc:
lattice: fcc lattice: cF
mech: mechanics:
output: [F, P, F_e, F_p, L_p, O] output: [F, P, F_e, F_p, L_p, O]
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
plasticity: plasticity:
@ -23,8 +23,8 @@ phase:
xi_0_sl: [31e6] xi_0_sl: [31e6]
xi_inf_sl: [63e6] xi_inf_sl: [63e6]
pheno_bcc: pheno_bcc:
lattice: bcc lattice: cI
mech: mechanics:
output: [F, P, F_e, F_p, L_p, O] output: [F, P, F_e, F_p, L_p, O]
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
plasticity: plasticity:

View File

@ -0,0 +1,56 @@
---
homogenization:
SX:
N_constituents: 1
mechanics: {type: none}
phase:
pheno_fcc:
lattice: cF
mechanics:
output: [F, P, F_e, F_p, L_p, O]
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
plasticity:
N_sl: [12]
a_sl: 2.25
atol_xi: 1.0
dot_gamma_0_sl: 0.001
h_0_sl_sl: 75e6
h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4]
n_sl: 20
output: [xi_sl]
type: phenopowerlaw
xi_0_sl: [31e6]
xi_inf_sl: [63e6]
material:
- constituents:
- fraction: 1.0
O: [0.8229200444892315, 0.5284940239127993, -0.11958598847729246, 0.17086795611292308]
phase: pheno_fcc
homogenization: SX
- constituents:
- fraction: 1.0
O: [0.029934934533052786, -0.0463822071939717, 0.9983440440417412, 0.01617900728410769]
phase: pheno_fcc
homogenization: SX
- constituents:
- fraction: 1.0
O: [0.5285808688806949, 0.7326575088838098, 0.4051997815944012, 0.1401013087924221]
phase: pheno_fcc
homogenization: SX
- constituents:
- fraction: 1.0
O: [0.1839974517790312, 0.49550065903084944, -0.1541415483910751, -0.8347840545305227]
phase: pheno_fcc
homogenization: SX
- constituents:
- fraction: 1.0
O: [0.8055693100147384, -0.22778497057116814, -0.028331746016454287, 0.5462320075864553]
phase: pheno_fcc
homogenization: SX
- constituents:
- fraction: 1.0
O: [0.8025842700117737, -0.33640019337884963, -0.3847408071640489, 0.3076815085881779]
phase: pheno_fcc
homogenization: SX

View File

@ -5,7 +5,7 @@ step:
t: 20 t: 20
N: 40 N: 40
f_out: 4 f_out: 4
mech: mechanics:
dot_F: [x, 0, 0, dot_F: [x, 0, 0,
0, 1.0e-3, 0, 0, 1.0e-3, 0,
0, 0, x] 0, 0, x]

View File

@ -173,11 +173,8 @@ class TestResult:
loc = {'O': default.get_dataset_location('O'), loc = {'O': default.get_dataset_location('O'),
'color': default.get_dataset_location('IPFcolor_[{} {} {}]'.format(*d))} 'color': default.get_dataset_location('IPFcolor_[{} {} {}]'.format(*d))}
qu = default.read_dataset(loc['O']).view(np.double).squeeze() qu = default.read_dataset(loc['O']).view(np.double).squeeze()
crystal_structure = default.get_crystal_structure() crystal_structure = default._get_attribute(default.get_dataset_location('O')[0],'Lattice')
c = Orientation(rotation=qu, c = Orientation(rotation=qu,lattice=crystal_structure)
lattice={'fcc':'cF',
'bcc':'cI',
'hex':'hP'}[crystal_structure])
in_memory = np.uint8(c.IPF_color(np.array(d))*255) in_memory = np.uint8(c.IPF_color(np.array(d))*255)
in_file = default.read_dataset(loc['color']) in_file = default.read_dataset(loc['color'])
assert np.allclose(in_memory,in_file) assert np.allclose(in_memory,in_file)

View File

@ -30,10 +30,10 @@ submodule(constitutive) constitutive_mech
myPlasticity myPlasticity
end function plastic_dislotwin_init end function plastic_dislotwin_init
module function plastic_disloTungsten_init() result(myPlasticity) module function plastic_dislotungsten_init() result(myPlasticity)
logical, dimension(:), allocatable :: & logical, dimension(:), allocatable :: &
myPlasticity myPlasticity
end function plastic_disloTungsten_init end function plastic_dislotungsten_init
module function plastic_nonlocal_init() result(myPlasticity) module function plastic_nonlocal_init() result(myPlasticity)
logical, dimension(:), allocatable :: & logical, dimension(:), allocatable :: &
@ -94,7 +94,7 @@ submodule(constitutive) constitutive_mech
of of
end subroutine plastic_dislotwin_LpAndItsTangent end subroutine plastic_dislotwin_LpAndItsTangent
pure module subroutine plastic_disloTungsten_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of) pure module subroutine plastic_dislotungsten_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: & real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: & real(pReal), dimension(3,3,3,3), intent(out) :: &
@ -107,7 +107,7 @@ submodule(constitutive) constitutive_mech
integer, intent(in) :: & integer, intent(in) :: &
instance, & instance, &
of of
end subroutine plastic_disloTungsten_LpAndItsTangent end subroutine plastic_dislotungsten_LpAndItsTangent
module subroutine plastic_nonlocal_LpAndItsTangent(Lp,dLp_dMp, & module subroutine plastic_nonlocal_LpAndItsTangent(Lp,dLp_dMp, &
Mp,Temperature,instance,of,ip,el) Mp,Temperature,instance,of,ip,el)
@ -136,11 +136,11 @@ submodule(constitutive) constitutive_mech
T T
end subroutine plastic_dislotwin_dependentState end subroutine plastic_dislotwin_dependentState
module subroutine plastic_disloTungsten_dependentState(instance,of) module subroutine plastic_dislotungsten_dependentState(instance,of)
integer, intent(in) :: & integer, intent(in) :: &
instance, & instance, &
of of
end subroutine plastic_disloTungsten_dependentState end subroutine plastic_dislotungsten_dependentState
module subroutine plastic_nonlocal_dependentState(F, Fp, instance, of, ip, el) module subroutine plastic_nonlocal_dependentState(F, Fp, instance, of, ip, el)
real(pReal), dimension(3,3), intent(in) :: & real(pReal), dimension(3,3), intent(in) :: &
@ -173,10 +173,10 @@ submodule(constitutive) constitutive_mech
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
end subroutine plastic_dislotwin_results end subroutine plastic_dislotwin_results
module subroutine plastic_disloTungsten_results(instance,group) module subroutine plastic_dislotungsten_results(instance,group)
integer, intent(in) :: instance integer, intent(in) :: instance
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
end subroutine plastic_disloTungsten_results end subroutine plastic_dislotungsten_results
module subroutine plastic_nonlocal_results(instance,group) module subroutine plastic_nonlocal_results(instance,group)
integer, intent(in) :: instance integer, intent(in) :: instance
@ -255,7 +255,7 @@ module subroutine mech_init
where(plastic_phenopowerlaw_init()) phase_plasticity = PLASTICITY_PHENOPOWERLAW_ID where(plastic_phenopowerlaw_init()) phase_plasticity = PLASTICITY_PHENOPOWERLAW_ID
where(plastic_kinehardening_init()) phase_plasticity = PLASTICITY_KINEHARDENING_ID where(plastic_kinehardening_init()) phase_plasticity = PLASTICITY_KINEHARDENING_ID
where(plastic_dislotwin_init()) phase_plasticity = PLASTICITY_DISLOTWIN_ID where(plastic_dislotwin_init()) phase_plasticity = PLASTICITY_DISLOTWIN_ID
where(plastic_disloTungsten_init()) phase_plasticity = PLASTICITY_DISLOTUNGSTEN_ID where(plastic_dislotungsten_init()) phase_plasticity = PLASTICITY_DISLOTUNGSTEN_ID
where(plastic_nonlocal_init()) phase_plasticity = PLASTICITY_NONLOCAL_ID where(plastic_nonlocal_init()) phase_plasticity = PLASTICITY_NONLOCAL_ID
do p = 1, phases%length do p = 1, phases%length
@ -368,7 +368,7 @@ module subroutine constitutive_plastic_dependentState(F, Fp, ipc, ip, el)
case (PLASTICITY_DISLOTWIN_ID) plasticityType case (PLASTICITY_DISLOTWIN_ID) plasticityType
call plastic_dislotwin_dependentState(temperature(ho)%p(tme),instance,of) call plastic_dislotwin_dependentState(temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOTUNGSTEN_ID) plasticityType case (PLASTICITY_DISLOTUNGSTEN_ID) plasticityType
call plastic_disloTungsten_dependentState(instance,of) call plastic_dislotungsten_dependentState(instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType case (PLASTICITY_NONLOCAL_ID) plasticityType
call plastic_nonlocal_dependentState (F,Fp,instance,of,ip,el) call plastic_nonlocal_dependentState (F,Fp,instance,of,ip,el)
end select plasticityType end select plasticityType
@ -435,7 +435,7 @@ module subroutine constitutive_plastic_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, &
call plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of) call plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOTUNGSTEN_ID) plasticityType case (PLASTICITY_DISLOTUNGSTEN_ID) plasticityType
call plastic_disloTungsten_LpAndItsTangent(Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of) call plastic_dislotungsten_LpAndItsTangent(Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of)
end select plasticityType end select plasticityType
@ -478,7 +478,7 @@ module subroutine plastic_results
call plastic_dislotwin_results(phase_plasticityInstance(p),group) call plastic_dislotwin_results(phase_plasticityInstance(p),group)
case(PLASTICITY_DISLOTUNGSTEN_ID) case(PLASTICITY_DISLOTUNGSTEN_ID)
call plastic_disloTungsten_results(phase_plasticityInstance(p),group) call plastic_dislotungsten_results(phase_plasticityInstance(p),group)
case(PLASTICITY_NONLOCAL_ID) case(PLASTICITY_NONLOCAL_ID)
call plastic_nonlocal_results(phase_plasticityInstance(p),group) call plastic_nonlocal_results(phase_plasticityInstance(p),group)

View File

@ -5,7 +5,7 @@
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @brief crystal plasticity model for bcc metals, especially Tungsten !> @brief crystal plasticity model for bcc metals, especially Tungsten
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
submodule(constitutive:constitutive_mech) plastic_disloTungsten submodule(constitutive:constitutive_mech) plastic_dislotungsten
real(pReal), parameter :: & real(pReal), parameter :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
@ -74,7 +74,7 @@ contains
!> @brief Perform module initialization. !> @brief Perform module initialization.
!> @details reads in material parameters, allocates arrays, and does sanity checks !> @details reads in material parameters, allocates arrays, and does sanity checks
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module function plastic_disloTungsten_init() result(myPlasticity) module function plastic_dislotungsten_init() result(myPlasticity)
logical, dimension(:), allocatable :: myPlasticity logical, dimension(:), allocatable :: myPlasticity
integer :: & integer :: &
@ -99,7 +99,7 @@ module function plastic_disloTungsten_init() result(myPlasticity)
print'(/,a)', ' <<<+- plastic_dislotungsten init -+>>>' print'(/,a)', ' <<<+- plastic_dislotungsten init -+>>>'
myPlasticity = plastic_active('disloTungsten') myPlasticity = plastic_active('dislotungsten')
Ninstances = count(myPlasticity) Ninstances = count(myPlasticity)
print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT) print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT)
if(Ninstances == 0) return if(Ninstances == 0) return
@ -142,7 +142,7 @@ module function plastic_disloTungsten_init() result(myPlasticity)
prm%P_sl = lattice_SchmidMatrix_slip(N_sl,phase%get_asString('lattice'),& prm%P_sl = lattice_SchmidMatrix_slip(N_sl,phase%get_asString('lattice'),&
phase%get_asFloat('c/a',defaultVal=0.0_pReal)) phase%get_asFloat('c/a',defaultVal=0.0_pReal))
if(trim(phase%get_asString('lattice')) == 'bcc') then if(trim(phase%get_asString('lattice')) == 'cI') then
a = pl%get_asFloats('a_nonSchmid',defaultVal = emptyRealArray) a = pl%get_asFloats('a_nonSchmid',defaultVal = emptyRealArray)
prm%nonSchmid_pos = lattice_nonSchmidMatrix(N_sl,a,+1) prm%nonSchmid_pos = lattice_nonSchmidMatrix(N_sl,a,+1)
prm%nonSchmid_neg = lattice_nonSchmidMatrix(N_sl,a,-1) prm%nonSchmid_neg = lattice_nonSchmidMatrix(N_sl,a,-1)
@ -180,7 +180,7 @@ module function plastic_disloTungsten_init() result(myPlasticity)
prm%f_at = pl%get_asFloat('f_at') * prm%b_sl**3.0_pReal prm%f_at = pl%get_asFloat('f_at') * prm%b_sl**3.0_pReal
prm%D_a = pl%get_asFloat('D_a') * prm%b_sl prm%D_a = pl%get_asFloat('D_a') * prm%b_sl
prm%dipoleformation = pl%get_asBool('dipole_formation_factor', defaultVal = .true.) prm%dipoleformation = .not. pl%get_asBool('no_dipole_formation', defaultVal = .false.)
! expand: family => system ! expand: family => system
rho_mob_0 = math_expand(rho_mob_0, N_sl) rho_mob_0 = math_expand(rho_mob_0, N_sl)
@ -262,17 +262,17 @@ module function plastic_disloTungsten_init() result(myPlasticity)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range ! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'(disloTungsten)') if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'(dislotungsten)')
enddo enddo
end function plastic_disloTungsten_init end function plastic_dislotungsten_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Calculate plastic velocity gradient and its tangent. !> @brief Calculate plastic velocity gradient and its tangent.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure module subroutine plastic_disloTungsten_LpAndItsTangent(Lp,dLp_dMp, & pure module subroutine plastic_dislotungsten_LpAndItsTangent(Lp,dLp_dMp, &
Mp,T,instance,of) Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: & real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient Lp !< plastic velocity gradient
@ -309,13 +309,13 @@ pure module subroutine plastic_disloTungsten_LpAndItsTangent(Lp,dLp_dMp, &
end associate end associate
end subroutine plastic_disloTungsten_LpAndItsTangent end subroutine plastic_dislotungsten_LpAndItsTangent
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Calculate the rate of change of microstructure. !> @brief Calculate the rate of change of microstructure.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine plastic_disloTungsten_dotState(Mp,T,instance,of) module subroutine plastic_dislotungsten_dotState(Mp,T,instance,of)
real(pReal), dimension(3,3), intent(in) :: & real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress Mp !< Mandel stress
@ -369,13 +369,13 @@ module subroutine plastic_disloTungsten_dotState(Mp,T,instance,of)
end associate end associate
end subroutine plastic_disloTungsten_dotState end subroutine plastic_dislotungsten_dotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Calculate derived quantities from state. !> @brief Calculate derived quantities from state.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine plastic_disloTungsten_dependentState(instance,of) module subroutine plastic_dislotungsten_dependentState(instance,of)
integer, intent(in) :: & integer, intent(in) :: &
instance, & instance, &
@ -394,13 +394,13 @@ module subroutine plastic_disloTungsten_dependentState(instance,of)
end associate end associate
end subroutine plastic_disloTungsten_dependentState end subroutine plastic_dislotungsten_dependentState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Write results to HDF5 output file. !> @brief Write results to HDF5 output file.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine plastic_disloTungsten_results(instance,group) module subroutine plastic_dislotungsten_results(instance,group)
integer, intent(in) :: instance integer, intent(in) :: instance
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
@ -429,7 +429,7 @@ module subroutine plastic_disloTungsten_results(instance,group)
enddo outputsLoop enddo outputsLoop
end associate end associate
end subroutine plastic_disloTungsten_results end subroutine plastic_dislotungsten_results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -547,4 +547,4 @@ pure subroutine kinetics(Mp,T,instance,of, &
end subroutine kinetics end subroutine kinetics
end submodule plastic_disloTungsten end submodule plastic_dislotungsten

View File

@ -301,7 +301,7 @@ module function plastic_dislotwin_init() result(myPlasticity)
prm%r = math_expand(prm%r,N_tw) prm%r = math_expand(prm%r,N_tw)
! sanity checks ! sanity checks
if ( prm%x_c_tw < 0.0_pReal) extmsg = trim(extmsg)//' x_c_twin' if ( prm%x_c_tw < 0.0_pReal) extmsg = trim(extmsg)//' x_c_tw'
if ( prm%L_tw < 0.0_pReal) extmsg = trim(extmsg)//' L_tw' if ( prm%L_tw < 0.0_pReal) extmsg = trim(extmsg)//' L_tw'
if ( prm%i_tw < 0.0_pReal) extmsg = trim(extmsg)//' i_tw' if ( prm%i_tw < 0.0_pReal) extmsg = trim(extmsg)//' i_tw'
if (any(prm%b_tw < 0.0_pReal)) extmsg = trim(extmsg)//' b_tw' if (any(prm%b_tw < 0.0_pReal)) extmsg = trim(extmsg)//' b_tw'
@ -332,15 +332,15 @@ module function plastic_dislotwin_init() result(myPlasticity)
prm%h_tr_tr = lattice_interaction_TransByTrans(N_tr,pl%get_asFloats('h_tr_tr'), & prm%h_tr_tr = lattice_interaction_TransByTrans(N_tr,pl%get_asFloats('h_tr_tr'), &
phase%get_asString('lattice')) phase%get_asString('lattice'))
prm%C66_tr = lattice_C66_trans(N_tr,prm%C66,pl%get_asString('trans_lattice_structure'), & prm%C66_tr = lattice_C66_trans(N_tr,prm%C66,pl%get_asString('lattice_tr'), &
0.0_pReal, & 0.0_pReal, &
pl%get_asFloat('a_bcc', defaultVal=0.0_pReal), & pl%get_asFloat('a_cI', defaultVal=0.0_pReal), &
pl%get_asFloat('a_fcc', defaultVal=0.0_pReal)) pl%get_asFloat('a_cF', defaultVal=0.0_pReal))
prm%P_tr = lattice_SchmidMatrix_trans(N_tr,pl%get_asString('trans_lattice_structure'), & prm%P_tr = lattice_SchmidMatrix_trans(N_tr,pl%get_asString('lattice_tr'), &
0.0_pReal, & 0.0_pReal, &
pl%get_asFloat('a_bcc', defaultVal=0.0_pReal), & pl%get_asFloat('a_cI', defaultVal=0.0_pReal), &
pl%get_asFloat('a_fcc', defaultVal=0.0_pReal)) pl%get_asFloat('a_cF', defaultVal=0.0_pReal))
if (lattice_structure(p) /= lattice_FCC_ID) then if (lattice_structure(p) /= lattice_FCC_ID) then
prm%dot_N_0_tr = pl%get_asFloats('dot_N_0_tr') prm%dot_N_0_tr = pl%get_asFloats('dot_N_0_tr')
@ -352,7 +352,7 @@ module function plastic_dislotwin_init() result(myPlasticity)
prm%s = math_expand(prm%s,N_tr) prm%s = math_expand(prm%s,N_tr)
! sanity checks ! sanity checks
if ( prm%x_c_tr < 0.0_pReal) extmsg = trim(extmsg)//' x_c_trans' if ( prm%x_c_tr < 0.0_pReal) extmsg = trim(extmsg)//' x_c_tr'
if ( prm%L_tr < 0.0_pReal) extmsg = trim(extmsg)//' L_tr' if ( prm%L_tr < 0.0_pReal) extmsg = trim(extmsg)//' L_tr'
if ( prm%i_tr < 0.0_pReal) extmsg = trim(extmsg)//' i_tr' if ( prm%i_tr < 0.0_pReal) extmsg = trim(extmsg)//' i_tr'
if (any(prm%t_tr < 0.0_pReal)) extmsg = trim(extmsg)//' t_tr' if (any(prm%t_tr < 0.0_pReal)) extmsg = trim(extmsg)//' t_tr'

View File

@ -125,7 +125,7 @@ module function plastic_kinehardening_init() result(myPlasticity)
prm%P = lattice_SchmidMatrix_slip(N_sl,phase%get_asString('lattice'),& prm%P = lattice_SchmidMatrix_slip(N_sl,phase%get_asString('lattice'),&
phase%get_asFloat('c/a',defaultVal=0.0_pReal)) phase%get_asFloat('c/a',defaultVal=0.0_pReal))
if(trim(phase%get_asString('lattice')) == 'bcc') then if(trim(phase%get_asString('lattice')) == 'cI') then
a = pl%get_asFloats('a_nonSchmid',defaultVal = emptyRealArray) a = pl%get_asFloats('a_nonSchmid',defaultVal = emptyRealArray)
if(size(a) > 0) prm%nonSchmidActive = .true. if(size(a) > 0) prm%nonSchmidActive = .true.
prm%nonSchmid_pos = lattice_nonSchmidMatrix(N_sl,a,+1) prm%nonSchmid_pos = lattice_nonSchmidMatrix(N_sl,a,+1)

View File

@ -244,7 +244,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
prm%Schmid = lattice_SchmidMatrix_slip(ini%N_sl,phase%get_asString('lattice'),& prm%Schmid = lattice_SchmidMatrix_slip(ini%N_sl,phase%get_asString('lattice'),&
phase%get_asFloat('c/a',defaultVal=0.0_pReal)) phase%get_asFloat('c/a',defaultVal=0.0_pReal))
if(trim(phase%get_asString('lattice')) == 'bcc') then if(trim(phase%get_asString('lattice')) == 'cI') then
a = pl%get_asFloats('a_nonSchmid',defaultVal = emptyRealArray) a = pl%get_asFloats('a_nonSchmid',defaultVal = emptyRealArray)
if(size(a) > 0) prm%nonSchmidActive = .true. if(size(a) > 0) prm%nonSchmidActive = .true.
prm%nonSchmid_pos = lattice_nonSchmidMatrix(ini%N_sl,a,+1) prm%nonSchmid_pos = lattice_nonSchmidMatrix(ini%N_sl,a,+1)
@ -362,7 +362,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
if (prm%nu_a <= 0.0_pReal) extmsg = trim(extmsg)//' nu_a' if (prm%nu_a <= 0.0_pReal) extmsg = trim(extmsg)//' nu_a'
if (prm%w <= 0.0_pReal) extmsg = trim(extmsg)//' w' if (prm%w <= 0.0_pReal) extmsg = trim(extmsg)//' w'
if (prm%D_0 < 0.0_pReal) extmsg = trim(extmsg)//' D_0' if (prm%D_0 < 0.0_pReal) extmsg = trim(extmsg)//' D_0'
if (prm%V_at <= 0.0_pReal) extmsg = trim(extmsg)//' V_at' ! ToDo: in disloTungsten, the atomic volume is given as a factor if (prm%V_at <= 0.0_pReal) extmsg = trim(extmsg)//' V_at' ! ToDo: in dislotungsten, the atomic volume is given as a factor
if (prm%rho_min < 0.0_pReal) extmsg = trim(extmsg)//' rho_min' if (prm%rho_min < 0.0_pReal) extmsg = trim(extmsg)//' rho_min'
if (prm%rho_significant < 0.0_pReal) extmsg = trim(extmsg)//' rho_significant' if (prm%rho_significant < 0.0_pReal) extmsg = trim(extmsg)//' rho_significant'

View File

@ -120,7 +120,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
prm%P_sl = lattice_SchmidMatrix_slip(N_sl,phase%get_asString('lattice'),& prm%P_sl = lattice_SchmidMatrix_slip(N_sl,phase%get_asString('lattice'),&
phase%get_asFloat('c/a',defaultVal=0.0_pReal)) phase%get_asFloat('c/a',defaultVal=0.0_pReal))
if(phase%get_asString('lattice') == 'bcc') then if(phase%get_asString('lattice') == 'cI') then
a = pl%get_asFloats('a_nonSchmid',defaultVal=emptyRealArray) a = pl%get_asFloats('a_nonSchmid',defaultVal=emptyRealArray)
if(size(a) > 0) prm%nonSchmidActive = .true. if(size(a) > 0) prm%nonSchmidActive = .true.
prm%nonSchmid_pos = lattice_nonSchmidMatrix(N_sl,a,+1) prm%nonSchmid_pos = lattice_nonSchmidMatrix(N_sl,a,+1)

View File

@ -780,17 +780,17 @@ subroutine crystallite_results
case('O') case('O')
select case(lattice_structure(p)) select case(lattice_structure(p))
case(lattice_ISO_ID) case(lattice_ISO_ID)
structureLabel = 'iso' structureLabel = 'aP'
case(lattice_FCC_ID) case(lattice_FCC_ID)
structureLabel = 'fcc' structureLabel = 'cF'
case(lattice_BCC_ID) case(lattice_BCC_ID)
structureLabel = 'bcc' structureLabel = 'cI'
case(lattice_BCT_ID) case(lattice_BCT_ID)
structureLabel = 'bct' structureLabel = 'tI'
case(lattice_HEX_ID) case(lattice_HEX_ID)
structureLabel = 'hex' structureLabel = 'hP'
case(lattice_ORT_ID) case(lattice_ORT_ID)
structureLabel = 'ort' structureLabel = 'oP'
end select end select
selected_rotations = select_rotations(crystallite_orientation,p) selected_rotations = select_rotations(crystallite_orientation,p)
call results_writeDataset(group,selected_rotations,output_constituent(p)%label(o),& call results_writeDataset(group,selected_rotations,output_constituent(p)%label(o),&

View File

@ -17,7 +17,7 @@ module lattice
private private
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! face centered cubic ! face centered cubic (cF)
integer, dimension(*), parameter :: & integer, dimension(*), parameter :: &
FCC_NSLIPSYSTEM = [12, 6] !< # of slip systems per family for fcc FCC_NSLIPSYSTEM = [12, 6] !< # of slip systems per family for fcc
@ -108,7 +108,7 @@ module lattice
],pReal),shape(FCC_SYSTEMCLEAVAGE)) ],pReal),shape(FCC_SYSTEMCLEAVAGE))
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! body centered cubic ! body centered cubic (cI)
integer, dimension(*), parameter :: & integer, dimension(*), parameter :: &
BCC_NSLIPSYSTEM = [12, 12] !< # of slip systems per family for bcc BCC_NSLIPSYSTEM = [12, 12] !< # of slip systems per family for bcc
@ -186,7 +186,7 @@ module lattice
],pReal),shape(BCC_SYSTEMCLEAVAGE)) ],pReal),shape(BCC_SYSTEMCLEAVAGE))
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! hexagonal ! hexagonal (hP)
integer, dimension(*), parameter :: & integer, dimension(*), parameter :: &
HEX_NSLIPSYSTEM = [3, 3, 3, 6, 12, 6] !< # of slip systems per family for hex HEX_NSLIPSYSTEM = [3, 3, 3, 6, 12, 6] !< # of slip systems per family for hex
@ -279,7 +279,7 @@ module lattice
],pReal),shape(HEX_SYSTEMTWIN)) !< twin systems for hex, sorted by P. Eisenlohr CCW around <c> starting next to a_1 axis ],pReal),shape(HEX_SYSTEMTWIN)) !< twin systems for hex, sorted by P. Eisenlohr CCW around <c> starting next to a_1 axis
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! body centered tetragonal ! body centered tetragonal (tI)
integer, dimension(*), parameter :: & integer, dimension(*), parameter :: &
BCT_NSLIPSYSTEM = [2, 2, 2, 4, 2, 4, 2, 2, 4, 8, 4, 8, 8 ] !< # of slip systems per family for bct (Sn) Bieler J. Electr Mater 2009 BCT_NSLIPSYSTEM = [2, 2, 2, 4, 2, 4, 2, 2, 4, 8, 4, 8, 8 ] !< # of slip systems per family for bct (Sn) Bieler J. Electr Mater 2009
@ -361,7 +361,7 @@ module lattice
],pReal),shape(BCT_SYSTEMSLIP)) !< slip systems for bct sorted by Bieler ],pReal),shape(BCT_SYSTEMSLIP)) !< slip systems for bct sorted by Bieler
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! orthorhombic ! orthorhombic primitive (oP)
integer, dimension(*), parameter :: & integer, dimension(*), parameter :: &
ORT_NCLEAVAGESYSTEM = [1, 1, 1] !< # of cleavage systems per family for ortho ORT_NCLEAVAGESYSTEM = [1, 1, 1] !< # of cleavage systems per family for ortho
@ -490,18 +490,18 @@ subroutine lattice_init
lattice_C66(6,6,p) = elasticity%get_asFloat('C_66',defaultVal=0.0_pReal) lattice_C66(6,6,p) = elasticity%get_asFloat('C_66',defaultVal=0.0_pReal)
select case(phase%get_asString('lattice')) select case(phase%get_asString('lattice'))
case('iso') case('cF')
lattice_structure(p) = lattice_ISO_ID
case('fcc')
lattice_structure(p) = lattice_FCC_ID lattice_structure(p) = lattice_FCC_ID
case('bcc') case('cI')
lattice_structure(p) = lattice_BCC_ID lattice_structure(p) = lattice_BCC_ID
case('hex') case('hP')
lattice_structure(p) = lattice_HEX_ID lattice_structure(p) = lattice_HEX_ID
case('bct') case('tI')
lattice_structure(p) = lattice_BCT_ID lattice_structure(p) = lattice_BCT_ID
case('ort') case('oP')
lattice_structure(p) = lattice_ORT_ID lattice_structure(p) = lattice_ORT_ID
case('aP')
lattice_structure(p) = lattice_ISO_ID
case default case default
call IO_error(130,ext_msg='lattice_init: '//phase%get_asString('lattice')) call IO_error(130,ext_msg='lattice_init: '//phase%get_asString('lattice'))
end select end select
@ -593,9 +593,9 @@ function lattice_characteristicShear_Twin(Ntwin,structure,CoverA) result(charact
mySystems: do s = 1,Ntwin(f) mySystems: do s = 1,Ntwin(f)
a = a + 1 a = a + 1
select case(structure) select case(structure)
case('fcc','bcc') case('cF','cI')
characteristicShear(a) = 0.5_pReal*sqrt(2.0_pReal) characteristicShear(a) = 0.5_pReal*sqrt(2.0_pReal)
case('hex') case('hP')
if (cOverA < 1.0_pReal .or. cOverA > 2.0_pReal) & if (cOverA < 1.0_pReal .or. cOverA > 2.0_pReal) &
call IO_error(131,ext_msg='lattice_characteristicShear_Twin') call IO_error(131,ext_msg='lattice_characteristicShear_Twin')
p = sum(HEX_NTWINSYSTEM(1:f-1))+s p = sum(HEX_NTWINSYSTEM(1:f-1))+s
@ -634,15 +634,15 @@ function lattice_C66_twin(Ntwin,C66,structure,CoverA)
integer :: i integer :: i
select case(structure) select case(structure)
case('fcc') case('cF')
coordinateSystem = buildCoordinateSystem(Ntwin,FCC_NSLIPSYSTEM,FCC_SYSTEMTWIN,& coordinateSystem = buildCoordinateSystem(Ntwin,FCC_NSLIPSYSTEM,FCC_SYSTEMTWIN,&
trim(structure),0.0_pReal) structure,0.0_pReal)
case('bcc') case('cI')
coordinateSystem = buildCoordinateSystem(Ntwin,BCC_NSLIPSYSTEM,BCC_SYSTEMTWIN,& coordinateSystem = buildCoordinateSystem(Ntwin,BCC_NSLIPSYSTEM,BCC_SYSTEMTWIN,&
trim(structure),0.0_pReal) structure,0.0_pReal)
case('hex') case('hP')
coordinateSystem = buildCoordinateSystem(Ntwin,HEX_NSLIPSYSTEM,HEX_SYSTEMTWIN,& coordinateSystem = buildCoordinateSystem(Ntwin,HEX_NSLIPSYSTEM,HEX_SYSTEMTWIN,&
'hex',cOverA) structure,cOverA)
case default case default
call IO_error(137,ext_msg='lattice_C66_twin: '//trim(structure)) call IO_error(137,ext_msg='lattice_C66_twin: '//trim(structure))
end select end select
@ -672,12 +672,9 @@ function lattice_C66_trans(Ntrans,C_parent66,structure_target, &
real(pReal) :: a_bcc, a_fcc, cOverA_trans real(pReal) :: a_bcc, a_fcc, cOverA_trans
integer :: i integer :: i
if (len_trim(structure_target) /= 3) &
call IO_error(137,ext_msg='lattice_C66_trans (target): '//trim(structure_target))
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! elasticity matrix of the target phase in cube orientation ! elasticity matrix of the target phase in cube orientation
if (structure_target(1:3) == 'hex') then if (structure_target == 'hP') then
if (cOverA_trans < 1.0_pReal .or. cOverA_trans > 2.0_pReal) & if (cOverA_trans < 1.0_pReal .or. cOverA_trans > 2.0_pReal) &
call IO_error(131,ext_msg='lattice_C66_trans: '//trim(structure_target)) call IO_error(131,ext_msg='lattice_C66_trans: '//trim(structure_target))
C_bar66(1,1) = (C_parent66(1,1) + C_parent66(1,2) + 2.0_pReal*C_parent66(4,4))/2.0_pReal C_bar66(1,1) = (C_parent66(1,1) + C_parent66(1,2) + 2.0_pReal*C_parent66(4,4))/2.0_pReal
@ -693,8 +690,8 @@ function lattice_C66_trans(Ntrans,C_parent66,structure_target, &
C_target_unrotated66(1,3) = C_bar66(1,3) C_target_unrotated66(1,3) = C_bar66(1,3)
C_target_unrotated66(3,3) = C_bar66(3,3) C_target_unrotated66(3,3) = C_bar66(3,3)
C_target_unrotated66(4,4) = C_bar66(4,4) - C_bar66(1,4)**2.0_pReal/(0.5_pReal*(C_bar66(1,1) - C_bar66(1,2))) C_target_unrotated66(4,4) = C_bar66(4,4) - C_bar66(1,4)**2.0_pReal/(0.5_pReal*(C_bar66(1,1) - C_bar66(1,2)))
C_target_unrotated66 = applyLatticeSymmetryC66(C_target_unrotated66,'hex') C_target_unrotated66 = applyLatticeSymmetryC66(C_target_unrotated66,'hP')
elseif (structure_target(1:3) == 'bcc') then elseif (structure_target == 'cI') then
if (a_bcc <= 0.0_pReal .or. a_fcc <= 0.0_pReal) & if (a_bcc <= 0.0_pReal .or. a_fcc <= 0.0_pReal) &
call IO_error(134,ext_msg='lattice_C66_trans: '//trim(structure_target)) call IO_error(134,ext_msg='lattice_C66_trans: '//trim(structure_target))
C_target_unrotated66 = C_parent66 C_target_unrotated66 = C_parent66
@ -737,9 +734,9 @@ function lattice_nonSchmidMatrix(Nslip,nonSchmidCoefficients,sense) result(nonSc
if (abs(sense) /= 1) error stop 'Sense in lattice_nonSchmidMatrix' if (abs(sense) /= 1) error stop 'Sense in lattice_nonSchmidMatrix'
coordinateSystem = buildCoordinateSystem(Nslip,BCC_NSLIPSYSTEM,BCC_SYSTEMSLIP,& coordinateSystem = buildCoordinateSystem(Nslip,BCC_NSLIPSYSTEM,BCC_SYSTEMSLIP,&
'bcc',0.0_pReal) 'cI',0.0_pReal)
coordinateSystem(1:3,1,1:sum(Nslip)) = coordinateSystem(1:3,1,1:sum(Nslip))*real(sense,pReal) ! convert unidirectional coordinate system coordinateSystem(1:3,1,1:sum(Nslip)) = coordinateSystem(1:3,1,1:sum(Nslip))*real(sense,pReal) ! convert unidirectional coordinate system
nonSchmidMatrix = lattice_SchmidMatrix_slip(Nslip,'bcc',0.0_pReal) ! Schmid contribution nonSchmidMatrix = lattice_SchmidMatrix_slip(Nslip,'cI',0.0_pReal) ! Schmid contribution
do i = 1,sum(Nslip) do i = 1,sum(Nslip)
direction = coordinateSystem(1:3,1,i) direction = coordinateSystem(1:3,1,i)
@ -961,16 +958,16 @@ function lattice_interaction_SlipBySlip(Nslip,interactionValues,structure) resul
select case(structure) select case(structure)
case('fcc') case('cF')
interactionTypes = FCC_INTERACTIONSLIPSLIP interactionTypes = FCC_INTERACTIONSLIPSLIP
NslipMax = FCC_NSLIPSYSTEM NslipMax = FCC_NSLIPSYSTEM
case('bcc') case('cI')
interactionTypes = BCC_INTERACTIONSLIPSLIP interactionTypes = BCC_INTERACTIONSLIPSLIP
NslipMax = BCC_NSLIPSYSTEM NslipMax = BCC_NSLIPSYSTEM
case('hex') case('hP')
interactionTypes = HEX_INTERACTIONSLIPSLIP interactionTypes = HEX_INTERACTIONSLIPSLIP
NslipMax = HEX_NSLIPSYSTEM NslipMax = HEX_NSLIPSYSTEM
case('bct') case('tI')
interactionTypes = BCT_INTERACTIONSLIPSLIP interactionTypes = BCT_INTERACTIONSLIPSLIP
NslipMax = BCT_NSLIPSYSTEM NslipMax = BCT_NSLIPSYSTEM
case default case default
@ -1062,13 +1059,13 @@ function lattice_interaction_TwinByTwin(Ntwin,interactionValues,structure) resul
],shape(HEX_INTERACTIONTWINTWIN)) !< Twin-twin interaction types for hex ],shape(HEX_INTERACTIONTWINTWIN)) !< Twin-twin interaction types for hex
select case(structure) select case(structure)
case('fcc') case('cF')
interactionTypes = FCC_INTERACTIONTWINTWIN interactionTypes = FCC_INTERACTIONTWINTWIN
NtwinMax = FCC_NTWINSYSTEM NtwinMax = FCC_NTWINSYSTEM
case('bcc') case('cI')
interactionTypes = BCC_INTERACTIONTWINTWIN interactionTypes = BCC_INTERACTIONTWINTWIN
NtwinMax = BCC_NTWINSYSTEM NtwinMax = BCC_NTWINSYSTEM
case('hex') case('hP')
interactionTypes = HEX_INTERACTIONTWINTWIN interactionTypes = HEX_INTERACTIONTWINTWIN
NtwinMax = HEX_NTWINSYSTEM NtwinMax = HEX_NTWINSYSTEM
case default case default
@ -1110,7 +1107,7 @@ function lattice_interaction_TransByTrans(Ntrans,interactionValues,structure) re
2,2,2,2,2,2,2,2,2,1,1,1 & 2,2,2,2,2,2,2,2,2,1,1,1 &
],shape(FCC_INTERACTIONTRANSTRANS)) !< Trans-trans interaction types for fcc ],shape(FCC_INTERACTIONTRANSTRANS)) !< Trans-trans interaction types for fcc
if(structure == 'fcc') then if(structure == 'cF') then
interactionTypes = FCC_INTERACTIONTRANSTRANS interactionTypes = FCC_INTERACTIONTRANSTRANS
NtransMax = FCC_NTRANSSYSTEM NtransMax = FCC_NTRANSSYSTEM
else else
@ -1238,15 +1235,15 @@ function lattice_interaction_SlipByTwin(Nslip,Ntwin,interactionValues,structure)
],shape(HEX_INTERACTIONSLIPTWIN)) !< Slip-twin interaction types for hex ],shape(HEX_INTERACTIONSLIPTWIN)) !< Slip-twin interaction types for hex
select case(structure) select case(structure)
case('fcc') case('cF')
interactionTypes = FCC_INTERACTIONSLIPTWIN interactionTypes = FCC_INTERACTIONSLIPTWIN
NslipMax = FCC_NSLIPSYSTEM NslipMax = FCC_NSLIPSYSTEM
NtwinMax = FCC_NTWINSYSTEM NtwinMax = FCC_NTWINSYSTEM
case('bcc') case('cI')
interactionTypes = BCC_INTERACTIONSLIPTWIN interactionTypes = BCC_INTERACTIONSLIPTWIN
NslipMax = BCC_NSLIPSYSTEM NslipMax = BCC_NSLIPSYSTEM
NtwinMax = BCC_NTWINSYSTEM NtwinMax = BCC_NTWINSYSTEM
case('hex') case('hP')
interactionTypes = HEX_INTERACTIONSLIPTWIN interactionTypes = HEX_INTERACTIONSLIPTWIN
NslipMax = HEX_NSLIPSYSTEM NslipMax = HEX_NSLIPSYSTEM
NtwinMax = HEX_NTWINSYSTEM NtwinMax = HEX_NTWINSYSTEM
@ -1299,7 +1296,7 @@ function lattice_interaction_SlipByTrans(Nslip,Ntrans,interactionValues,structur
],shape(FCC_INTERACTIONSLIPTRANS)) !< Slip-trans interaction types for fcc ],shape(FCC_INTERACTIONSLIPTRANS)) !< Slip-trans interaction types for fcc
select case(structure) select case(structure)
case('fcc') case('cF')
interactionTypes = FCC_INTERACTIONSLIPTRANS interactionTypes = FCC_INTERACTIONSLIPTRANS
NslipMax = FCC_NSLIPSYSTEM NslipMax = FCC_NSLIPSYSTEM
NtransMax = FCC_NTRANSSYSTEM NtransMax = FCC_NTRANSSYSTEM
@ -1366,15 +1363,15 @@ function lattice_interaction_TwinBySlip(Ntwin,Nslip,interactionValues,structure)
],shape(HEX_INTERACTIONTWINSLIP)) !< Twin-slip interaction types for hex ],shape(HEX_INTERACTIONTWINSLIP)) !< Twin-slip interaction types for hex
select case(structure) select case(structure)
case('fcc') case('cF')
interactionTypes = FCC_INTERACTIONTWINSLIP interactionTypes = FCC_INTERACTIONTWINSLIP
NtwinMax = FCC_NTWINSYSTEM NtwinMax = FCC_NTWINSYSTEM
NslipMax = FCC_NSLIPSYSTEM NslipMax = FCC_NSLIPSYSTEM
case('bcc') case('cI')
interactionTypes = BCC_INTERACTIONTWINSLIP interactionTypes = BCC_INTERACTIONTWINSLIP
NtwinMax = BCC_NTWINSYSTEM NtwinMax = BCC_NTWINSYSTEM
NslipMax = BCC_NSLIPSYSTEM NslipMax = BCC_NSLIPSYSTEM
case('hex') case('hP')
interactionTypes = HEX_INTERACTIONTWINSLIP interactionTypes = HEX_INTERACTIONTWINSLIP
NtwinMax = HEX_NTWINSYSTEM NtwinMax = HEX_NTWINSYSTEM
NslipMax = HEX_NSLIPSYSTEM NslipMax = HEX_NSLIPSYSTEM
@ -1404,16 +1401,16 @@ function lattice_SchmidMatrix_slip(Nslip,structure,cOverA) result(SchmidMatrix)
integer :: i integer :: i
select case(structure) select case(structure)
case('fcc') case('cF')
NslipMax = FCC_NSLIPSYSTEM NslipMax = FCC_NSLIPSYSTEM
slipSystems = FCC_SYSTEMSLIP slipSystems = FCC_SYSTEMSLIP
case('bcc') case('cI')
NslipMax = BCC_NSLIPSYSTEM NslipMax = BCC_NSLIPSYSTEM
slipSystems = BCC_SYSTEMSLIP slipSystems = BCC_SYSTEMSLIP
case('hex') case('hP')
NslipMax = HEX_NSLIPSYSTEM NslipMax = HEX_NSLIPSYSTEM
slipSystems = HEX_SYSTEMSLIP slipSystems = HEX_SYSTEMSLIP
case('bct') case('tI')
NslipMax = BCT_NSLIPSYSTEM NslipMax = BCT_NSLIPSYSTEM
slipSystems = BCT_SYSTEMSLIP slipSystems = BCT_SYSTEMSLIP
case default case default
@ -1454,13 +1451,13 @@ function lattice_SchmidMatrix_twin(Ntwin,structure,cOverA) result(SchmidMatrix)
integer :: i integer :: i
select case(structure) select case(structure)
case('fcc') case('cF')
NtwinMax = FCC_NTWINSYSTEM NtwinMax = FCC_NTWINSYSTEM
twinSystems = FCC_SYSTEMTWIN twinSystems = FCC_SYSTEMTWIN
case('bcc') case('cI')
NtwinMax = BCC_NTWINSYSTEM NtwinMax = BCC_NTWINSYSTEM
twinSystems = BCC_SYSTEMTWIN twinSystems = BCC_SYSTEMTWIN
case('hex') case('hP')
NtwinMax = HEX_NTWINSYSTEM NtwinMax = HEX_NTWINSYSTEM
twinSystems = HEX_SYSTEMTWIN twinSystems = HEX_SYSTEMTWIN
case default case default
@ -1498,15 +1495,13 @@ function lattice_SchmidMatrix_trans(Ntrans,structure_target,cOverA,a_bcc,a_fcc)
real(pReal), dimension(3,3,sum(Ntrans)) :: devNull real(pReal), dimension(3,3,sum(Ntrans)) :: devNull
real(pReal) :: a_bcc, a_fcc real(pReal) :: a_bcc, a_fcc
if (len_trim(structure_target) /= 3) & if (structure_target /= 'cI' .and. structure_target /= 'hP') &
call IO_error(137,ext_msg='lattice_SchmidMatrix_trans: '//trim(structure_target))
if (structure_target(1:3) /= 'bcc' .and. structure_target(1:3) /= 'hex') &
call IO_error(137,ext_msg='lattice_SchmidMatrix_trans: '//trim(structure_target)) call IO_error(137,ext_msg='lattice_SchmidMatrix_trans: '//trim(structure_target))
if (structure_target(1:3) == 'hex' .and. (cOverA < 1.0_pReal .or. cOverA > 2.0_pReal)) & if (structure_target == 'hP' .and. (cOverA < 1.0_pReal .or. cOverA > 2.0_pReal)) &
call IO_error(131,ext_msg='lattice_SchmidMatrix_trans: '//trim(structure_target)) call IO_error(131,ext_msg='lattice_SchmidMatrix_trans: '//trim(structure_target))
if (structure_target(1:3) == 'bcc' .and. (a_bcc <= 0.0_pReal .or. a_fcc <= 0.0_pReal)) & if (structure_target == 'cI' .and. (a_bcc <= 0.0_pReal .or. a_fcc <= 0.0_pReal)) &
call IO_error(134,ext_msg='lattice_SchmidMatrix_trans: '//trim(structure_target)) call IO_error(134,ext_msg='lattice_SchmidMatrix_trans: '//trim(structure_target))
call buildTransformationSystem(devNull,SchmidMatrix,Ntrans,cOverA,a_fcc,a_bcc) call buildTransformationSystem(devNull,SchmidMatrix,Ntrans,cOverA,a_fcc,a_bcc)
@ -1531,13 +1526,13 @@ function lattice_SchmidMatrix_cleavage(Ncleavage,structure,cOverA) result(Schmid
integer :: i integer :: i
select case(structure) select case(structure)
case('ort') case('oP')
NcleavageMax = ORT_NCLEAVAGESYSTEM NcleavageMax = ORT_NCLEAVAGESYSTEM
cleavageSystems = ORT_SYSTEMCLEAVAGE cleavageSystems = ORT_SYSTEMCLEAVAGE
case('fcc') case('cF')
NcleavageMax = FCC_NCLEAVAGESYSTEM NcleavageMax = FCC_NCLEAVAGESYSTEM
cleavageSystems = FCC_SYSTEMCLEAVAGE cleavageSystems = FCC_SYSTEMCLEAVAGE
case('bcc') case('cI')
NcleavageMax = BCC_NCLEAVAGESYSTEM NcleavageMax = BCC_NCLEAVAGESYSTEM
cleavageSystems = BCC_SYSTEMCLEAVAGE cleavageSystems = BCC_SYSTEMCLEAVAGE
case default case default
@ -1630,16 +1625,16 @@ function lattice_labels_slip(Nslip,structure) result(labels)
integer, dimension(:), allocatable :: NslipMax integer, dimension(:), allocatable :: NslipMax
select case(structure) select case(structure)
case('fcc') case('cF')
NslipMax = FCC_NSLIPSYSTEM NslipMax = FCC_NSLIPSYSTEM
slipSystems = FCC_SYSTEMSLIP slipSystems = FCC_SYSTEMSLIP
case('bcc') case('cI')
NslipMax = BCC_NSLIPSYSTEM NslipMax = BCC_NSLIPSYSTEM
slipSystems = BCC_SYSTEMSLIP slipSystems = BCC_SYSTEMSLIP
case('hex') case('hP')
NslipMax = HEX_NSLIPSYSTEM NslipMax = HEX_NSLIPSYSTEM
slipSystems = HEX_SYSTEMSLIP slipSystems = HEX_SYSTEMSLIP
case('bct') case('tI')
NslipMax = BCT_NSLIPSYSTEM NslipMax = BCT_NSLIPSYSTEM
slipSystems = BCT_SYSTEMSLIP slipSystems = BCT_SYSTEMSLIP
case default case default
@ -1671,15 +1666,15 @@ function lattice_applyLatticeSymmetry33(T,structure) result(T_sym)
T_sym = 0.0_pReal T_sym = 0.0_pReal
select case(structure) select case(structure)
case('iso','fcc','bcc') case('aP','cF','cI')
do k=1,3 do k=1,3
T_sym(k,k) = T(1,1) T_sym(k,k) = T(1,1)
enddo enddo
case('hex') case('hP')
T_sym(1,1) = T(1,1) T_sym(1,1) = T(1,1)
T_sym(2,2) = T(1,1) T_sym(2,2) = T(1,1)
T_sym(3,3) = T(3,3) T_sym(3,3) = T(3,3)
case('ort','bct') case('oP','tI')
T_sym(1,1) = T(1,1) T_sym(1,1) = T(1,1)
T_sym(2,2) = T(2,2) T_sym(2,2) = T(2,2)
T_sym(3,3) = T(3,3) T_sym(3,3) = T(3,3)
@ -1706,7 +1701,7 @@ function applyLatticeSymmetryC66(C66,structure) result(C66_sym)
C66_sym = 0.0_pReal C66_sym = 0.0_pReal
select case(structure) select case(structure)
case ('iso') case ('aP')
do k=1,3 do k=1,3
do j=1,3 do j=1,3
C66_sym(k,j) = C66(1,2) C66_sym(k,j) = C66(1,2)
@ -1714,7 +1709,7 @@ function applyLatticeSymmetryC66(C66,structure) result(C66_sym)
C66_sym(k,k) = C66(1,1) C66_sym(k,k) = C66(1,1)
C66_sym(k+3,k+3) = 0.5_pReal*(C66(1,1)-C66(1,2)) C66_sym(k+3,k+3) = 0.5_pReal*(C66(1,1)-C66(1,2))
enddo enddo
case ('fcc','bcc') case ('cF','cI')
do k=1,3 do k=1,3
do j=1,3 do j=1,3
C66_sym(k,j) = C66(1,2) C66_sym(k,j) = C66(1,2)
@ -1722,7 +1717,7 @@ function applyLatticeSymmetryC66(C66,structure) result(C66_sym)
C66_sym(k,k) = C66(1,1) C66_sym(k,k) = C66(1,1)
C66_sym(k+3,k+3) = C66(4,4) C66_sym(k+3,k+3) = C66(4,4)
enddo enddo
case ('hex') case ('hP')
C66_sym(1,1) = C66(1,1) C66_sym(1,1) = C66(1,1)
C66_sym(2,2) = C66(1,1) C66_sym(2,2) = C66(1,1)
C66_sym(3,3) = C66(3,3) C66_sym(3,3) = C66(3,3)
@ -1735,7 +1730,7 @@ function applyLatticeSymmetryC66(C66,structure) result(C66_sym)
C66_sym(4,4) = C66(4,4) C66_sym(4,4) = C66(4,4)
C66_sym(5,5) = C66(4,4) C66_sym(5,5) = C66(4,4)
C66_sym(6,6) = 0.5_pReal*(C66(1,1)-C66(1,2)) C66_sym(6,6) = 0.5_pReal*(C66(1,1)-C66(1,2))
case ('ort') case ('oP')
C66_sym(1,1) = C66(1,1) C66_sym(1,1) = C66(1,1)
C66_sym(2,2) = C66(2,2) C66_sym(2,2) = C66(2,2)
C66_sym(3,3) = C66(3,3) C66_sym(3,3) = C66(3,3)
@ -1748,7 +1743,7 @@ function applyLatticeSymmetryC66(C66,structure) result(C66_sym)
C66_sym(4,4) = C66(4,4) C66_sym(4,4) = C66(4,4)
C66_sym(5,5) = C66(5,5) C66_sym(5,5) = C66(5,5)
C66_sym(6,6) = C66(6,6) C66_sym(6,6) = C66(6,6)
case ('bct') case ('tI')
C66_sym(1,1) = C66(1,1) C66_sym(1,1) = C66(1,1)
C66_sym(2,2) = C66(1,1) C66_sym(2,2) = C66(1,1)
C66_sym(3,3) = C66(3,3) C66_sym(3,3) = C66(3,3)
@ -1783,13 +1778,13 @@ function lattice_labels_twin(Ntwin,structure) result(labels)
integer, dimension(:), allocatable :: NtwinMax integer, dimension(:), allocatable :: NtwinMax
select case(structure) select case(structure)
case('fcc') case('cF')
NtwinMax = FCC_NTWINSYSTEM NtwinMax = FCC_NTWINSYSTEM
twinSystems = FCC_SYSTEMTWIN twinSystems = FCC_SYSTEMTWIN
case('bcc') case('cI')
NtwinMax = BCC_NTWINSYSTEM NtwinMax = BCC_NTWINSYSTEM
twinSystems = BCC_SYSTEMTWIN twinSystems = BCC_SYSTEMTWIN
case('hex') case('hP')
NtwinMax = HEX_NTWINSYSTEM NtwinMax = HEX_NTWINSYSTEM
twinSystems = HEX_SYSTEMTWIN twinSystems = HEX_SYSTEMTWIN
case default case default
@ -1869,16 +1864,16 @@ function coordinateSystem_slip(Nslip,structure,cOverA) result(coordinateSystem)
integer, dimension(:), allocatable :: NslipMax integer, dimension(:), allocatable :: NslipMax
select case(structure) select case(structure)
case('fcc') case('cF')
NslipMax = FCC_NSLIPSYSTEM NslipMax = FCC_NSLIPSYSTEM
slipSystems = FCC_SYSTEMSLIP slipSystems = FCC_SYSTEMSLIP
case('bcc') case('cI')
NslipMax = BCC_NSLIPSYSTEM NslipMax = BCC_NSLIPSYSTEM
slipSystems = BCC_SYSTEMSLIP slipSystems = BCC_SYSTEMSLIP
case('hex') case('hP')
NslipMax = HEX_NSLIPSYSTEM NslipMax = HEX_NSLIPSYSTEM
slipSystems = HEX_SYSTEMSLIP slipSystems = HEX_SYSTEMSLIP
case('bct') case('tI')
NslipMax = BCT_NSLIPSYSTEM NslipMax = BCT_NSLIPSYSTEM
slipSystems = BCT_SYSTEMSLIP slipSystems = BCT_SYSTEMSLIP
case default case default
@ -1965,11 +1960,9 @@ function buildCoordinateSystem(active,potential,system,structure,cOverA)
f, & !< index of my family f, & !< index of my family
s !< index of my system in current family s !< index of my system in current family
if (len_trim(structure) /= 3) & if (structure == 'tI' .and. cOverA > 2.0_pReal) &
call IO_error(137,ext_msg='buildCoordinateSystem: '//trim(structure))
if (trim(structure) == 'bct' .and. cOverA > 2.0_pReal) &
call IO_error(131,ext_msg='buildCoordinateSystem:'//trim(structure)) call IO_error(131,ext_msg='buildCoordinateSystem:'//trim(structure))
if (trim(structure) == 'hex' .and. (cOverA < 1.0_pReal .or. cOverA > 2.0_pReal)) & if (structure == 'hP' .and. (cOverA < 1.0_pReal .or. cOverA > 2.0_pReal)) &
call IO_error(131,ext_msg='buildCoordinateSystem:'//trim(structure)) call IO_error(131,ext_msg='buildCoordinateSystem:'//trim(structure))
a = 0 a = 0
@ -1978,13 +1971,13 @@ function buildCoordinateSystem(active,potential,system,structure,cOverA)
a = a + 1 a = a + 1
p = sum(potential(1:f-1))+s p = sum(potential(1:f-1))+s
select case(trim(structure)) select case(structure)
case ('fcc','bcc','iso','ort','bct') case ('cF','cI','aP','oP','tI')
direction = system(1:3,p) direction = system(1:3,p)
normal = system(4:6,p) normal = system(4:6,p)
case ('hex') case ('hP')
direction = [ system(1,p)*1.5_pReal, & direction = [ system(1,p)*1.5_pReal, &
(system(1,p)+2.0_pReal*system(2,p))*sqrt(0.75_pReal), & (system(1,p)+2.0_pReal*system(2,p))*sqrt(0.75_pReal), &
system(4,p)*cOverA ] ! direction [uvtw]->[3u/2 (u+2v)*sqrt(3)/2 w*(p/a)]) system(4,p)*cOverA ] ! direction [uvtw]->[3u/2 (u+2v)*sqrt(3)/2 w*(p/a)])
@ -2267,12 +2260,12 @@ subroutine selfTest
call random_number(r) call random_number(r)
system = reshape([1.0_pReal+r(1),0.0_pReal,0.0_pReal, 0.0_pReal,1.0_pReal+r(2),0.0_pReal],[6,1]) system = reshape([1.0_pReal+r(1),0.0_pReal,0.0_pReal, 0.0_pReal,1.0_pReal+r(2),0.0_pReal],[6,1])
CoSy = buildCoordinateSystem([1],[1],system,'fcc',0.0_pReal) CoSy = buildCoordinateSystem([1],[1],system,'cF',0.0_pReal)
if(any(dNeq(CoSy(1:3,1:3,1),math_I3))) error stop 'buildCoordinateSystem' if(any(dNeq(CoSy(1:3,1:3,1),math_I3))) error stop 'buildCoordinateSystem'
call random_number(C) call random_number(C)
C(1,1) = C(1,1) + 1.0_pReal C(1,1) = C(1,1) + 1.0_pReal
C = applyLatticeSymmetryC66(C,'iso') C = applyLatticeSymmetryC66(C,'aP')
if(dNeq(C(6,6),equivalent_mu(C,'voigt'),1.0e-12_pReal)) error stop 'equivalent_mu/voigt' if(dNeq(C(6,6),equivalent_mu(C,'voigt'),1.0e-12_pReal)) error stop 'equivalent_mu/voigt'
if(dNeq(C(6,6),equivalent_mu(C,'voigt'),1.0e-12_pReal)) error stop 'equivalent_mu/reuss' if(dNeq(C(6,6),equivalent_mu(C,'voigt'),1.0e-12_pReal)) error stop 'equivalent_mu/reuss'

View File

@ -74,10 +74,10 @@ subroutine results_init(restart)
if(.not. restart) then if(.not. restart) then
resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','w',.true.) resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','w',.true.)
call results_addAttribute('DADF5_version_major',0) call results_addAttribute('DADF5_version_major',0)
call results_addAttribute('DADF5_version_minor',8) call results_addAttribute('DADF5_version_minor',9)
call results_addAttribute('DAMASK_version',DAMASKVERSION) call results_addAttribute('DAMASK_version',DAMASKVERSION)
call get_command(commandLine) call get_command(commandLine)
call results_addAttribute('call',trim(commandLine)) call results_addAttribute('Call',trim(commandLine))
call results_closeGroup(results_addGroup('mapping')) call results_closeGroup(results_addGroup('mapping'))
call results_closeJobFile call results_closeJobFile
endif endif