From 28414490c818eb696ee5a3d234c9fb587c13ebfc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 11 Jul 2018 05:12:49 +0200 Subject: [PATCH 01/10] following https://packaging.python.org/tutorials/packaging-projects --- lib/damask/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index 379b23547..9809ce5b2 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -6,6 +6,8 @@ import os with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f: version = f.readline()[:-1] +name = 'damask' + from .environment import Environment # noqa from .asciitable import ASCIItable # noqa From bc5fcf2c1426e63e4d24b7c08f387de72479ec95 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 16 Jul 2018 10:51:42 +0200 Subject: [PATCH 02/10] leftover variable from cleaning --- src/debug.f90 | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/debug.f90 b/src/debug.f90 index ea2b659a1..55cc62ca0 100644 --- a/src/debug.f90 +++ b/src/debug.f90 @@ -283,11 +283,8 @@ end subroutine debug_reset subroutine debug_info implicit none - character(len=1) :: exceed - !$OMP CRITICAL (write2out) - debugOutputCPFEM: if (iand(debug_level(debug_CPFEM),debug_LEVELBASIC) /= 0 & .and. any(debug_stressMinLocation /= 0_pInt) & .and. any(debug_stressMaxLocation /= 0_pInt) ) then From 7f05bf9c0a49d22de2a1f2cafa7a5ccbf905f291 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 16 Jul 2018 11:54:46 +0200 Subject: [PATCH 03/10] leftover variables not needed anymore --- PRIVATE | 2 +- src/crystallite.f90 | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/PRIVATE b/PRIVATE index d1d465808..4d3d6d517 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit d1d46580823d2896059b9514ddc975f9fe5f6b1f +Subproject commit 4d3d6d517171b7c22295896c1c4358238fe6d05d diff --git a/src/crystallite.f90 b/src/crystallite.f90 index aea4fb993..0ee71b5de 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -494,7 +494,6 @@ subroutine crystallite_stressAndItsTangent(updateJaco) subStepMinCryst, & subStepSizeCryst, & stepIncreaseCryst, & - nCryst, & numerics_integrator, & numerics_integrationMode, & numerics_timeSyncing @@ -1215,8 +1214,6 @@ end subroutine crystallite_stressAndItsTangent subroutine crystallite_integrateStateRK4() use, intrinsic :: & IEEE_arithmetic - use numerics, only: & - numerics_integrationMode use debug, only: & #ifdef DEBUG debug_e, & @@ -1517,8 +1514,7 @@ subroutine crystallite_integrateStateRKCK45() debug_levelExtensive, & debug_levelSelective use numerics, only: & - rTol_crystalliteState, & - numerics_integrationMode + rTol_crystalliteState use FEsolving, only: & FEsolving_execElem, & FEsolving_execIP @@ -2581,7 +2577,6 @@ subroutine crystallite_integrateStateFPI() debug_levelSelective use numerics, only: & nState, & - numerics_integrationMode, & rTol_crystalliteState use FEsolving, only: & FEsolving_execElem, & @@ -3156,7 +3151,6 @@ logical function crystallite_integrateStress(& aTol_crystalliteStress, & rTol_crystalliteStress, & iJacoLpresiduum, & - numerics_integrationMode, & subStepSizeLp, & subStepSizeLi use debug, only: debug_level, & From e7fd445816807e870aa3affbdb1cfd1f82b97f65 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 20 Jul 2018 14:13:13 +0200 Subject: [PATCH 04/10] WIP: Simplifying using maxval gives inherently correct values and a consistency check is not needed any more using config_phase capabilities to read in lattice related data --- src/lattice.f90 | 468 +++++++++++++++++++----------------------------- 1 file changed, 180 insertions(+), 288 deletions(-) diff --git a/src/lattice.f90 b/src/lattice.f90 index 386001c76..3064c363e 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -88,11 +88,11 @@ module lattice LATTICE_fcc_NcleavageSystem = int([3, 4, 0],pInt) !< # of cleavage systems per family for fcc integer(pInt), parameter, private :: & - LATTICE_fcc_Nslip = 12_pInt, & !sum(lattice_fcc_NslipSystem), & !< total # of slip systems for fcc - LATTICE_fcc_Ntwin = 12_pInt, & !sum(lattice_fcc_NtwinSystem), & !< total # of twin systems for fcc + LATTICE_fcc_Nslip = sum(lattice_fcc_NslipSystem), & !< total # of slip systems for fcc + LATTICE_fcc_Ntwin = sum(lattice_fcc_NtwinSystem), & !< total # of twin systems for fcc LATTICE_fcc_NnonSchmid = 0_pInt, & !< total # of non-Schmid contributions for fcc - LATTICE_fcc_Ntrans = 12_pInt, & !sum(lattice_fcc_NtransSystem), & !< total # of transformation systems for fcc - LATTICE_fcc_Ncleavage = 7_pInt !sum(lattice_fcc_NcleavageSystem) !< total # of cleavage systems for fcc + LATTICE_fcc_Ntrans = sum(lattice_fcc_NtransSystem), & !< total # of transformation systems for fcc + LATTICE_fcc_Ncleavage = sum(lattice_fcc_NcleavageSystem) !< total # of cleavage systems for fcc real(pReal), dimension(3+3,LATTICE_fcc_Nslip), parameter, private :: & LATTICE_fcc_systemSlip = reshape(real([& @@ -371,11 +371,11 @@ module lattice LATTICE_bcc_NcleavageSystem = int([3,6,0],pInt) !< # of cleavage systems per family for bcc integer(pInt), parameter, private :: & - LATTICE_bcc_Nslip = 24_pInt, & !sum(lattice_bcc_NslipSystem), & !< total # of slip systems for bcc - LATTICE_bcc_Ntwin = 12_pInt, & !sum(lattice_bcc_NtwinSystem), & !< total # of twin systems for bcc + LATTICE_bcc_Nslip = sum(lattice_bcc_NslipSystem), & !< total # of slip systems for bcc + LATTICE_bcc_Ntwin = sum(lattice_bcc_NtwinSystem), & !< total # of twin systems for bcc LATTICE_bcc_NnonSchmid = 6_pInt, & !< total # of non-Schmid contributions for bcc (A. Koester, A. Ma, A. Hartmaier 2012) - LATTICE_bcc_Ntrans = 0_pInt, & !sum(lattice_bcc_NtransSystem), & !< total # of transformation systems for bcc - LATTICE_bcc_Ncleavage = 9_pInt !sum(lattice_bcc_NcleavageSystem) !< total # of cleavage systems for bcc + LATTICE_bcc_Ntrans = sum(lattice_bcc_NtransSystem), & !< total # of transformation systems for bcc + LATTICE_bcc_Ncleavage = sum(lattice_bcc_NcleavageSystem) !< total # of cleavage systems for bcc real(pReal), dimension(3+3,LATTICE_bcc_Nslip), parameter, private :: & LATTICE_bcc_systemSlip = reshape(real([& @@ -556,7 +556,7 @@ module lattice !-------------------------------------------------------------------------------------------------- ! hexagonal integer(pInt), dimension(LATTICE_maxNslipFamily), parameter, public :: & - lattice_hex_NslipSystem = int([ 3, 3, 3, 6, 12, 6, 0, 0, 0, 0, 0, 0, 0],pInt) !< # of slip systems per family for hex + lattice_hex_NslipSystem = int([ 3, 3, 3, 6, 12, 6, 0, 0, 0, 0, 0, 0, 0],pInt) !< # of slip systems per family for hex integer(pInt), dimension(LATTICE_maxNtwinFamily), parameter, public :: & lattice_hex_NtwinSystem = int([ 6, 6, 6, 6],pInt) !< # of slip systems per family for hex @@ -568,11 +568,11 @@ module lattice LATTICE_hex_NcleavageSystem = int([3,0,0],pInt) !< # of cleavage systems per family for hex integer(pInt), parameter, private :: & - LATTICE_hex_Nslip = 33_pInt, & !sum(lattice_hex_NslipSystem), & !< total # of slip systems for hex - LATTICE_hex_Ntwin = 24_pInt, & !sum(lattice_hex_NtwinSystem), & !< total # of twin systems for hex + LATTICE_hex_Nslip = sum(lattice_hex_NslipSystem), & !< total # of slip systems for hex + LATTICE_hex_Ntwin = sum(lattice_hex_NtwinSystem), & !< total # of twin systems for hex LATTICE_hex_NnonSchmid = 0_pInt, & !< total # of non-Schmid contributions for hex - LATTICE_hex_Ntrans = 0_pInt, & !sum(lattice_hex_NtransSystem), & !< total # of transformation systems for hex - LATTICE_hex_Ncleavage = 3_pInt !sum(lattice_hex_NcleavageSystem) !< total # of cleavage systems for hex + LATTICE_hex_Ntrans = sum(lattice_hex_NtransSystem), & !< total # of transformation systems for hex + LATTICE_hex_Ncleavage = sum(lattice_hex_NcleavageSystem) !< total # of cleavage systems for hex real(pReal), dimension(4+4,LATTICE_hex_Nslip), parameter, private :: & LATTICE_hex_systemSlip = reshape(real([& @@ -850,11 +850,11 @@ module lattice LATTICE_bct_NcleavageSystem = int([0,0,0],pInt) !< # of cleavage systems per family for bct integer(pInt), parameter, private :: & - LATTICE_bct_Nslip = 52_pInt, & !sum(lattice_bct_NslipSystem), & !< total # of slip systems for bct - LATTICE_bct_Ntwin = 0_pInt, & !sum(lattice_bct_NtwinSystem), & !< total # of twin systems for bct + LATTICE_bct_Nslip = sum(lattice_bct_NslipSystem), & !< total # of slip systems for bct + LATTICE_bct_Ntwin = sum(lattice_bct_NtwinSystem), & !< total # of twin systems for bct LATTICE_bct_NnonSchmid = 0_pInt, & !< total # of non-Schmid contributions for bct - LATTICE_bct_Ntrans = 0_pInt, & !sum(lattice_bct_NtransSystem), & !< total # of transformation systems for bct - LATTICE_bct_Ncleavage = 0_pInt !sum(lattice_bct_NcleavageSystem) !< total # of cleavage systems for bct + LATTICE_bct_Ntrans = sum(lattice_bct_NtransSystem), & !< total # of transformation systems for bct + LATTICE_bct_Ncleavage = sum(lattice_bct_NcleavageSystem) !< total # of cleavage systems for bct real(pReal), dimension(3+3,LATTICE_bct_Nslip), parameter, private :: & LATTICE_bct_systemSlip = reshape(real([& @@ -1039,11 +1039,11 @@ module lattice LATTICE_ortho_NcleavageSystem = int([1,1,1],pInt) !< # of cleavage systems per family for ortho integer(pInt), parameter, private :: & - LATTICE_ortho_Nslip = 0_pInt, & !sum(lattice_ortho_NslipSystem), & !< total # of slip systems for ortho - LATTICE_ortho_Ntwin = 0_pInt, & !sum(lattice_ortho_NtwinSystem), & !< total # of twin systems for ortho + LATTICE_ortho_Nslip = sum(lattice_ortho_NslipSystem), & !< total # of slip systems for ortho + LATTICE_ortho_Ntwin = sum(lattice_ortho_NtwinSystem), & !< total # of twin systems for ortho LATTICE_ortho_NnonSchmid = 0_pInt, & !< total # of non-Schmid contributions for ortho - LATTICE_ortho_Ntrans = 0_pInt, & !sum(lattice_ortho_NtransSystem), & !< total # of transformation systems for ortho - LATTICE_ortho_Ncleavage = 3_pInt !sum(lattice_ortho_NcleavageSystem) !< total # of cleavage systems for ortho + LATTICE_ortho_Ntrans = sum(lattice_ortho_NtransSystem), & !< total # of transformation systems for ortho + LATTICE_ortho_Ncleavage = sum(lattice_ortho_NcleavageSystem) !< total # of cleavage systems for ortho real(pReal), dimension(3+3,LATTICE_ortho_Ncleavage), parameter, private :: & LATTICE_ortho_systemCleavage = reshape(real([& @@ -1054,23 +1054,18 @@ module lattice ],pReal),[ 3_pInt + 3_pInt,LATTICE_ortho_Ncleavage]) integer(pInt), parameter, public :: & - LATTICE_maxNslip = 52_pInt, & - !LATTICE_maxNslip = maxval([LATTICE_fcc_Nslip,LATTICE_bcc_Nslip,LATTICE_hex_Nslip,\ - ! LATTICE_bct_Nslip,LATTICE_iso_Nslip,LATTICE_ortho_Nslip]), & !< max # of slip systems over lattice structures - LATTICE_maxNtwin = 24_pInt, & - !LATTICE_maxNtwin = maxval([LATTICE_fcc_Ntwin,LATTICE_bcc_Ntwin,LATTICE_hex_Ntwin,\ - ! LATTICE_bct_Ntwin,LATTICE_iso_Ntwin,LATTICE_ortho_Ntwin]), & !< max # of twin systems over lattice structures - LATTICE_maxNnonSchmid = 6_pInt, & - !LATTICE_maxNtwin = maxval([LATTICE_fcc_NnonSchmid,LATTICE_bcc_NnonSchmid,\ - ! LATTICE_hex_NnonSchmid,LATTICE_bct_NnonSchmid,\ - ! LATTICE_iso_NnonSchmid,LATTICE_ortho_NnonSchmid]), & !< max # of non-Schmid contributions over lattice structures - LATTICE_maxNtrans = 12_pInt, & - !LATTICE_maxNtrans = maxval([LATTICE_fcc_Ntrans,LATTICE_bcc_Ntrans,LATTICE_hex_Ntrans,\ - ! LATTICE_bct_Ntrans,LATTICE_iso_Ntrans,LATTICE_ortho_Ntrans]),&!< max # of transformation systems over lattice structures - LATTICE_maxNcleavage = 9_pInt, & - !LATTICE_maxNcleavage = maxval([LATTICE_fcc_Ncleavage,LATTICE_bcc_Ncleavage,\ - ! LATTICE_hex_Ncleavage,LATTICE_bct_Ncleavage,\ - ! LATTICE_iso_Ncleavage,LATTICE_ortho_Ncleavage]) !< max # of cleavage systems over lattice structures + LATTICE_maxNslip = maxval([LATTICE_fcc_Nslip,LATTICE_bcc_Nslip,LATTICE_hex_Nslip, & + LATTICE_bct_Nslip,LATTICE_iso_Nslip,LATTICE_ortho_Nslip]), & !< max # of slip systems over lattice structures + LATTICE_maxNtwin = maxval([LATTICE_fcc_Ntwin,LATTICE_bcc_Ntwin,LATTICE_hex_Ntwin, & + LATTICE_bct_Ntwin,LATTICE_iso_Ntwin,LATTICE_ortho_Ntwin]), & !< max # of twin systems over lattice structures + LATTICE_maxNnonSchmid = maxval([LATTICE_fcc_NnonSchmid,LATTICE_bcc_NnonSchmid, & + LATTICE_hex_NnonSchmid,LATTICE_bct_NnonSchmid, & + LATTICE_iso_NnonSchmid,LATTICE_ortho_NnonSchmid]), & !< max # of non-Schmid contributions over lattice structures + LATTICE_maxNtrans = maxval([LATTICE_fcc_Ntrans,LATTICE_bcc_Ntrans,LATTICE_hex_Ntrans, & + LATTICE_bct_Ntrans,LATTICE_iso_Ntrans,LATTICE_ortho_Ntrans]), & !< max # of transformation systems over lattice structures + LATTICE_maxNcleavage = maxval([LATTICE_fcc_Ncleavage,LATTICE_bcc_Ncleavage, & + LATTICE_hex_Ncleavage,LATTICE_bct_Ncleavage, & + LATTICE_iso_Ncleavage,LATTICE_ortho_Ncleavage]) , & !< max # of cleavage systems over lattice structures LATTICE_maxNinteraction = 182_pInt !< max # of interaction types (in hardening matrix part) real(pReal), dimension(:,:,:), allocatable, public, protected :: & @@ -1250,36 +1245,20 @@ subroutine lattice_init compiler_options #endif use IO, only: & - IO_open_file,& - IO_open_jobFile_stat, & - IO_countSections, & IO_error, & - IO_timeStamp, & - IO_EOF, & - IO_read, & - IO_lc, & - IO_getTag, & - IO_isBlank, & - IO_stringPos, & - IO_stringValue, & - IO_floatValue + IO_timeStamp use config, only: & - material_configfile, & - material_localFileExt, & - material_partPhase + config_phase use debug, only: & debug_level, & debug_lattice, & debug_levelBasic implicit none - integer(pInt), parameter :: FILEUNIT = 200_pInt integer(pInt) :: Nphases character(len=65536) :: & - tag = '', & - line = '' - integer(pInt), allocatable, dimension(:) :: chunkPos - integer(pInt) :: section = 0_pInt,i + tag = '' + integer(pInt) :: section = 0_pInt,i,p real(pReal), dimension(:), allocatable :: & CoverA, & !!!!!!< c/a ratio for low symmetry type lattice CoverA_trans, & !< c/a ratio for transformed hex type lattice @@ -1290,56 +1269,6 @@ subroutine lattice_init write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" -!-------------------------------------------------------------------------------------------------- -! consistency checks (required since ifort 15.0 does not support sum/maxval in parameter definition) - - if (LATTICE_maxNslip /= maxval([LATTICE_fcc_Nslip,LATTICE_bcc_Nslip,LATTICE_hex_Nslip,LATTICE_bct_Nslip])) & - call IO_error(0_pInt,ext_msg = 'LATTICE_maxNslip') - if (LATTICE_maxNtwin /= maxval([LATTICE_fcc_Ntwin,LATTICE_bcc_Ntwin,LATTICE_hex_Ntwin])) & - call IO_error(0_pInt,ext_msg = 'LATTICE_maxNtwin') - if (LATTICE_maxNtrans /= maxval([LATTICE_fcc_Ntrans,LATTICE_bcc_Ntrans,LATTICE_hex_Ntrans])) & - call IO_error(0_pInt,ext_msg = 'LATTICE_maxNtrans') - if (LATTICE_maxNnonSchmid /= maxval([lattice_fcc_NnonSchmid,lattice_bcc_NnonSchmid,& - lattice_hex_NnonSchmid])) call IO_error(0_pInt,ext_msg = 'LATTICE_maxNnonSchmid') - - if (LATTICE_fcc_Nslip /= sum(lattice_fcc_NslipSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_fcc_Nslip') - if (LATTICE_bcc_Nslip /= sum(lattice_bcc_NslipSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_bcc_Nslip') - if (LATTICE_hex_Nslip /= sum(lattice_hex_NslipSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_hex_Nslip') - if (LATTICE_bct_Nslip /= sum(lattice_bct_NslipSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_bct_Nslip') - - if (LATTICE_fcc_Ntwin /= sum(lattice_fcc_NtwinSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_fcc_Ntwin') - if (LATTICE_bcc_Ntwin /= sum(lattice_bcc_NtwinSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_bcc_Ntwin') - if (LATTICE_hex_Ntwin /= sum(lattice_hex_NtwinSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_hex_Ntwin') - if (LATTICE_bct_Ntwin /= sum(lattice_bct_NtwinSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_bct_Ntwin') - - if (LATTICE_fcc_Ntrans /= sum(lattice_fcc_NtransSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_fcc_Ntrans') - if (LATTICE_bcc_Ntrans /= sum(lattice_bcc_NtransSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_bcc_Ntrans') - if (LATTICE_hex_Ntrans /= sum(lattice_hex_NtransSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_hex_Ntrans') - if (LATTICE_bct_Ntrans /= sum(lattice_bct_NtransSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_bct_Ntrans') - - if (LATTICE_fcc_Ncleavage /= sum(lattice_fcc_NcleavageSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_fcc_Ncleavage') - if (LATTICE_bcc_Ncleavage /= sum(lattice_bcc_NcleavageSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_bcc_Ncleavage') - if (LATTICE_hex_Ncleavage /= sum(lattice_hex_NcleavageSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_hex_Ncleavage') - if (LATTICE_bct_Ncleavage /= sum(lattice_bct_NcleavageSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_bct_Ncleavage') - if (LATTICE_iso_Ncleavage /= sum(lattice_iso_NcleavageSystem)) & - call IO_error(0_pInt,ext_msg = 'LATTICE_iso_Ncleavage') - if (LATTICE_maxNinteraction /= max(& maxval(lattice_fcc_interactionSlipSlip), & maxval(lattice_bcc_interactionSlipSlip), & @@ -1362,18 +1291,7 @@ subroutine lattice_init ! maxval(lattice_bct_interactionTwinTwin))) & call IO_error(0_pInt,ext_msg = 'LATTICE_maxNinteraction') -!-------------------------------------------------------------------------------------------------- -! read from material configuration file - if (.not. IO_open_jobFile_stat(FILEUNIT,material_localFileExt)) & ! no local material configuration present... - call IO_open_file(FILEUNIT,material_configFile) ! ... open material.config file - Nphases = IO_countSections(FILEUNIT,material_partPhase) - - if(Nphases<1_pInt) & - call IO_error(160_pInt,Nphases, ext_msg='No phases found') - - if (iand(debug_level(debug_lattice),debug_levelBasic) /= 0_pInt) then - write(6,'(a16,1x,i5)') ' # phases:',Nphases - endif + Nphases = size(config_phase) allocate(lattice_structure(Nphases),source = LATTICE_undefined_ID) allocate(trans_lattice_structure(Nphases),source = LATTICE_undefined_ID) @@ -1450,179 +1368,155 @@ subroutine lattice_init allocate(a_fcc(Nphases),source=0.0_pReal) allocate(a_bcc(Nphases),source=0.0_pReal) - rewind(fileUnit) - line = '' ! to have it initialized - section = 0_pInt ! - " - - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= material_partPhase) ! wind forward to - line = IO_read(fileUnit) - enddo - - do while (trim(line) /= IO_EOF) ! read through sections of material part - line = IO_read(fileUnit) - if (IO_isBlank(line)) cycle ! skip empty lines - if (IO_getTag(line,'<','>') /= '') then ! stop at next part - line = IO_read(fileUnit, .true.) ! reset IO_read - exit - endif - if (IO_getTag(line,'[',']') /= '') then ! next section - section = section + 1_pInt - endif - if (section > 0_pInt) then - chunkPos = IO_stringPos(line) - tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key - select case(tag) - case ('lattice_structure') - select case(trim(IO_lc(IO_stringValue(line,chunkPos,2_pInt)))) + do section = 1, size(config_phase) + p = section + tag = config_phase(p)%getString('lattice_structure') + select case(trim(tag)) case('iso','isotropic') - lattice_structure(section) = LATTICE_iso_ID + lattice_structure(p) = LATTICE_iso_ID case('fcc') - lattice_structure(section) = LATTICE_fcc_ID + lattice_structure(p) = LATTICE_fcc_ID case('bcc') - lattice_structure(section) = LATTICE_bcc_ID + lattice_structure(p) = LATTICE_bcc_ID case('hex','hexagonal') - lattice_structure(section) = LATTICE_hex_ID + lattice_structure(p) = LATTICE_hex_ID case('bct') - lattice_structure(section) = LATTICE_bct_ID + lattice_structure(p) = LATTICE_bct_ID case('ort','orthorhombic') - lattice_structure(section) = LATTICE_ort_ID - case default - call IO_error(130_pInt,ext_msg=trim(IO_lc(IO_stringValue(line,chunkPos,2_pInt)))) - end select - case('trans_lattice_structure') - select case(trim(IO_lc(IO_stringValue(line,chunkPos,2_pInt)))) - case('bcc') - trans_lattice_structure(section) = LATTICE_bcc_ID - case('hex','hexagonal','hcp') - trans_lattice_structure(section) = LATTICE_hex_ID - end select - case ('c11') - lattice_C66(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c12') - lattice_C66(1,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c13') - lattice_C66(1,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c22') - lattice_C66(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c23') - lattice_C66(2,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c33') - lattice_C66(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c44') - lattice_C66(4,4,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c55') - lattice_C66(5,5,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c66') - lattice_C66(6,6,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c11_trans') - lattice_trans_C66(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c12_trans') - lattice_trans_C66(1,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c13_trans') - lattice_trans_C66(1,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c22_trans') - lattice_trans_C66(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c23_trans') - lattice_trans_C66(2,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c33_trans') - lattice_trans_C66(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c44_trans') - lattice_trans_C66(4,4,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c55_trans') - lattice_trans_C66(5,5,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c66_trans') - lattice_trans_C66(6,6,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('covera_ratio','c/a_ratio','c/a') - CoverA(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('c/a_trans','c/a_martensite','c/a_mart') - CoverA_trans(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('a_fcc') - a_fcc(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('a_bcc') - a_bcc(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('thermal_conductivity11') - lattice_thermalConductivity33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('thermal_conductivity22') - lattice_thermalConductivity33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('thermal_conductivity33') - lattice_thermalConductivity33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('thermal_expansion11') - do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) - lattice_thermalExpansion33(1,1,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) - enddo - case ('thermal_expansion22') - do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) - lattice_thermalExpansion33(2,2,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) - enddo - case ('thermal_expansion33') - do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) - lattice_thermalExpansion33(3,3,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) - enddo - case ('specific_heat') - lattice_specificHeat(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancyformationenergy') - lattice_vacancyFormationEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancysurfaceenergy') - lattice_vacancySurfaceEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancyvolume') - lattice_vacancyVol(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogenformationenergy') - lattice_hydrogenFormationEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogensurfaceenergy') - lattice_hydrogenSurfaceEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogenvolume') - lattice_hydrogenVol(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('mass_density') - lattice_massDensity(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('reference_temperature') - lattice_referenceTemperature(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('damage_diffusion11') - lattice_DamageDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('damage_diffusion22') - lattice_DamageDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('damage_diffusion33') - lattice_DamageDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('damage_mobility') - lattice_DamageMobility(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancyflux_diffusion11') - lattice_vacancyfluxDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancyflux_diffusion22') - lattice_vacancyfluxDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancyflux_diffusion33') - lattice_vacancyfluxDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancyflux_mobility11') - lattice_vacancyfluxMobility33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancyflux_mobility22') - lattice_vacancyfluxMobility33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancyflux_mobility33') - lattice_vacancyfluxMobility33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('porosity_diffusion11') - lattice_PorosityDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('porosity_diffusion22') - lattice_PorosityDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('porosity_diffusion33') - lattice_PorosityDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('porosity_mobility') - lattice_PorosityMobility(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogenflux_diffusion11') - lattice_hydrogenfluxDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogenflux_diffusion22') - lattice_hydrogenfluxDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogenflux_diffusion33') - lattice_hydrogenfluxDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogenflux_mobility11') - lattice_hydrogenfluxMobility33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogenflux_mobility22') - lattice_hydrogenfluxMobility33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogenflux_mobility33') - lattice_hydrogenfluxMobility33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) - case ('vacancy_eqcv') - lattice_equilibriumVacancyConcentration(section) = IO_floatValue(line,chunkPos,2_pInt) - case ('hydrogen_eqch') - lattice_equilibriumHydrogenConcentration(section) = IO_floatValue(line,chunkPos,2_pInt) - end select - endif - enddo + lattice_structure(p) = LATTICE_ort_ID +end select +! case('trans_lattice_structure') +! select case(trim(IO_lc(IO_stringValue(line,chunkPos,2_pInt)))) +! case('bcc') +! trans_lattice_structure(section) = LATTICE_bcc_ID +! case('hex','hexagonal') +! trans_lattice_structure(section) = LATTICE_hex_ID +! end select + + + lattice_C66(1,1,section) = config_phase(p)%getFloat('c11',defaultVal=0.0_pReal) + lattice_C66(1,2,section) = config_phase(p)%getFloat('c12',defaultVal=0.0_pReal) + lattice_C66(1,3,section) = config_phase(p)%getFloat('c13',defaultVal=0.0_pReal) + lattice_C66(2,3,section) = config_phase(p)%getFloat('c23',defaultVal=0.0_pReal) + lattice_C66(3,3,section) = config_phase(p)%getFloat('c33',defaultVal=0.0_pReal) + lattice_C66(4,4,section) = config_phase(p)%getFloat('c44',defaultVal=0.0_pReal) + lattice_C66(5,5,section) = config_phase(p)%getFloat('c55',defaultVal=0.0_pReal) + lattice_C66(6,6,section) = config_phase(p)%getFloat('c66',defaultVal=0.0_pReal) + +! case ('c11_trans') +! lattice_trans_C66(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c12_trans') +! lattice_trans_C66(1,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c13_trans') +! lattice_trans_C66(1,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c22_trans') +! lattice_trans_C66(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c23_trans') +! lattice_trans_C66(2,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c33_trans') +! lattice_trans_C66(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c44_trans') +! lattice_trans_C66(4,4,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c55_trans') +! lattice_trans_C66(5,5,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c66_trans') +! lattice_trans_C66(6,6,section) = IO_floatValue(line,chunkPos,2_pInt) +! +! case ('covera_ratio','c/a_ratio','c/a') +! CoverA(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('c/a_trans','c/a_martensite','c/a_mart') +! CoverA_trans(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('a_fcc') +! a_fcc(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('a_bcc') +! a_bcc(section) = IO_floatValue(line,chunkPos,2_pInt) +! +! case ('thermal_conductivity11') +! lattice_thermalConductivity33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('thermal_conductivity22') +! lattice_thermalConductivity33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('thermal_conductivity33') +! lattice_thermalConductivity33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('thermal_expansion11') +! do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) +! lattice_thermalExpansion33(1,1,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) +! enddo +! case ('thermal_expansion22') +! do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) +! lattice_thermalExpansion33(2,2,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) +! enddo +! case ('thermal_expansion33') +! do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) +! lattice_thermalExpansion33(3,3,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) +! enddo +! case ('specific_heat') +! lattice_specificHeat(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancyformationenergy') +! lattice_vacancyFormationEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancysurfaceenergy') +! lattice_vacancySurfaceEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancyvolume') +! lattice_vacancyVol(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogenformationenergy') +! lattice_hydrogenFormationEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogensurfaceenergy') +! lattice_hydrogenSurfaceEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogenvolume') +! lattice_hydrogenVol(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('mass_density') +! lattice_massDensity(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('reference_temperature') +! lattice_referenceTemperature(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('damage_diffusion11') +! lattice_DamageDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('damage_diffusion22') +! lattice_DamageDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('damage_diffusion33') +! lattice_DamageDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('damage_mobility') +! lattice_DamageMobility(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancyflux_diffusion11') +! lattice_vacancyfluxDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancyflux_diffusion22') +! lattice_vacancyfluxDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancyflux_diffusion33') +! lattice_vacancyfluxDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancyflux_mobility11') +! lattice_vacancyfluxMobility33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancyflux_mobility22') +! lattice_vacancyfluxMobility33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancyflux_mobility33') +! lattice_vacancyfluxMobility33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('porosity_diffusion11') +! lattice_PorosityDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('porosity_diffusion22') +! lattice_PorosityDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('porosity_diffusion33') +! lattice_PorosityDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('porosity_mobility') +! lattice_PorosityMobility(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogenflux_diffusion11') +! lattice_hydrogenfluxDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogenflux_diffusion22') +! lattice_hydrogenfluxDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogenflux_diffusion33') +! lattice_hydrogenfluxDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogenflux_mobility11') +! lattice_hydrogenfluxMobility33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogenflux_mobility22') +! lattice_hydrogenfluxMobility33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogenflux_mobility33') +! lattice_hydrogenfluxMobility33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('vacancy_eqcv') +! lattice_equilibriumVacancyConcentration(section) = IO_floatValue(line,chunkPos,2_pInt) +! case ('hydrogen_eqch') +! lattice_equilibriumHydrogenConcentration(section) = IO_floatValue(line,chunkPos,2_pInt) +! end select +! endif +! enddo + + enddo do i = 1_pInt,Nphases if ((CoverA(i) < 1.0_pReal .or. CoverA(i) > 2.0_pReal) & .and. lattice_structure(i) == LATTICE_hex_ID) call IO_error(131_pInt,el=i) ! checking physical significance of c/a @@ -1631,8 +1525,6 @@ subroutine lattice_init call lattice_initializeStructure(i, CoverA(i), CoverA_trans(i), a_fcc(i), a_bcc(i)) enddo - deallocate(CoverA,CoverA_trans,a_fcc,a_bcc) - end subroutine lattice_init From ed97afb51cf14dda17c4d3124fde1aa704fc3440 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 29 Jul 2018 21:03:14 +0200 Subject: [PATCH 05/10] WIP: inherent definition instead of check, using new reading in functionality --- PRIVATE | 2 +- src/lattice.f90 | 294 ++++++++++++++++++++---------------------------- 2 files changed, 121 insertions(+), 175 deletions(-) diff --git a/PRIVATE b/PRIVATE index 55609e107..20881ab8e 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 55609e1079d6ffde6dffdd584ee22a527ff00a34 +Subproject commit 20881ab8ebe6e64bac939ef6b2f8eb5168601a71 diff --git a/src/lattice.f90 b/src/lattice.f90 index 3064c363e..07f230358 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -16,7 +16,7 @@ module lattice integer(pInt), parameter, public :: & LATTICE_maxNslipFamily = 13_pInt, & !< max # of slip system families over lattice structures LATTICE_maxNtwinFamily = 4_pInt, & !< max # of twin system families over lattice structures - LATTICE_maxNtransFamily = 2_pInt, & !< max # of transformation system families over lattice structures + LATTICE_maxNtransFamily = 1_pInt, & !< max # of transformation system families over lattice structures LATTICE_maxNcleavageFamily = 3_pInt !< max # of transformation system families over lattice structures integer(pInt), allocatable, dimension(:,:), protected, public :: & @@ -82,7 +82,7 @@ module lattice LATTICE_fcc_NtwinSystem = int([12, 0, 0, 0],pInt) !< # of twin systems per family for fcc integer(pInt), dimension(LATTICE_maxNtransFamily), parameter, public :: & - LATTICE_fcc_NtransSystem = int([12, 0],pInt) !< # of transformation systems per family for fcc + LATTICE_fcc_NtransSystem = int([12],pInt) !< # of transformation systems per family for fcc integer(pInt), dimension(LATTICE_maxNcleavageFamily), parameter, public :: & LATTICE_fcc_NcleavageSystem = int([3, 4, 0],pInt) !< # of cleavage systems per family for fcc @@ -365,10 +365,10 @@ module lattice LATTICE_bcc_NtwinSystem = int([ 12, 0, 0, 0], pInt) !< # of twin systems per family for bcc integer(pInt), dimension(LATTICE_maxNtransFamily), parameter, public :: & - LATTICE_bcc_NtransSystem = int([0,0],pInt) !< # of transformation systems per family for bcc + LATTICE_bcc_NtransSystem = int([0],pInt) !< # of transformation systems per family for bcc integer(pInt), dimension(LATTICE_maxNcleavageFamily), parameter, public :: & - LATTICE_bcc_NcleavageSystem = int([3,6,0],pInt) !< # of cleavage systems per family for bcc + LATTICE_bcc_NcleavageSystem = int([3, 6, 0],pInt) !< # of cleavage systems per family for bcc integer(pInt), parameter, private :: & LATTICE_bcc_Nslip = sum(lattice_bcc_NslipSystem), & !< total # of slip systems for bcc @@ -562,10 +562,10 @@ module lattice lattice_hex_NtwinSystem = int([ 6, 6, 6, 6],pInt) !< # of slip systems per family for hex integer(pInt), dimension(LATTICE_maxNtransFamily), parameter, public :: & - LATTICE_hex_NtransSystem = int([0,0],pInt) !< # of transformation systems per family for hex + LATTICE_hex_NtransSystem = int([0],pInt) !< # of transformation systems per family for hex integer(pInt), dimension(LATTICE_maxNcleavageFamily), parameter, public :: & - LATTICE_hex_NcleavageSystem = int([3,0,0],pInt) !< # of cleavage systems per family for hex + LATTICE_hex_NcleavageSystem = int([3, 0, 0],pInt) !< # of cleavage systems per family for hex integer(pInt), parameter, private :: & LATTICE_hex_Nslip = sum(lattice_hex_NslipSystem), & !< total # of slip systems for hex @@ -844,10 +844,10 @@ module lattice LATTICE_bct_NtwinSystem = int([0, 0, 0, 0], pInt) !< # of twin systems per family for bct integer(pInt), dimension(LATTICE_maxNtransFamily), parameter, public :: & - LATTICE_bct_NtransSystem = int([0,0],pInt) !< # of transformation systems per family for bct + LATTICE_bct_NtransSystem = int([0],pInt) !< # of transformation systems per family for bct integer(pInt), dimension(LATTICE_maxNcleavageFamily), parameter, public :: & - LATTICE_bct_NcleavageSystem = int([0,0,0],pInt) !< # of cleavage systems per family for bct + LATTICE_bct_NcleavageSystem = int([0, 0, 0],pInt) !< # of cleavage systems per family for bct integer(pInt), parameter, private :: & LATTICE_bct_Nslip = sum(lattice_bct_NslipSystem), & !< total # of slip systems for bct @@ -1004,17 +1004,17 @@ module lattice LATTICE_iso_NtwinSystem = int([0, 0, 0, 0], pInt) !< # of twin systems per family for iso integer(pInt), dimension(LATTICE_maxNtransFamily), parameter, public :: & - LATTICE_iso_NtransSystem = int([0, 0],pInt) !< # of transformation systems per family for iso + LATTICE_iso_NtransSystem = int([0],pInt) !< # of transformation systems per family for iso integer(pInt), dimension(LATTICE_maxNcleavageFamily), parameter, public :: & - LATTICE_iso_NcleavageSystem = int([3,0,0],pInt) !< # of cleavage systems per family for iso + LATTICE_iso_NcleavageSystem = int([3, 0, 0],pInt) !< # of cleavage systems per family for iso integer(pInt), parameter, private :: & - LATTICE_iso_Nslip = 0_pInt, & !sum(lattice_iso_NslipSystem), & !< total # of slip systems for iso - LATTICE_iso_Ntwin = 0_pInt, & !sum(lattice_iso_NtwinSystem), & !< total # of twin systems for iso + LATTICE_iso_Nslip = sum(lattice_iso_NslipSystem), & !< total # of slip systems for iso + LATTICE_iso_Ntwin = sum(lattice_iso_NtwinSystem), & !< total # of twin systems for iso LATTICE_iso_NnonSchmid = 0_pInt, & !< total # of non-Schmid contributions for iso - LATTICE_iso_Ntrans = 0_pInt, & !sum(lattice_iso_NtransSystem), & !< total # of transformation systems for iso - LATTICE_iso_Ncleavage = 3_pInt !sum(lattice_iso_NcleavageSystem) !< total # of cleavage systems for iso + LATTICE_iso_Ntrans = sum(lattice_iso_NtransSystem), & !< total # of transformation systems for iso + LATTICE_iso_Ncleavage = sum(lattice_iso_NcleavageSystem) !< total # of cleavage systems for iso real(pReal), dimension(3+3,LATTICE_iso_Ncleavage), parameter, private :: & LATTICE_iso_systemCleavage = reshape(real([& @@ -1033,10 +1033,10 @@ module lattice LATTICE_ortho_NtwinSystem = int([0, 0, 0, 0], pInt) !< # of twin systems per family for ortho integer(pInt), dimension(LATTICE_maxNtransFamily), parameter, public :: & - LATTICE_ortho_NtransSystem = int([0, 0],pInt) !< # of transformation systems per family for ortho + LATTICE_ortho_NtransSystem = int([0],pInt) !< # of transformation systems per family for ortho integer(pInt), dimension(LATTICE_maxNcleavageFamily), parameter, public :: & - LATTICE_ortho_NcleavageSystem = int([1,1,1],pInt) !< # of cleavage systems per family for ortho + LATTICE_ortho_NcleavageSystem = int([1, 1, 1],pInt) !< # of cleavage systems per family for ortho integer(pInt), parameter, private :: & LATTICE_ortho_Nslip = sum(lattice_ortho_NslipSystem), & !< total # of slip systems for ortho @@ -1055,18 +1055,38 @@ module lattice integer(pInt), parameter, public :: & LATTICE_maxNslip = maxval([LATTICE_fcc_Nslip,LATTICE_bcc_Nslip,LATTICE_hex_Nslip, & - LATTICE_bct_Nslip,LATTICE_iso_Nslip,LATTICE_ortho_Nslip]), & !< max # of slip systems over lattice structures + LATTICE_bct_Nslip,LATTICE_iso_Nslip,LATTICE_ortho_Nslip]), & !< max # of slip systems over lattice structures LATTICE_maxNtwin = maxval([LATTICE_fcc_Ntwin,LATTICE_bcc_Ntwin,LATTICE_hex_Ntwin, & - LATTICE_bct_Ntwin,LATTICE_iso_Ntwin,LATTICE_ortho_Ntwin]), & !< max # of twin systems over lattice structures + LATTICE_bct_Ntwin,LATTICE_iso_Ntwin,LATTICE_ortho_Ntwin]), & !< max # of twin systems over lattice structures LATTICE_maxNnonSchmid = maxval([LATTICE_fcc_NnonSchmid,LATTICE_bcc_NnonSchmid, & LATTICE_hex_NnonSchmid,LATTICE_bct_NnonSchmid, & - LATTICE_iso_NnonSchmid,LATTICE_ortho_NnonSchmid]), & !< max # of non-Schmid contributions over lattice structures + LATTICE_iso_NnonSchmid,LATTICE_ortho_NnonSchmid]), & !< max # of non-Schmid contributions over lattice structures LATTICE_maxNtrans = maxval([LATTICE_fcc_Ntrans,LATTICE_bcc_Ntrans,LATTICE_hex_Ntrans, & - LATTICE_bct_Ntrans,LATTICE_iso_Ntrans,LATTICE_ortho_Ntrans]), & !< max # of transformation systems over lattice structures + LATTICE_bct_Ntrans,LATTICE_iso_Ntrans,LATTICE_ortho_Ntrans]), &!< max # of transformation systems over lattice structures LATTICE_maxNcleavage = maxval([LATTICE_fcc_Ncleavage,LATTICE_bcc_Ncleavage, & LATTICE_hex_Ncleavage,LATTICE_bct_Ncleavage, & - LATTICE_iso_Ncleavage,LATTICE_ortho_Ncleavage]) , & !< max # of cleavage systems over lattice structures - LATTICE_maxNinteraction = 182_pInt !< max # of interaction types (in hardening matrix part) + LATTICE_iso_Ncleavage,LATTICE_ortho_Ncleavage]), & !< max # of cleavage systems over lattice structures + LATTICE_maxNinteraction = maxval([ & + maxval(lattice_fcc_interactionSlipSlip), & + maxval(lattice_bcc_interactionSlipSlip), & + maxval(lattice_hex_interactionSlipSlip), & + maxval(lattice_bct_interactionSlipSlip), & + ! + maxval(lattice_fcc_interactionSlipTwin), & + maxval(lattice_bcc_interactionSlipTwin), & + maxval(lattice_hex_interactionSlipTwin), & + ! maxval(lattice_bct_interactionSlipTwin), & + ! + maxval(lattice_fcc_interactionTwinSlip), & + maxval(lattice_bcc_interactionTwinSlip), & + maxval(lattice_hex_interactionTwinSlip), & + ! maxval(lattice_bct_interactionTwinSlip), & + ! + maxval(lattice_fcc_interactionTwinTwin), & + maxval(lattice_bcc_interactionTwinTwin), & + maxval(lattice_hex_interactionTwinTwin) & + ! maxval(lattice_bct_interactionTwinTwin))) + ]) !< max # of interaction types (in hardening matrix part) real(pReal), dimension(:,:,:), allocatable, public, protected :: & lattice_C66, lattice_trans_C66 @@ -1249,10 +1269,6 @@ subroutine lattice_init IO_timeStamp use config, only: & config_phase - use debug, only: & - debug_level, & - debug_lattice, & - debug_levelBasic implicit none integer(pInt) :: Nphases @@ -1260,7 +1276,7 @@ subroutine lattice_init tag = '' integer(pInt) :: section = 0_pInt,i,p real(pReal), dimension(:), allocatable :: & - CoverA, & !!!!!!< c/a ratio for low symmetry type lattice + CoverA, & !< c/a ratio for low symmetry type lattice CoverA_trans, & !< c/a ratio for transformed hex type lattice a_fcc, & !< lattice parameter a for fcc austenite a_bcc !< lattice paramater a for bcc martensite @@ -1269,28 +1285,6 @@ subroutine lattice_init write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - if (LATTICE_maxNinteraction /= max(& - maxval(lattice_fcc_interactionSlipSlip), & - maxval(lattice_bcc_interactionSlipSlip), & - maxval(lattice_hex_interactionSlipSlip), & - maxval(lattice_bct_interactionSlipSlip), & - ! - maxval(lattice_fcc_interactionSlipTwin), & - maxval(lattice_bcc_interactionSlipTwin), & - maxval(lattice_hex_interactionSlipTwin), & -! maxval(lattice_bct_interactionSlipTwin), & - ! - maxval(lattice_fcc_interactionTwinSlip), & - maxval(lattice_bcc_interactionTwinSlip), & - maxval(lattice_hex_interactionTwinSlip), & -! maxval(lattice_bct_interactionTwinSlip), & - ! - maxval(lattice_fcc_interactionTwinTwin), & - maxval(lattice_bcc_interactionTwinTwin), & - maxval(lattice_hex_interactionTwinTwin))) & -! maxval(lattice_bct_interactionTwinTwin))) & - call IO_error(0_pInt,ext_msg = 'LATTICE_maxNinteraction') - Nphases = size(config_phase) allocate(lattice_structure(Nphases),source = LATTICE_undefined_ID) @@ -1368,23 +1362,22 @@ subroutine lattice_init allocate(a_fcc(Nphases),source=0.0_pReal) allocate(a_bcc(Nphases),source=0.0_pReal) - do section = 1, size(config_phase) - p = section - tag = config_phase(p)%getString('lattice_structure') - select case(trim(tag)) - case('iso','isotropic') - lattice_structure(p) = LATTICE_iso_ID - case('fcc') - lattice_structure(p) = LATTICE_fcc_ID - case('bcc') - lattice_structure(p) = LATTICE_bcc_ID - case('hex','hexagonal') - lattice_structure(p) = LATTICE_hex_ID - case('bct') - lattice_structure(p) = LATTICE_bct_ID - case('ort','orthorhombic') - lattice_structure(p) = LATTICE_ort_ID -end select + do p = 1, size(config_phase) + tag = config_phase(p)%getString('lattice_structure') + select case(trim(tag)) + case('iso','isotropic') + lattice_structure(p) = LATTICE_iso_ID + case('fcc') + lattice_structure(p) = LATTICE_fcc_ID + case('bcc') + lattice_structure(p) = LATTICE_bcc_ID + case('hex','hexagonal') + lattice_structure(p) = LATTICE_hex_ID + case('bct') + lattice_structure(p) = LATTICE_bct_ID + case('ort','orthorhombic') + lattice_structure(p) = LATTICE_ort_ID + end select ! case('trans_lattice_structure') ! select case(trim(IO_lc(IO_stringValue(line,chunkPos,2_pInt)))) @@ -1394,44 +1387,30 @@ end select ! trans_lattice_structure(section) = LATTICE_hex_ID ! end select + lattice_C66(1,1,p) = config_phase(p)%getFloat('c11',defaultVal=0.0_pReal) + lattice_C66(1,2,p) = config_phase(p)%getFloat('c12',defaultVal=0.0_pReal) + lattice_C66(1,3,p) = config_phase(p)%getFloat('c13',defaultVal=0.0_pReal) + lattice_C66(2,3,p) = config_phase(p)%getFloat('c23',defaultVal=0.0_pReal) + lattice_C66(3,3,p) = config_phase(p)%getFloat('c33',defaultVal=0.0_pReal) + lattice_C66(4,4,p) = config_phase(p)%getFloat('c44',defaultVal=0.0_pReal) + lattice_C66(5,5,p) = config_phase(p)%getFloat('c55',defaultVal=0.0_pReal) + lattice_C66(6,6,p) = config_phase(p)%getFloat('c66',defaultVal=0.0_pReal) - lattice_C66(1,1,section) = config_phase(p)%getFloat('c11',defaultVal=0.0_pReal) - lattice_C66(1,2,section) = config_phase(p)%getFloat('c12',defaultVal=0.0_pReal) - lattice_C66(1,3,section) = config_phase(p)%getFloat('c13',defaultVal=0.0_pReal) - lattice_C66(2,3,section) = config_phase(p)%getFloat('c23',defaultVal=0.0_pReal) - lattice_C66(3,3,section) = config_phase(p)%getFloat('c33',defaultVal=0.0_pReal) - lattice_C66(4,4,section) = config_phase(p)%getFloat('c44',defaultVal=0.0_pReal) - lattice_C66(5,5,section) = config_phase(p)%getFloat('c55',defaultVal=0.0_pReal) - lattice_C66(6,6,section) = config_phase(p)%getFloat('c66',defaultVal=0.0_pReal) + lattice_trans_C66(1,1,p) = config_phase(p)%getFloat('c11_trans',defaultVal=0.0_pReal) + lattice_trans_C66(1,2,p) = config_phase(p)%getFloat('c12_trans',defaultVal=0.0_pReal) + lattice_trans_C66(1,3,p) = config_phase(p)%getFloat('c13_trans',defaultVal=0.0_pReal) + lattice_trans_C66(2,2,p) = config_phase(p)%getFloat('c22_trans',defaultVal=0.0_pReal) + lattice_trans_C66(2,3,p) = config_phase(p)%getFloat('c23_trans',defaultVal=0.0_pReal) + lattice_trans_C66(3,3,p) = config_phase(p)%getFloat('c33_trans',defaultVal=0.0_pReal) + lattice_trans_C66(4,4,p) = config_phase(p)%getFloat('c44_trans',defaultVal=0.0_pReal) + lattice_trans_C66(5,5,p) = config_phase(p)%getFloat('c55_trans',defaultVal=0.0_pReal) + lattice_trans_C66(6,6,p) = config_phase(p)%getFloat('c66_trans',defaultVal=0.0_pReal) + + CoverA(p) = config_phase(p)%getFloat('c/a',defaultVal=0.0_pReal) + CoverA_trans(p) = config_phase(p)%getFloat('c/a_trans',defaultVal=0.0_pReal) + a_fcc(p) = config_phase(p)%getFloat('a_fcc',defaultVal=0.0_pReal) + a_bcc(p) = config_phase(p)%getFloat('a_bcc',defaultVal=0.0_pReal) -! case ('c11_trans') -! lattice_trans_C66(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c12_trans') -! lattice_trans_C66(1,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c13_trans') -! lattice_trans_C66(1,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c22_trans') -! lattice_trans_C66(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c23_trans') -! lattice_trans_C66(2,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c33_trans') -! lattice_trans_C66(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c44_trans') -! lattice_trans_C66(4,4,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c55_trans') -! lattice_trans_C66(5,5,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c66_trans') -! lattice_trans_C66(6,6,section) = IO_floatValue(line,chunkPos,2_pInt) -! -! case ('covera_ratio','c/a_ratio','c/a') -! CoverA(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('c/a_trans','c/a_martensite','c/a_mart') -! CoverA_trans(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('a_fcc') -! a_fcc(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('a_bcc') -! a_bcc(section) = IO_floatValue(line,chunkPos,2_pInt) -! ! case ('thermal_conductivity11') ! lattice_thermalConductivity33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) ! case ('thermal_conductivity22') @@ -1450,73 +1429,40 @@ end select ! do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) ! lattice_thermalExpansion33(3,3,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) ! enddo -! case ('specific_heat') -! lattice_specificHeat(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancyformationenergy') -! lattice_vacancyFormationEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancysurfaceenergy') -! lattice_vacancySurfaceEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancyvolume') -! lattice_vacancyVol(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogenformationenergy') -! lattice_hydrogenFormationEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogensurfaceenergy') -! lattice_hydrogenSurfaceEnergy(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogenvolume') -! lattice_hydrogenVol(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('mass_density') -! lattice_massDensity(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('reference_temperature') -! lattice_referenceTemperature(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('damage_diffusion11') -! lattice_DamageDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('damage_diffusion22') -! lattice_DamageDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('damage_diffusion33') -! lattice_DamageDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('damage_mobility') -! lattice_DamageMobility(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancyflux_diffusion11') -! lattice_vacancyfluxDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancyflux_diffusion22') -! lattice_vacancyfluxDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancyflux_diffusion33') -! lattice_vacancyfluxDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancyflux_mobility11') -! lattice_vacancyfluxMobility33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancyflux_mobility22') -! lattice_vacancyfluxMobility33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancyflux_mobility33') -! lattice_vacancyfluxMobility33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('porosity_diffusion11') -! lattice_PorosityDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('porosity_diffusion22') -! lattice_PorosityDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('porosity_diffusion33') -! lattice_PorosityDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('porosity_mobility') -! lattice_PorosityMobility(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogenflux_diffusion11') -! lattice_hydrogenfluxDiffusion33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogenflux_diffusion22') -! lattice_hydrogenfluxDiffusion33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogenflux_diffusion33') -! lattice_hydrogenfluxDiffusion33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogenflux_mobility11') -! lattice_hydrogenfluxMobility33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogenflux_mobility22') -! lattice_hydrogenfluxMobility33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogenflux_mobility33') -! lattice_hydrogenfluxMobility33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('vacancy_eqcv') -! lattice_equilibriumVacancyConcentration(section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('hydrogen_eqch') -! lattice_equilibriumHydrogenConcentration(section) = IO_floatValue(line,chunkPos,2_pInt) -! end select -! endif -! enddo + lattice_specificHeat(p) = config_phase(p)%getFloat( 'specific_heat',defaultVal=0.0_pReal) + lattice_vacancyFormationEnergy(p) = config_phase(p)%getFloat( 'vacancyformationenergy',defaultVal=0.0_pReal) + lattice_vacancySurfaceEnergy(p) = config_phase(p)%getFloat( 'vacancyvolume',defaultVal=0.0_pReal) + lattice_vacancyVol(p) = config_phase(p)%getFloat( 'vacancysurfaceenergy',defaultVal=0.0_pReal) + lattice_hydrogenFormationEnergy(p) = config_phase(p)%getFloat( 'hydrogenformationenergy',defaultVal=0.0_pReal) + lattice_hydrogenSurfaceEnergy(p) = config_phase(p)%getFloat( 'hydrogensurfaceenergy',defaultVal=0.0_pReal) + lattice_hydrogenVol(p) = config_phase(p)%getFloat( 'hydrogenvolume',defaultVal=0.0_pReal) + lattice_massDensity(p) = config_phase(p)%getFloat( 'mass_density',defaultVal=0.0_pReal) + lattice_referenceTemperature(p) = config_phase(p)%getFloat( 'reference_temperature',defaultVal=0.0_pReal) + lattice_DamageDiffusion33(1,1,p) = config_phase(p)%getFloat( 'damage_diffusion11',defaultVal=0.0_pReal) + lattice_DamageDiffusion33(2,2,p) = config_phase(p)%getFloat( 'damage_diffusion22',defaultVal=0.0_pReal) + lattice_DamageDiffusion33(3,3,p) = config_phase(p)%getFloat( 'damage_diffusion33',defaultVal=0.0_pReal) + lattice_DamageMobility(p) = config_phase(p)%getFloat( 'damage_mobility',defaultVal=0.0_pReal) + lattice_vacancyfluxDiffusion33(1,1,p) = config_phase(p)%getFloat( 'vacancyflux_diffusion11',defaultVal=0.0_pReal) + lattice_vacancyfluxDiffusion33(2,2,p) = config_phase(p)%getFloat( 'vacancyflux_diffusion22',defaultVal=0.0_pReal) + lattice_vacancyfluxDiffusion33(3,3,p) = config_phase(p)%getFloat( 'vacancyflux_diffusion33',defaultVal=0.0_pReal) + lattice_vacancyfluxMobility33(1,1,p) = config_phase(p)%getFloat( 'vacancyflux_mobility11',defaultVal=0.0_pReal) + lattice_vacancyfluxMobility33(2,2,p) = config_phase(p)%getFloat( 'vacancyflux_mobility22',defaultVal=0.0_pReal) + lattice_vacancyfluxMobility33(3,3,p) = config_phase(p)%getFloat( 'vacancyflux_mobility33',defaultVal=0.0_pReal) + lattice_PorosityDiffusion33(1,1,p) = config_phase(p)%getFloat( 'porosity_diffusion11',defaultVal=0.0_pReal) + lattice_PorosityDiffusion33(2,2,p) = config_phase(p)%getFloat( 'porosity_diffusion22',defaultVal=0.0_pReal) + lattice_PorosityDiffusion33(3,3,p) = config_phase(p)%getFloat( 'porosity_diffusion33',defaultVal=0.0_pReal) + lattice_PorosityMobility(p) = config_phase(p)%getFloat( 'porosity_mobility',defaultVal=0.0_pReal) + lattice_hydrogenfluxDiffusion33(1,1,p) = config_phase(p)%getFloat( 'hydrogenflux_diffusion11',defaultVal=0.0_pReal) + lattice_hydrogenfluxDiffusion33(2,2,p) = config_phase(p)%getFloat( 'hydrogenflux_diffusion22',defaultVal=0.0_pReal) + lattice_hydrogenfluxDiffusion33(3,3,p) = config_phase(p)%getFloat( 'hydrogenflux_diffusion33',defaultVal=0.0_pReal) + lattice_hydrogenfluxMobility33(1,1,p) = config_phase(p)%getFloat( 'hydrogenflux_mobility11',defaultVal=0.0_pReal) + lattice_hydrogenfluxMobility33(2,2,p) = config_phase(p)%getFloat( 'hydrogenflux_mobility22',defaultVal=0.0_pReal) + lattice_hydrogenfluxMobility33(3,3,p) = config_phase(p)%getFloat( 'hydrogenflux_mobility33',defaultVal=0.0_pReal) + lattice_equilibriumVacancyConcentration(p) = config_phase(p)%getFloat( 'vacancy_eqcv',defaultVal=0.0_pReal) + lattice_equilibriumHydrogenConcentration(p) = config_phase(p)%getFloat( 'hydrogen_eqch',defaultVal=0.0_pReal) enddo + do i = 1_pInt,Nphases if ((CoverA(i) < 1.0_pReal .or. CoverA(i) > 2.0_pReal) & .and. lattice_structure(i) == LATTICE_hex_ID) call IO_error(131_pInt,el=i) ! checking physical significance of c/a @@ -1682,16 +1628,16 @@ subroutine lattice_initializeStructure(myPhase,CoverA,CoverA_trans,a_fcc,a_bcc) myNtwin = lattice_fcc_Ntwin myNtrans = lattice_fcc_Ntrans myNcleavage = lattice_fcc_Ncleavage - do i = 1_pInt,myNslip ! assign slip system vectors + do i = 1_pInt,myNslip ! assign slip system vectors sd(1:3,i) = lattice_fcc_systemSlip(1:3,i) sn(1:3,i) = lattice_fcc_systemSlip(4:6,i) enddo - do i = 1_pInt,myNtwin ! assign twin system vectors and shears + do i = 1_pInt,myNtwin ! assign twin system vectors and shears td(1:3,i) = lattice_fcc_systemTwin(1:3,i) tn(1:3,i) = lattice_fcc_systemTwin(4:6,i) ts(i) = lattice_fcc_shearTwin(i) enddo - do i = 1_pInt, myNcleavage ! assign cleavage system vectors + do i = 1_pInt, myNcleavage ! assign cleavage system vectors cd(1:3,i) = lattice_fcc_systemCleavage(1:3,i)/norm2(lattice_fcc_systemCleavage(1:3,i)) cn(1:3,i) = lattice_fcc_systemCleavage(4:6,i)/norm2(lattice_fcc_systemCleavage(4:6,i)) ct(1:3,i) = math_crossproduct(cd(1:3,i),cn(1:3,i)) @@ -1699,16 +1645,16 @@ subroutine lattice_initializeStructure(myPhase,CoverA,CoverA_trans,a_fcc,a_bcc) ! Phase transformation select case(trans_lattice_structure(myPhase)) - case (LATTICE_bcc_ID) ! fcc to bcc transformation + case (LATTICE_bcc_ID) ! fcc to bcc transformation do i = 1_pInt,myNtrans - Rtr(1:3,1:3,i) = math_axisAngleToR(lattice_fccTobcc_systemTrans(1:3,i), & ! Pitsch rotation + Rtr(1:3,1:3,i) = math_axisAngleToR(lattice_fccTobcc_systemTrans(1:3,i), & ! Pitsch rotation lattice_fccTobcc_systemTrans(4,i)*INRAD) - Btr(1:3,1:3,i) = math_axisAngleToR(lattice_fccTobcc_bainRot(1:3,i), & ! Rotation of fcc to Bain coordinate system + Btr(1:3,1:3,i) = math_axisAngleToR(lattice_fccTobcc_bainRot(1:3,i), & ! Rotation of fcc to Bain coordinate system lattice_fccTobcc_bainRot(4,i)*INRAD) xtr(1:3,i) = real(LATTICE_fccTobcc_bainVariant(1:3,i),pReal) ytr(1:3,i) = real(LATTICE_fccTobcc_bainVariant(4:6,i),pReal) ztr(1:3,i) = real(LATTICE_fccTobcc_bainVariant(7:9,i),pReal) - Utr(1:3,1:3,i) = 0.0_pReal ! Bain deformation + Utr(1:3,1:3,i) = 0.0_pReal ! Bain deformation if ((a_fcc > 0.0_pReal) .and. (a_bcc > 0.0_pReal)) then Utr(1:3,1:3,i) = (a_bcc/a_fcc)*math_tensorproduct33(xtr(1:3,i), xtr(1:3,i)) + & sqrt(2.0_pReal)*(a_bcc/a_fcc)*math_tensorproduct33(ytr(1:3,i), ytr(1:3,i)) + & From a908e663060c8cbb9544d491c543b3843606c695 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 30 Jul 2018 11:45:16 +0200 Subject: [PATCH 06/10] WIP: reading in new style --- src/homogenization.f90 | 1 - src/lattice.f90 | 25 ++++++++++++------------- src/numerics.f90 | 5 ----- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 75330e86c..3565999a8 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -494,7 +494,6 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) subStepMinHomog, & subStepSizeHomog, & stepIncreaseHomog, & - nHomog, & nMPstate use math, only: & math_transpose33 diff --git a/src/lattice.f90 b/src/lattice.f90 index 07f230358..a0717659e 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -1379,13 +1379,14 @@ subroutine lattice_init lattice_structure(p) = LATTICE_ort_ID end select -! case('trans_lattice_structure') -! select case(trim(IO_lc(IO_stringValue(line,chunkPos,2_pInt)))) -! case('bcc') -! trans_lattice_structure(section) = LATTICE_bcc_ID -! case('hex','hexagonal') -! trans_lattice_structure(section) = LATTICE_hex_ID -! end select + tag = 'undefined' + tag = config_phase(p)%getString('trans_lattice_structure',defaultVal=tag) + select case(trim(tag)) + case('bcc') + trans_lattice_structure(section) = LATTICE_bcc_ID + case('hex','hexagonal') + trans_lattice_structure(section) = LATTICE_hex_ID + end select lattice_C66(1,1,p) = config_phase(p)%getFloat('c11',defaultVal=0.0_pReal) lattice_C66(1,2,p) = config_phase(p)%getFloat('c12',defaultVal=0.0_pReal) @@ -1411,12 +1412,10 @@ subroutine lattice_init a_fcc(p) = config_phase(p)%getFloat('a_fcc',defaultVal=0.0_pReal) a_bcc(p) = config_phase(p)%getFloat('a_bcc',defaultVal=0.0_pReal) -! case ('thermal_conductivity11') -! lattice_thermalConductivity33(1,1,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('thermal_conductivity22') -! lattice_thermalConductivity33(2,2,section) = IO_floatValue(line,chunkPos,2_pInt) -! case ('thermal_conductivity33') -! lattice_thermalConductivity33(3,3,section) = IO_floatValue(line,chunkPos,2_pInt) + lattice_thermalConductivity33(1,1,p) = config_phase(p)%getFloat('thermal_conductivity11') + lattice_thermalConductivity33(2,2,p) = config_phase(p)%getFloat('thermal_conductivity22') + lattice_thermalConductivity33(3,3,p) = config_phase(p)%getFloat('thermal_conductivity33') + ! case ('thermal_expansion11') ! do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) ! lattice_thermalExpansion33(1,1,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) diff --git a/src/numerics.f90 b/src/numerics.f90 index 8de664248..56da2041e 100644 --- a/src/numerics.f90 +++ b/src/numerics.f90 @@ -16,7 +16,6 @@ module numerics integer(pInt), protected, public :: & iJacoStiffness = 1_pInt, & !< frequency of stiffness update iJacoLpresiduum = 1_pInt, & !< frequency of Jacobian update of residuum in Lp - nHomog = 20_pInt, & !< homogenization loop limit (only for debugging info, loop limit is determined by "subStepMinHomog") nMPstate = 10_pInt, & !< materialpoint state loop limit nCryst = 20_pInt, & !< crystallite loop limit (only for debugging info, loop limit is determined by "subStepMinCryst") nState = 10_pInt, & !< state loop limit @@ -284,8 +283,6 @@ subroutine numerics_init pert_Fg = IO_floatValue(line,chunkPos,2_pInt) case ('pert_method') pert_method = IO_intValue(line,chunkPos,2_pInt) - case ('nhomog') - nHomog = IO_intValue(line,chunkPos,2_pInt) case ('nmpstate') nMPstate = IO_intValue(line,chunkPos,2_pInt) case ('ncryst') @@ -536,7 +533,6 @@ subroutine numerics_init write(6,'(a24,1x,L8)') ' use ping pong scheme: ',usepingpong write(6,'(a24,1x,es8.1,/)')' unitlength: ',numerics_unitlength - write(6,'(a24,1x,i8)') ' nHomog: ',nHomog write(6,'(a24,1x,es8.1)') ' subStepMinHomog: ',subStepMinHomog write(6,'(a24,1x,es8.1)') ' subStepSizeHomog: ',subStepSizeHomog write(6,'(a24,1x,es8.1)') ' stepIncreaseHomog: ',stepIncreaseHomog @@ -646,7 +642,6 @@ subroutine numerics_init if (pert_Fg <= 0.0_pReal) call IO_error(301_pInt,ext_msg='pert_Fg') if (pert_method <= 0_pInt .or. pert_method >= 4_pInt) & call IO_error(301_pInt,ext_msg='pert_method') - if (nHomog < 1_pInt) call IO_error(301_pInt,ext_msg='nHomog') if (nMPstate < 1_pInt) call IO_error(301_pInt,ext_msg='nMPstate') if (nCryst < 1_pInt) call IO_error(301_pInt,ext_msg='nCryst') if (nState < 1_pInt) call IO_error(301_pInt,ext_msg='nState') From af931a78c7c779405ab213ac5610bebae58cf7f2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 3 Aug 2018 08:09:28 +0200 Subject: [PATCH 07/10] finalizing reading in --- src/lattice.f90 | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/lattice.f90 b/src/lattice.f90 index a0717659e..e5fde8be8 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -1276,6 +1276,7 @@ subroutine lattice_init tag = '' integer(pInt) :: section = 0_pInt,i,p real(pReal), dimension(:), allocatable :: & + temp, & CoverA, & !< c/a ratio for low symmetry type lattice CoverA_trans, & !< c/a ratio for transformed hex type lattice a_fcc, & !< lattice parameter a for fcc austenite @@ -1416,18 +1417,12 @@ subroutine lattice_init lattice_thermalConductivity33(2,2,p) = config_phase(p)%getFloat('thermal_conductivity22') lattice_thermalConductivity33(3,3,p) = config_phase(p)%getFloat('thermal_conductivity33') -! case ('thermal_expansion11') -! do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) -! lattice_thermalExpansion33(1,1,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) -! enddo -! case ('thermal_expansion22') -! do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) -! lattice_thermalExpansion33(2,2,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) -! enddo -! case ('thermal_expansion33') -! do i = 2_pInt, min(4,chunkPos(1)) ! read up to three parameters (constant, linear, quadratic with T) -! lattice_thermalExpansion33(3,3,i-1_pInt,section) = IO_floatValue(line,chunkPos,i) -! enddo + temp = config_phase(p)%getFloats('thermal_expansion11') ! read up to three parameters (constant, linear, quadratic with T) + lattice_thermalExpansion33(1,1,1:size(temp),p) = temp + temp = config_phase(p)%getFloats('thermal_expansion22') ! read up to three parameters (constant, linear, quadratic with T) + lattice_thermalExpansion33(2,2,1:size(temp),p) = temp + temp = config_phase(p)%getFloats('thermal_expansion33') ! read up to three parameters (constant, linear, quadratic with T) + lattice_thermalExpansion33(3,3,1:size(temp),p) = temp lattice_specificHeat(p) = config_phase(p)%getFloat( 'specific_heat',defaultVal=0.0_pReal) lattice_vacancyFormationEnergy(p) = config_phase(p)%getFloat( 'vacancyformationenergy',defaultVal=0.0_pReal) From c2f97095670a0f85538672cd683e52361e38adc4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 3 Aug 2018 08:42:26 +0200 Subject: [PATCH 08/10] leaner, most of it also supported by older gcc --- src/lattice.f90 | 66 ++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/src/lattice.f90 b/src/lattice.f90 index e5fde8be8..f75745433 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -1054,40 +1054,44 @@ module lattice ],pReal),[ 3_pInt + 3_pInt,LATTICE_ortho_Ncleavage]) integer(pInt), parameter, public :: & - LATTICE_maxNslip = maxval([LATTICE_fcc_Nslip,LATTICE_bcc_Nslip,LATTICE_hex_Nslip, & - LATTICE_bct_Nslip,LATTICE_iso_Nslip,LATTICE_ortho_Nslip]), & !< max # of slip systems over lattice structures - LATTICE_maxNtwin = maxval([LATTICE_fcc_Ntwin,LATTICE_bcc_Ntwin,LATTICE_hex_Ntwin, & - LATTICE_bct_Ntwin,LATTICE_iso_Ntwin,LATTICE_ortho_Ntwin]), & !< max # of twin systems over lattice structures - LATTICE_maxNnonSchmid = maxval([LATTICE_fcc_NnonSchmid,LATTICE_bcc_NnonSchmid, & - LATTICE_hex_NnonSchmid,LATTICE_bct_NnonSchmid, & - LATTICE_iso_NnonSchmid,LATTICE_ortho_NnonSchmid]), & !< max # of non-Schmid contributions over lattice structures - LATTICE_maxNtrans = maxval([LATTICE_fcc_Ntrans,LATTICE_bcc_Ntrans,LATTICE_hex_Ntrans, & - LATTICE_bct_Ntrans,LATTICE_iso_Ntrans,LATTICE_ortho_Ntrans]), &!< max # of transformation systems over lattice structures - LATTICE_maxNcleavage = maxval([LATTICE_fcc_Ncleavage,LATTICE_bcc_Ncleavage, & - LATTICE_hex_Ncleavage,LATTICE_bct_Ncleavage, & - LATTICE_iso_Ncleavage,LATTICE_ortho_Ncleavage]), & !< max # of cleavage systems over lattice structures - LATTICE_maxNinteraction = maxval([ & - maxval(lattice_fcc_interactionSlipSlip), & - maxval(lattice_bcc_interactionSlipSlip), & - maxval(lattice_hex_interactionSlipSlip), & - maxval(lattice_bct_interactionSlipSlip), & + LATTICE_maxNslip = max(LATTICE_fcc_Nslip,LATTICE_bcc_Nslip,LATTICE_hex_Nslip, & + LATTICE_bct_Nslip,LATTICE_iso_Nslip,LATTICE_ortho_Nslip), & !< max # of slip systems over lattice structures + LATTICE_maxNtwin = max(LATTICE_fcc_Ntwin,LATTICE_bcc_Ntwin,LATTICE_hex_Ntwin, & + LATTICE_bct_Ntwin,LATTICE_iso_Ntwin,LATTICE_ortho_Ntwin), & !< max # of twin systems over lattice structures + LATTICE_maxNnonSchmid = max(LATTICE_fcc_NnonSchmid,LATTICE_bcc_NnonSchmid, & + LATTICE_hex_NnonSchmid,LATTICE_bct_NnonSchmid, & + LATTICE_iso_NnonSchmid,LATTICE_ortho_NnonSchmid), & !< max # of non-Schmid contributions over lattice structures + LATTICE_maxNtrans = max(LATTICE_fcc_Ntrans,LATTICE_bcc_Ntrans,LATTICE_hex_Ntrans, & + LATTICE_bct_Ntrans,LATTICE_iso_Ntrans,LATTICE_ortho_Ntrans), & !< max # of transformation systems over lattice structures + LATTICE_maxNcleavage = max(LATTICE_fcc_Ncleavage,LATTICE_bcc_Ncleavage, & + LATTICE_hex_Ncleavage,LATTICE_bct_Ncleavage, & + LATTICE_iso_Ncleavage,LATTICE_ortho_Ncleavage), & !< max # of cleavage systems over lattice structures +#if defined(__GFORTRAN__) + ! only supported in gcc 8 + LATTICE_maxNinteraction = 182_pInt +#else + LATTICE_maxNinteraction = max(& + maxval(lattice_fcc_interactionSlipSlip), & + maxval(lattice_bcc_interactionSlipSlip), & + maxval(lattice_hex_interactionSlipSlip), & + maxval(lattice_bct_interactionSlipSlip), & ! - maxval(lattice_fcc_interactionSlipTwin), & - maxval(lattice_bcc_interactionSlipTwin), & - maxval(lattice_hex_interactionSlipTwin), & - ! maxval(lattice_bct_interactionSlipTwin), & + maxval(lattice_fcc_interactionSlipTwin), & + maxval(lattice_bcc_interactionSlipTwin), & + maxval(lattice_hex_interactionSlipTwin), & + !maxval(lattice_bct_interactionSlipTwin), & ! - maxval(lattice_fcc_interactionTwinSlip), & - maxval(lattice_bcc_interactionTwinSlip), & - maxval(lattice_hex_interactionTwinSlip), & - ! maxval(lattice_bct_interactionTwinSlip), & + maxval(lattice_fcc_interactionTwinSlip), & + maxval(lattice_bcc_interactionTwinSlip), & + maxval(lattice_hex_interactionTwinSlip), & + !maxval(lattice_bct_interactionTwinSlip), & ! - maxval(lattice_fcc_interactionTwinTwin), & - maxval(lattice_bcc_interactionTwinTwin), & - maxval(lattice_hex_interactionTwinTwin) & - ! maxval(lattice_bct_interactionTwinTwin))) - ]) !< max # of interaction types (in hardening matrix part) - + maxval(lattice_fcc_interactionTwinTwin), & + maxval(lattice_bcc_interactionTwinTwin), & + maxval(lattice_hex_interactionTwinTwin) & + !maxval(lattice_bct_interactionTwinTwin))) + ) !< max # of interaction types (in hardening matrix part) +#endif real(pReal), dimension(:,:,:), allocatable, public, protected :: & lattice_C66, lattice_trans_C66 real(pReal), dimension(:,:,:,:,:), allocatable, public, protected :: & From 661636d83ec0b532635c8a6e400f1b55c03541b7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 4 Aug 2018 22:53:56 +0200 Subject: [PATCH 09/10] default values needed to suppress error in case of missing key --- src/lattice.f90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lattice.f90 b/src/lattice.f90 index f75745433..2b7fe5774 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -1417,15 +1417,15 @@ subroutine lattice_init a_fcc(p) = config_phase(p)%getFloat('a_fcc',defaultVal=0.0_pReal) a_bcc(p) = config_phase(p)%getFloat('a_bcc',defaultVal=0.0_pReal) - lattice_thermalConductivity33(1,1,p) = config_phase(p)%getFloat('thermal_conductivity11') - lattice_thermalConductivity33(2,2,p) = config_phase(p)%getFloat('thermal_conductivity22') - lattice_thermalConductivity33(3,3,p) = config_phase(p)%getFloat('thermal_conductivity33') + lattice_thermalConductivity33(1,1,p) = config_phase(p)%getFloat('thermal_conductivity11',defaultVal=0.0_pReal) + lattice_thermalConductivity33(2,2,p) = config_phase(p)%getFloat('thermal_conductivity22',defaultVal=0.0_pReal) + lattice_thermalConductivity33(3,3,p) = config_phase(p)%getFloat('thermal_conductivity33',defaultVal=0.0_pReal) - temp = config_phase(p)%getFloats('thermal_expansion11') ! read up to three parameters (constant, linear, quadratic with T) + temp = config_phase(p)%getFloats('thermal_expansion11',defaultVal=[0.0_pReal]) ! read up to three parameters (constant, linear, quadratic with T) lattice_thermalExpansion33(1,1,1:size(temp),p) = temp - temp = config_phase(p)%getFloats('thermal_expansion22') ! read up to three parameters (constant, linear, quadratic with T) + temp = config_phase(p)%getFloats('thermal_expansion22',defaultVal=[0.0_pReal]) ! read up to three parameters (constant, linear, quadratic with T) lattice_thermalExpansion33(2,2,1:size(temp),p) = temp - temp = config_phase(p)%getFloats('thermal_expansion33') ! read up to three parameters (constant, linear, quadratic with T) + temp = config_phase(p)%getFloats('thermal_expansion33',defaultVal=[0.0_pReal]) ! read up to three parameters (constant, linear, quadratic with T) lattice_thermalExpansion33(3,3,1:size(temp),p) = temp lattice_specificHeat(p) = config_phase(p)%getFloat( 'specific_heat',defaultVal=0.0_pReal) From 2ea894dbbeec0571df07bac2b3c4d007cdc456e2 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 16 Aug 2018 03:16:13 +0200 Subject: [PATCH 10/10] [skip ci] updated version information after successful test of v2.0.2-374-g3e4f6598 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 104e87fde..943cac93c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.2-357-g3fbc537b +v2.0.2-374-g3e4f6598