diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..bc8af4d11 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,489 @@ +stages: + - prepareAll + - preprocessing + - postprocessing + - compileSpectralIntel + - compileSpectralGNU + - prepareSpectral + - spectral + - compileMarc2014 + - compileMarc2014.2 + - compileMarc2015 + - compileMarc2016 + - marc + - compileAbaqus2016 + - compileAbaqus2017 + - example + - updateMaster + - createDocumentation + - clean + +################################################################################################### +before_script: + - source $DAMASKROOT/DAMASK_env.sh + - module purge + - cd $DAMASKROOT/PRIVATE/testing + +################################################################################################### +variables: + #================================================================================================ + # GitLab Settings + #================================================================================================ + GIT_SUBMODULE_STRATEGY: none + + #================================================================================================ + # Shortcut names + #================================================================================================ + DAMASKROOT: "$HOME/GitlabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" + + #================================================================================================ + # Names of module files to load + #================================================================================================ + # ++++++++++++ Compiler ++++++++++++++++++++++++++++++++++++++++++++++ + IntelCompiler16_0: "Compiler/Intel/16.0 Libraries/IMKL/2016" + IntelCompiler17_0: "Compiler/Intel/17.0 Libraries/IMKL/2017" + GNUCompiler5_3: "Compiler/GNU/5.3" + # ------------ Defaults ---------------------------------------------- + IntelCompiler: "$IntelCompiler17_0" + GNUCompiler: "$GNUCompiler5_3" + # ++++++++++++ MPI +++++++++++++++++++++++++++++++++++++++++++++++++++ + MPICH3_2Intel17_0: "MPI/Intel/17.0/MPICH/3.2" + MPICH3_2GNU5_3: "MPI/GNU/5.3/MPICH/3.2" + # ------------ Defaults ---------------------------------------------- + MPICH_GNU: "$MPICH3_2GNU5_3" + MPICH_Intel: "$MPICH3_2Intel17_0" + # ++++++++++++ PETSc +++++++++++++++++++++++++++++++++++++++++++++++++ + PETSc3_6_4MPICH3_2Intel17_0: "Libraries/PETSc/3.6.4/Intel-17.0-MPICH-3.2" + PETSc3_7_5MPICH3_2Intel17_0: "Libraries/PETSc/3.7.5/Intel-17.0-MPICH-3.2" + PETSc3_7_5MPICH3_2GNU5_3: "Libraries/PETSc/3.7.5/GNU-5.3-MPICH-3.2" + # ------------ Defaults ---------------------------------------------- + PETSc_MPICH_Intel: "$PETSc3_7_5MPICH3_2Intel17_0" + PETSc_MPICH_GNU: "$PETSc3_7_5MPICH3_2GNU5_3" + # ++++++++++++ FEM +++++++++++++++++++++++++++++++++++++++++++++++++++ + Abaqus2016: "FEM/Abaqus/2016" + Abaqus2017: "FEM/Abaqus/2017" + MSC2014: "FEM/MSC/2014" + MSC2014_2: "FEM/MSC/2014.2" + MSC2015: "FEM/MSC/2015" + MSC2016: "FEM/MSC/2016" + # ------------ Defaults ---------------------------------------------- + Abaqus: "$Abaqus2017" + MSC: "$MSC2016" + # ++++++++++++ Documentation +++++++++++++++++++++++++++++++++++++++++ + Doxygen1_8_13: "Documentation/Doxygen/1.8.13" + # ------------ Defaults ---------------------------------------------- + Doxygen: "$Doxygen1_8_13" + + +################################################################################################### +checkout: + stage: prepareAll + before_script: + - $HOME/wait.sh + - echo $CI_PIPELINE_ID > $HOME/GitLabCI.lock + script: + - mkdir -p $DAMASKROOT + - git clone -q git@magit1.mpie.de:damask/DAMASK.git $DAMASKROOT + - cd $DAMASKROOT + - git checkout $CI_COMMIT_SHA + - git clone -q git@magit1.mpie.de:damask/PRIVATE.git + - source $DAMASKROOT/DAMASK_env.sh + - make install + except: + - master + - release + +################################################################################################### +OrientationRelationship: + stage: preprocessing + script: OrientationRelationship/test.py + except: + - master + - release + +Pre_SeedGeneration: + stage: preprocessing + script: PreProcessing_SeedGeneration/test.py + except: + - master + - release + +Pre_GeomGeneration: + stage: preprocessing + script: PreProcessing_GeomGeneration/test.py + except: + - master + - release + +Pre_GeomModification: + stage: preprocessing + script: PreProcessing_GeomModification/test.py + except: + - master + - release + +Pre_General: + stage: preprocessing + script: PreProcessing/test.py + except: + - master + - release + +Spectral_geometryPacking: + stage: preprocessing + script: Spectral_geometryPacking/test.py + except: + - master + - release + +################################################################################################### +Post_General: + stage: postprocessing + script: PostProcessing/test.py + except: + - master + - release + +Post_GeometryReconstruction: + stage: postprocessing + script: Spectral_geometryReconstruction/test.py + except: + - master + - release + +Post_addCurl: + stage: postprocessing + script: addCurl/test.py + except: + - master + - release + +Post_addDivergence: + stage: postprocessing + script: addDivergence/test.py + except: + - master + - release + +Post_addGradient: + stage: postprocessing + script: addGradient/test.py + except: + - master + - release + +Post_ParaviewRelated: + stage: postprocessing + script: ParaviewRelated/test.py + except: + - master + - release + +################################################################################################### +Compile_Intel: + stage: compileSpectralIntel + script: + - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel + - SpectralAll_compileIfort/test.py + except: + - master + - release + +################################################################################################### +Compile_GNU: + stage: compileSpectralGNU + script: + - module load $GNUCompiler $MPICH_GNU $PETSc_MPICH_GNU + - SpectralAll_compileGfortran/test.py + except: + - master + - release + +################################################################################################### +Compile_Intel_Prepare: + stage: prepareSpectral + script: + - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel + - make -C $DAMASKROOT clean spectral install tidy + except: + - master + - release + +################################################################################################### +Spectral_PackedGeometry: + stage: spectral + script: Spectral_PackedGeometry/test.py + except: + - master + - release + +Spectral_parsingArguments: + stage: spectral + script: Spectral_parsingArguments/test.py + except: + - master + - release + +StateIntegration_compareVariants: + stage: spectral + script: StateIntegration_compareVariants/test.py + except: + - master + - release + +nonlocal_densityConservation: + stage: spectral + script: nonlocal_densityConservation/test.py + except: + - master + - release + +Spectral_ipNeighborhood: + stage: spectral + script: Spectral_ipNeighborhood/test.py + except: + - master + - release + +Nonlocal_Damage_DetectChanges: + stage: spectral + script: Nonlocal_Damage_DetectChanges/test.py + except: + - master + - release + +SpectralAll_restart: + stage: spectral + script: SpectralAll_restart/test.py + except: + - master + - release + +SpectralAll_parsingLoadCase: + stage: spectral + script: SpectralAll_parsingLoadCase/test.py + except: + - master + - release + +SpectralBasic_loadCaseRotation: + stage: spectral + script: SpectralBasic_loadCaseRotation/test.py + except: + - master + - release + +Spectral_MPI: + stage: spectral + script: + - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel + - Spectral_MPI/test.py + except: + - master + - release + +Plasticity_DetectChanges: + stage: spectral + script: Plasticity_DetectChanges/test.py + except: + - master + - release + +Homogenization: + stage: spectral + script: Homogenization/test.py + except: + - master + - release + +Phenopowerlaw_singleSlip: + stage: spectral + script: Phenopowerlaw_singleSlip/test.py + except: + - master + - release + +HybridIA: + stage: spectral + script: HybridIA/test.py + except: + - master + - release + +################################################################################################### +Marc_compileIfort2014: + stage: compileMarc2014 + script: + - module load $IntelCompiler16_0 $MSC2014 + - Marc_compileIfort/test.py -m 2014 + except: + - master + - release + +################################################################################################### +Marc_compileIfort2014.2: + stage: compileMarc2014.2 + script: + - module load $IntelCompiler16_0 $MSC2014_2 + - Marc_compileIfort/test.py -m 2014.2 + except: + - master + - release + +################################################################################################### +Marc_compileIfort2015: + stage: compileMarc2015 + script: + - module load $IntelCompiler16_0 $MSC2015 + - Marc_compileIfort/test.py -m 2015 + except: + - master + - release + +################################################################################################### +Marc_compileIfort2016: + stage: compileMarc2016 + script: + - module load $IntelCompiler16_0 $MSC2016 + - Marc_compileIfort/test.py -m 2016 + except: + - master + - release + +################################################################################################### +Hex_elastic: + stage: marc + script: + - module load $IntelCompiler16_0 $MSC + - Hex_elastic/test.py + except: + - master + - release + +CubicFCC_elastic: + stage: marc + script: + - module load $IntelCompiler16_0 $MSC + - CubicFCC_elastic/test.py + except: + - master + - release + +CubicBCC_elastic: + stage: marc + script: + - module load $IntelCompiler16_0 $MSC + - CubicBCC_elastic/test.py + except: + - master + - release + +J2_plasticBehavior: + stage: marc + script: + - module load $IntelCompiler16_0 $MSC + - J2_plasticBehavior/test.py + except: + - master + - release + +################################################################################################### +Abaqus_compile2016: + stage: compileAbaqus2016 + script: + - module load $IntelCompiler16_0 $Abaqus2016 + - Abaqus_compileIfort/test.py -a 2016 + except: + - master + - release + +################################################################################################### +Abaqus_compile2017: + stage: compileAbaqus2017 + script: + - module load $IntelCompiler16_0 $Abaqus2017 + - Abaqus_compileIfort/test.py -a 2017 + except: + - master + - release + +################################################################################################### +SpectralExample: + stage: example + script: SpectralAll_example/test.py + only: + - development + +AbaqusExample: + stage: example + script: + - module load $IntelCompiler16_0 $Abaqus + - Abaqus_example/test.py + only: + - development + +################################################################################################## +mergeIntoMaster: + stage: updateMaster + script: + - cd $DAMASKROOT + - export TESTEDREV=$(git describe) # might be detached from development branch + - echo $TESTEDREV > VERSION + - git commit VERSION -m "[skip ci] updated version information after successful test of $TESTEDREV" + - export UPDATEDREV=$(git describe) # tested state + 1 commit + - git checkout master + - git merge $UPDATEDREV + - git push origin master # master is now tested version and has updated VERSION file + - git checkout development + - git merge master -s ours # only possible conflict is in VERSION file + - git push origin development # development is unchanged (as master is based on it) but has updated VERSION file + only: + - development + +################################################################################################### +AbaqusExp: + stage: createDocumentation + script: + - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen + - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT abaqus_exp + except: + - master + - release + +AbaqusStd: + stage: createDocumentation + script: + - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen + - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT abaqus_std + except: + - master + - release + +Marc: + stage: createDocumentation + script: + - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen + - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT marc + except: + - master + - release + +Spectral: + stage: createDocumentation + script: + - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen + - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT spectral + except: + - master + - release + +################################################################################################### +removeLock: + stage: clean + before_script: + - echo 'Do nothing' + when: always + script: rm $HOME/GitLabCI.lock + except: + - master + - release diff --git a/DAMASK_env.sh b/DAMASK_env.sh index fa3171c48..078dd582b 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -25,11 +25,11 @@ if [[ "x$DAMASK_BIN" != "x" && ! $(echo ":$PATH:" | grep $DAMASK_BIN:) ]]; then export PATH=$DAMASK_BIN:$PATH fi -SOLVER=$(which DAMASK_spectral 2>/dev/null) +SOLVER=$(which DAMASK_spectral || true 2>/dev/null) if [ "x$SOLVER" == "x" ]; then SOLVER='Not found!' fi -PROCESSING=$(which postResults 2>/dev/null) +PROCESSING=$(which postResults || true 2>/dev/null) if [ "x$PROCESSING" == "x" ]; then PROCESSING='Not found!' fi diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index dbb781894..0d043c390 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -19,8 +19,8 @@ if [[ ( "x$DAMASK_BIN" != "x" ) && ( "x$MATCH" = "x" ) ]]; then export PATH=$DAMASK_BIN:$PATH fi -SOLVER=`which DAMASK_spectral 2>/dev/null` -PROCESSING=`which postResults 2>/dev/null` +SOLVER=`which DAMASK_spectral || True 2>/dev/null` +PROCESSING=`which postResults || True 2>/dev/null` if [ "x$DAMASK_NUM_THREADS" = "x" ]; then DAMASK_NUM_THREADS=1 fi diff --git a/LICENSE b/LICENSE index 5a76343a0..97d799216 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2011-16 Max-Planck-Institut für Eisenforschung GmbH +Copyright 2011-17 Max-Planck-Institut für Eisenforschung GmbH This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/VERSION b/VERSION index 3f6b37f8f..1d89fa753 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-393-gf010aa9 +v2.0.1-414-g81d0752 diff --git a/code/math.f90 b/code/math.f90 index 315da2642..e62fe60c3 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -1181,6 +1181,9 @@ end function math_Voigt66to3333 !-------------------------------------------------------------------------------------------------- !> @brief random quaternion +! http://math.stackexchange.com/questions/131336/uniform-random-quaternion-in-a-restricted-angle-range +! K. Shoemake. Uniform random rotations. In D. Kirk, editor, Graphics Gems III, pages 124-132. +! Academic, New York, 1992. !-------------------------------------------------------------------------------------------------- function math_qRand() diff --git a/code/numerics.f90 b/code/numerics.f90 index 6569d7cb4..4358624de 100644 --- a/code/numerics.f90 +++ b/code/numerics.f90 @@ -694,9 +694,9 @@ subroutine numerics_init .not. memory_efficient) call IO_error(error_ID = 847_pInt) if (err_stress_tolrel <= 0.0_pReal) call IO_error(301_pInt,ext_msg='err_stress_tolRel') if (err_stress_tolabs <= 0.0_pReal) call IO_error(301_pInt,ext_msg='err_stress_tolAbs') - if (err_div_tolRel <= 0.0_pReal) call IO_error(301_pInt,ext_msg='err_div_tolRel') + if (err_div_tolRel < 0.0_pReal) call IO_error(301_pInt,ext_msg='err_div_tolRel') if (err_div_tolAbs <= 0.0_pReal) call IO_error(301_pInt,ext_msg='err_div_tolAbs') - if (err_curl_tolRel <= 0.0_pReal) call IO_error(301_pInt,ext_msg='err_curl_tolRel') + if (err_curl_tolRel < 0.0_pReal) call IO_error(301_pInt,ext_msg='err_curl_tolRel') if (err_curl_tolAbs <= 0.0_pReal) call IO_error(301_pInt,ext_msg='err_curl_tolAbs') if (polarAlpha <= 0.0_pReal .or. & polarAlpha > 2.0_pReal) call IO_error(301_pInt,ext_msg='polarAlpha') diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index fdef1a9fb..f37f083d6 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -20,7 +20,6 @@ module DAMASK_interface geometryFile = '', & !< parameter given for geometry file loadCaseFile = '' !< parameter given for load case file character(len=1024), private :: workingDirectory !< accessed by getSolverWorkingDirectoryName for compatibility reasons - character, private,parameter :: pathSep = '/' public :: & getSolverWorkingDirectoryName, & @@ -96,7 +95,11 @@ subroutine DAMASK_interface_init() call quit(1_pInt) endif if (error_unit /= 0) then - write(output_unit,'(a)') ' STERR != 0' + write(output_unit,'(a)') ' STDERR != 0' + call quit(1_pInt) + endif + if (PETSC_VERSION_MAJOR /= 3 .or. PETSC_VERSION_MINOR /= 7) then + write(6,'(a,2(i1.1,a))') 'PETSc ',PETSC_VERSION_MAJOR,'.',PETSC_VERSION_MINOR,'.x not supported' call quit(1_pInt) endif else mainProcess @@ -168,7 +171,7 @@ subroutine DAMASK_interface_init() write(6,'(a)') ' Help:' write(6,'(/,a)')' --help' write(6,'(a,/)')' Prints this message and exits' - call quit(0_pInt) ! normal Termination + call quit(0_pInt) ! normal Termination case ('-l', '--load', '--loadcase') loadcaseArg = IIO_stringValue(commandLine,chunkPos,i+1_pInt) case ('-g', '--geom', '--geometry') @@ -194,7 +197,6 @@ subroutine DAMASK_interface_init() error = getHostName(hostName) write(6,'(a,a)') ' Host name: ', trim(hostName) write(6,'(a,a)') ' User name: ', trim(userName) - write(6,'(a,a)') ' Path separator: ', pathSep write(6,'(a,a)') ' Command line call: ', trim(commandLine) if (len(trim(workingDirArg))>0) & write(6,'(a,a)') ' Working dir argument: ', trim(workingDirArg) @@ -229,22 +231,22 @@ character(len=1024) function storeWorkingDirectory(workingDirectoryArg,geometryA external :: quit wdGiven: if (len(workingDirectoryArg)>0) then - absolutePath: if (workingDirectoryArg(1:1) == pathSep) then + absolutePath: if (workingDirectoryArg(1:1) == '/') then storeWorkingDirectory = workingDirectoryArg else absolutePath error = getCWD(cwd) if (error) call quit(1_pInt) - storeWorkingDirectory = trim(cwd)//pathSep//workingDirectoryArg + storeWorkingDirectory = trim(cwd)//'/'//workingDirectoryArg endif absolutePath - if (storeWorkingDirectory(len(trim(storeWorkingDirectory)):len(trim(storeWorkingDirectory))) /= pathSep) & - storeWorkingDirectory = trim(storeWorkingDirectory)//pathSep ! if path seperator is not given, append it + if (storeWorkingDirectory(len(trim(storeWorkingDirectory)):len(trim(storeWorkingDirectory))) /= '/') & + storeWorkingDirectory = trim(storeWorkingDirectory)//'/' ! if path seperator is not given, append it else wdGiven - if (geometryArg(1:1) == pathSep) then ! absolute path given as command line argument - storeWorkingDirectory = geometryArg(1:scan(geometryArg,pathSep,back=.true.)) + if (geometryArg(1:1) == '/') then ! absolute path given as command line argument + storeWorkingDirectory = geometryArg(1:scan(geometryArg,'/',back=.true.)) else error = getCWD(cwd) ! relative path given as command line argument if (error) call quit(1_pInt) - storeWorkingDirectory = trim(cwd)//pathSep//geometryArg(1:scan(geometryArg,pathSep,back=.true.)) + storeWorkingDirectory = trim(cwd)//'/'//geometryArg(1:scan(geometryArg,'/',back=.true.)) endif endif wdGiven @@ -281,13 +283,13 @@ character(len=1024) function getSolverJobName() tempString = geometryFile posExt = scan(tempString,'.',back=.true.) - posSep = scan(tempString,pathSep,back=.true.) + posSep = scan(tempString,'/',back=.true.) getSolverJobName = tempString(posSep+1:posExt-1) tempString = loadCaseFile posExt = scan(tempString,'.',back=.true.) - posSep = scan(tempString,pathSep,back=.true.) + posSep = scan(tempString,'/',back=.true.) getSolverJobName = trim(getSolverJobName)//'_'//tempString(posSep+1:posExt-1) @@ -312,13 +314,13 @@ character(len=1024) function getGeometryFile(geometryParameter) getGeometryFile = geometryParameter posExt = scan(getGeometryFile,'.',back=.true.) - posSep = scan(getGeometryFile,pathSep,back=.true.) + posSep = scan(getGeometryFile,'/',back=.true.) if (posExt <= posSep) getGeometryFile = trim(getGeometryFile)//('.geom') ! no extension present - if (scan(getGeometryFile,pathSep) /= 1) then ! relative path given as command line argument + if (scan(getGeometryFile,'/') /= 1) then ! relative path given as command line argument error = getcwd(cwd) if (error) call quit(1_pInt) - getGeometryFile = rectifyPath(trim(cwd)//pathSep//getGeometryFile) + getGeometryFile = rectifyPath(trim(cwd)//'/'//getGeometryFile) else getGeometryFile = rectifyPath(getGeometryFile) endif @@ -346,13 +348,13 @@ character(len=1024) function getLoadCaseFile(loadCaseParameter) getLoadCaseFile = loadcaseParameter posExt = scan(getLoadCaseFile,'.',back=.true.) - posSep = scan(getLoadCaseFile,pathSep,back=.true.) + posSep = scan(getLoadCaseFile,'/',back=.true.) if (posExt <= posSep) getLoadCaseFile = trim(getLoadCaseFile)//('.load') ! no extension present - if (scan(getLoadCaseFile,pathSep) /= 1) then ! relative path given as command line argument + if (scan(getLoadCaseFile,'/') /= 1) then ! relative path given as command line argument error = getcwd(cwd) if (error) call quit(1_pInt) - getLoadCaseFile = rectifyPath(trim(cwd)//pathSep//getLoadCaseFile) + getLoadCaseFile = rectifyPath(trim(cwd)//'/'//getLoadCaseFile) else getLoadCaseFile = rectifyPath(getLoadCaseFile) endif @@ -377,26 +379,26 @@ function rectifyPath(path) l = len_trim(path) rectifyPath = path do i = l,3,-1 - if (rectifyPath(i-2:i) == pathSep//'.'//pathSep) & + if (rectifyPath(i-2:i) == '/'//'.'//'/') & rectifyPath(i-1:l) = rectifyPath(i+1:l)//' ' enddo !-------------------------------------------------------------------------------------------------- ! remove ../ and corresponding directory from rectifyPath l = len_trim(rectifyPath) - i = index(rectifyPath(i:l),'..'//pathSep) + i = index(rectifyPath(i:l),'..'//'/') j = 0 do while (i > j) - j = scan(rectifyPath(1:i-2),pathSep,back=.true.) + j = scan(rectifyPath(1:i-2),'/',back=.true.) rectifyPath(j+1:l) = rectifyPath(i+3:l)//repeat(' ',2+i-j) - if (rectifyPath(j+1:j+1) == pathSep) then !search for '//' that appear in case of XXX/../../XXX + if (rectifyPath(j+1:j+1) == '/') then !search for '//' that appear in case of XXX/../../XXX k = len_trim(rectifyPath) rectifyPath(j+1:k-1) = rectifyPath(j+2:k) rectifyPath(k:k) = ' ' endif - i = j+index(rectifyPath(j+1:l),'..'//pathSep) + i = j+index(rectifyPath(j+1:l),'..'//'/') enddo - if(len_trim(rectifyPath) == 0) rectifyPath = pathSep + if(len_trim(rectifyPath) == 0) rectifyPath = '/' end function rectifyPath @@ -415,12 +417,12 @@ character(len=1024) function makeRelativePath(a,b) do i = 1, min(1024,len_trim(a),len_trim(b)) if (a(i:i) /= b(i:i)) exit - if (a(i:i) == pathSep) posLastCommonSlash = i + if (a(i:i) == '/') posLastCommonSlash = i enddo do i = posLastCommonSlash+1,len_trim(a) - if (a(i:i) == pathSep) remainingSlashes = remainingSlashes + 1 + if (a(i:i) == '/') remainingSlashes = remainingSlashes + 1 enddo - makeRelativePath = repeat('..'//pathSep,remainingSlashes)//b(posLastCommonSlash+1:len_trim(b)) + makeRelativePath = repeat('..'//'/',remainingSlashes)//b(posLastCommonSlash+1:len_trim(b)) end function makeRelativePath diff --git a/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config b/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config index 2570b1b95..e7c9d4e19 100644 --- a/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config +++ b/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config @@ -50,7 +50,7 @@ interactionSlipSlip 0.122 0.122 0.625 0.07 0.137 0.122 # Interaction coefficient ### Shearband parameters ### shearbandresistance 180e6 -shearbandvelocity 1e-4 # set to zero to turn shear banding of +shearbandvelocity 0e-4 # set to zero to turn shear banding of QedgePerSbSystem 3.7e-19 # Activation energy for shear banding [J] p_shearband 1.0 # p-exponent in glide velocity q_shearband 1.0 # q-exponent in glide velocity diff --git a/examples/ConfigFiles/Phase_None_Orthorombic.config b/examples/ConfigFiles/Phase_None_Orthorombic.config index 006b0e048..d7955cf2a 100644 --- a/examples/ConfigFiles/Phase_None_Orthorombic.config +++ b/examples/ConfigFiles/Phase_None_Orthorombic.config @@ -12,4 +12,4 @@ c13 60.41e9 c23 60.41e9 c44 28.34e9 c55 28.34e9 -c66 28.34e9 \ No newline at end of file +c66 28.34e9 diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config index 6efd84f65..594c5dc22 100644 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config @@ -18,8 +18,5 @@ tau0_slip 95.e6 97.e6 # per family, optimization long tausat_slip 222.e6 412.7e6 # per family, optimization long simplex 109 h0_slipslip 1000.0e6 interaction_slipslip 1 1 1.4 1.4 1.4 1.4 -interaction_sliptwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 w0_slip 2.0 (output) totalshear diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config index 89ae0339b..6e005f251 100644 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config @@ -18,8 +18,5 @@ tau0_slip 405.8e6 456.7e6 # per family tausat_slip 872.9e6 971.2e6 # per family h0_slipslip 563.0e9 interaction_slipslip 1 1 1.4 1.4 1.4 1.4 -interaction_sliptwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 w0_slip 2.0 (output) totalshear diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_Gold.config b/examples/ConfigFiles/Phase_Phenopowerlaw_Gold.config index fdae9c8e7..a2e06fc07 100644 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_Gold.config +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_Gold.config @@ -35,18 +35,7 @@ tausat_slip 53.00e6 # per family a_slip 1.0 gdot0_twin 0.001 n_twin 20 -tau0_twin 0 # per family -s_pr 0 # push-up factor for slip saturation due to twinning -twin_b 0 -twin_c 0 -twin_d 0 -twin_e 0 h0_slipslip 75e6 -h0_twinslip 0 -h0_twintwin 0 interaction_slipslip 1 1 1.4 1.4 1.4 1.4 -interaction_sliptwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 atol_resistance 1 diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_multiField.config b/examples/ConfigFiles/Phase_Phenopowerlaw_multiField.config index 4436564cc..05503a6e7 100644 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_multiField.config +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_multiField.config @@ -29,18 +29,8 @@ a_slip 2.25 gdot0_twin 0.001 n_twin 20 tau0_twin 31e6 # per family -s_pr 0 # push-up factor for slip saturation due to twinning -twin_b 0 -twin_c 0 -twin_d 0 -twin_e 0 h0_slipslip 75e6 -h0_twinslip 0 -h0_twintwin 0 interaction_slipslip 1 1 1.4 1.4 1.4 1.4 -interaction_sliptwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 atol_resistance 1 (stiffness_degradation) damage diff --git a/examples/ConfigFiles/Source_Damage_IsoBrittle.config b/examples/ConfigFiles/Source_Damage_IsoBrittle.config index b248bb8fc..b36165ab4 100644 --- a/examples/ConfigFiles/Source_Damage_IsoBrittle.config +++ b/examples/ConfigFiles/Source_Damage_IsoBrittle.config @@ -2,4 +2,4 @@ isobrittle_criticalStrainEnergy 1400000.0 isobrittle_atol 0.01 isobrittle_N 1.0 -(output) isoBrittle_DrivingForce \ No newline at end of file +(output) isoBrittle_DrivingForce diff --git a/examples/ConfigFiles/Texture_Gauss_001.config b/examples/ConfigFiles/Texture_Gauss_001.config index 153fab381..4711c4135 100644 --- a/examples/ConfigFiles/Texture_Gauss_001.config +++ b/examples/ConfigFiles/Texture_Gauss_001.config @@ -1,2 +1,2 @@ [001] -(gauss) phi1 0.000 Phi 0.000 phi2 0.000 scatter 0.000 fraction 1.000 \ No newline at end of file +(gauss) phi1 0.000 Phi 0.000 phi2 0.000 scatter 0.000 fraction 1.000 diff --git a/examples/ConfigFiles/Texture_Gauss_101.config b/examples/ConfigFiles/Texture_Gauss_101.config index 28351eece..79457aeac 100644 --- a/examples/ConfigFiles/Texture_Gauss_101.config +++ b/examples/ConfigFiles/Texture_Gauss_101.config @@ -1,2 +1,2 @@ [101] -(gauss) phi1 0.000 Phi 45.000 phi2 90.000 scatter 0.000 fraction 1.000 \ No newline at end of file +(gauss) phi1 0.000 Phi 45.000 phi2 90.000 scatter 0.000 fraction 1.000 diff --git a/examples/ConfigFiles/Texture_Gauss_111.config b/examples/ConfigFiles/Texture_Gauss_111.config index e4dc139f8..8204bfb69 100644 --- a/examples/ConfigFiles/Texture_Gauss_111.config +++ b/examples/ConfigFiles/Texture_Gauss_111.config @@ -1,2 +1,2 @@ [111] -(gauss) phi1 0.000 Phi 54.7356 phi2 45.000 scatter 0.000 fraction 1.000 \ No newline at end of file +(gauss) phi1 0.000 Phi 54.7356 phi2 45.000 scatter 0.000 fraction 1.000 diff --git a/examples/ConfigFiles/Texture_Gauss_123.config b/examples/ConfigFiles/Texture_Gauss_123.config index 374674e09..32d28442f 100644 --- a/examples/ConfigFiles/Texture_Gauss_123.config +++ b/examples/ConfigFiles/Texture_Gauss_123.config @@ -1,2 +1,2 @@ [123] -(gauss) phi1 209.805 Phi 29.206 phi2 63.435 scatter 0.000 fraction 1.000 \ No newline at end of file +(gauss) phi1 209.805 Phi 29.206 phi2 63.435 scatter 0.000 fraction 1.000 diff --git a/examples/ConfigFiles/Texture_RandomSingleCrystals.config b/examples/ConfigFiles/Texture_RandomSingleCrystals.config index fac65ae20..6e1f98a3d 100644 --- a/examples/ConfigFiles/Texture_RandomSingleCrystals.config +++ b/examples/ConfigFiles/Texture_RandomSingleCrystals.config @@ -1,2 +1,2 @@ [RandomSingleCrystals] -(random) scatter 0.000 fraction 1.000 \ No newline at end of file +(random) scatter 0.000 fraction 1.000 diff --git a/examples/SpectralMethod/material.config b/examples/SpectralMethod/material.config index 14437c5d8..978e0f511 100644 --- a/examples/SpectralMethod/material.config +++ b/examples/SpectralMethod/material.config @@ -52,22 +52,8 @@ n_slip 20 tau0_slip 31e6 # per family tausat_slip 63e6 # per family a_slip 2.25 -gdot0_twin 0.001 -n_twin 20 -tau0_twin 31e6 # per family -s_pr 0 # push-up factor for slip saturation due to twinning -twin_b 0 -twin_c 0 -twin_d 0 -twin_e 0 h0_slipslip 75e6 -h0_sliptwin 0 -h0_twinslip 0 -h0_twintwin 0 interaction_slipslip 1 1 1.4 1.4 1.4 1.4 -interaction_sliptwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 atol_resistance 1 diff --git a/installation/mods_Abaqus/abaqus_v6.env b/installation/mods_Abaqus/abaqus_v6.env index d30554d41..0bc5063a1 100644 --- a/installation/mods_Abaqus/abaqus_v6.env +++ b/installation/mods_Abaqus/abaqus_v6.env @@ -31,7 +31,7 @@ fortCmd = "ifort" # -integer-size 32 -DINT=4 assume size of integer to be 4 bytes, matches our definition of pInt compile_fortran = (fortCmd + " -c -fPIC -auto -shared-intel " + - "-I%I -I../lib -free -O1 -fpp -openmp " + + "-I%I -free -O1 -fpp -openmp " + "-ftz -diag-disable 5268 " + "-implicitnone -assume byterecl -stand f08 -standard-semantics " + "-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 " + diff --git a/installation/mods_Abaqus/abaqus_v6_serial.env b/installation/mods_Abaqus/abaqus_v6_serial.env index 8cf9778f2..0469dc5f9 100644 --- a/installation/mods_Abaqus/abaqus_v6_serial.env +++ b/installation/mods_Abaqus/abaqus_v6_serial.env @@ -31,7 +31,7 @@ fortCmd = "ifort" # -integer-size 32 -DINT=4 assume size of integer to be 4 bytes, matches our definition of pInt compile_fortran = (fortCmd + " -c -fPIC -auto -shared-intel " + - "-I%I -I../lib -free -O1 -fpp " + + "-I%I -free -O1 -fpp " + "-ftz -diag-disable 5268 " + "-implicitnone -assume byterecl -stand f08 -standard-semantics " + "-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 " + diff --git a/lib/damask/environment.py b/lib/damask/environment.py index a37f9dc5c..6ec0bff79 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -33,7 +33,7 @@ class Environment(): 'explicit':5} if Nneeded == -1: Nneeded = licensesNeeded[software] try: - cmd = """ ssh mulicense2 "/Stat_Flexlm | grep 'Users of %s: ' | cut -d' ' -f7,13" """%software + cmd = """ ssh mulicense2 "/lm-status | grep 'Users of %s: ' | cut -d' ' -f7,13" """%software process = subprocess.Popen(shlex.split(cmd),stdout = subprocess.PIPE,stderr = subprocess.PIPE) licenses = list(map(int, process.stdout.readline().split())) try: diff --git a/processing/post/postResults.py b/processing/post/postResults.py index a3501bc81..23550e980 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -851,7 +851,7 @@ for opt in ['nodalScalar','elemScalar','elemTensor','homogenizationResult','crys if options.info: if options.filetype == 'marc': - print('\n\nMentat release {}'.format(damask.solver.Marc().version('../../'))) + print('\n\nMentat release {}'.format(damask.solver.Marc().version())) if options.filetype == 'spectral': print('\n\n{}'.format(p)) diff --git a/processing/pre/geom_addPrimitive.py b/processing/pre/geom_addPrimitive.py index 349708b3b..607e5facd 100755 --- a/processing/pre/geom_addPrimitive.py +++ b/processing/pre/geom_addPrimitive.py @@ -48,29 +48,32 @@ parser.add_option( '--degrees', dest='degrees', action='store_true', help = 'angle is given in degrees [%default]') parser.add_option( '--nonperiodic', dest='periodic', action='store_false', help = 'wrap around edges [%default]') - -parser.set_defaults(center = [0,0,0], +parser.add_option( '--voxelspace', dest='voxelspace', action='store_true', + help = '-c and -d are given in (0 to grid) coordinates instead of (origin to origin+size) \ +coordinates [%default]') +parser.set_defaults(center = (.0,.0,.0), fill = 0, - quaternion = [], - angleaxis = [], degrees = False, - exponent = [1e10,1e10,1e10], # box shape by default - periodic = True + exponent = (1e10,1e10,1e10), # box shape by default + periodic = True, + voxelspace = False ) (options, filenames) = parser.parse_args() - -if options.angleaxis != []: +if options.dimension is None: + parser.error('no dimension specified.') +if options.angleaxis is not None: options.angleaxis = map(float,options.angleaxis) rotation = damask.Quaternion().fromAngleAxis(np.radians(options.angleaxis[0]) if options.degrees else options.angleaxis[0], options.angleaxis[1:4]) -elif options.quaternion != []: +elif options.quaternion is not None: options.quaternion = map(float,options.quaternion) rotation = damask.Quaternion(options.quaternion) else: rotation = damask.Quaternion() options.center = np.array(options.center) +options.dimension = np.array(options.dimension) # --- loop over input files ------------------------------------------------------------------------- if filenames == []: filenames = [None] @@ -117,9 +120,14 @@ for name in filenames: # If we have a negative dimension, make it an ellipsoid for backwards compatibility options.exponent = np.where(np.array(options.dimension) > 0, options.exponent, 2) - microstructure = microstructure.reshape(info['grid'],order='F') + # coordinates given in real space (default) vs voxel space + if not options.voxelspace: + options.center += info['origin'] + options.center *= np.array(info['grid']) / np.array(info['size']) + options.dimension *= np.array(info['grid']) / np.array(info['size']) + size = microstructure.shape # change to coordinate space where the primitive is the unit sphere/cube/etc