From 74396bf828ba22ab2e3360e9bf43bb2b3c61a5c1 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 8 Nov 2017 04:48:44 +0100 Subject: [PATCH 01/11] [skip ci] updated version information after successful test of v2.0.1-982-ge4700cd --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d63a99433..ed59e5b34 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-980-ge2c66ca +v2.0.1-982-ge4700cd From c81a438546d1dda06a6c322001c280f2330c943a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 18 Nov 2017 22:39:13 +0100 Subject: [PATCH 02/11] SCHMID-BOAS notation for reference --- src/lattice.f90 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lattice.f90 b/src/lattice.f90 index 328d65380..9635643e8 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -96,19 +96,19 @@ module lattice real(pReal), dimension(3+3,LATTICE_fcc_Nslip), parameter, private :: & LATTICE_fcc_systemSlip = reshape(real([& - ! Slip direction Plane normal - 0, 1,-1, 1, 1, 1, & - -1, 0, 1, 1, 1, 1, & - 1,-1, 0, 1, 1, 1, & - 0,-1,-1, -1,-1, 1, & - 1, 0, 1, -1,-1, 1, & - -1, 1, 0, -1,-1, 1, & - 0,-1, 1, 1,-1,-1, & - -1, 0,-1, 1,-1,-1, & - 1, 1, 0, 1,-1,-1, & - 0, 1, 1, -1, 1,-1, & - 1, 0,-1, -1, 1,-1, & - -1,-1, 0, -1, 1,-1 & + ! Slip direction Plane normal ! SCHMID-BOAS notation + 0, 1,-1, 1, 1, 1, & ! B2 + -1, 0, 1, 1, 1, 1, & ! B4 + 1,-1, 0, 1, 1, 1, & ! B5 + 0,-1,-1, -1,-1, 1, & ! C1 + 1, 0, 1, -1,-1, 1, & ! C3 + -1, 1, 0, -1,-1, 1, & ! C5 + 0,-1, 1, 1,-1,-1, & ! A2 + -1, 0,-1, 1,-1,-1, & ! A3 + 1, 1, 0, 1,-1,-1, & ! A6 + 0, 1, 1, -1, 1,-1, & ! D1 + 1, 0,-1, -1, 1,-1, & ! D4 + -1,-1, 0, -1, 1,-1 & ! D6 ],pReal),[ 3_pInt + 3_pInt,LATTICE_fcc_Nslip]) !< Slip system <110>{111} directions. Sorted according to Eisenlohr & Hantcherli real(pReal), dimension(3+3,LATTICE_fcc_Ntwin), parameter, private :: & From 90c617e05552f5617601c0d9ab093928fa41c86b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 20 Nov 2017 12:57:30 +0100 Subject: [PATCH 03/11] incorporating changes in PETSc and DAMASK --- installation/patch/PETSc3.8 | 447 ++++++++++++----------------------- installation/patch/README.md | 7 + 2 files changed, 152 insertions(+), 302 deletions(-) diff --git a/installation/patch/PETSc3.8 b/installation/patch/PETSc3.8 index c6b95f775..c7008fffa 100644 --- a/installation/patch/PETSc3.8 +++ b/installation/patch/PETSc3.8 @@ -1,38 +1,36 @@ -From 2355d41203f829e5a24154184ab1a1a05e40b5e2 Mon Sep 17 00:00:00 2001 +From 1cc8e60d02323c3c9448df73bfc8f36f697e939a Mon Sep 17 00:00:00 2001 From: Martin Diehl -Date: Sun, 5 Nov 2017 12:48:31 +0100 -Subject: [PATCH 1/3] adjusted calling of PETSc routines. Compiles but crashes - conditional prints for worldrank not needed (redirected to /dev/null) failing - during compilation is faster than during runtime +Date: Mon, 20 Nov 2017 12:53:47 +0100 +Subject: [PATCH] existing patch + further fixes --- - src/DAMASK_spectral.f90 | 27 ++++++------------ - src/constitutive.f90 | 6 ++-- - src/damage_local.f90 | 8 ++---- - src/damage_none.f90 | 8 ++---- - src/damage_nonlocal.f90 | 8 ++---- - src/homogenization_RGC.f90 | 8 ++---- - src/homogenization_isostrain.f90 | 8 ++---- - src/homogenization_none.f90 | 10 ++----- - src/hydrogenflux_cahnhilliard.f90 | 8 ++---- - src/hydrogenflux_isoconc.f90 | 10 ++----- - src/kinematics_cleavage_opening.f90 | 8 ++---- - src/kinematics_slipplane_opening.f90 | 8 ++---- - src/kinematics_thermal_expansion.f90 | 8 ++---- - src/kinematics_vacancy_strain.f90 | 8 ++---- - src/mesh.f90 | 10 +++---- - src/numerics.f90 | 13 ++++----- - src/spectral_damage.f90 | 37 +++++++----------------- - src/spectral_interface.f90 | 31 ++++++++++---------- - src/spectral_mech_AL.f90 | 43 +++++++++------------------- - src/spectral_mech_Basic.f90 | 48 +++++++++++-------------------- - src/spectral_mech_Polarisation.f90 | 49 +++++++++++--------------------- - src/spectral_thermal.f90 | 55 ++++++++++++++++-------------------- - src/spectral_utilities.f90 | 34 ++++++++-------------- - 23 files changed, 156 insertions(+), 297 deletions(-) + src/DAMASK_spectral.f90 | 27 +++++-------- + src/constitutive.f90 | 6 +-- + src/damage_local.f90 | 8 +--- + src/damage_none.f90 | 8 +--- + src/damage_nonlocal.f90 | 8 +--- + src/homogenization_RGC.f90 | 8 +--- + src/homogenization_isostrain.f90 | 8 +--- + src/homogenization_none.f90 | 10 ++--- + src/hydrogenflux_cahnhilliard.f90 | 8 +--- + src/hydrogenflux_isoconc.f90 | 10 ++--- + src/kinematics_cleavage_opening.f90 | 8 +--- + src/kinematics_slipplane_opening.f90 | 8 +--- + src/kinematics_thermal_expansion.f90 | 8 +--- + src/kinematics_vacancy_strain.f90 | 8 +--- + src/mesh.f90 | 12 +++--- + src/numerics.f90 | 13 +++---- + src/spectral_damage.f90 | 39 ++++++------------- + src/spectral_interface.f90 | 31 ++++++++------- + src/spectral_mech_AL.f90 | 46 ++++++++-------------- + src/spectral_mech_Basic.f90 | 52 +++++++++---------------- + src/spectral_mech_Polarisation.f90 | 52 +++++++++---------------- + src/spectral_thermal.f90 | 75 +++++++++++++++++------------------- + src/spectral_utilities.f90 | 34 ++++++---------- + 23 files changed, 175 insertions(+), 312 deletions(-) diff --git a/src/DAMASK_spectral.f90 b/src/DAMASK_spectral.f90 -index dc529b2e..ee6b20fc 100644 +index f32bfb7b..c315b1b8 100644 --- a/src/DAMASK_spectral.f90 +++ b/src/DAMASK_spectral.f90 @@ -12,6 +12,8 @@ program DAMASK_spectral @@ -82,9 +80,9 @@ index dc529b2e..ee6b20fc 100644 @@ -448,7 +440,7 @@ program DAMASK_spectral call MPI_file_write(resUnit, & reshape(materialpoint_results(:,:,outputIndex(1):outputIndex(2)), & - [(outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults]), & -- (outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults, & -+ int((outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults), & + [(outputIndex(2)-outputIndex(1)+1)*int(materialpoint_sizeResults,pLongInt)]), & +- (outputIndex(2)-outputIndex(1)+1)*int(materialpoint_sizeResults,pLongInt), & ++ int(outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults, & MPI_DOUBLE, MPI_STATUS_IGNORE, ierr) if (ierr /= 0_pInt) call IO_error(error_ID=894_pInt, ext_msg='MPI_file_write') enddo @@ -101,9 +99,9 @@ index dc529b2e..ee6b20fc 100644 @@ -646,7 +637,7 @@ program DAMASK_spectral min(i*((maxRealOut)/materialpoint_sizeResults),size(materialpoint_results,3))],pLongInt) call MPI_file_write(resUnit,reshape(materialpoint_results(:,:,outputIndex(1):outputIndex(2)),& - [(outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults]), & -- (outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults,& -+ int((outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults), & + [(outputIndex(2)-outputIndex(1)+1)*int(materialpoint_sizeResults,pLongInt)]), & +- (outputIndex(2)-outputIndex(1)+1)*int(materialpoint_sizeResults,pLongInt),& ++ int(outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults,& MPI_DOUBLE, MPI_STATUS_IGNORE, ierr) if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_file_write') enddo @@ -454,7 +452,7 @@ index 791c0e3c..9558f506 100644 maxNinstance = int(count(phase_kinematics == KINEMATICS_vacancy_strain_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/src/mesh.f90 b/src/mesh.f90 -index 87160f2c..6e3b4823 100644 +index 666fe1e3..a314c22c 100644 --- a/src/mesh.f90 +++ b/src/mesh.f90 @@ -115,11 +115,6 @@ module mesh @@ -488,8 +486,17 @@ index 87160f2c..6e3b4823 100644 integer(C_INTPTR_T) :: devNull, local_K, local_K_offset integer :: ierr, worldsize #endif +@@ -518,8 +518,6 @@ subroutine mesh_init(ip,el) + integer(pInt), intent(in) :: el, ip + integer(pInt) :: j + logical :: myDebug +- +- external :: MPI_comm_size + + write(6,'(/,a)') ' <<<+- mesh init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() diff --git a/src/numerics.f90 b/src/numerics.f90 -index 2085e221..d2d00f3e 100644 +index 70c7f3c3..e7d54893 100644 --- a/src/numerics.f90 +++ b/src/numerics.f90 @@ -10,9 +10,6 @@ module numerics @@ -527,7 +534,7 @@ index 2085e221..d2d00f3e 100644 call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) call MPI_Comm_size(PETSC_COMM_WORLD,worldsize,ierr);CHKERRQ(ierr) diff --git a/src/spectral_damage.f90 b/src/spectral_damage.f90 -index 72765987..cea6f69c 100644 +index 72765987..11da3b96 100644 --- a/src/spectral_damage.f90 +++ b/src/spectral_damage.f90 @@ -4,8 +4,10 @@ @@ -597,8 +604,12 @@ index 72765987..cea6f69c 100644 DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, & !< cut off stencil at boundary DMDA_STENCIL_BOX, & !< Moore (26) neighborhood around central point grid(1),grid(2),grid(3), & !< global grid -@@ -126,7 +116,7 @@ subroutine spectral_damage_init() +@@ -124,9 +114,11 @@ subroutine spectral_damage_init() + damage_grid,ierr) !< handle, error + CHKERRQ(ierr) call SNESSetDM(damage_snes,damage_grid,ierr); CHKERRQ(ierr) !< connect snes to da ++ call DMsetFromOptions(damage_grid,ierr); CHKERRQ(ierr) ++ call DMsetUp(damage_grid,ierr); CHKERRQ(ierr) call DMCreateGlobalVector(damage_grid,solution,ierr); CHKERRQ(ierr) !< global solution vector (grid x 1, i.e. every def grad tensor) call DMDASNESSetFunctionLocal(damage_grid,INSERT_VALUES,spectral_damage_formResidual,& - PETSC_NULL_OBJECT,ierr) !< residual vector of same shape as solution vector @@ -606,16 +617,16 @@ index 72765987..cea6f69c 100644 CHKERRQ(ierr) call SNESSetFromOptions(damage_snes,ierr); CHKERRQ(ierr) !< pull it all together with additional cli arguments call SNESGetType(damage_snes,snes_type,ierr); CHKERRQ(ierr) -@@ -214,7 +204,7 @@ type(tSolutionState) function spectral_damage_solution(timeinc,timeinc_old,loadC +@@ -214,7 +206,7 @@ type(tSolutionState) function spectral_damage_solution(timeinc,timeinc_old,loadC params%timeinc = timeinc params%timeincOld = timeinc_old - call SNESSolve(damage_snes,PETSC_NULL_OBJECT,solution,ierr); CHKERRQ(ierr) -+ call SNESSolve(damage_snes,PETSC_NULL_SNES,solution,ierr); CHKERRQ(ierr) ++ call SNESSolve(damage_snes,PETSC_NULL_VEC,solution,ierr); CHKERRQ(ierr) call SNESGetConvergedReason(damage_snes,reason,ierr); CHKERRQ(ierr) if (reason < 1) then -@@ -360,9 +350,6 @@ subroutine spectral_damage_forward() +@@ -360,9 +352,6 @@ subroutine spectral_damage_forward() PetscScalar, dimension(:,:,:), pointer :: x_scal PetscErrorCode :: ierr @@ -625,7 +636,7 @@ index 72765987..cea6f69c 100644 if (cutBack) then damage_current = damage_lastInc damage_stagInc = damage_lastInc -@@ -405,10 +392,6 @@ subroutine spectral_damage_destroy() +@@ -405,10 +394,6 @@ subroutine spectral_damage_destroy() implicit none PetscErrorCode :: ierr @@ -716,7 +727,7 @@ index 3c8489d0..51360ac1 100644 getGeometryFile = geometryParameter posExt = scan(getGeometryFile,'.',back=.true.) diff --git a/src/spectral_mech_AL.f90 b/src/spectral_mech_AL.f90 -index 6d0fff28..e7ff0fbe 100644 +index 6d0fff28..dc221f6c 100644 --- a/src/spectral_mech_AL.f90 +++ b/src/spectral_mech_AL.f90 @@ -5,6 +5,8 @@ @@ -778,9 +789,12 @@ index 6d0fff28..e7ff0fbe 100644 write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverAL init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" -@@ -166,9 +161,9 @@ subroutine AL_init +@@ -165,10 +160,12 @@ subroutine AL_init + da,ierr) ! handle, error CHKERRQ(ierr) call SNESSetDM(snes,da,ierr); CHKERRQ(ierr) ++ call DMsetFromOptions(da,ierr); CHKERRQ(ierr) ++ call DMsetUp(da,ierr); CHKERRQ(ierr) call DMCreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) - call DMDASNESSetFunctionLocal(da,INSERT_VALUES,AL_formResidual,PETSC_NULL_OBJECT,ierr) + call DMDASNESSetFunctionLocal(da,INSERT_VALUES,AL_formResidual,PETSC_NULL_SNES,ierr) @@ -790,7 +804,7 @@ index 6d0fff28..e7ff0fbe 100644 CHKERRQ(ierr) call SNESSetFromOptions(snes,ierr); CHKERRQ(ierr) -@@ -280,8 +275,7 @@ type(tSolutionState) function & +@@ -280,8 +277,7 @@ type(tSolutionState) function & SNESConvergedReason :: reason external :: & @@ -800,16 +814,17 @@ index 6d0fff28..e7ff0fbe 100644 incInfo = incInfoIn -@@ -304,7 +298,7 @@ type(tSolutionState) function & +@@ -304,8 +300,7 @@ type(tSolutionState) function & !-------------------------------------------------------------------------------------------------- ! solve BVP - call SNESSolve(snes,PETSC_NULL_OBJECT,solution_vec,ierr) -+ call SNESSolve(snes,PETSC_NULL_SNES,solution_vec,ierr) - CHKERRQ(ierr) +- CHKERRQ(ierr) ++ call SNESsolve(snes,PETSC_NULL_VEC,solution_vec,ierr); CHKERRQ(ierr) !-------------------------------------------------------------------------------------------------- -@@ -383,10 +377,6 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) + ! check convergence +@@ -383,10 +378,6 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) integer(pInt) :: & i, j, k, e @@ -820,7 +835,7 @@ index 6d0fff28..e7ff0fbe 100644 F => x_scal(1:3,1:3,1,& XG_RANGE,YG_RANGE,ZG_RANGE) F_lambda => x_scal(1:3,1:3,2,& -@@ -697,11 +687,6 @@ subroutine AL_destroy() +@@ -697,11 +688,6 @@ subroutine AL_destroy() implicit none PetscErrorCode :: ierr @@ -833,7 +848,7 @@ index 6d0fff28..e7ff0fbe 100644 call SNESDestroy(snes,ierr); CHKERRQ(ierr) call DMDestroy(da,ierr); CHKERRQ(ierr) diff --git a/src/spectral_mech_Basic.f90 b/src/spectral_mech_Basic.f90 -index cfb72712..b02cfd8c 100644 +index 55403ee7..fe9eb493 100644 --- a/src/spectral_mech_Basic.f90 +++ b/src/spectral_mech_Basic.f90 @@ -5,6 +5,8 @@ @@ -888,7 +903,7 @@ index cfb72712..b02cfd8c 100644 write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverBasicPETSc init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" -@@ -152,14 +146,14 @@ subroutine basicPETSc_init +@@ -152,19 +146,20 @@ subroutine basicPETSc_init grid(1),grid(2),localK, & ! local grid da,ierr) ! handle, error CHKERRQ(ierr) @@ -896,6 +911,8 @@ index cfb72712..b02cfd8c 100644 - call DMCreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) ! global solution vector (grid x 9, i.e. every def grad tensor) - call DMDASNESSetFunctionLocal(da,INSERT_VALUES,BasicPETSC_formResidual,PETSC_NULL_OBJECT,ierr) ! residual vector of same shape as solution vector + call SNESsetDM(snes,da,ierr); CHKERRQ(ierr) ++ call DMsetFromOptions(da,ierr); CHKERRQ(ierr) ++ call DMsetUp(da,ierr); CHKERRQ(ierr) + call DMcreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) ! global solution vector (grid x 9, i.e. every def grad tensor) + call DMDASNESsetFunctionLocal(da,INSERT_VALUES,BasicPETSC_formResidual,PETSC_NULL_SNES,ierr) ! residual vector of same shape as solution vector CHKERRQ(ierr) @@ -909,7 +926,12 @@ index cfb72712..b02cfd8c 100644 !-------------------------------------------------------------------------------------------------- ! init fields -@@ -253,8 +247,7 @@ type(tSolutionState) function & + call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) ! get the data out of PETSc to work with +- + restart: if (restartInc > 1_pInt) then + if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0) & + write(6,'(/,a,'//IO_intOut(restartInc-1_pInt)//',a)') & +@@ -253,8 +248,7 @@ type(tSolutionState) function & SNESConvergedReason :: reason external :: & @@ -919,16 +941,17 @@ index cfb72712..b02cfd8c 100644 incInfo = incInfoIn -@@ -274,7 +267,7 @@ type(tSolutionState) function & +@@ -274,8 +268,7 @@ type(tSolutionState) function & !-------------------------------------------------------------------------------------------------- ! solve BVP - call SNESSolve(snes,PETSC_NULL_OBJECT,solution_vec,ierr) -+ call SNESSolve(snes,PETSC_NULL_SNES,solution_vec,ierr) - CHKERRQ(ierr) +- CHKERRQ(ierr) ++ call SNESsolve(snes,PETSC_NULL_VEC,solution_vec,ierr); CHKERRQ(ierr) !-------------------------------------------------------------------------------------------------- -@@ -337,10 +330,6 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) + ! check convergence +@@ -336,10 +329,6 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) PetscObject :: dummy PetscErrorCode :: ierr @@ -939,7 +962,7 @@ index cfb72712..b02cfd8c 100644 call SNESGetNumberFunctionEvals(snes,nfuncs,ierr); CHKERRQ(ierr) call SNESGetIterationNumber(snes,PETScIter,ierr); CHKERRQ(ierr) -@@ -556,11 +545,6 @@ subroutine BasicPETSc_destroy() +@@ -555,11 +544,6 @@ subroutine BasicPETSc_destroy() implicit none PetscErrorCode :: ierr @@ -952,7 +975,7 @@ index cfb72712..b02cfd8c 100644 call SNESDestroy(snes,ierr); CHKERRQ(ierr) call DMDestroy(da,ierr); CHKERRQ(ierr) diff --git a/src/spectral_mech_Polarisation.f90 b/src/spectral_mech_Polarisation.f90 -index ecf707d4..2b9dddc0 100644 +index ecf707d4..3b024f56 100644 --- a/src/spectral_mech_Polarisation.f90 +++ b/src/spectral_mech_Polarisation.f90 @@ -5,6 +5,8 @@ @@ -1014,7 +1037,7 @@ index ecf707d4..2b9dddc0 100644 write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverPolarisation init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" -@@ -164,13 +159,13 @@ subroutine Polarisation_init +@@ -164,13 +159,15 @@ subroutine Polarisation_init grid(1),grid(2),localK, & ! local grid da,ierr) ! handle, error CHKERRQ(ierr) @@ -1022,6 +1045,8 @@ index ecf707d4..2b9dddc0 100644 - call DMCreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) - call DMDASNESSetFunctionLocal(da,INSERT_VALUES,Polarisation_formResidual,PETSC_NULL_OBJECT,ierr) + call SNESsetDM(snes,da,ierr); CHKERRQ(ierr) ++ call DMsetFromOptions(da,ierr); CHKERRQ(ierr) ++ call DMsetUp(da,ierr); CHKERRQ(ierr) + call DMcreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) + call DMDASNESsetFunctionLocal(da,INSERT_VALUES,Polarisation_formResidual,PETSC_NULL_SNES,ierr) CHKERRQ(ierr) @@ -1033,7 +1058,7 @@ index ecf707d4..2b9dddc0 100644 !-------------------------------------------------------------------------------------------------- ! init fields -@@ -280,8 +275,7 @@ type(tSolutionState) function & +@@ -280,8 +277,7 @@ type(tSolutionState) function & SNESConvergedReason :: reason external :: & @@ -1043,16 +1068,17 @@ index ecf707d4..2b9dddc0 100644 incInfo = incInfoIn -@@ -304,7 +298,7 @@ type(tSolutionState) function & +@@ -304,8 +300,7 @@ type(tSolutionState) function & !-------------------------------------------------------------------------------------------------- ! solve BVP - call SNESSolve(snes,PETSC_NULL_OBJECT,solution_vec,ierr) -+ call SNESSolve(snes,PETSC_NULL_SNES,solution_vec,ierr) - CHKERRQ(ierr) +- CHKERRQ(ierr) ++ call SNESsolve(snes,PETSC_NULL_VEC,solution_vec,ierr); CHKERRQ(ierr) !-------------------------------------------------------------------------------------------------- -@@ -383,10 +377,6 @@ subroutine Polarisation_formResidual(in,x_scal,f_scal,dummy,ierr) + ! check convergence +@@ -383,10 +378,6 @@ subroutine Polarisation_formResidual(in,x_scal,f_scal,dummy,ierr) integer(pInt) :: & i, j, k, e @@ -1063,7 +1089,7 @@ index ecf707d4..2b9dddc0 100644 F => x_scal(1:3,1:3,1,& XG_RANGE,YG_RANGE,ZG_RANGE) F_tau => x_scal(1:3,1:3,2,& -@@ -698,11 +688,6 @@ subroutine Polarisation_destroy() +@@ -698,11 +689,6 @@ subroutine Polarisation_destroy() implicit none PetscErrorCode :: ierr @@ -1076,7 +1102,7 @@ index ecf707d4..2b9dddc0 100644 call SNESDestroy(snes,ierr); CHKERRQ(ierr) call DMDestroy(da,ierr); CHKERRQ(ierr) diff --git a/src/spectral_thermal.f90 b/src/spectral_thermal.f90 -index 322f1203..cc0f7678 100644 +index 322f1203..2374d83b 100644 --- a/src/spectral_thermal.f90 +++ b/src/spectral_thermal.f90 @@ -4,6 +4,8 @@ @@ -1151,25 +1177,64 @@ index 322f1203..cc0f7678 100644 !-------------------------------------------------------------------------------------------------- ! initialize solver specific parts of PETSc -@@ -127,7 +122,7 @@ subroutine spectral_thermal_init - call SNESSetDM(thermal_snes,thermal_grid,ierr); CHKERRQ(ierr) ! connect snes to da - call DMCreateGlobalVector(thermal_grid,solution ,ierr); CHKERRQ(ierr) ! global solution vector (grid x 1, i.e. every def grad tensor) - call DMDASNESSetFunctionLocal(thermal_grid,INSERT_VALUES,spectral_thermal_formResidual,& +@@ -124,16 +119,18 @@ subroutine spectral_thermal_init + grid (1),grid(2),localK, & ! local grid + thermal_grid,ierr) ! handle, error + CHKERRQ(ierr) +- call SNESSetDM(thermal_snes,thermal_grid,ierr); CHKERRQ(ierr) ! connect snes to da +- call DMCreateGlobalVector(thermal_grid,solution ,ierr); CHKERRQ(ierr) ! global solution vector (grid x 1, i.e. every def grad tensor) +- call DMDASNESSetFunctionLocal(thermal_grid,INSERT_VALUES,spectral_thermal_formResidual,& - PETSC_NULL_OBJECT,ierr) ! residual vector of same shape as solution vector ++ call SNESsetDM(thermal_snes,thermal_grid,ierr); CHKERRQ(ierr) ! connect snes to da ++ call DMsetFromOptions(thermal_grid,ierr); CHKERRQ(ierr) ++ call DMsetUp(thermal_grid,ierr); CHKERRQ(ierr) ++ call DMcreateGlobalVector(thermal_grid,solution,ierr); CHKERRQ(ierr) ! global solution vector (grid x 1, i.e. every def grad tensor) ++ call DMDASNESsetFunctionLocal(thermal_grid,INSERT_VALUES,spectral_thermal_formResidual,& + PETSC_NULL_SNES,ierr) ! residual vector of same shape as solution vector CHKERRQ(ierr) - call SNESSetFromOptions(thermal_snes,ierr); CHKERRQ(ierr) ! pull it all together with additional cli arguments +- call SNESSetFromOptions(thermal_snes,ierr); CHKERRQ(ierr) ! pull it all together with additional cli arguments ++ call SNESsetFromOptions(thermal_snes,ierr); CHKERRQ(ierr) ! pull it all together with additional cli arguments -@@ -215,7 +210,7 @@ type(tSolutionState) function spectral_thermal_solution(timeinc,timeinc_old,load + !-------------------------------------------------------------------------------------------------- + ! init fields +- call DMDAGetCorners(thermal_grid,xstart,ystart,zstart,xend,yend,zend,ierr) ++ call DMDAgetCorners(thermal_grid,xstart,ystart,zstart,xend,yend,zend,ierr) + CHKERRQ(ierr) + xend = xstart + xend - 1 + yend = ystart + yend - 1 +@@ -149,9 +146,9 @@ subroutine spectral_thermal_init + temperature_lastInc(i,j,k) = temperature_current(i,j,k) + temperature_stagInc(i,j,k) = temperature_current(i,j,k) + enddo; enddo; enddo +- call DMDAVecGetArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) !< get the data out of PETSc to work with ++ call DMDAvecGetArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) !< get the data out of PETSc to work with + x_scal(xstart:xend,ystart:yend,zstart:zend) = temperature_current +- call DMDAVecRestoreArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) ++ call DMDAvecRestoreArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) + + !-------------------------------------------------------------------------------------------------- + ! thermal reference diffusion update +@@ -205,8 +202,8 @@ type(tSolutionState) function spectral_thermal_solution(timeinc,timeinc_old,load + external :: & + VecMin, & + VecMax, & +- SNESSolve, & +- SNESGetConvergedReason ++ SNESsolve, & ++ SNESgetConvergedReason + + spectral_thermal_solution%converged =.false. + +@@ -215,7 +212,7 @@ type(tSolutionState) function spectral_thermal_solution(timeinc,timeinc_old,load params%timeinc = timeinc params%timeincOld = timeinc_old - call SNESSolve(thermal_snes,PETSC_NULL_OBJECT,solution,ierr); CHKERRQ(ierr) -+ call SNESSolve(thermal_snes,PETSC_NULL_SNES,solution,ierr); CHKERRQ(ierr) ++ call SNESsolve(thermal_snes,PETSC_NULL_VEC,solution,ierr); CHKERRQ(ierr) call SNESGetConvergedReason(thermal_snes,reason,ierr); CHKERRQ(ierr) if (reason < 1) then -@@ -245,14 +240,12 @@ type(tSolutionState) function spectral_thermal_solution(timeinc,timeinc_old,load +@@ -245,14 +242,12 @@ type(tSolutionState) function spectral_thermal_solution(timeinc,timeinc_old,load call VecMin(solution,position,minTemperature,ierr); CHKERRQ(ierr) call VecMax(solution,position,maxTemperature,ierr); CHKERRQ(ierr) @@ -1191,7 +1256,7 @@ index 322f1203..cc0f7678 100644 end function spectral_thermal_solution diff --git a/src/spectral_utilities.f90 b/src/spectral_utilities.f90 -index 1ad25174..bbef337f 100644 +index 1bbf2e60..52bb07fd 100644 --- a/src/spectral_utilities.f90 +++ b/src/spectral_utilities.f90 @@ -5,15 +5,16 @@ @@ -1282,7 +1347,7 @@ index 1ad25174..bbef337f 100644 write(6,'(/,a)') ' ... calculating curl ......................................................' flush(6) -@@ -1096,9 +1089,6 @@ function utilities_forwardField(timeinc,field_lastInc,rate,aim) +@@ -1099,9 +1092,6 @@ function utilities_forwardField(timeinc,field_lastInc,rate,aim) real(pReal), dimension(3,3) :: fieldDiff !< - aim PetscErrorCode :: ierr @@ -1292,7 +1357,7 @@ index 1ad25174..bbef337f 100644 utilities_forwardField = field_lastInc + rate*timeinc if (present(aim)) then !< correct to match average fieldDiff = sum(sum(sum(utilities_forwardField,dim=5),dim=4),dim=3)*wgt -@@ -1190,8 +1180,6 @@ subroutine utilities_updateIPcoords(F) +@@ -1193,8 +1183,6 @@ subroutine utilities_updateIPcoords(F) integer(pInt) :: i, j, k, m, ierr real(pReal), dimension(3) :: step, offset_coords real(pReal), dimension(3,3) :: Favg @@ -1304,225 +1369,3 @@ index 1ad25174..bbef337f 100644 -- 2.15.0 - -From 237f199bbf574bb2509123ce8b037ac751abd15d Mon Sep 17 00:00:00 2001 -From: Martin Diehl -Date: Sun, 5 Nov 2017 13:45:52 +0100 -Subject: [PATCH 2/3] extra function calls for da needed - (https://lists.mcs.anl.gov/pipermail/petsc-users/2017-February/031538.html) - SNESsolve requires PETSC_NULL_VEC not PETSC_NULL_SNES (indicating b=0) - ---- - src/spectral_damage.f90 | 4 +++- - src/spectral_mech_AL.f90 | 5 +++-- - src/spectral_mech_Basic.f90 | 6 +++--- - src/spectral_mech_Polarisation.f90 | 5 +++-- - src/spectral_thermal.f90 | 22 ++++++++++++---------- - 5 files changed, 24 insertions(+), 18 deletions(-) - -diff --git a/src/spectral_damage.f90 b/src/spectral_damage.f90 -index cea6f69c..2c195c56 100644 ---- a/src/spectral_damage.f90 -+++ b/src/spectral_damage.f90 -@@ -114,6 +114,8 @@ subroutine spectral_damage_init() - damage_grid,ierr) !< handle, error - CHKERRQ(ierr) - call SNESSetDM(damage_snes,damage_grid,ierr); CHKERRQ(ierr) !< connect snes to da -+ call DMsetFromOptions(da,ierr); CHKERRQ(ierr) -+ call DMsetUp(da,ierr); CHKERRQ(ierr) - call DMCreateGlobalVector(damage_grid,solution,ierr); CHKERRQ(ierr) !< global solution vector (grid x 1, i.e. every def grad tensor) - call DMDASNESSetFunctionLocal(damage_grid,INSERT_VALUES,spectral_damage_formResidual,& - PETSC_NULL_SNES,ierr) !< residual vector of same shape as solution vector -@@ -204,7 +206,7 @@ type(tSolutionState) function spectral_damage_solution(timeinc,timeinc_old,loadC - params%timeinc = timeinc - params%timeincOld = timeinc_old - -- call SNESSolve(damage_snes,PETSC_NULL_SNES,solution,ierr); CHKERRQ(ierr) -+ call SNESSolve(damage_snes,PETSC_NULL_VEC,solution,ierr); CHKERRQ(ierr) - call SNESGetConvergedReason(damage_snes,reason,ierr); CHKERRQ(ierr) - - if (reason < 1) then -diff --git a/src/spectral_mech_AL.f90 b/src/spectral_mech_AL.f90 -index e7ff0fbe..dc221f6c 100644 ---- a/src/spectral_mech_AL.f90 -+++ b/src/spectral_mech_AL.f90 -@@ -160,6 +160,8 @@ subroutine AL_init - da,ierr) ! handle, error - CHKERRQ(ierr) - call SNESSetDM(snes,da,ierr); CHKERRQ(ierr) -+ call DMsetFromOptions(da,ierr); CHKERRQ(ierr) -+ call DMsetUp(da,ierr); CHKERRQ(ierr) - call DMCreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) - call DMDASNESSetFunctionLocal(da,INSERT_VALUES,AL_formResidual,PETSC_NULL_SNES,ierr) - CHKERRQ(ierr) -@@ -298,8 +300,7 @@ type(tSolutionState) function & - - !-------------------------------------------------------------------------------------------------- - ! solve BVP -- call SNESSolve(snes,PETSC_NULL_SNES,solution_vec,ierr) -- CHKERRQ(ierr) -+ call SNESsolve(snes,PETSC_NULL_VEC,solution_vec,ierr); CHKERRQ(ierr) - - !-------------------------------------------------------------------------------------------------- - ! check convergence -diff --git a/src/spectral_mech_Basic.f90 b/src/spectral_mech_Basic.f90 -index b02cfd8c..c335f2d7 100644 ---- a/src/spectral_mech_Basic.f90 -+++ b/src/spectral_mech_Basic.f90 -@@ -147,6 +147,8 @@ subroutine basicPETSc_init - da,ierr) ! handle, error - CHKERRQ(ierr) - call SNESsetDM(snes,da,ierr); CHKERRQ(ierr) -+ call DMsetFromOptions(da,ierr); CHKERRQ(ierr) -+ call DMsetUp(da,ierr); CHKERRQ(ierr) - call DMcreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) ! global solution vector (grid x 9, i.e. every def grad tensor) - call DMDASNESsetFunctionLocal(da,INSERT_VALUES,BasicPETSC_formResidual,PETSC_NULL_SNES,ierr) ! residual vector of same shape as solution vector - CHKERRQ(ierr) -@@ -158,7 +160,6 @@ subroutine basicPETSc_init - !-------------------------------------------------------------------------------------------------- - ! init fields - call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) ! get the data out of PETSc to work with -- - restart: if (restartInc > 1_pInt) then - if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0) & - write(6,'(/,a,'//IO_intOut(restartInc-1_pInt)//',a)') & -@@ -267,8 +268,7 @@ type(tSolutionState) function & - - !-------------------------------------------------------------------------------------------------- - ! solve BVP -- call SNESSolve(snes,PETSC_NULL_SNES,solution_vec,ierr) -- CHKERRQ(ierr) -+ call SNESsolve(snes,PETSC_NULL_VEC,solution_vec,ierr); CHKERRQ(ierr) - - !-------------------------------------------------------------------------------------------------- - ! check convergence -diff --git a/src/spectral_mech_Polarisation.f90 b/src/spectral_mech_Polarisation.f90 -index 2b9dddc0..3b024f56 100644 ---- a/src/spectral_mech_Polarisation.f90 -+++ b/src/spectral_mech_Polarisation.f90 -@@ -160,6 +160,8 @@ subroutine Polarisation_init - da,ierr) ! handle, error - CHKERRQ(ierr) - call SNESsetDM(snes,da,ierr); CHKERRQ(ierr) -+ call DMsetFromOptions(da,ierr); CHKERRQ(ierr) -+ call DMsetUp(da,ierr); CHKERRQ(ierr) - call DMcreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) - call DMDASNESsetFunctionLocal(da,INSERT_VALUES,Polarisation_formResidual,PETSC_NULL_SNES,ierr) - CHKERRQ(ierr) -@@ -298,8 +300,7 @@ type(tSolutionState) function & - - !-------------------------------------------------------------------------------------------------- - ! solve BVP -- call SNESSolve(snes,PETSC_NULL_SNES,solution_vec,ierr) -- CHKERRQ(ierr) -+ call SNESsolve(snes,PETSC_NULL_VEC,solution_vec,ierr); CHKERRQ(ierr) - - !-------------------------------------------------------------------------------------------------- - ! check convergence -diff --git a/src/spectral_thermal.f90 b/src/spectral_thermal.f90 -index cc0f7678..7115538c 100644 ---- a/src/spectral_thermal.f90 -+++ b/src/spectral_thermal.f90 -@@ -119,16 +119,18 @@ subroutine spectral_thermal_init - grid (1),grid(2),localK, & ! local grid - thermal_grid,ierr) ! handle, error - CHKERRQ(ierr) -- call SNESSetDM(thermal_snes,thermal_grid,ierr); CHKERRQ(ierr) ! connect snes to da -- call DMCreateGlobalVector(thermal_grid,solution ,ierr); CHKERRQ(ierr) ! global solution vector (grid x 1, i.e. every def grad tensor) -- call DMDASNESSetFunctionLocal(thermal_grid,INSERT_VALUES,spectral_thermal_formResidual,& -+ call SNESsetDM(thermal_snes,thermal_grid,ierr); CHKERRQ(ierr) ! connect snes to da -+ call DMsetFromOptions(da,ierr); CHKERRQ(ierr) -+ call DMsetUp(da,ierr); CHKERRQ(ierr) -+ call DMcreateGlobalVector(thermal_grid,solution,ierr); CHKERRQ(ierr) ! global solution vector (grid x 1, i.e. every def grad tensor) -+ call DMDASNESsetFunctionLocal(thermal_grid,INSERT_VALUES,spectral_thermal_formResidual,& - PETSC_NULL_SNES,ierr) ! residual vector of same shape as solution vector - CHKERRQ(ierr) -- call SNESSetFromOptions(thermal_snes,ierr); CHKERRQ(ierr) ! pull it all together with additional cli arguments -+ call SNESsetFromOptions(thermal_snes,ierr); CHKERRQ(ierr) ! pull it all together with additional cli arguments - - !-------------------------------------------------------------------------------------------------- - ! init fields -- call DMDAGetCorners(thermal_grid,xstart,ystart,zstart,xend,yend,zend,ierr) -+ call DMDAgetCorners(thermal_grid,xstart,ystart,zstart,xend,yend,zend,ierr) - CHKERRQ(ierr) - xend = xstart + xend - 1 - yend = ystart + yend - 1 -@@ -144,9 +146,9 @@ subroutine spectral_thermal_init - temperature_lastInc(i,j,k) = temperature_current(i,j,k) - temperature_stagInc(i,j,k) = temperature_current(i,j,k) - enddo; enddo; enddo -- call DMDAVecGetArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) !< get the data out of PETSc to work with -+ call DMDAvecGetArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) !< get the data out of PETSc to work with - x_scal(xstart:xend,ystart:yend,zstart:zend) = temperature_current -- call DMDAVecRestoreArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) -+ call DMDAvecRestoreArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) - - !-------------------------------------------------------------------------------------------------- - ! thermal reference diffusion update -@@ -200,8 +202,8 @@ type(tSolutionState) function spectral_thermal_solution(timeinc,timeinc_old,load - external :: & - VecMin, & - VecMax, & -- SNESSolve, & -- SNESGetConvergedReason -+ SNESsolve, & -+ SNESgetConvergedReason - - spectral_thermal_solution%converged =.false. - -@@ -210,7 +212,7 @@ type(tSolutionState) function spectral_thermal_solution(timeinc,timeinc_old,load - params%timeinc = timeinc - params%timeincOld = timeinc_old - -- call SNESSolve(thermal_snes,PETSC_NULL_SNES,solution,ierr); CHKERRQ(ierr) -+ call SNESsolve(thermal_snes,PETSC_NULL_VEC,solution,ierr); CHKERRQ(ierr) - call SNESGetConvergedReason(thermal_snes,reason,ierr); CHKERRQ(ierr) - - if (reason < 1) then --- -2.15.0 - - -From 1af2e332a1b86f388aa9e481255f4405874d7960 Mon Sep 17 00:00:00 2001 -From: Martin Diehl -Date: Sun, 5 Nov 2017 14:18:45 +0100 -Subject: [PATCH 3/3] named better in thermal and damage - ---- - src/spectral_damage.f90 | 4 ++-- - src/spectral_thermal.f90 | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/spectral_damage.f90 b/src/spectral_damage.f90 -index 2c195c56..11da3b96 100644 ---- a/src/spectral_damage.f90 -+++ b/src/spectral_damage.f90 -@@ -114,8 +114,8 @@ subroutine spectral_damage_init() - damage_grid,ierr) !< handle, error - CHKERRQ(ierr) - call SNESSetDM(damage_snes,damage_grid,ierr); CHKERRQ(ierr) !< connect snes to da -- call DMsetFromOptions(da,ierr); CHKERRQ(ierr) -- call DMsetUp(da,ierr); CHKERRQ(ierr) -+ call DMsetFromOptions(damage_grid,ierr); CHKERRQ(ierr) -+ call DMsetUp(damage_grid,ierr); CHKERRQ(ierr) - call DMCreateGlobalVector(damage_grid,solution,ierr); CHKERRQ(ierr) !< global solution vector (grid x 1, i.e. every def grad tensor) - call DMDASNESSetFunctionLocal(damage_grid,INSERT_VALUES,spectral_damage_formResidual,& - PETSC_NULL_SNES,ierr) !< residual vector of same shape as solution vector -diff --git a/src/spectral_thermal.f90 b/src/spectral_thermal.f90 -index 7115538c..2374d83b 100644 ---- a/src/spectral_thermal.f90 -+++ b/src/spectral_thermal.f90 -@@ -120,8 +120,8 @@ subroutine spectral_thermal_init - thermal_grid,ierr) ! handle, error - CHKERRQ(ierr) - call SNESsetDM(thermal_snes,thermal_grid,ierr); CHKERRQ(ierr) ! connect snes to da -- call DMsetFromOptions(da,ierr); CHKERRQ(ierr) -- call DMsetUp(da,ierr); CHKERRQ(ierr) -+ call DMsetFromOptions(thermal_grid,ierr); CHKERRQ(ierr) -+ call DMsetUp(thermal_grid,ierr); CHKERRQ(ierr) - call DMcreateGlobalVector(thermal_grid,solution,ierr); CHKERRQ(ierr) ! global solution vector (grid x 1, i.e. every def grad tensor) - call DMDASNESsetFunctionLocal(thermal_grid,INSERT_VALUES,spectral_thermal_formResidual,& - PETSC_NULL_SNES,ierr) ! residual vector of same shape as solution vector --- -2.15.0 - diff --git a/installation/patch/README.md b/installation/patch/README.md index cd4549b2b..69b9176ee 100644 --- a/installation/patch/README.md +++ b/installation/patch/README.md @@ -16,3 +16,10 @@ patch -p1 < installation/patch/nameOfPatch * **PETSc-3.8** adjusts all includes nad calls to PETSc to the 3.8.x API This allows to use the current version of PETSc + +## Create patch +commit your changes + +```bash +git format-patch PATH_TO_COMPARE --stdout > +``` From b53a2a65077b19b43773d7db8e9a4aa85b863f07 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 20 Nov 2017 16:59:52 +0100 Subject: [PATCH 04/11] [skip ci] updated version information after successful test of v2.0.1-985-g90c617e --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ed59e5b34..7a1f21f80 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-982-ge4700cd +v2.0.1-985-g90c617e From 37e154de651e714033648968acbe10127a667be6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 20 Nov 2017 23:43:06 +0100 Subject: [PATCH 05/11] preventing division by zero --- src/plastic_disloUCLA.f90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plastic_disloUCLA.f90 b/src/plastic_disloUCLA.f90 index 75e087770..c02a7c4d4 100644 --- a/src/plastic_disloUCLA.f90 +++ b/src/plastic_disloUCLA.f90 @@ -1178,7 +1178,7 @@ end subroutine plastic_disloUCLA_dotState function plastic_disloUCLA_postResults(Tstar_v,Temperature,ipc,ip,el) use prec, only: & tol_math_check, & - dEq + dEq, dNeq0 use math, only: & pi use material, only: & @@ -1445,9 +1445,13 @@ function plastic_disloUCLA_postResults(Tstar_v,Temperature,ipc,ip,el) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family slipSystems2: do i = 1_pInt,plastic_disloUCLA_Nslip(f,instance) j = j + 1_pInt + if (dNeq0(abs(dot_product(Tstar_v,lattice_Sslip_v(:,1,index_myFamily+i,ph))))) then plastic_disloUCLA_postResults(c+j) = & (3.0_pReal*lattice_mu(ph)*plastic_disloUCLA_burgersPerSlipSystem(j,instance))/& (16.0_pReal*pi*abs(dot_product(Tstar_v,lattice_Sslip_v(:,1,index_myFamily+i,ph)))) + else + plastic_disloUCLA_postResults(c+j) = huge(1.0_pReal) + endif plastic_disloUCLA_postResults(c+j)=min(plastic_disloUCLA_postResults(c+j),& state(instance)%mfp_slip(j,of)) enddo slipSystems2; enddo slipFamilies2 From 09a66d918d684c3ab6fe5748becc5cbe9662e9cb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 21 Nov 2017 09:18:03 +0100 Subject: [PATCH 06/11] (in)equality comparison for double was far too tolerant --- src/prec.f90 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/prec.f90 b/src/prec.f90 index 0e3b276db..912a02533 100644 --- a/src/prec.f90 +++ b/src/prec.f90 @@ -137,6 +137,7 @@ end subroutine prec_init !> @brief equality comparison for float with double precision ! replaces "==" but for certain (relative) tolerance. Counterpart to dNeq ! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ +! AlmostEqualRelative !-------------------------------------------------------------------------------------------------- logical elemental pure function dEq(a,b,tol) @@ -153,6 +154,7 @@ end function dEq !> @brief inequality comparison for float with double precision ! replaces "!=" but for certain (relative) tolerance. Counterpart to dEq ! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ +! AlmostEqualRelative NOT !-------------------------------------------------------------------------------------------------- logical elemental pure function dNeq(a,b,tol) @@ -167,33 +169,35 @@ end function dNeq !-------------------------------------------------------------------------------------------------- !> @brief equality to 0 comparison for float with double precision -! replaces "==0" but for certain (absolute) tolerance. Counterpart to dNeq0 -! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ +! replaces "==0" but everything not representable as a normal number is treated as 0. Counterpart to dNeq0 +! https://de.mathworks.com/help/matlab/ref/realmin.html +! https://docs.oracle.com/cd/E19957-01/806-3568/ncg_math.html !-------------------------------------------------------------------------------------------------- logical elemental pure function dEq0(a,tol) implicit none real(pReal), intent(in) :: a real(pReal), intent(in), optional :: tol - real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + real(pReal), parameter :: eps = 2.2250738585072014E-308 ! smallest non-denormalized number - dEq0 = merge(.True., .False.,abs(a) <= merge(tol,eps,present(tol))*10.0_pReal) + dEq0 = merge(.True., .False.,abs(a) <= merge(tol,eps,present(tol))) end function dEq0 !-------------------------------------------------------------------------------------------------- !> @brief inequality to 0 comparison for float with double precision -! replaces "!=0" but for certain (absolute) tolerance. Counterpart to dEq0 -! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ +! replaces "!=0" but everything not representable as a normal number is treated as 0. Counterpart to dEq0 +! https://de.mathworks.com/help/matlab/ref/realmin.html +! https://docs.oracle.com/cd/E19957-01/806-3568/ncg_math.html !-------------------------------------------------------------------------------------------------- logical elemental pure function dNeq0(a,tol) implicit none real(pReal), intent(in) :: a real(pReal), intent(in), optional :: tol - real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + real(pReal), parameter :: eps = 2.2250738585072014E-308 ! smallest non-denormalized number - dNeq0 = merge(.False., .True.,abs(a) <= merge(tol,eps,present(tol))*10.0_pReal) + dNeq0 = merge(.False., .True.,abs(a) <= merge(tol,eps,present(tol))) end function dNeq0 From 4dfb52c79295a24516a7d18be65c925558798bf7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 20 Nov 2017 13:35:25 +0100 Subject: [PATCH 07/11] unfinished HDF5 should not be part of the next release --- lib/damask/DS_HDF5.xml | 198 ------------------ lib/damask/__init__.py | 18 -- lib/damask/h5table.py | 146 ------------- processing/post/h5_addCalculation.py | 72 ------- processing/post/h5_addCauchy.py | 61 ------ processing/post/h5_addIPFcolor.py | 145 ------------- processing/post/h5_addMises.py | 85 -------- processing/post/h5_addStrainTensors.py | 156 -------------- processing/post/h5_addXdmfWapper.py | 130 ------------ .../post/h5_vtkAddRectilinearGridData.py | 191 ----------------- processing/post/h5_vtkRectilinearGrid.py | 135 ------------ processing/pre/3DRVEfrom2Dang.py | 0 12 files changed, 1337 deletions(-) delete mode 100644 lib/damask/DS_HDF5.xml delete mode 100644 lib/damask/h5table.py delete mode 100755 processing/post/h5_addCalculation.py delete mode 100755 processing/post/h5_addCauchy.py delete mode 100755 processing/post/h5_addIPFcolor.py delete mode 100755 processing/post/h5_addMises.py delete mode 100755 processing/post/h5_addStrainTensors.py delete mode 100755 processing/post/h5_addXdmfWapper.py delete mode 100755 processing/post/h5_vtkAddRectilinearGridData.py delete mode 100755 processing/post/h5_vtkRectilinearGrid.py mode change 100644 => 100755 processing/pre/3DRVEfrom2Dang.py diff --git a/lib/damask/DS_HDF5.xml b/lib/damask/DS_HDF5.xml deleted file mode 100644 index 1277ce8d2..000000000 --- a/lib/damask/DS_HDF5.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - attr - / - - store cmd history - - - - attr - / - - - - - - - Scalar - /Geometry/Vx - Geometry - Vector along x define the spectral mesh - - - - Scalar - /Geometry/Vy - Geometry - Vector along y defines the spectral mesh - - - - Scalar - /Geometry/Vz - Geometry - Vector along z defines the spectral mesh - - - - Scalar - /Geometry/ip - Geometry - - - - - Scalar - /Geometry/node - Geometry - - - - - Scalar - /Geometry/grain - Geometry - - - - - Vector - /Geometry/pos - Geometry - - - - - Scalar - /Geometry/elem - Geometry - - - - - - Scalar - /Crystallite/phase - Crystallite - - - - - Scalar - /Crystallite/texture - Crystallite - - - - - Scalar - /Crystallite/volume - Crystallite - - - - - Vector - /Crystallite/orientation - Crystallite - - - - - Vector - /Crystallite/eulerangles - Crystallite - Bunnge Euler angles in degrees - - - - Vector - /Crystallite/grainrotation - Crystallite - - - - - Tensor - /Crystallite/f - Crystallite - deformation gradient (F) - - -

- Tensor - /Crystallite/p - Crystallite - Pikola Kirkhoff stress -

- - - Tensor - /Crystallite/Cauchy - Crystallite - Cauchy stress tensor - - - - Tensor - /Crystallite/lnV - Crystallite - - - - - Scalar - /Crystallite/MisesCauchy - Crystallite - von Mises equivalent of Cauchy stress - - - - Scalar - /Crystallite/MiseslnV - Crystallite - left von Mises strain - - - - - Vector - /Constitutive/resistance_slip - Constitutive - - - - - Vector - /Constitutive/shearrate_slip - Constitutive - - - - - Vector - /Constitutive/resolvedstress_slip - Constitutive - - - - - Scalar - /Constitutive/totalshear - Constitutive - - - - - Matrix - /Constitutive/accumulatedshear_slip - Constitutive - vector contains accumulated shear per slip system - - - - -
\ No newline at end of file diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index 1875ffdae..5b748ee19 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -3,29 +3,11 @@ """Main aggregator""" import os,sys,time -h5py_flag = os.path.join(os.path.dirname(__file__),'../../.noH5py') -h5py_grace = 7200 # only complain once every 7200 sec (2 hours) -h5py_msg = "h5py module not found." - -now = time.time() - with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f: version = f.readline()[:-1] from .environment import Environment # noqa from .asciitable import ASCIItable # noqa -try: - from .h5table import H5Table # noqa - if os.path.exists(h5py_flag): os.remove(h5py_flag) # delete flagging file on success -except ImportError: - if os.path.exists(h5py_flag): - if now - os.path.getmtime(h5py_flag) > h5py_grace: # complain (again) every so-and-so often - sys.stderr.write(h5py_msg+'\n') - with open(h5py_flag, 'a'): - os.utime(h5py_flag,(now,now)) # update flag modification time to "now" - else: - open(h5py_flag, 'a').close() # create flagging file - sys.stderr.write(h5py_msg+'\n') # complain for the first time from .config import Material # noqa from .colormaps import Colormap, Color # noqa diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py deleted file mode 100644 index 67d5853b6..000000000 --- a/lib/damask/h5table.py +++ /dev/null @@ -1,146 +0,0 @@ -# -*- coding: UTF-8 no BOM -*- - -# ----------------------------------------------------------- # -# Ideally the h5py should be enough to serve as the data # -# interface for future DAMASK, but since we are still not # -# sure when this major shift will happen, it seems to be a # -# good idea to provide a interface class that help user ease # -# into using HDF5 as the new daily storage driver. # -# ----------------------------------------------------------- # - -import os -import h5py -import numpy as np -import xml.etree.cElementTree as ET - -# ---------------------------------------------------------------- # -# python 3 has no unicode object, this ensures that the code works # -# on Python 2&3 # -# ---------------------------------------------------------------- # -try: - test = isinstance('test', unicode) -except(NameError): - unicode = str - - -def lables_to_path(label, dsXMLPath=None): - """Read the XML definition file and return the path.""" - if dsXMLPath is None: - # use the default storage layout in DS_HDF5.xml - if "h5table.pyc" in __file__: - dsXMLPath = os.path.abspath(__file__).replace("h5table.pyc", - "DS_HDF5.xml") - else: - dsXMLPath = os.path.abspath(__file__).replace("h5table.py", - "DS_HDF5.xml") - # This current implementation requires that all variables - # stay under the root node, the nesting is defined through the - # h5path. - # Allow new derived data to be put under the root - tree = ET.parse(dsXMLPath) - try: - dataType = tree.find('{}/type'.format(label)).text - h5path = tree.find('{}/h5path'.format(label)).text - except: - dataType = "Scalar" - h5path = "/{}".format(label) # just put it under root - return (dataType, h5path) - - -class H5Table(object): - """ - Lightweight interface class for h5py - - DESCRIPTION - ----------- - Interface/wrapper class for manipulating data in HDF5 with DAMASK - specialized data structure. - --> try to maintain a minimal API design. - PARAMETERS - ---------- - h5f_path: str - Absolute path of the HDF5 file - METHOD - ------ - del_entry() -- Force delete attributes/group/datasets (dangerous) - get_attr() -- Return attributes if possible - add_attr() -- Add NEW attributes to dataset/group (no force overwrite) - get_data() -- Retrieve data in numpy.ndarray - add_data() -- Add dataset to H5 file - get_cmdlog() -- Return the command used to generate the data if possible - NOTE - ---- - 1. As an interface class, it uses the lazy evaluation design - that reads the data only when it is absolutely necessary. - 2. The command line used to generate each new feature is stored with - each dataset as dataset attribute. - - """ - - def __init__(self, h5f_path, new_file=False, dsXMLFile=None): - self.h5f_path = h5f_path - self.dsXMLFile = dsXMLFile - msg = 'Created by H5Talbe from DAMASK' - mode = 'w' if new_file else 'a' - with h5py.File(self.h5f_path, mode) as h5f: - h5f['/'].attrs['description'] = msg - - def del_entry(self, feature_name): - """Delete entry in HDF5 table""" - dataType, h5f_path = lables_to_path(feature_name, - dsXMLPath=self.dsXMLFile) - with h5py.File(self.h5f_path, 'a') as h5f: - del h5f[h5f_path] - - def get_attr(self, attr_name): - dataType, h5f_path = lables_to_path(attr_name, - dsXMLPath=self.dsXMLFile) - with h5py.File(self.h5f_path, 'a') as h5f: - rst_attr = h5f[h5f_path].attrs[attr_name] - return rst_attr - - def add_attr(self, attr_name, attr_data): - dataType, h5f_path = lables_to_path(attr_name, - dsXMLPath=self.dsXMLFile) - with h5py.File(self.h5f_path, 'a') as h5f: - h5f[h5f_path].attrs[attr_name] = attr_data - h5f.flush() - - def get_data(self, feature_name=None): - """Extract dataset from HDF5 table and return it in a numpy array""" - dataType, h5f_path = lables_to_path(feature_name, - dsXMLPath=self.dsXMLFile) - with h5py.File(self.h5f_path, 'a') as h5f: - h5f_dst = h5f[h5f_path] # get the handle for target dataset(table) - rst_data = np.zeros(h5f_dst.shape) - h5f_dst.read_direct(rst_data) - return rst_data - - def add_data(self, feature_name, dataset, cmd_log=None): - """Adding new feature into existing HDF5 file""" - dataType, h5f_path = lables_to_path(feature_name, - dsXMLPath=self.dsXMLFile) - with h5py.File(self.h5f_path, 'a') as h5f: - # NOTE: - # --> If dataset exists, delete the old one so as to write - # a new one. For brand new dataset. For brand new one, - # record its state as fresh in the cmd log. - try: - del h5f[h5f_path] - print("***deleting old {} from {}".format(feature_name,self.h5f_path)) - except: - # if no cmd log, None will used - cmd_log = str(cmd_log) + " [FRESH]" - h5f.create_dataset(h5f_path, data=dataset) - # store the cmd in log is possible - if cmd_log is not None: - h5f[h5f_path].attrs['log'] = str(cmd_log) - h5f.flush() - - def get_cmdlog(self, feature_name): - """Get cmd history used to generate the feature""" - dataType, h5f_path = lables_to_path(feature_name, - dsXMLPath=self.dsXMLFile) - with h5py.File(self.h5f_path, 'a') as h5f: - cmd_logs = h5f[h5f_path].attrs['log'] - return cmd_logs diff --git a/processing/post/h5_addCalculation.py b/processing/post/h5_addCalculation.py deleted file mode 100755 index 0ce1981a1..000000000 --- a/processing/post/h5_addCalculation.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -import os -# import re -# import sys -import collections -# import math -import damask -# import numpy as np -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName, damask.version]) - - -# ----- Helper functions ----- # -def listify(x): - return x if isinstance(x, collections.Iterable) else [x] - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- -usageEx = """ -usage_in_details: - Column labels are tagged by '#label#' in formulas. - Use ';' for ',' in functions. Numpy is available as 'np'. - Special variables: #_row_# -- row index - - Examples: - (1) magnitude of vector -- "np.linalg.norm(#vec#)" - (2) rounded root of row number -- "round(math.sqrt(#_row_#);3)" -""" -desp = "Add or alter column(s) with derived values according to " -desp += "user-defined arithmetic operation between column(s)." - -parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]' + usageEx, - description=desp, - version=scriptID) -parser.add_option('-l', '--label', - dest='labels', - action='extend', metavar='', - help='(list of) new column labels') -parser.add_option('-f', '--formula', - dest='formulas', - action='extend', metavar='', - help='(list of) formulas corresponding to labels') -parser.add_option('-c', '--condition', - dest='condition', metavar='string', - help='condition to filter rows') - -parser.set_defaults(condition=None) - -(options, filenames) = parser.parse_args() - -# ----- parse formulas ----- # -for i in range(len(options.formulas)): - options.formulas[i] = options.formulas[i].replace(';', ',') - -# ----- loop over input files ----- # -for name in filenames: - try: - h5f = damask.H5Table(name, new_file=False) - except: - print("!!!Cannot process {}".format(name)) - continue - damask.util.report(scriptName, name) - -# Note: -# --> not immediately needed, come back later diff --git a/processing/post/h5_addCauchy.py b/processing/post/h5_addCauchy.py deleted file mode 100755 index 84145d99d..000000000 --- a/processing/post/h5_addCauchy.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -import os -import damask -import numpy as np -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName, damask.version]) - - -def getCauchy(f, p): - """Return Cauchy stress for given f and p""" - # [Cauchy] = (1/det(F)) * [P].[F_transpose] - f = f.reshape((3, 3)) - p = p.reshape((3, 3)) - return 1.0/np.linalg.det(f)*np.dot(p, f.T).reshape(9) - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- -desp = "Add column(s) containing Cauchy stress based on given column(s)" -desp += "of deformation gradient and first Piola--Kirchhoff stress." -parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description=desp, - version=scriptID) -parser.add_option('-f', '--defgrad', - dest='defgrad', - type='string', metavar='string', - help='heading for deformation gradient [%default]') -parser.add_option('-p', '--stress', - dest='stress', - type='string', metavar='string', - help='heading for first Piola--Kirchhoff stress [%default]') - -parser.set_defaults(defgrad='f', - stress='p') - -(options, filenames) = parser.parse_args() - -# ----- loop over input H5 files ----- # -for name in filenames: - try: - h5f = damask.H5Table(name, new_file=False) - except: - continue - damask.util.report(scriptName, name) - - # ----- read in data ----- # - f = h5f.get_data("f") - p = h5f.get_data("p") - - # ----- calculate Cauchy stress ----- # - cauchy = [getCauchy(f_i, p_i) for f_i, p_i in zip(f, p)] - - # ----- write to HDF5 file ----- # - cmd_log = " ".join([scriptID, name]) - h5f.add_data('Cauchy', np.array(cauchy), cmd_log=cmd_log) diff --git a/processing/post/h5_addIPFcolor.py b/processing/post/h5_addIPFcolor.py deleted file mode 100755 index c92483fa5..000000000 --- a/processing/post/h5_addIPFcolor.py +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -import os -import sys -import math -import damask -import numpy as np -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName, damask.version]) - -# TODO -# This implementation will have to iterate through the array one -# element at a time, maybe there are some other ways to make this -# faster. - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- -desp = "Add RGB color value corresponding to TSL-OIM scheme for IPF." -parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description=desp, - version=scriptID) -parser.add_option('-p', '--pole', - dest='pole', - type='float', nargs=3, metavar='float float float', - help='lab frame direction for IPF [%default]') -msg = ', '.join(damask.Symmetry.lattices[1:]) -parser.add_option('-s', '--symmetry', - dest='symmetry', - type='choice', choices=damask.Symmetry.lattices[1:], - metavar='string', - help='crystal symmetry [%default] {{{}}} '.format(msg)) -parser.add_option('-e', '--eulers', - dest='eulers', - type='string', metavar='string', - help='Euler angles label') -parser.add_option('-d', '--degrees', - dest='degrees', - action='store_true', - help='Euler angles are given in degrees [%default]') -parser.add_option('-m', '--matrix', - dest='matrix', - type='string', metavar='string', - help='orientation matrix label') -parser.add_option('-a', - dest='a', - type='string', metavar='string', - help='crystal frame a vector label') -parser.add_option('-b', - dest='b', - type='string', metavar='string', - help='crystal frame b vector label') -parser.add_option('-c', - dest='c', - type='string', metavar='string', - help='crystal frame c vector label') -parser.add_option('-q', '--quaternion', - dest='quaternion', - type='string', metavar='string', - help='quaternion label') - -parser.set_defaults(pole=(0.0, 0.0, 1.0), - symmetry=damask.Symmetry.lattices[-1], - degrees=False) - -(options, filenames) = parser.parse_args() - -# safe guarding to have only one orientation representation -# use dynamic typing to group a,b,c into frame -options.frame = [options.a, options.b, options.c] -input = [options.eulers is not None, - all(options.frame), - options.matrix is not None, - options.quaternion is not None] - -if np.sum(input) != 1: - parser.error('needs exactly one input format.') - -# select input label that was requested (active) -label_active = np.where(input)[0][0] -(label, dim, inputtype) = [(options.eulers, 3, 'eulers'), - (options.frame, [3, 3, 3], 'frame'), - (options.matrix, 9, 'matrix'), - (options.quaternion, 4, 'quaternion')][label_active] - -# rescale degrees to radians -toRadians = math.pi/180.0 if options.degrees else 1.0 - -# only use normalized pole -pole = np.array(options.pole) -pole /= np.linalg.norm(pole) - -# ----- Loop over input files ----- # -for name in filenames: - try: - h5f = damask.H5Table(name, new_file=False) - except: - continue - damask.util.report(scriptName, name) - - # extract data from HDF5 file - if inputtype == 'eulers': - orieData = h5f.get_data(label) - elif inputtype == 'matrix': - orieData = h5f.get_data(label) - orieData = orieData.reshape(orieData.shape[0], 3, 3) - elif inputtype == 'frame': - vctr_a = h5f.get_data(label[0]) - vctr_b = h5f.get_data(label[1]) - vctr_c = h5f.get_data(label[2]) - frame = np.column_stack((vctr_a, vctr_b, vctr_c)) - orieData = frame.reshape(frame.shape[0], 3, 3) - elif inputtype == 'quaternion': - orieData = h5f.get_data(label) - - # calculate the IPF color - rgbArrays = np.zeros((orieData.shape[0], 3)) - for ci in range(rgbArrays.shape[0]): - if inputtype == 'eulers': - o = damask.Orientation(Eulers=np.array(orieData[ci, :])*toRadians, - symmetry=options.symmetry).reduced() - elif inputtype == 'matrix': - o = damask.Orientation(matrix=orieData[ci, :, :].transpose(), - symmetry=options.symmetry).reduced() - elif inputtype == 'frame': - o = damask.Orientation(matrix=orieData[ci, :, :], - symmetry=options.symmetry).reduced() - elif inputtype == 'quaternion': - o = damask.Orientation(quaternion=orieData[ci, :], - symmetry=options.symmetry).reduced() - rgbArrays[ci, :] = o.IPFcolor(pole) - - # compose labels/headers for IPF color (RGB) - labelIPF = 'IPF_{:g}{:g}{:g}_{sym}'.format(*options.pole, - sym=options.symmetry.lower()) - - # compose cmd history (go with dataset) - cmd_log = scriptID + '\t' + ' '.join(sys.argv[1:]) - - # write data to HDF5 file - h5f.add_data(labelIPF, rgbArrays, cmd_log=cmd_log) diff --git a/processing/post/h5_addMises.py b/processing/post/h5_addMises.py deleted file mode 100755 index 99367cd80..000000000 --- a/processing/post/h5_addMises.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -import os -import sys -import math -import damask -import numpy as np -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName, damask.version]) - - -# ----- Helper functions ----- # -def calcMises(what, tensor): - """Calculate von Mises equivalent""" - dev = tensor - np.trace(tensor)/3.0*np.eye(3) - symdev = 0.5*(dev+dev.T) - return math.sqrt(np.sum(symdev*symdev.T) * - { - 'stress': 3.0/2.0, - 'strain': 2.0/3.0, - }[what.lower()]) - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- -desp = "Add von Mises equivalent values for symmetric part of requested" -parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description=desp, - version=scriptID) -parser.add_option('-e', '--strain', - dest='strain', - metavar='string', - help='name of dataset containing strain tensors') -parser.add_option('-s', '--stress', - dest='stress', - metavar='string', - help='name of dataset containing stress tensors') - -parser.set_defaults(strain=None, stress=None) - -(options, filenames) = parser.parse_args() - -# ----- Loop over input files ----- # -for name in filenames: - try: - h5f = damask.H5Table(name, new_file=False) - except: - continue - damask.util.report(scriptName, name) - - # TODO: - # Could use some refactoring here - if options.stress is not None: - # extract stress tensor from HDF5 - tnsr = h5f.get_data(options.stress) - - # calculate von Mises equivalent row by row - vmStress = np.zeros(tnsr.shape[0]) - for ri in range(tnsr.shape[0]): - stressTnsr = tnsr[ri, :].reshape(3, 3) - vmStress[ri] = calcMises('stress', stressTnsr) - - # compose label - label = "Mises{}".format(options.stress) - - # prepare log info - cmd_log = scriptID + '\t' + ' '.join(sys.argv[1:]) - - # write data to HDF5 file - h5f.add_data(label, vmStress, cmd_log=cmd_log) - - if options.strain is not None: - tnsr = h5f.get_data(options.strain) - vmStrain = np.zeros(tnsr.shape[0]) - for ri in range(tnsr.shape[0]): - strainTnsr = tnsr[ri, :].reshape(3, 3) - vmStrain[ri] = calcMises('strain', strainTnsr) - label = "Mises{}".format(options.strain) - cmd_log = scriptID + '\t' + ' '.join(sys.argv[1:]) - h5f.add_data(label, vmStrain, cmd_log=cmd_log) diff --git a/processing/post/h5_addStrainTensors.py b/processing/post/h5_addStrainTensors.py deleted file mode 100755 index 9e3f49233..000000000 --- a/processing/post/h5_addStrainTensors.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -import os -import sys -import damask -import numpy as np -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName, damask.version]) - - -# ----- Helper functions ----- # -def operator(stretch, strain, eigenvalues): - # Albrecht Bertram: Elasticity and Plasticity of Large Deformations - # An Introduction (3rd Edition, 2012), p. 102 - return {'V#ln': np.log(eigenvalues), - 'U#ln': np.log(eigenvalues), - 'V#Biot': (np.ones(3, 'd') - 1.0/eigenvalues), - 'U#Biot': (eigenvalues - np.ones(3, 'd')), - 'V#Green': (np.ones(3, 'd') - 1.0/eigenvalues/eigenvalues)*0.5, - 'U#Green': (eigenvalues*eigenvalues - np.ones(3, 'd'))*0.5, - }[stretch+'#'+strain] - - -def calcEPS(defgrads, stretchType, strainType): - """Calculate specific type of strain tensor""" - eps = np.zeros(defgrads.shape) # initialize container - - # TODO: - # this loop can use some performance boost - # (multi-threading?) - for ri in range(defgrads.shape[0]): - f = defgrads[ri, :].reshape(3, 3) - U, S, Vh = np.linalg.svd(f) - R = np.dot(U, Vh) # rotation of polar decomposition - if stretchType == 'U': - stretch = np.dot(np.linalg.inv(R), f) # F = RU - elif stretchType == 'V': - stretch = np.dot(f, np.linalg.inv(R)) # F = VR - - # kill nasty noisy data - stretch = np.where(abs(stretch) < 1e-12, 0, stretch) - - (D, V) = np.linalg.eig(stretch) - # flip principal component with negative Eigen values - neg = np.where(D < 0.0) - D[neg] *= -1. - V[:, neg] *= -1. - - # check each vector for orthogonality - # --> brutal force enforcing orthogonal base - # and re-normalize - for i, eigval in enumerate(D): - if np.dot(V[:, i], V[:, (i+1) % 3]) != 0.0: - V[:, (i+1) % 3] = np.cross(V[:, (i+2) % 3], V[:, i]) - V[:, (i+1) % 3] /= np.sqrt(np.dot(V[:, (i+1) % 3], - V[:, (i+1) % 3].conj())) - - # calculate requested version of strain tensor - d = operator(stretchType, strainType, D) - eps[ri] = (np.dot(V, np.dot(np.diag(d), V.T)).real).reshape(9) - - return eps - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- -desp = "Add column(s) containing given strains based on given stretches" -parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description=desp, - version=scriptID) -msg = 'material strains based on right Cauchy-Green deformation, i.e., C and U' -parser.add_option('-u', '--right', - dest='right', - action='store_true', - help=msg) -msg = 'spatial strains based on left Cauchy--Green deformation, i.e., B and V' -parser.add_option('-v', '--left', - dest='left', - action='store_true', - help=msg) -parser.add_option('-0', '--logarithmic', - dest='logarithmic', - action='store_true', - help='calculate logarithmic strain tensor') -parser.add_option('-1', '--biot', - dest='biot', - action='store_true', - help='calculate biot strain tensor') -parser.add_option('-2', '--green', - dest='green', - action='store_true', - help='calculate green strain tensor') -# NOTE: -# It might be easier to just calculate one type of deformation gradient -# at a time. -msg = 'heading(s) of columns containing deformation tensor values' -parser.add_option('-f', '--defgrad', - dest='defgrad', - action='extend', - metavar='', - help=msg) - -parser.set_defaults(right=False, left=False, - logarithmic=False, biot=False, green=False, - defgrad='f') - -(options, filenames) = parser.parse_args() - -stretches = [] -strains = [] - -if options.right: - stretches.append('U') -if options.left: - stretches.append('V') - -if options.logarithmic: - strains.append('ln') -if options.biot: - strains.append('Biot') -if options.green: - strains.append('Green') - -if options.defgrad is None: - parser.error('no data column specified.') - -# ----- Loop over input files ----- # -for name in filenames: - try: - h5f = damask.H5Table(name, new_file=False) - except: - continue - damask.util.report(scriptName, name) - - # extract defgrads from HDF5 storage - F = h5f.get_data(options.defgrad) - - # allow calculate multiple types of strain within the - # same cmd call - for stretchType in stretches: - for strainType in strains: - # calculate strain tensor for this type - eps = calcEPS(F, stretchType, strainType) - - # compose labels/headers for this strain tensor - labelsStrain = strainType + stretchType - - # prepare log info - cmd_log = scriptID + '\t' + ' '.join(sys.argv[1:]) - - # write data to HDF5 file - h5f.add_data(labelsStrain, eps, cmd_log=cmd_log) diff --git a/processing/post/h5_addXdmfWapper.py b/processing/post/h5_addXdmfWapper.py deleted file mode 100755 index e5588a069..000000000 --- a/processing/post/h5_addXdmfWapper.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -# ------------------------------------------------------------------- # -# NOTE: # -# 1. Current Xdmf rendering in Paraview has some memory issue where # -# large number of polyvertices will cause segmentation fault. By # -# default, paraview output a cell based xdmf description, which # -# is working for small and medium mesh (<10,000) points. Hence a # -# rectangular mesh is used as the de facto Geometry description # -# here. # -# 2. Due to the unstable state Xdmf, it is safer to use port data # -# to VTR rather than using xdmf as interpretive layer for data # -# visualization. # -# ------------------------------------------------------------------- # - - -import os -import damask -import h5py -import xml.etree.cElementTree as ET -from optparse import OptionParser -from xml.dom import minidom -from damask.h5table import lables_to_path - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - - -# ----- HELPER FUNCTIONS -----# -def addTopLvlCmt(xmlstr, topLevelCmt): - """Add top level comment to string from ET""" - # a quick hack to add the top level comment to XML file - # --> somehow Elementtree does not provide this functionality - # --> by default - strList = xmlstr.split("\n") - strList[0] += "\n"+topLevelCmt - return "\n".join(strList) - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -msg = 'Generate Xdmf wrapper for HDF5 file.' -parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description = msg, - version = scriptID) - -(options, filenames) = parser.parse_args() - -h5f = filenames[0] -h5f_base = h5f.split("/")[-1] - -# ----- parse HDF5 file ----- # -h5f_dataDim = {} -h5f_dataPath = {} -h5f_dataType = {} -with h5py.File(h5f, 'a') as f: - labels = f.keys() - labels += f['/Constitutive'].keys() - labels += f['/Crystallite'].keys() - labels += ['Vx', 'Vy', "Vz"] - # remove group names as they do not contain real data - # TODO: use h5py/H5table API to detect dataset name to - # avoid necessary name space pruning. - labels.remove('Constitutive') - labels.remove('Crystallite') - labels.remove('Geometry') - # loop through remaining labels - for label in labels: - dataType, h5Path = lables_to_path(label) - h5f_dataType[label] = dataType - h5f_dataDim[label] = " ".join(map(str,f[h5Path].shape)) - h5f_dataPath[label] = h5Path - -# ----- constructing xdmf elements ----- # -root = ET.Element("Xdmf", version='3.3') -root.set('xmlns:xi', "http://www.w3.org/2001/XInclude") -root.append(ET.Comment('Generated Xdmf wapper for DAMASH H5 output')) - -# usually there should only be ONE domain -domain = ET.SubElement(root, 'Domain', - Name=h5f_base.split(".")[0]) - -# use global topology through reference -grid = ET.SubElement(domain, 'Grid', GridType="Uniform") -# geometry section -geometry = ET.SubElement(grid, 'Geometry', GeometryType="VXVYVZ") -for vector in ["Vz", "Vy", "Vx"]: - dataitem = ET.SubElement(geometry, "DataItem", - DataType="Float", - Dimensions=h5f_dataDim[vector], - Name=vector, - Format="HDF") - dataitem.text = h5f_base.split("/")[-1] + ":{}".format(h5f_dataPath[vector]) -# topology section -# TODO: support for other format based on given option -meshDim = [h5f_dataDim["Vz"], h5f_dataDim["Vy"], h5f_dataDim["Vx"]] -topology = ET.SubElement(grid, 'Topology', - TopologyType="3DRectMesh", - Dimensions=" ".join(map(str, meshDim))) - -# attributes section -# Question: how to properly handle data mapping for multiphase situations -labelsProcessed = ['Vx', 'Vy', 'Vz'] -# walk through each attributes -for label in labels: - if label in labelsProcessed: continue - print("adding {}...".format(label)) - attr = ET.SubElement(grid, 'Attribute', - Name=label, - Type="None", - Center="Cell") - dataitem = ET.SubElement(attr, 'DataItem', - Name=label, - Format='HDF', - Dimensions=h5f_dataDim[label]) - dataitem.text = h5f_base + ":" + h5f_dataPath[label] - # update progress list - labelsProcessed.append(label) - - -# pretty print the xdmf(xml) file content -xmlstr = minidom.parseString(ET.tostring(root)).toprettyxml(indent="\t") -xmlstr = addTopLvlCmt(xmlstr, '') -# write str to file through native python API -with open(h5f.replace(".h5", ".xmf"), 'w') as f: - f.write(xmlstr) diff --git a/processing/post/h5_vtkAddRectilinearGridData.py b/processing/post/h5_vtkAddRectilinearGridData.py deleted file mode 100755 index 1c0492f53..000000000 --- a/processing/post/h5_vtkAddRectilinearGridData.py +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -import os -import vtk -import damask -from vtk.util import numpy_support -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName, damask.version]) - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- -msg = "Add scalars, vectors, and/or an RGB tuple from" -msg += "an HDF5 to existing VTK rectilinear grid (.vtr/.vtk)." -parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description=msg, - version=scriptID) -parser.add_option('--vtk', - dest='vtk', - type='string', metavar='string', - help='VTK file name') -parser.add_option('--inplace', - dest='inplace', - action='store_true', - help='modify VTK file in-place') -parser.add_option('-r', '--render', - dest='render', - action='store_true', - help='open output in VTK render window') -parser.add_option('-d', '--data', - dest='data', - action='extend', metavar='', - help='scalar/vector value(s) label(s)') -parser.add_option('-t', '--tensor', - dest='tensor', - action='extend', metavar='', - help='tensor (3x3) value label(s)') -parser.add_option('-c', '--color', - dest='color', - action='extend', metavar='', - help='RGB color tuple label') -parser.add_option('-m', - '--mode', - dest='mode', - metavar='string', - type='choice', choices=['cell', 'point'], - help='cell-centered or point-centered coordinates') - -parser.set_defaults(data=[], - tensor=[], - color=[], - mode='cell', - inplace=False, - render=False) - -(options, filenames) = parser.parse_args() - -# ----- Legacy VTK format support ----- # -if os.path.splitext(options.vtk)[1] == '.vtr': - reader = vtk.vtkXMLRectilinearGridReader() - reader.SetFileName(options.vtk) - reader.Update() - rGrid = reader.GetOutput() -elif os.path.splitext(options.vtk)[1] == '.vtk': - reader = vtk.vtkGenericDataObjectReader() - reader.SetFileName(options.vtk) - reader.Update() - rGrid = reader.GetRectilinearGridOutput() -else: - parser.error('Unsupported VTK file type extension.') - -Npoints = rGrid.GetNumberOfPoints() -Ncells = rGrid.GetNumberOfCells() - -# ----- Summary output (Sanity Check) ----- # -msg = '{}: {} points and {} cells...'.format(options.vtk, - Npoints, - Ncells) -damask.util.croak(msg) - -# ----- Read HDF5 file ----- # -# NOTE: -# --> It is possible in the future we are trying to add data -# from different increment into the same VTK file, but -# this feature is not supported for the moment. -# --> Let it fail, if the HDF5 is invalid, python interpretor -# --> should be able to catch this error. -h5f = damask.H5Table(filenames[0], new_file=False) - -# ----- Process data ----- # -featureToAdd = {'data': options.data, - 'tensor': options.tensor, - 'color': options.color} -VTKarray = {} # store all vtkData in dict, then ship them to file -for dataType in featureToAdd.keys(): - featureNames = featureToAdd[dataType] - for featureName in featureNames: - VTKtype = vtk.VTK_DOUBLE - VTKdata = h5f.get_data(featureName) - if dataType == 'color': - VTKtype = vtk.VTK_UNSIGNED_CHAR - VTKdata = (VTKdata*255).astype(int) - elif dataType == 'tensor': - # Force symmetries tensor type data - VTKdata[:, 1] = VTKdata[:, 3] = 0.5*(VTKdata[:, 1]+VTKdata[:, 3]) - VTKdata[:, 2] = VTKdata[:, 6] = 0.5*(VTKdata[:, 2]+VTKdata[:, 6]) - VTKdata[:, 5] = VTKdata[:, 7] = 0.5*(VTKdata[:, 5]+VTKdata[:, 7]) - # use vtk build-in numpy support to add data (much faster) - # NOTE: - # --> deep copy is necessary here, otherwise memory leak could occur - VTKarray[featureName] = numpy_support.numpy_to_vtk(num_array=VTKdata, - deep=True, - array_type=VTKtype) - VTKarray[featureName].SetName(featureName) - -# ----- ship data to vtkGrid ----- # -mode = options.mode -damask.util.croak('{} mode...'.format(mode)) - -# NOTE: -# --> For unknown reason, Paraview only recognize one -# tensor attributes per cell, thus it would be safe -# to only add one attributes as tensor. -for dataType in featureToAdd.keys(): - featureNames = featureToAdd[dataType] - for featureName in featureNames: - if dataType == 'color': - if mode == 'cell': - rGrid.GetCellData().SetScalars(VTKarray[featureName]) - elif mode == 'point': - rGrid.GetPointData().SetScalars(VTKarray[featureName]) - elif dataType == 'tensor': - if mode == 'cell': - rGrid.GetCellData().SetTensors(VTKarray[featureName]) - elif mode == 'point': - rGrid.GetPointData().SetTensors(VTKarray[featureName]) - else: - if mode == 'cell': - rGrid.GetCellData().AddArray(VTKarray[featureName]) - elif mode == 'point': - rGrid.GetPointData().AddArray(VTKarray[featureName]) - -rGrid.Modified() -if vtk.VTK_MAJOR_VERSION <= 5: - rGrid.Update() - -# ----- write Grid to VTK file ----- # -writer = vtk.vtkXMLRectilinearGridWriter() -writer.SetDataModeToBinary() -writer.SetCompressorTypeToZLib() -vtkFileN = os.path.splitext(options.vtk)[0] -vtkExtsn = '.vtr' if options.inplace else '_added.vtr' -writer.SetFileName(vtkFileN+vtkExtsn) -if vtk.VTK_MAJOR_VERSION <= 5: - writer.SetInput(rGrid) -else: - writer.SetInputData(rGrid) -writer.Write() - -# ----- render results from script ----- # -if options.render: - mapper = vtk.vtkDataSetMapper() - mapper.SetInputData(rGrid) - actor = vtk.vtkActor() - actor.SetMapper(mapper) - - # Create the graphics structure. The renderer renders into the - # render window. The render window interactor captures mouse events - # and will perform appropriate camera or actor manipulation - # depending on the nature of the events. - - ren = vtk.vtkRenderer() - - renWin = vtk.vtkRenderWindow() - renWin.AddRenderer(ren) - - ren.AddActor(actor) - ren.SetBackground(1, 1, 1) - renWin.SetSize(200, 200) - - iren = vtk.vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - iren.Initialize() - renWin.Render() - iren.Start() diff --git a/processing/post/h5_vtkRectilinearGrid.py b/processing/post/h5_vtkRectilinearGrid.py deleted file mode 100755 index b08070b84..000000000 --- a/processing/post/h5_vtkRectilinearGrid.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -# ------------------------------------------------------------------ # -# NOTE: # -# 1. It might be a good idea to separate IO and calculation. # -# 2. Some of the calculation could be useful in other situations, # -# why not build a math_util, or math_sup module that contains # -# all the useful functions. # -# ------------------------------------------------------------------ # - -import os -import vtk -import numpy as np -import damask -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName, damask.version]) - - -# ----- HELPER FUNCTION ----- # -def getMeshFromXYZ(xyzArray, mode): - """Calc Vx,Vy,Vz vectors for vtk rectangular mesh""" - # NOTE: - # --> np.unique will automatically sort the list - # --> although not exactly n(1), but since mesh dimension should - # small anyway, so this is still light weight. - dim = xyzArray.shape[1] # 2D:2, 3D:3 - coords = [np.unique(xyzArray[:, i]) for i in range(dim)] - - if mode == 'cell': - # since x, y, z might now have the same number of elements, - # we have to deal with them individually - for ri in range(dim): - vctr_pt = coords[ri] - vctr_cell = np.empty(len(vctr_pt)+1) - # calculate first and last end point - vctr_cell[0] = vctr_pt[0] - 0.5*abs(vctr_pt[1] - vctr_pt[0]) - vctr_cell[-1] = vctr_pt[-1] + 0.5*abs(vctr_pt[-2] - vctr_pt[-1]) - for cj in range(1, len(vctr_cell)-1): - vctr_cell[cj] = 0.5*(vctr_pt[cj-1] + vctr_pt[cj]) - # update the coords - coords[ri] = vctr_cell - - if dim < 3: - coords.append([0]) # expand to a 3D with 0 for z - - # auxiliary description - grid = np.array(map(len, coords), 'i') - N = grid.prod() if mode == 'point' else (grid-1).prod() - return coords, grid, N - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -msg = "Create regular voxel grid from points in an ASCIItable." -parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description=msg, - version=scriptID) - -parser.add_option('-m', - '--mode', - dest='mode', - metavar='string', - type='choice', choices=['cell', 'point'], - help='cell-centered or point-centered coordinates') -parser.add_option('-p', - '--pos', '--position', - dest='pos', - type='string', metavar='string', - help='label of coordinates [%default]') - -parser.set_defaults(mode='cell', - pos='pos') - -(options, filenames) = parser.parse_args() - -# ----- loop over input files ----- # -for name in filenames: - try: - h5f = damask.H5Table(name, new_file=False) - except: - continue - damask.util.report(scriptName, name) - - # ----- read xyzArray from HDF5 file ----- # - xyzArray = h5f.get_data(options.pos) - - # ----- figure out size and grid ----- # - coords, grid, N = getMeshFromXYZ(xyzArray, options.mode) - - # ----- process data ----- # - rGrid = vtk.vtkRectilinearGrid() - # WARNING: list expansion does not work here as these are - # just pointers for a vtk instance. Simply put, - # DON't USE - # [] * - coordArray = [vtk.vtkDoubleArray(), - vtk.vtkDoubleArray(), - vtk.vtkDoubleArray()] - - rGrid.SetDimensions(*grid) - for i, points in enumerate(coords): - for point in points: - coordArray[i].InsertNextValue(point) - - rGrid.SetXCoordinates(coordArray[0]) - rGrid.SetYCoordinates(coordArray[1]) - rGrid.SetZCoordinates(coordArray[2]) - - # ----- output result ----- # - dirPath = os.path.split(name)[0] - if name: - writer = vtk.vtkXMLRectilinearGridWriter() - writer.SetCompressorTypeToZLib() - writer.SetDataModeToBinary() - # getting the name is a little bit tricky - vtkFileName = os.path.splitext(os.path.split(name)[1])[0] - vtkFileName += '_{}({})'.format(options.pos, options.mode) - vtkFileName += '.' + writer.GetDefaultFileExtension() - writer.SetFileName(os.path.join(dirPath, vtkFileName)) - else: - writer = vtk.vtkDataSetWriter() - writer.SetHeader('# powered by '+scriptID) - writer.WriteToOutputStringOn() - - if vtk.VTK_MAJOR_VERSION <= 5: - writer.SetInput(rGrid) - else: - writer.SetInputData(rGrid) - - writer.Write() diff --git a/processing/pre/3DRVEfrom2Dang.py b/processing/pre/3DRVEfrom2Dang.py old mode 100644 new mode 100755 From f52721e0a74719b15ed47680b6859c8ac2581376 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 21 Nov 2017 11:41:02 +0100 Subject: [PATCH 08/11] unneded modules --- lib/damask/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index 5b748ee19..379b23547 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 no BOM -*- """Main aggregator""" -import os,sys,time +import os with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f: version = f.readline()[:-1] From 8d705522ea7e0ff76d279637c6d21295fff36b4f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 21 Nov 2017 15:08:45 +0100 Subject: [PATCH 09/11] output already disabled for worldrank !=0 --- src/constitutive.f90 | 6 +++--- src/damage_local.f90 | 8 ++------ src/damage_none.f90 | 8 ++------ src/damage_nonlocal.f90 | 8 ++------ src/homogenization_RGC.f90 | 8 ++------ src/homogenization_isostrain.f90 | 8 ++------ src/homogenization_none.f90 | 10 +++------- src/hydrogenflux_cahnhilliard.f90 | 8 ++------ src/hydrogenflux_isoconc.f90 | 10 +++------- src/kinematics_cleavage_opening.f90 | 8 ++------ src/kinematics_slipplane_opening.f90 | 8 ++------ src/kinematics_thermal_expansion.f90 | 8 ++------ src/kinematics_vacancy_strain.f90 | 8 ++------ 13 files changed, 29 insertions(+), 77 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 202242aec..f124e545b 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -186,11 +186,11 @@ subroutine constitutive_init() if (any(phase_kinematics == KINEMATICS_hydrogen_strain_ID)) call kinematics_hydrogen_strain_init(FILEUNIT) close(FILEUNIT) - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" + mainProcess: if (worldrank == 0) then !-------------------------------------------------------------------------------------------------- ! write description file for constitutive output call IO_write_jobFile(FILEUNIT,'outputConstitutive') diff --git a/src/damage_local.f90 b/src/damage_local.f90 index a24f0b1a5..2f3014937 100644 --- a/src/damage_local.f90 +++ b/src/damage_local.f90 @@ -72,8 +72,6 @@ subroutine damage_local_init(fileUnit) damage, & damage_initialPhi, & material_partHomogenization - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -86,11 +84,9 @@ subroutine damage_local_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_local_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_local_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(damage_type == DAMAGE_local_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/src/damage_none.f90 b/src/damage_none.f90 index 746de340c..4750f5949 100644 --- a/src/damage_none.f90 +++ b/src/damage_none.f90 @@ -26,19 +26,15 @@ subroutine damage_none_init() use IO, only: & IO_timeStamp use material - use numerics, only: & - worldrank implicit none integer(pInt) :: & homog, & NofMyHomog - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_none_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_none_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess initializeInstances: do homog = 1_pInt, material_Nhomogenization diff --git a/src/damage_nonlocal.f90 b/src/damage_nonlocal.f90 index fb960ed7f..cd6ba8a5b 100644 --- a/src/damage_nonlocal.f90 +++ b/src/damage_nonlocal.f90 @@ -77,8 +77,6 @@ subroutine damage_nonlocal_init(fileUnit) damage, & damage_initialPhi, & material_partHomogenization - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -91,11 +89,9 @@ subroutine damage_nonlocal_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_nonlocal_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_nonlocal_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(damage_type == DAMAGE_nonlocal_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/src/homogenization_RGC.f90 b/src/homogenization_RGC.f90 index 43c16a39d..84cb594db 100644 --- a/src/homogenization_RGC.f90 +++ b/src/homogenization_RGC.f90 @@ -100,8 +100,6 @@ subroutine homogenization_RGC_init(fileUnit) FE_geomtype use IO use material - use numerics, only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit !< file pointer to material configuration @@ -117,11 +115,9 @@ subroutine homogenization_RGC_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_RGC_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_RGC_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(homogenization_type == HOMOGENIZATION_RGC_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/src/homogenization_isostrain.f90 b/src/homogenization_isostrain.f90 index aeb77c275..055bfbb46 100644 --- a/src/homogenization_isostrain.f90 +++ b/src/homogenization_isostrain.f90 @@ -62,8 +62,6 @@ subroutine homogenization_isostrain_init(fileUnit) debug_levelBasic use IO use material - use numerics, only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -80,11 +78,9 @@ subroutine homogenization_isostrain_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_ISOSTRAIN_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_ISOSTRAIN_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = count(homogenization_type == HOMOGENIZATION_ISOSTRAIN_ID) if (maxNinstance == 0) return diff --git a/src/homogenization_none.f90 b/src/homogenization_none.f90 index 11bed7813..75d8bcd3a 100644 --- a/src/homogenization_none.f90 +++ b/src/homogenization_none.f90 @@ -29,21 +29,17 @@ subroutine homogenization_none_init() use IO, only: & IO_timeStamp use material - use numerics, only: & - worldrank implicit none integer(pInt) :: & homog, & NofMyHomog - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_NONE_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_NONE_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess - initializeInstances: do homog = 1_pInt, material_Nhomogenization + initializeInstances: do homog = 1_pInt, material_Nhomogenization myhomog: if (homogenization_type(homog) == HOMOGENIZATION_none_ID) then NofMyHomog = count(material_homog == homog) diff --git a/src/hydrogenflux_cahnhilliard.f90 b/src/hydrogenflux_cahnhilliard.f90 index db08bf5d8..89479a9c9 100644 --- a/src/hydrogenflux_cahnhilliard.f90 +++ b/src/hydrogenflux_cahnhilliard.f90 @@ -84,8 +84,6 @@ subroutine hydrogenflux_cahnhilliard_init(fileUnit) hydrogenflux_initialCh, & material_partHomogenization, & material_partPhase - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -98,11 +96,9 @@ subroutine hydrogenflux_cahnhilliard_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- hydrogenflux_'//HYDROGENFLUX_cahnhilliard_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- hydrogenflux_'//HYDROGENFLUX_cahnhilliard_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(hydrogenflux_type == HYDROGENFLUX_cahnhilliard_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/src/hydrogenflux_isoconc.f90 b/src/hydrogenflux_isoconc.f90 index df5c01e68..bef2a8437 100644 --- a/src/hydrogenflux_isoconc.f90 +++ b/src/hydrogenflux_isoconc.f90 @@ -27,21 +27,17 @@ subroutine hydrogenflux_isoconc_init() use IO, only: & IO_timeStamp use material - use numerics, only: & - worldrank implicit none integer(pInt) :: & homog, & NofMyHomog - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- hydrogenflux_'//HYDROGENFLUX_isoconc_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- hydrogenflux_'//HYDROGENFLUX_isoconc_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess - initializeInstances: do homog = 1_pInt, material_Nhomogenization + initializeInstances: do homog = 1_pInt, material_Nhomogenization myhomog: if (hydrogenflux_type(homog) == HYDROGENFLUX_isoconc_ID) then NofMyHomog = count(material_homog == homog) diff --git a/src/kinematics_cleavage_opening.f90 b/src/kinematics_cleavage_opening.f90 index 146918f5c..fffa26165 100644 --- a/src/kinematics_cleavage_opening.f90 +++ b/src/kinematics_cleavage_opening.f90 @@ -81,8 +81,6 @@ subroutine kinematics_cleavage_opening_init(fileUnit) KINEMATICS_cleavage_opening_ID, & material_Nphase, & MATERIAL_partPhase - use numerics,only: & - worldrank use lattice, only: & lattice_maxNcleavageFamily, & lattice_NcleavageSystem @@ -97,11 +95,9 @@ subroutine kinematics_cleavage_opening_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_cleavage_opening_LABEL//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_cleavage_opening_LABEL//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_kinematics == KINEMATICS_cleavage_opening_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/src/kinematics_slipplane_opening.f90 b/src/kinematics_slipplane_opening.f90 index f32efa929..07b98aa23 100644 --- a/src/kinematics_slipplane_opening.f90 +++ b/src/kinematics_slipplane_opening.f90 @@ -81,8 +81,6 @@ subroutine kinematics_slipplane_opening_init(fileUnit) KINEMATICS_slipplane_opening_ID, & material_Nphase, & MATERIAL_partPhase - use numerics,only: & - worldrank use lattice, only: & lattice_maxNslipFamily, & lattice_NslipSystem @@ -97,11 +95,9 @@ subroutine kinematics_slipplane_opening_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_slipplane_opening_LABEL//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_slipplane_opening_LABEL//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_kinematics == KINEMATICS_slipplane_opening_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/src/kinematics_thermal_expansion.f90 b/src/kinematics_thermal_expansion.f90 index 30c267d34..e7cbca673 100644 --- a/src/kinematics_thermal_expansion.f90 +++ b/src/kinematics_thermal_expansion.f90 @@ -71,8 +71,6 @@ subroutine kinematics_thermal_expansion_init(fileUnit) KINEMATICS_thermal_expansion_ID, & material_Nphase, & MATERIAL_partPhase - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -83,11 +81,9 @@ subroutine kinematics_thermal_expansion_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_thermal_expansion_LABEL//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_thermal_expansion_LABEL//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_kinematics == KINEMATICS_thermal_expansion_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/src/kinematics_vacancy_strain.f90 b/src/kinematics_vacancy_strain.f90 index 791c0e3c1..9558f506d 100644 --- a/src/kinematics_vacancy_strain.f90 +++ b/src/kinematics_vacancy_strain.f90 @@ -71,8 +71,6 @@ subroutine kinematics_vacancy_strain_init(fileUnit) KINEMATICS_vacancy_strain_ID, & material_Nphase, & MATERIAL_partPhase - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -83,11 +81,9 @@ subroutine kinematics_vacancy_strain_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_vacancy_strain_LABEL//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_vacancy_strain_LABEL//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_kinematics == KINEMATICS_vacancy_strain_ID),pInt) if (maxNinstance == 0_pInt) return From 20d8133fa9d16b855c22f340d880a7fd5d9219e3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 21 Nov 2017 15:15:55 +0100 Subject: [PATCH 10/11] diff for changes only directly related to PETSc 3.8 --- installation/patch/PETSc3.8 | 387 ++---------------------------------- 1 file changed, 14 insertions(+), 373 deletions(-) diff --git a/installation/patch/PETSc3.8 b/installation/patch/PETSc3.8 index c7008fffa..f66ee6d09 100644 --- a/installation/patch/PETSc3.8 +++ b/installation/patch/PETSc3.8 @@ -1,33 +1,20 @@ -From 1cc8e60d02323c3c9448df73bfc8f36f697e939a Mon Sep 17 00:00:00 2001 +From 87e307a9c511f3f40598edbd5996297d7804ce62 Mon Sep 17 00:00:00 2001 From: Martin Diehl -Date: Mon, 20 Nov 2017 12:53:47 +0100 -Subject: [PATCH] existing patch + further fixes +Date: Tue, 21 Nov 2017 15:12:04 +0100 +Subject: [PATCH] due to changes in interface of PETSc --- - src/DAMASK_spectral.f90 | 27 +++++-------- - src/constitutive.f90 | 6 +-- - src/damage_local.f90 | 8 +--- - src/damage_none.f90 | 8 +--- - src/damage_nonlocal.f90 | 8 +--- - src/homogenization_RGC.f90 | 8 +--- - src/homogenization_isostrain.f90 | 8 +--- - src/homogenization_none.f90 | 10 ++--- - src/hydrogenflux_cahnhilliard.f90 | 8 +--- - src/hydrogenflux_isoconc.f90 | 10 ++--- - src/kinematics_cleavage_opening.f90 | 8 +--- - src/kinematics_slipplane_opening.f90 | 8 +--- - src/kinematics_thermal_expansion.f90 | 8 +--- - src/kinematics_vacancy_strain.f90 | 8 +--- - src/mesh.f90 | 12 +++--- - src/numerics.f90 | 13 +++---- - src/spectral_damage.f90 | 39 ++++++------------- - src/spectral_interface.f90 | 31 ++++++++------- - src/spectral_mech_AL.f90 | 46 ++++++++-------------- - src/spectral_mech_Basic.f90 | 52 +++++++++---------------- - src/spectral_mech_Polarisation.f90 | 52 +++++++++---------------- - src/spectral_thermal.f90 | 75 +++++++++++++++++------------------- - src/spectral_utilities.f90 | 34 ++++++---------- - 23 files changed, 175 insertions(+), 312 deletions(-) + src/DAMASK_spectral.f90 | 27 +++++--------- + src/mesh.f90 | 12 +++--- + src/numerics.f90 | 13 +++---- + src/spectral_damage.f90 | 39 ++++++-------------- + src/spectral_interface.f90 | 31 ++++++++-------- + src/spectral_mech_AL.f90 | 46 ++++++++--------------- + src/spectral_mech_Basic.f90 | 52 +++++++++----------------- + src/spectral_mech_Polarisation.f90 | 52 ++++++++++---------------- + src/spectral_thermal.f90 | 75 ++++++++++++++++++-------------------- + src/spectral_utilities.f90 | 34 ++++++----------- + 10 files changed, 146 insertions(+), 235 deletions(-) diff --git a/src/DAMASK_spectral.f90 b/src/DAMASK_spectral.f90 index f32bfb7b..c315b1b8 100644 @@ -105,352 +92,6 @@ index f32bfb7b..c315b1b8 100644 MPI_DOUBLE, MPI_STATUS_IGNORE, ierr) if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_file_write') enddo -diff --git a/src/constitutive.f90 b/src/constitutive.f90 -index 202242ae..f124e545 100644 ---- a/src/constitutive.f90 -+++ b/src/constitutive.f90 -@@ -186,11 +186,11 @@ subroutine constitutive_init() - if (any(phase_kinematics == KINEMATICS_hydrogen_strain_ID)) call kinematics_hydrogen_strain_init(FILEUNIT) - close(FILEUNIT) - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- constitutive init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- constitutive init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" - -+ mainProcess: if (worldrank == 0) then - !-------------------------------------------------------------------------------------------------- - ! write description file for constitutive output - call IO_write_jobFile(FILEUNIT,'outputConstitutive') -diff --git a/src/damage_local.f90 b/src/damage_local.f90 -index a24f0b1a..2f301493 100644 ---- a/src/damage_local.f90 -+++ b/src/damage_local.f90 -@@ -72,8 +72,6 @@ subroutine damage_local_init(fileUnit) - damage, & - damage_initialPhi, & - material_partHomogenization -- use numerics,only: & -- worldrank - - implicit none - integer(pInt), intent(in) :: fileUnit -@@ -86,11 +84,9 @@ subroutine damage_local_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_local_label//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_local_label//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = int(count(damage_type == DAMAGE_local_ID),pInt) - if (maxNinstance == 0_pInt) return -diff --git a/src/damage_none.f90 b/src/damage_none.f90 -index 746de340..4750f594 100644 ---- a/src/damage_none.f90 -+++ b/src/damage_none.f90 -@@ -26,19 +26,15 @@ subroutine damage_none_init() - use IO, only: & - IO_timeStamp - use material -- use numerics, only: & -- worldrank - - implicit none - integer(pInt) :: & - homog, & - NofMyHomog - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_none_label//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_none_label//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - initializeInstances: do homog = 1_pInt, material_Nhomogenization - -diff --git a/src/damage_nonlocal.f90 b/src/damage_nonlocal.f90 -index fb960ed7..cd6ba8a5 100644 ---- a/src/damage_nonlocal.f90 -+++ b/src/damage_nonlocal.f90 -@@ -77,8 +77,6 @@ subroutine damage_nonlocal_init(fileUnit) - damage, & - damage_initialPhi, & - material_partHomogenization -- use numerics,only: & -- worldrank - - implicit none - integer(pInt), intent(in) :: fileUnit -@@ -91,11 +89,9 @@ subroutine damage_nonlocal_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_nonlocal_label//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_nonlocal_label//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = int(count(damage_type == DAMAGE_nonlocal_ID),pInt) - if (maxNinstance == 0_pInt) return -diff --git a/src/homogenization_RGC.f90 b/src/homogenization_RGC.f90 -index 43c16a39..84cb594d 100644 ---- a/src/homogenization_RGC.f90 -+++ b/src/homogenization_RGC.f90 -@@ -100,8 +100,6 @@ subroutine homogenization_RGC_init(fileUnit) - FE_geomtype - use IO - use material -- use numerics, only: & -- worldrank - - implicit none - integer(pInt), intent(in) :: fileUnit !< file pointer to material configuration -@@ -117,11 +115,9 @@ subroutine homogenization_RGC_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_RGC_label//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_RGC_label//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = int(count(homogenization_type == HOMOGENIZATION_RGC_ID),pInt) - if (maxNinstance == 0_pInt) return -diff --git a/src/homogenization_isostrain.f90 b/src/homogenization_isostrain.f90 -index aeb77c27..055bfbb4 100644 ---- a/src/homogenization_isostrain.f90 -+++ b/src/homogenization_isostrain.f90 -@@ -62,8 +62,6 @@ subroutine homogenization_isostrain_init(fileUnit) - debug_levelBasic - use IO - use material -- use numerics, only: & -- worldrank - - implicit none - integer(pInt), intent(in) :: fileUnit -@@ -80,11 +78,9 @@ subroutine homogenization_isostrain_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_ISOSTRAIN_label//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_ISOSTRAIN_label//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = count(homogenization_type == HOMOGENIZATION_ISOSTRAIN_ID) - if (maxNinstance == 0) return -diff --git a/src/homogenization_none.f90 b/src/homogenization_none.f90 -index 11bed781..75d8bcd3 100644 ---- a/src/homogenization_none.f90 -+++ b/src/homogenization_none.f90 -@@ -29,21 +29,17 @@ subroutine homogenization_none_init() - use IO, only: & - IO_timeStamp - use material -- use numerics, only: & -- worldrank - - implicit none - integer(pInt) :: & - homog, & - NofMyHomog - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_NONE_label//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- homogenization_'//HOMOGENIZATION_NONE_label//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - -- initializeInstances: do homog = 1_pInt, material_Nhomogenization -+ initializeInstances: do homog = 1_pInt, material_Nhomogenization - - myhomog: if (homogenization_type(homog) == HOMOGENIZATION_none_ID) then - NofMyHomog = count(material_homog == homog) -diff --git a/src/hydrogenflux_cahnhilliard.f90 b/src/hydrogenflux_cahnhilliard.f90 -index db08bf5d..89479a9c 100644 ---- a/src/hydrogenflux_cahnhilliard.f90 -+++ b/src/hydrogenflux_cahnhilliard.f90 -@@ -84,8 +84,6 @@ subroutine hydrogenflux_cahnhilliard_init(fileUnit) - hydrogenflux_initialCh, & - material_partHomogenization, & - material_partPhase -- use numerics,only: & -- worldrank - - implicit none - integer(pInt), intent(in) :: fileUnit -@@ -98,11 +96,9 @@ subroutine hydrogenflux_cahnhilliard_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- hydrogenflux_'//HYDROGENFLUX_cahnhilliard_label//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- hydrogenflux_'//HYDROGENFLUX_cahnhilliard_label//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = int(count(hydrogenflux_type == HYDROGENFLUX_cahnhilliard_ID),pInt) - if (maxNinstance == 0_pInt) return -diff --git a/src/hydrogenflux_isoconc.f90 b/src/hydrogenflux_isoconc.f90 -index df5c01e6..bef2a843 100644 ---- a/src/hydrogenflux_isoconc.f90 -+++ b/src/hydrogenflux_isoconc.f90 -@@ -27,21 +27,17 @@ subroutine hydrogenflux_isoconc_init() - use IO, only: & - IO_timeStamp - use material -- use numerics, only: & -- worldrank - - implicit none - integer(pInt) :: & - homog, & - NofMyHomog - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- hydrogenflux_'//HYDROGENFLUX_isoconc_label//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- hydrogenflux_'//HYDROGENFLUX_isoconc_label//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - -- initializeInstances: do homog = 1_pInt, material_Nhomogenization -+ initializeInstances: do homog = 1_pInt, material_Nhomogenization - - myhomog: if (hydrogenflux_type(homog) == HYDROGENFLUX_isoconc_ID) then - NofMyHomog = count(material_homog == homog) -diff --git a/src/kinematics_cleavage_opening.f90 b/src/kinematics_cleavage_opening.f90 -index 146918f5..fffa2616 100644 ---- a/src/kinematics_cleavage_opening.f90 -+++ b/src/kinematics_cleavage_opening.f90 -@@ -81,8 +81,6 @@ subroutine kinematics_cleavage_opening_init(fileUnit) - KINEMATICS_cleavage_opening_ID, & - material_Nphase, & - MATERIAL_partPhase -- use numerics,only: & -- worldrank - use lattice, only: & - lattice_maxNcleavageFamily, & - lattice_NcleavageSystem -@@ -97,11 +95,9 @@ subroutine kinematics_cleavage_opening_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_cleavage_opening_LABEL//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_cleavage_opening_LABEL//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = int(count(phase_kinematics == KINEMATICS_cleavage_opening_ID),pInt) - if (maxNinstance == 0_pInt) return -diff --git a/src/kinematics_slipplane_opening.f90 b/src/kinematics_slipplane_opening.f90 -index f32efa92..07b98aa2 100644 ---- a/src/kinematics_slipplane_opening.f90 -+++ b/src/kinematics_slipplane_opening.f90 -@@ -81,8 +81,6 @@ subroutine kinematics_slipplane_opening_init(fileUnit) - KINEMATICS_slipplane_opening_ID, & - material_Nphase, & - MATERIAL_partPhase -- use numerics,only: & -- worldrank - use lattice, only: & - lattice_maxNslipFamily, & - lattice_NslipSystem -@@ -97,11 +95,9 @@ subroutine kinematics_slipplane_opening_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_slipplane_opening_LABEL//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_slipplane_opening_LABEL//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = int(count(phase_kinematics == KINEMATICS_slipplane_opening_ID),pInt) - if (maxNinstance == 0_pInt) return -diff --git a/src/kinematics_thermal_expansion.f90 b/src/kinematics_thermal_expansion.f90 -index 30c267d3..e7cbca67 100644 ---- a/src/kinematics_thermal_expansion.f90 -+++ b/src/kinematics_thermal_expansion.f90 -@@ -71,8 +71,6 @@ subroutine kinematics_thermal_expansion_init(fileUnit) - KINEMATICS_thermal_expansion_ID, & - material_Nphase, & - MATERIAL_partPhase -- use numerics,only: & -- worldrank - - implicit none - integer(pInt), intent(in) :: fileUnit -@@ -83,11 +81,9 @@ subroutine kinematics_thermal_expansion_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_thermal_expansion_LABEL//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_thermal_expansion_LABEL//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = int(count(phase_kinematics == KINEMATICS_thermal_expansion_ID),pInt) - if (maxNinstance == 0_pInt) return -diff --git a/src/kinematics_vacancy_strain.f90 b/src/kinematics_vacancy_strain.f90 -index 791c0e3c..9558f506 100644 ---- a/src/kinematics_vacancy_strain.f90 -+++ b/src/kinematics_vacancy_strain.f90 -@@ -71,8 +71,6 @@ subroutine kinematics_vacancy_strain_init(fileUnit) - KINEMATICS_vacancy_strain_ID, & - material_Nphase, & - MATERIAL_partPhase -- use numerics,only: & -- worldrank - - implicit none - integer(pInt), intent(in) :: fileUnit -@@ -83,11 +81,9 @@ subroutine kinematics_vacancy_strain_init(fileUnit) - tag = '', & - line = '' - -- mainProcess: if (worldrank == 0) then -- write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_vacancy_strain_LABEL//' init -+>>>' -- write(6,'(a15,a)') ' Current time: ',IO_timeStamp() -+ write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_vacancy_strain_LABEL//' init -+>>>' -+ write(6,'(a15,a)') ' Current time: ',IO_timeStamp() - #include "compilation_info.f90" -- endif mainProcess - - maxNinstance = int(count(phase_kinematics == KINEMATICS_vacancy_strain_ID),pInt) - if (maxNinstance == 0_pInt) return diff --git a/src/mesh.f90 b/src/mesh.f90 index 666fe1e3..a314c22c 100644 --- a/src/mesh.f90 From 74c3e9c54287e15a26c05ca76fae95660b5b026a Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 22 Nov 2017 08:38:17 +0100 Subject: [PATCH 11/11] [skip ci] updated version information after successful test of v2.0.1-992-g20d8133 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7a1f21f80..5c3c2583f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-985-g90c617e +v2.0.1-992-g20d8133