From 28380c098581e87c0b5e67603dd1957d6dfed08e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 6 Oct 2020 23:25:46 +0200 Subject: [PATCH 1/5] N_constituents is a general homogenization poperty --- PRIVATE | 2 +- src/homogenization_mech_isostrain.f90 | 2 +- src/material.f90 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PRIVATE b/PRIVATE index 64e62f805..ae5882a2f 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 64e62f805b5ad784e3397ee5f735aaeb3cc134c2 +Subproject commit ae5882a2ffd932807d7589bc375ebff01836495f diff --git a/src/homogenization_mech_isostrain.f90 b/src/homogenization_mech_isostrain.f90 index 6883f1c37..5eec454f1 100644 --- a/src/homogenization_mech_isostrain.f90 +++ b/src/homogenization_mech_isostrain.f90 @@ -51,7 +51,7 @@ module subroutine mech_isostrain_init homogMech => homog%get('mech') associate(prm => param(homogenization_typeInstance(h))) - prm%N_constituents = homogMech%get_asInt('N_constituents') + prm%N_constituents = homog%get_asInt('N_constituents') select case(homogMech%get_asString('mapping',defaultVal = 'sum')) case ('sum') prm%mapping = parallel_ID diff --git a/src/material.f90 b/src/material.f90 index 742a29b9d..bab2f7499 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -262,10 +262,10 @@ subroutine material_parseHomogenization homogenization_Ngrains(h) = 1 case('isostrain') homogenization_type(h) = HOMOGENIZATION_ISOSTRAIN_ID - homogenization_Ngrains(h) = homogMech%get_asInt('N_constituents') + homogenization_Ngrains(h) = homog%get_asInt('N_constituents') case('RGC') homogenization_type(h) = HOMOGENIZATION_RGC_ID - homogenization_Ngrains(h) = homogMech%get_asInt('N_constituents') + homogenization_Ngrains(h) = homog%get_asInt('N_constituents') case default call IO_error(500,ext_msg=homogMech%get_asString('type')) end select From 9550b0d8a29ac8e01eccc2711b54ef326a77fd32 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 7 Oct 2020 17:44:54 +0200 Subject: [PATCH 2/5] mandatory N_constituents --- PRIVATE | 2 +- examples/FEM/polyXtal/material.yaml | 1 + examples/SpectralMethod/Polycrystal/material.yaml | 1 + src/IO.f90 | 4 +--- src/homogenization_mech_RGC.f90 | 2 +- src/homogenization_mech_isostrain.f90 | 2 +- src/homogenization_mech_none.f90 | 5 ++++- src/material.f90 | 4 +--- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/PRIVATE b/PRIVATE index ae5882a2f..4c9a47e76 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit ae5882a2ffd932807d7589bc375ebff01836495f +Subproject commit 4c9a47e76ca23cbae70d47b2ab07d1ec15e158d7 diff --git a/examples/FEM/polyXtal/material.yaml b/examples/FEM/polyXtal/material.yaml index 3d4b0addf..5c00f17ad 100644 --- a/examples/FEM/polyXtal/material.yaml +++ b/examples/FEM/polyXtal/material.yaml @@ -1,5 +1,6 @@ homogenization: SX: + N_constituents: 1 mech: {type: none} phase: diff --git a/examples/SpectralMethod/Polycrystal/material.yaml b/examples/SpectralMethod/Polycrystal/material.yaml index 394d16ed8..cdc210152 100644 --- a/examples/SpectralMethod/Polycrystal/material.yaml +++ b/examples/SpectralMethod/Polycrystal/material.yaml @@ -1,5 +1,6 @@ homogenization: SX: + N_constituents: 1 mech: {type: none} material: diff --git a/src/IO.f90 b/src/IO.f90 index 4a442cb06..a95938a7f 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -371,8 +371,6 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg) msg = 'write error for file:' case (102) msg = 'could not read file:' - case (103) - msg = 'could not assemble input files' case (106) msg = 'working directory does not exist:' @@ -411,7 +409,7 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg) msg = 'not enough interaction parameters given' !-------------------------------------------------------------------------------------------------- -! errors related to the parsing of material.config +! errors related to the parsing of material.yaml case (140) msg = 'key not found' case (141) diff --git a/src/homogenization_mech_RGC.f90 b/src/homogenization_mech_RGC.f90 index 6c015eea8..b429e949f 100644 --- a/src/homogenization_mech_RGC.f90 +++ b/src/homogenization_mech_RGC.f90 @@ -165,7 +165,7 @@ module subroutine mech_RGC_init(num_homogMech) prm%N_constituents = homogMech%get_asInts('cluster_size',requiredSize=3) if (homogenization_Ngrains(h) /= product(prm%N_constituents)) & - call IO_error(211,ext_msg='clustersize (mech_rgc)') + call IO_error(211,ext_msg='N_constituents (mech_RGC)') prm%xi_alpha = homogMech%get_asFloat('xi_alpha') prm%c_alpha = homogMech%get_asFloat('c_alpha') diff --git a/src/homogenization_mech_isostrain.f90 b/src/homogenization_mech_isostrain.f90 index 5eec454f1..f064578c8 100644 --- a/src/homogenization_mech_isostrain.f90 +++ b/src/homogenization_mech_isostrain.f90 @@ -51,7 +51,7 @@ module subroutine mech_isostrain_init homogMech => homog%get('mech') associate(prm => param(homogenization_typeInstance(h))) - prm%N_constituents = homog%get_asInt('N_constituents') + prm%N_constituents = homogenization_Ngrains(h) select case(homogMech%get_asString('mapping',defaultVal = 'sum')) case ('sum') prm%mapping = parallel_ID diff --git a/src/homogenization_mech_none.f90 b/src/homogenization_mech_none.f90 index 3cbec5911..a58147c45 100644 --- a/src/homogenization_mech_none.f90 +++ b/src/homogenization_mech_none.f90 @@ -24,8 +24,11 @@ module subroutine mech_none_init print'(a,i2)', ' # instances: ',Ninstance; flush(IO_STDOUT) do h = 1, size(homogenization_type) - if (homogenization_type(h) /= HOMOGENIZATION_NONE_ID) cycle + if(homogenization_type(h) /= HOMOGENIZATION_NONE_ID) cycle + if(homogenization_Ngrains(h) /= 1) & + call IO_error(211,ext_msg='N_constituents (mech_none)') + NofMyHomog = count(material_homogenizationAt == h) homogState(h)%sizeState = 0 allocate(homogState(h)%state0 (0,NofMyHomog)) diff --git a/src/material.f90 b/src/material.f90 index bab2f7499..11dfeb42e 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -256,16 +256,14 @@ subroutine material_parseHomogenization do h=1, material_Nhomogenization homog => material_homogenization%get(h) homogMech => homog%get('mech') + homogenization_Ngrains(h) = homog%get_asInt('N_constituents') select case (homogMech%get_asString('type')) case('none') homogenization_type(h) = HOMOGENIZATION_NONE_ID - homogenization_Ngrains(h) = 1 case('isostrain') homogenization_type(h) = HOMOGENIZATION_ISOSTRAIN_ID - homogenization_Ngrains(h) = homog%get_asInt('N_constituents') case('RGC') homogenization_type(h) = HOMOGENIZATION_RGC_ID - homogenization_Ngrains(h) = homog%get_asInt('N_constituents') case default call IO_error(500,ext_msg=homogMech%get_asString('type')) end select From 2b18161909f6d7864838ec6ffc7b0e839a46bd40 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 7 Oct 2020 19:44:17 +0200 Subject: [PATCH 3/5] bugfix in PRIVATE: N_constituents was missing --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 4c9a47e76..c92f6d3e2 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 4c9a47e76ca23cbae70d47b2ab07d1ec15e158d7 +Subproject commit c92f6d3e23a4c310898b502f00e395dbe670a63c From 5267aff1a2546aa2f540851d0435002bc39c8955 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 12 Oct 2020 05:29:48 +0200 Subject: [PATCH 4/5] natural Fortran order --- src/rotations.f90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rotations.f90 b/src/rotations.f90 index 0b72c1dd5..ea4a8a9d8 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -737,13 +737,13 @@ pure function eu2om(eu) result(om) s = sin(eu) om(1,1) = c(1)*c(3)-s(1)*s(3)*c(2) - om(1,2) = s(1)*c(3)+c(1)*s(3)*c(2) - om(1,3) = s(3)*s(2) om(2,1) = -c(1)*s(3)-s(1)*c(3)*c(2) - om(2,2) = -s(1)*s(3)+c(1)*c(3)*c(2) - om(2,3) = c(3)*s(2) om(3,1) = s(1)*s(2) + om(1,2) = s(1)*c(3)+c(1)*s(3)*c(2) + om(2,2) = -s(1)*s(3)+c(1)*c(3)*c(2) om(3,2) = -c(1)*s(2) + om(1,3) = s(3)*s(2) + om(2,3) = c(3)*s(2) om(3,3) = c(2) where(abs(om)<1.0e-12_pReal) om = 0.0_pReal From 19dba92235710ce589f5134bf0dd151664f0f525 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 12 Oct 2020 05:33:32 +0200 Subject: [PATCH 5/5] material.config -> material.yaml --- .../Phase_Phenopowerlaw_BCC-Ferrite.config | 21 ------------------- .../Phase_Phenopowerlaw_BCC-Ferrite.yaml | 16 ++++++++++++++ .../Phase_Phenopowerlaw_BCC-Martensite.config | 21 ------------------- .../Phase_Phenopowerlaw_BCC-Martensite.yaml | 16 ++++++++++++++ 4 files changed, 32 insertions(+), 42 deletions(-) delete mode 100644 examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config create mode 100644 examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.yaml delete mode 100644 examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config create mode 100644 examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.yaml diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config deleted file mode 100644 index 5af1eee11..000000000 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config +++ /dev/null @@ -1,21 +0,0 @@ -# Tasan et.al. 2015 Acta Materalia -# Tasan et.al. 2015 International Journal of Plasticity -# Diehl et.al. 2015 Meccanica -[BCC-Ferrite] - -elasticity hooke -plasticity phenopowerlaw - -lattice_structure bcc -Nslip 12 12 # per family -Ntwin 0 # per family -c11 233.3e9 -c12 135.5e9 -c44 118.0e9 -gdot0_slip 0.001 -n_slip 20 -tau0_slip 95.e6 97.e6 # per family, optimization long simplex 109 -tausat_slip 222.e6 412.7e6 # per family, optimization long simplex 109 -h0_slipslip 1000.0e6 -interaction_slipslip 1 1 1.4 1.4 1.4 1.4 -a_slip 2.0 diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.yaml b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.yaml new file mode 100644 index 000000000..4940ca8bd --- /dev/null +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.yaml @@ -0,0 +1,16 @@ +# Tasan et.al. 2015 Acta Materalia +# Tasan et.al. 2015 International Journal of Plasticity +# Diehl et.al. 2015 Meccanica +Ferrite: + elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke} + lattice: bcc + plasticity: + N_sl: [12, 12] + a_sl: 2.0 + dot_gamma_0_sl: 0.001 + h_0_sl_sl: 1000.0e6 + h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4] + n_sl: 20 + type: phenopowerlaw + xi_0_sl: [95.e6, 96.e6] + xi_inf_sl: [222.e6, 412.7e6] diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config deleted file mode 100644 index a04f27e7f..000000000 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config +++ /dev/null @@ -1,21 +0,0 @@ -# Tasan et.al. 2015 Acta Materalia -# Tasan et.al. 2015 International Journal of Plasticity -# Diehl et.al. 2015 Meccanica -[BCC-Martensite] - -elasticity hooke -plasticity phenopowerlaw - -lattice_structure bcc -Nslip 12 12 # per family -Ntwin 0 # per family -c11 417.4e9 -c12 242.4e9 -c44 211.1e9 -gdot0_slip 0.001 -n_slip 20 -tau0_slip 405.8e6 456.7e6 # per family -tausat_slip 872.9e6 971.2e6 # per family -h0_slipslip 563.0e9 -interaction_slipslip 1 1 1.4 1.4 1.4 1.4 -a_slip 2.0 diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.yaml b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.yaml new file mode 100644 index 000000000..b207d7b34 --- /dev/null +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.yaml @@ -0,0 +1,16 @@ +# Tasan et.al. 2015 Acta Materalia +# Tasan et.al. 2015 International Journal of Plasticity +# Diehl et.al. 2015 Meccanica +Martensite: + elasticity: {C_11: 417.4e9, C_12: 242.4e9, C_44: 211.1e9, type: hooke} + lattice: bcc + plasticity: + N_sl: [12, 12] + a_sl: 2.0 + dot_gamma_0_sl: 0.001 + h_0_sl_sl: 563.0e9 + h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4] + n_sl: 20 + type: phenopowerlaw + xi_0_sl: [405.8e6, 456.7e6] + xi_inf_sl: [872.9e6, 971.2e6]