adopted dNeq for constituent fraction sanity check

This commit is contained in:
Philip Eisenlohr 2017-04-30 13:19:56 -04:00
commit 592b3d043a
108 changed files with 1266 additions and 1195 deletions

2
.gitignore vendored
View File

@ -6,4 +6,4 @@
*.bak *.bak
*~ *~
bin bin
PRIVATE build

View File

@ -14,13 +14,13 @@ stages:
- compileAbaqus2016 - compileAbaqus2016
- compileAbaqus2017 - compileAbaqus2017
- example - example
- updateMaster
- createDocumentation - createDocumentation
- updateMaster
- clean
################################################################################################### ###################################################################################################
before_script: before_script:
- eval 'source $DAMASKROOT/DAMASK_env.sh' - source $DAMASKROOT/DAMASK_env.sh
- module purge
- cd $DAMASKROOT/PRIVATE/testing - cd $DAMASKROOT/PRIVATE/testing
################################################################################################### ###################################################################################################
@ -33,7 +33,7 @@ variables:
#================================================================================================ #================================================================================================
# Shortcut names # Shortcut names
#================================================================================================ #================================================================================================
DAMASKROOT: "$HOME/GitlabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" DAMASKROOT: "$HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/DAMASK"
#================================================================================================ #================================================================================================
# Names of module files to load # Names of module files to load
@ -53,10 +53,11 @@ variables:
MPICH_Intel: "$MPICH3_2Intel17_0" MPICH_Intel: "$MPICH3_2Intel17_0"
# ++++++++++++ PETSc +++++++++++++++++++++++++++++++++++++++++++++++++ # ++++++++++++ PETSc +++++++++++++++++++++++++++++++++++++++++++++++++
PETSc3_6_4MPICH3_2Intel17_0: "Libraries/PETSc/3.6.4/Intel-17.0-MPICH-3.2" PETSc3_6_4MPICH3_2Intel17_0: "Libraries/PETSc/3.6.4/Intel-17.0-MPICH-3.2"
PETSc3_7_6MPICH3_2Intel17_0: "Libraries/PETSc/3.7.5/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_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" PETSc3_7_5MPICH3_2GNU5_3: "Libraries/PETSc/3.7.5/GNU-5.3-MPICH-3.2"
# ------------ Defaults ---------------------------------------------- # ------------ Defaults ----------------------------------------------
PETSc_MPICH_Intel: "$PETSc3_7_5MPICH3_2Intel17_0" PETSc_MPICH_Intel: "$PETSc3_7_6MPICH3_2Intel17_0"
PETSc_MPICH_GNU: "$PETSc3_7_5MPICH3_2GNU5_3" PETSc_MPICH_GNU: "$PETSc3_7_5MPICH3_2GNU5_3"
# ++++++++++++ FEM +++++++++++++++++++++++++++++++++++++++++++++++++++ # ++++++++++++ FEM +++++++++++++++++++++++++++++++++++++++++++++++++++
Abaqus2016: "FEM/Abaqus/2016" Abaqus2016: "FEM/Abaqus/2016"
@ -78,143 +79,239 @@ variables:
checkout: checkout:
stage: prepareAll stage: prepareAll
before_script: before_script:
- echo 'Do nothing' - echo $CI_PIPELINE_ID >> $HOME/GitLabCI.queue
- while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $HOME/GitLabCI.queue) -ne 1 ];do sleep 5m; done
script: script:
- mkdir -p $DAMASKROOT - mkdir -p $DAMASKROOT
- git clone -b GitLabRunner git@magit1.mpie.de:damask/DAMASK.git $DAMASKROOT - git clone -q git@magit1.mpie.de:damask/DAMASK.git $DAMASKROOT
- git clone git@magit1.mpie.de:damask/PRIVATE.git $DAMASKROOT/PRIVATE - cd $DAMASKROOT
- eval 'source $DAMASKROOT/DAMASK_env.sh' - git checkout $CI_COMMIT_SHA
- make -C $DAMASKROOT install - git clone -q git@magit1.mpie.de:damask/PRIVATE.git
- source $DAMASKROOT/DAMASK_env.sh
- make processing
except:
- master
- release
################################################################################################### ###################################################################################################
OrientationRelationship: OrientationRelationship:
stage: preprocessing stage: preprocessing
script: OrientationRelationship/test.py script: OrientationRelationship/test.py
except:
- master
- release
Pre_SeedGeneration: Pre_SeedGeneration:
stage: preprocessing stage: preprocessing
script: PreProcessing_SeedGeneration/test.py script: PreProcessing_SeedGeneration/test.py
except:
- master
- release
Pre_GeomGeneration: Pre_GeomGeneration:
stage: preprocessing stage: preprocessing
script: PreProcessing_GeomGeneration/test.py script: PreProcessing_GeomGeneration/test.py
except:
- master
- release
Pre_GeomModification: Pre_GeomModification:
stage: preprocessing stage: preprocessing
script: PreProcessing_GeomModification/test.py script: PreProcessing_GeomModification/test.py
except:
- master
- release
Pre_General: Pre_General:
stage: preprocessing stage: preprocessing
script: PreProcessing/test.py script: PreProcessing/test.py
except:
- master
- release
Spectral_geometryPacking: Spectral_geometryPacking:
stage: preprocessing stage: preprocessing
script: Spectral_geometryPacking/test.py script: Spectral_geometryPacking/test.py
except:
- master
- release
################################################################################################### ###################################################################################################
Post_General: Post_General:
stage: postprocessing stage: postprocessing
script: PostProcessing/test.py script: PostProcessing/test.py
except:
- master
- release
Post_GeometryReconstruction: Post_GeometryReconstruction:
stage: postprocessing stage: postprocessing
script: Spectral_geometryReconstruction/test.py script: Spectral_geometryReconstruction/test.py
except:
- master
- release
Post_addCurl: Post_addCurl:
stage: postprocessing stage: postprocessing
script: addCurl/test.py script: addCurl/test.py
except:
- master
- release
Post_addDivergence: Post_addDivergence:
stage: postprocessing stage: postprocessing
script: addDivergence/test.py script: addDivergence/test.py
except:
- master
- release
Post_addGradient: Post_addGradient:
stage: postprocessing stage: postprocessing
script: addGradient/test.py script: addGradient/test.py
except:
- master
- release
Post_ParaviewRelated: Post_ParaviewRelated:
stage: postprocessing stage: postprocessing
script: ParaviewRelated/test.py script: ParaviewRelated/test.py
except:
- master
- release
################################################################################################### ###################################################################################################
Compile_Intel: Compile_Intel:
stage: compileSpectralIntel stage: compileSpectralIntel
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel
- SpectralAll_compileIfort/test.py - SpectralAll_compile/test.py
except:
- master
- release
################################################################################################### ###################################################################################################
Compile_GNU: Compile_GNU:
stage: compileSpectralGNU stage: compileSpectralGNU
script: script:
- module load $GNUCompiler $MPICH_GNU $PETSc_MPICH_GNU - module load $GNUCompiler $MPICH_GNU $PETSc_MPICH_GNU
- SpectralAll_compileGfortran/test.py - SpectralAll_compile/test.py
except:
- master
- release
################################################################################################### ###################################################################################################
Compile_Intel_Prepare: Compile_Intel_Prepare:
stage: prepareSpectral stage: prepareSpectral
script: before_script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel
- make -C $DAMASKROOT clean spectral install tidy script:
- cd $DAMASKROOT
- source DAMASK_env.sh
- make clean spectral processing
except:
- master
- release
################################################################################################### ###################################################################################################
Spectral_PackedGeometry: Spectral_PackedGeometry:
stage: spectral stage: spectral
script: Spectral_PackedGeometry/test.py script: Spectral_PackedGeometry/test.py
except:
- master
- release
Spectral_parsingArguments: Spectral_parsingArguments:
stage: spectral stage: spectral
script: Spectral_parsingArguments/test.py script: Spectral_parsingArguments/test.py
except:
- master
- release
StateIntegration_compareVariants: StateIntegration_compareVariants:
stage: spectral stage: spectral
script: StateIntegration_compareVariants/test.py script: StateIntegration_compareVariants/test.py
except:
- master
- release
nonlocal_densityConservation: nonlocal_densityConservation:
stage: spectral stage: spectral
script: nonlocal_densityConservation/test.py script: nonlocal_densityConservation/test.py
except:
- master
- release
Spectral_ipNeighborhood: Spectral_ipNeighborhood:
stage: spectral stage: spectral
script: Spectral_ipNeighborhood/test.py script: Spectral_ipNeighborhood/test.py
except:
- master
- release
Nonlocal_Damage_DetectChanges: Nonlocal_Damage_DetectChanges:
stage: spectral stage: spectral
script: Nonlocal_Damage_DetectChanges/test.py script: Nonlocal_Damage_DetectChanges/test.py
except:
- master
- release
SpectralAll_restart: SpectralAll_restart:
stage: spectral stage: spectral
script: SpectralAll_restart/test.py script: SpectralAll_restart/test.py
except:
- master
- release
SpectralAll_parsingLoadCase: SpectralAll_parsingLoadCase:
stage: spectral stage: spectral
script: SpectralAll_parsingLoadCase/test.py script: SpectralAll_parsingLoadCase/test.py
except:
- master
- release
SpectralBasic_loadCaseRotation: SpectralBasic_loadCaseRotation:
stage: spectral stage: spectral
script: SpectralBasic_loadCaseRotation/test.py script: SpectralBasic_loadCaseRotation/test.py
except:
- master
- release
Spectral_MPI: Spectral_MPI:
stage: spectral stage: spectral
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel
- Spectral_MPI/test.py - Spectral_MPI/test.py
except:
- master
- release
Plasticity_DetectChanges: Plasticity_DetectChanges:
stage: spectral stage: spectral
script: Plasticity_DetectChanges/test.py script: Plasticity_DetectChanges/test.py
except:
- master
- release
Homogenization: Homogenization:
stage: spectral stage: spectral
script: Homogenization/test.py script: Homogenization/test.py
except:
- master
- release
Phenopowerlaw_singleSlip: Phenopowerlaw_singleSlip:
stage: spectral stage: spectral
script: Phenopowerlaw_singleSlip/test.py script: Phenopowerlaw_singleSlip/test.py
except:
- master
- release
HybridIA: HybridIA:
stage: spectral stage: spectral
script: HybridIA/test.py script: HybridIA/test.py
except:
- master
- release
################################################################################################### ###################################################################################################
Marc_compileIfort2014: Marc_compileIfort2014:
@ -222,6 +319,9 @@ Marc_compileIfort2014:
script: script:
- module load $IntelCompiler16_0 $MSC2014 - module load $IntelCompiler16_0 $MSC2014
- Marc_compileIfort/test.py -m 2014 - Marc_compileIfort/test.py -m 2014
except:
- master
- release
################################################################################################### ###################################################################################################
Marc_compileIfort2014.2: Marc_compileIfort2014.2:
@ -229,6 +329,9 @@ Marc_compileIfort2014.2:
script: script:
- module load $IntelCompiler16_0 $MSC2014_2 - module load $IntelCompiler16_0 $MSC2014_2
- Marc_compileIfort/test.py -m 2014.2 - Marc_compileIfort/test.py -m 2014.2
except:
- master
- release
################################################################################################### ###################################################################################################
Marc_compileIfort2015: Marc_compileIfort2015:
@ -236,6 +339,9 @@ Marc_compileIfort2015:
script: script:
- module load $IntelCompiler16_0 $MSC2015 - module load $IntelCompiler16_0 $MSC2015
- Marc_compileIfort/test.py -m 2015 - Marc_compileIfort/test.py -m 2015
except:
- master
- release
################################################################################################### ###################################################################################################
Marc_compileIfort2016: Marc_compileIfort2016:
@ -243,6 +349,9 @@ Marc_compileIfort2016:
script: script:
- module load $IntelCompiler16_0 $MSC2016 - module load $IntelCompiler16_0 $MSC2016
- Marc_compileIfort/test.py -m 2016 - Marc_compileIfort/test.py -m 2016
except:
- master
- release
################################################################################################### ###################################################################################################
Hex_elastic: Hex_elastic:
@ -250,24 +359,36 @@ Hex_elastic:
script: script:
- module load $IntelCompiler16_0 $MSC - module load $IntelCompiler16_0 $MSC
- Hex_elastic/test.py - Hex_elastic/test.py
except:
- master
- release
CubicFCC_elastic: CubicFCC_elastic:
stage: marc stage: marc
script: script:
- module load $IntelCompiler16_0 $MSC - module load $IntelCompiler16_0 $MSC
- CubicFCC_elastic/test.py - CubicFCC_elastic/test.py
except:
- master
- release
CubicBCC_elastic: CubicBCC_elastic:
stage: marc stage: marc
script: script:
- module load $IntelCompiler16_0 $MSC - module load $IntelCompiler16_0 $MSC
- CubicBCC_elastic/test.py - CubicBCC_elastic/test.py
except:
- master
- release
J2_plasticBehavior: J2_plasticBehavior:
stage: marc stage: marc
script: script:
- module load $IntelCompiler16_0 $MSC - module load $IntelCompiler16_0 $MSC
- J2_plasticBehavior/test.py - J2_plasticBehavior/test.py
except:
- master
- release
################################################################################################### ###################################################################################################
Abaqus_compile2016: Abaqus_compile2016:
@ -275,6 +396,9 @@ Abaqus_compile2016:
script: script:
- module load $IntelCompiler16_0 $Abaqus2016 - module load $IntelCompiler16_0 $Abaqus2016
- Abaqus_compileIfort/test.py -a 2016 - Abaqus_compileIfort/test.py -a 2016
except:
- master
- release
################################################################################################### ###################################################################################################
Abaqus_compile2017: Abaqus_compile2017:
@ -282,37 +406,43 @@ Abaqus_compile2017:
script: script:
- module load $IntelCompiler16_0 $Abaqus2017 - module load $IntelCompiler16_0 $Abaqus2017
- Abaqus_compileIfort/test.py -a 2017 - Abaqus_compileIfort/test.py -a 2017
except:
- master
- release
################################################################################################### ###################################################################################################
SpectralExample: SpectralExample:
stage: example stage: example
script: SpectralAll_example/test.py
only: only:
- development - development
script: SpectralAll_example/test.py
AbaqusExample: AbaqusExample:
stage: example stage: example
only:
- development
script: script:
- module load $IntelCompiler16_0 $Abaqus - module load $IntelCompiler16_0 $Abaqus
- Abaqus_example/test.py - Abaqus_example/test.py
###################################################################################################
mergeIntoMaster:
stage: updateMaster
only: only:
- development - development
##################################################################################################
mergeIntoMaster:
stage: updateMaster
script: script:
- eval 'cd $DAMASKROOT' - cd $DAMASKROOT
- export DEVREV=$(git describe) - export TESTEDREV=$(git describe) # might be detached from development branch
- git commit VERSION -m "[skip ci] updated version information after successful test of $DEVREV" - 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 checkout master
- git merge development - git merge $UPDATEDREV -s recursive -X ours # conflicts occur only for inconsistent state
- git status - git push origin master # master is now tested version and has updated VERSION file
- git push origin master
- git checkout development - git checkout development
- git push origin development - git pull
- git merge master -s recursive -X ours -m "[skip ci] Merge branch 'master' into development" # 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: AbaqusExp:
@ -320,21 +450,44 @@ AbaqusExp:
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen
- $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT abaqus_exp - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT abaqus_exp
except:
- master
- release
AbaqusStd: AbaqusStd:
stage: createDocumentation stage: createDocumentation
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen
- $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT abaqus_std - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT abaqus_std
except:
- master
- release
Marc: Marc:
stage: createDocumentation stage: createDocumentation
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen
- $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT marc - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT marc
except:
- master
- release
Spectral: Spectral:
stage: createDocumentation stage: createDocumentation
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen
- $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT spectral - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT spectral
except:
- master
- release
###################################################################################################
removeLock:
stage: clean
before_script:
- echo 'Do nothing'
when: always
script: sed -i "/$CI_PIPELINE_ID/d" $HOME/GitLabCI.queue
except:
- master
- release

481
CMakeLists.txt Normal file
View File

@ -0,0 +1,481 @@
########################################################################################
# Compiler options for building DAMASK
cmake_minimum_required (VERSION 2.8.8 FATAL_ERROR)
#---------------------------------------------------------------------------------------
# Find PETSc from system environment
set(PETSC_DIR $ENV{PETSC_DIR})
if ("${PETSC_DIR}" STREQUAL "")
message (FATAL_ERROR "PETSC_DIR is not defined")
endif ()
set (petsc_conf_variables "${PETSC_DIR}/lib/petsc/conf/variables")
set (petsc_conf_rules "${PETSC_DIR}/lib/petsc/conf/rules" )
# Use existing variables from PETSc
# https://github.com/jedbrown/cmake-modules/blob/master/FindPETSc.cmake
# Generate a temporary makefile to probe the PETSc configuration
# This file will be deleted
# once the settings from PETSc are parsed into CMake
exec_program (mktemp ARGS -d OUTPUT_VARIABLE TEMPDIR)
set (petsc_config_makefile "${TEMPDIR}/Makefile.petsc")
file (WRITE
"${petsc_config_makefile}"
"## This file was auto generated by CMake
# PETSC_DIR = ${PETSC_DIR}
SHELL = /bin/sh
include ${petsc_conf_rules}
include ${petsc_conf_variables}
INCLUDE_DIRS := \${PETSC_FC_INCLUDES}
LIBRARIES := \${PETSC_WITH_EXTERNAL_LIB}
COMPILERF := \${FC}
COMPILERC := \${CC}
LINKERNAME := \${FLINKER}
includes:
\t@echo \${INCLUDE_DIRS}
extlibs:
\t@echo \${LIBRARIES}
compilerf:
\t@echo \${COMPILERF}
compilerc:
\t@echo \${COMPILERC}
linker:
\t@echo \${LINKERNAME}
")
# CMake will execute each target in the ${petsc_config_makefile}
# to acquire corresponding PETSc Variables.
find_program (MAKE_EXECUTABLE NAMES make gmake)
# Find the PETSc includes directory settings
execute_process (COMMAND ${MAKE_EXECUTABLE} --no-print-directory -f ${petsc_config_makefile} "includes"
RESULT_VARIABLE PETSC_INCLUDES_RETURN
OUTPUT_VARIABLE petsc_includes
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Find the PETSc external linking directory settings
# required for final linking, must be appended after the executable
execute_process (COMMAND ${MAKE_EXECUTABLE} --no-print-directory -f ${petsc_config_makefile} "extlibs"
RESULT_VARIABLE PETSC_EXTERNAL_LIB_RETURN
OUTPUT_VARIABLE petsc_external_lib
OUTPUT_STRIP_TRAILING_WHITESPACE)
# PETSc specified fortran compiler
execute_process (COMMAND ${MAKE_EXECUTABLE} --no-print-directory -f ${petsc_config_makefile} "compilerf"
RESULT_VARIABLE PETSC_MPIFC_RETURN
OUTPUT_VARIABLE PETSC_MPIFC
OUTPUT_STRIP_TRAILING_WHITESPACE)
# PETSc specified C compiler
execute_process (COMMAND ${MAKE_EXECUTABLE} --no-print-directory -f ${petsc_config_makefile} "compilerc"
RESULT_VARIABLE PETSC_MPICC_RETURN
OUTPUT_VARIABLE PETSC_MPICC
OUTPUT_STRIP_TRAILING_WHITESPACE)
# PETSc specified linker (MPIF90 + PETSc linking flags)
execute_process (COMMAND ${MAKE_EXECUTABLE} --no-print-directory -f ${petsc_config_makefile} "linker"
RESULT_VARIABLE PETSC_LINKER_RETURN
OUTPUT_VARIABLE PETSC_LINKER
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Remove temporary makefile, no need to keep it anymore.
file (REMOVE_RECURSE ${TEMPDIR})
# Remove duplicate compiler and linker flags
string (REGEX MATCHALL "-I([^\" ]+)" TMP_LIST "${petsc_includes}")
list (REMOVE_DUPLICATES TMP_LIST)
foreach (dir ${TMP_LIST})
set (PETSC_INCLUDES "${PETSC_INCLUDES} ${dir}")
endforeach (dir)
string (REGEX MATCHALL "-[lLW]([^\" ]+)" TMP_LIST "${petsc_external_lib}")
list (REMOVE_DUPLICATES TMP_LIST)
foreach (exlib ${TMP_LIST})
set (PETSC_EXTERNAL_LIB "${PETSC_EXTERNAL_LIB} ${exlib}")
endforeach (exlib)
message ("Found PETSC_DIR:\n${PETSC_DIR}\n" )
message ("Found PETSC_INCLUDES:\n${PETSC_INCLUDES}\n" )
message ("Found PETSC_EXTERNAL_LIB:\n${PETSC_EXTERNAL_LIB}\n")
message ("Found PETSC_LINKER:\n${PETSC_LINKER}\n" )
message ("Found MPI Fortran Compiler:\n${PETSC_MPIFC}\n" )
message ("Found MPI C Compiler:\n${PETSC_MPICC}\n" )
#---------------------------------------------------------------------------------------
# Now start to care about DAMASK
# DAMASK solver defines project to build
if ("${DAMASK_SOLVER}" STREQUAL "SPECTRAL")
project (DAMASK_spectral Fortran C)
add_definitions (-DSpectral)
message ("Building Spectral Solver\n")
elseif ("${DAMASK_SOLVER}" STREQUAL "FEM")
project (DAMASK_FEM Fortran C)
add_definitions (-DFEM)
message ("Building FEM Solver\n")
endif ()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set (CMAKE_BUILD_TYPE "RELEASE")
endif ()
# set compiler and linker commands (need to be done after defining the project)
# https://cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F
set (CMAKE_Fortran_COMPILER "${PETSC_MPIFC}")
set (CMAKE_C_COMPILER "${PETSC_MPICC}")
set (CMAKE_LINKER "${PETSC_LINKER}")
# Predefined sets for OPTIMIZATION/OPENMP based on BUILD_TYPE
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" OR "${CMAKE_BUILD_TYPE}" STREQUAL "SYNTAXONLY" )
set (PARALLEL "OFF")
set (OPTI "OFF")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
set (PARALLEL "ON")
set (OPTI "DEFENSIVE")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "PERFORMANCE")
set (PARALLEL "ON")
set (OPTI "AGGRESSIVE")
endif ()
# $OPTIMIZATION takes precedence over $BUILD_TYPE defaults
if ("${OPTIMIZATION}" STREQUAL "")
set (OPTIMIZATION "${OPTI}")
else ()
set (OPTIMIZATION "${OPTIMIZATION}")
endif ()
# $OPENMP takes precedence over $BUILD_TYPE defaults
if ("${OPENMP}" STREQUAL "")
set (OPENMP "${PARALLEL}")
else ()
set(OPENMP "${OPENMP}")
endif ()
# syntax check only (mainly for pre-receive hook, works only with gfortran)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "SYNTAXONLY" )
set (BUILDCMD_POST "${BUILDCMD_POST} -fsyntax-only")
endif ()
# Parse DAMASK_BIN from CONFIG file
file (READ "CONFIG" CONFIGFILE)
string (REGEX REPLACE ";" "\\\\;" CONFIGFILE "${CONFIGFILE}")
string (REGEX REPLACE "\n" ";" CONFIGFILE "${CONFIGFILE}")
foreach (item ${CONFIGFILE})
string (REGEX MATCH ".+DAMASK_BIN.+" item ${item})
if (item)
string (REGEX REPLACE "set" "" item "${item}")
string (REGEX REPLACE "=" " " item "${item}")
string (REGEX REPLACE "\\\${DAMASK_ROOT}" "${PROJECT_SOURCE_DIR}" item "${item}")
string (REPLACE "DAMASK_BIN" ";" STRING_LIST ${item})
list (GET STRING_LIST 1 item)
string (STRIP "${item}" CMAKE_INSTALL_PREFIX)
endif ()
endforeach(item ${CONFIGFILE})
# Parse DAMASK version from VERSION file
find_program (CAT_EXECUTABLE NAMES cat)
execute_process (COMMAND ${CAT_EXECUTABLE} ${PROJECT_SOURCE_DIR}/VERSION
RESULT_VARIABLE DAMASK_VERSION_RETURN
OUTPUT_VARIABLE DAMASK_V
OUTPUT_STRIP_TRAILING_WHITESPACE)
add_definitions (-DDAMASKVERSION="${DAMASK_V}")
# definition of other macros
add_definitions (-DPETSc)
add_definitions (-DFLOAT=8)
add_definitions (-DINT=4)
set (DAMASK_INCLUDE_FLAGS "${DAMASK_INCLUDE_FLAGS} ${PETSC_INCLUDES}")
###################################################################################################
# Intel Compiler
###################################################################################################
if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
if (OPENMP)
set (OPENMP_FLAGS "-qopenmp -parallel")
endif ()
if ("${OPTIMIZATION}" STREQUAL "OFF")
set (OPTIMIZATION_FLAGS "-O0 -no-ip")
elseif ("${OPTIMIZATION}" STREQUAL "DEFENSIVE")
set (OPTIMIZATION_FLAGS "-O2")
elseif ("${OPTIMIZATION}" STREQUAL "AGGRESSIVE")
set (OPTIMIZATION_FLAGS "-ipo -O3 -no-prec-div -fp-model fast=2 -xHost")
# -fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost"
endif ()
set (STANDARD_CHECK "-stand f08 -standard-semantics")
set (LINKER_FLAGS "${LINKER_FLAGS} -shared-intel")
# Link against shared Intel libraries instead of static ones
#------------------------------------------------------------------------------------------------
# Fine tuning compilation options
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fpp")
# preprocessor
set (COMPILE_FLAGS "${COMPILE_FLAGS} -ftz")
# flush underflow to zero, automatically set if -O[1,2,3]
set (COMPILE_FLAGS "${COMPILE_FLAGS} -assume")
# assume ...
set (COMPILE_FLAGS "${COMPILE_FLAGS} byterecl")
# ... record length is given in bytes (also set by -standard-semantics)
set (COMPILE_FLAGS "${COMPILE_FLAGS},fpe_summary")
# ... print list of floating point exceptions occured during execution
set (COMPILE_FLAGS "${COMPILE_FLAGS} -diag-disable")
# disables warnings ...
set (COMPILE_FLAGS "${COMPILE_FLAGS} 5268")
# ... the text exceeds right hand column allowed on the line (we have only comments there)
set (COMPILE_FLAGS "${COMPILE_FLAGS} -warn")
# enables warnings ...
set (COMPILE_FLAGS "${COMPILE_FLAGS} declarations")
# ... any undeclared names (alternative name: -implicitnone)
set (COMPILE_FLAGS "${COMPILE_FLAGS},general")
# ... warning messages and informational messages are issued by the compiler
set (COMPILE_FLAGS "${COMPILE_FLAGS},usage")
# ... questionable programming practices
set (COMPILE_FLAGS "${COMPILE_FLAGS},interfaces")
# ... checks the interfaces of all SUBROUTINEs called and FUNCTIONs invoked in your compilation against an external set of interface blocks
set (COMPILE_FLAGS "${COMPILE_FLAGS},ignore_loc")
# ... %LOC is stripped from an actual argument
set (COMPILE_FLAGS "${COMPILE_FLAGS},alignments")
# ... data that is not naturally aligned
set (COMPILE_FLAGS "${COMPILE_FLAGS},unused")
# ... declared variables that are never used
# Additional options
# -warn: enables warnings, where
# truncated_source: Determines whether warnings occur when source exceeds the maximum column width in fixed-format files.
# (too many warnings because we have comments beyond character 132)
# uncalled: Determines whether warnings occur when a statement function is never called
# all:
# -name as_is: case sensitive Fortran!
#------------------------------------------------------------------------------------------------
# Runtime debugging
set (DEBUG_FLAGS "${DEBUG_FLAGS} -g")
# Generate symbolic debugging information in the object file
set (DEBUG_FLAGS "${DEBUG_FLAGS} -traceback")
# Generate extra information in the object file to provide source file traceback information when a severe error occurs at run time
set (DEBUG_FLAGS "${DEBUG_FLAGS} -gen-interfaces")
# Generate an interface block for each routine. http://software.intel.com/en-us/blogs/2012/01/05/doctor-fortran-gets-explicit-again/
set (DEBUG_FLAGS "${DEBUG_FLAGS} -fp-stack-check")
# Generate extra code after every function call to ensure that the floating-point (FP) stack is in the expected state
set (DEBUG_FLAGS "${DEBUG_FLAGS} -fp-model strict")
# Trap uninitalized variables
set (DEBUG_FLAGS "${DEBUG_FLAGS} -check" )
# Checks at runtime ...
set (DEBUG_FLAGS "${DEBUG_FLAGS} bounds")
# ... if an array index is too small (<1) or too large!
set (DEBUG_FLAGS "${DEBUG_FLAGS},format")
# ... for the data type of an item being formatted for output.
set (DEBUG_FLAGS "${DEBUG_FLAGS},output_conversion")
# ... for the fit of data items within a designated format descriptor field.
set (DEBUG_FLAGS "${DEBUG_FLAGS},pointers")
# ... for certain disassociated or uninitialized pointers or unallocated allocatable objects.
set (DEBUG_FLAGS "${DEBUG_FLAGS},uninit")
# ... for uninitialized variables.
set (DEBUG_FLAGS "${DEBUG_FLAGS} -ftrapuv")
# ... initializes stack local variables to an unusual value to aid error detection
set (DEBUG_FLAGS "${DEBUG_FLAGS} -fpe-all0")
# ... capture all floating-point exceptions, sets -ftz automatically
set (DEBUG_FLAGS "${DEBUG_FLAGS} -warn")
# enables warnings ...
set (DEBUG_FLAGS "${DEBUG_FLAGS} errors")
# ... warnings are changed to errors
set (DEBUG_FLAGS "${DEBUG_FLAGS},stderrors")
# ... warnings about Fortran standard violations are changed to errors
set (DEBUG_FLAGS "${DEBUG_FLAGS} -debug-parameters all")
# generate debug information for parameters
# Additional options
# -heap-arrays: Should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits
# -check: Checks at runtime, where
# arg_temp_created: will cause a lot of warnings because we create a bunch of temporary arrays (performance?)
# stack:
#------------------------------------------------------------------------------------------------
# precision settings
set (PRECISION_FLAGS "${PRECISION_FLAGS} -real-size 64")
# set precision for standard real to 32 | 64 | 128 (= 4 | 8 | 16 bytes, type pReal is always 8 bytes)
set (PRECISION_FLAGS "${PRECISION_FLAGS} -integer-size 32")
# set precision for standard int to 16 | 32 | 64 (= 2 | 4 | 8 bytes, type pInt is always 4 bytes)
###################################################################################################
# GNU Compiler
###################################################################################################
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
if (OPENMP)
set (OPENMP_FLAGS "-fopenmp")
endif ()
if ("${OPTIMIZATION}" STREQUAL "OFF")
set (OPTIMIZATION_FLAGS "-O0" )
elseif ("${OPTIMIZATION}" STREQUAL "DEFENSIVE")
set (OPTIMIZATION_FLAGS "-O2")
elseif ("${OPTIMIZATION}" STREQUAL "AGGRESSIVE")
set (OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -ftree-vectorize")
endif ()
set (STANDARD_CHECK "-std=f2008ts -pedantic-errors" )
set (LINKER_FLAGS "${LINKER_FLAGS} -Wl")
# options parsed directly to the linker
set (LINKER_FLAGS "${LINKER_FLAGS},-undefined,dynamic_lookup" )
# ensure to link against dynamic libraries
#------------------------------------------------------------------------------------------------
# Fine tuning compilation options
set (COMPILE_FLAGS "${COMPILE_FLAGS} -xf95-cpp-input")
# preprocessor
set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffree-line-length-132")
# restrict line length to the standard 132 characters (lattice.f90 require more characters)
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fimplicit-none")
# assume "implicit none" even if not present in source
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fmodule-private")
# assume "private" even if not present in source
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wall")
# sets the following Fortran options:
# -Waliasing: warn about possible aliasing of dummy arguments. Specifically, it warns if the same actual argument is associated with a dummy argument with "INTENT(IN)" and a dummy argument with "INTENT(OUT)" in a call with an explicit interface.
# -Wampersand: checks if a character expression is continued proberly by an ampersand at the end of the line and at the beginning of the new line
# -Warray-bounds: checks if array reference is out of bounds at compile time. use -fcheck-bounds to also check during runtime
# -Wconversion: warn about implicit conversions between different type
# -Wsurprising: warn when "suspicious" code constructs are encountered. While technically legal these usually indicate that an error has been made.
# -Wc-binding-type:
# -Wintrinsics-std: only standard intrisics are available, e.g. "call flush(6)" will cause an error
# -Wno-tabs: do not allow tabs in source
# -Wintrinsic-shadow: warn if a user-defined procedure or module procedure has the same name as an intrinsic
# -Wline-truncation:
# -Wtarget-lifetime:
# -Wreal-q-constant: warn about real-literal-constants with 'q' exponent-letter
# -Wunused: a number of unused-xxx warnings
# and sets the general (non-Fortran options) options:
# -Waddress
# -Warray-bounds (only with -O2)
# -Wc++11-compat
# -Wchar-subscripts
# -Wcomment
# -Wformat
# -Wmaybe-uninitialized
# -Wnonnull
# -Wparentheses
# -Wpointer-sign
# -Wreorder
# -Wreturn-type
# -Wsequence-point
# -Wstrict-aliasing
# -Wstrict-overflow=1
# -Wswitch
# -Wtrigraphs
# -Wuninitialized
# -Wunknown-pragmas
# -Wunused-function
# -Wunused-label
# -Wunused-value
# -Wunused-variable
# -Wvolatile-register-var
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wextra")
# sets the following Fortran options:
# -Wunuses-parameter:
# -Wcompare-reals:
# and sets the general (non-Fortran options) options:
# -Wclobbered
# -Wempty-body
# -Wignored-qualifiers
# -Wmissing-field-initializers
# -Woverride-init
# -Wsign-compare
# -Wtype-limits
# -Wuninitialized
# -Wunused-but-set-parameter (only with -Wunused or -Wall)
# -Wno-globals
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wcharacter-truncation")
# warn if character expressions (strings) are truncated
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wunderflow")
# produce a warning when numerical constant expressions are encountered, which yield an UNDERFLOW during compilation
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wsuggest-attribute=pure")
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wsuggest-attribute=noreturn")
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wconversion-extra")
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wimplicit-procedure")
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-unused-parameter")
set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffpe-summary=all")
# print summary of floating point exeptions (invalid,zero,overflow,underflow,inexact,denormal)
# Additional options
# -Warray-temporarieswarnings: because we have many temporary arrays (performance issue?):
# -Wimplicit-interface: no interfaces for lapack/MPI routines
# -Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions.
#------------------------------------------------------------------------------------------------
# Runtime debugging
set (DEBUG_FLAGS "${DEBUG_FLAGS} -ffpe-trap=invalid,zero,overflow")
# stop execution if floating point exception is detected (NaN is silent)
set (DEBUG_FLAGS "${DEBUG_FLAGS} -g")
# Generate symbolic debugging information in the object file
set (DEBUG_FLAGS "${DEBUG_FLAGS} -fbacktrace")
set (DEBUG_FLAGS "${DEBUG_FLAGS} -fdump-core")
set (DEBUG_FLAGS "${DEBUG_FLAGS} -fcheck=all")
# checks for (array-temps,bounds,do,mem,pointer,recursion)
# Additional options
# -ffpe-trap=precision,denormal,underflow
#------------------------------------------------------------------------------------------------
# precision settings
set (PRECISION_FLAGS "${PRECISION_FLAGS} -fdefault-real-8")
# set precision to 8 bytes for standard real (=8 for pReal). Will set size of double to 16 bytes as long as -fdefault-double-8 is not set
set (PRECISION_FLAGS "${PRECISION_FLAGS} -fdefault-double-8")
# set precision to 8 bytes for double real, would be 16 bytes if -fdefault-real-8 is used
# Additional options
# -fdefault-integer-8: Use it to set precision to 8 bytes for integer, don't use it for the standard case of pInt=4 (there is no -fdefault-integer-4)
endif ()
set (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE} "${BUILDCMD_PRE} ${OPENMP_FLAGS} ${STANDARD_CHECK} ${OPTIMIZATION_FLAGS} ${COMPILE_FLAGS} ${PRECISION_FLAGS}")
set (CMAKE_Fortran_LINK_EXECUTABLE "${BUILDCMD_PRE} ${CMAKE_LINKER} ${OPENMP_FLAGS} ${OPTIMIZATION_FLAGS} ${LINKER_FLAGS}")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
set (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE}} ${DEBUG_FLAGS}")
set (CMAKE_Fortran_LINK_EXECUTABLE "${CMAKE_Fortran_LINK_EXECUTABLE} ${DEBUG_FLAGS}")
endif ()
set (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE}} ${DAMASK_INCLUDE_FLAGS} ${BUILDCMD_POST}")
set (CMAKE_Fortran_LINK_EXECUTABLE "${CMAKE_Fortran_LINK_EXECUTABLE} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB} ${BUILDCMD_POST}")
message ("Fortran Compiler Flags:\n${CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE}}\n")
message ("C Compiler Flags:\n${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}\n")
message ("Fortran Linker Command:\n${CMAKE_Fortran_LINK_EXECUTABLE}\n")
# location of code
add_subdirectory (src)
# INSTALL BUILT BINARIES
if ("${CMAKE_BUILD_TYPE}" STREQUAL "SYNTAXONLY")
exec_program (mktemp ARGS -d OUTPUT_VARIABLE BLACK_HOLE)
install (PROGRAMS ${PROJECT_BINARY_DIR}/src/prec.mod
DESTINATION ${BLACK_HOLE})
else ()
if ("${PROJECT_NAME}" STREQUAL "DAMASK_spectral")
install (PROGRAMS ${PROJECT_BINARY_DIR}/src/DAMASK_spectral
DESTINATION ${CMAKE_INSTALL_PREFIX})
elseif ("${PROJECT_NAME}" STREQUAL "DAMASK_FEM")
install (PROGRAMS ${PROJECT_BINARY_DIR}/src/DAMASK_FEM
DESTINATION ${CMAKE_INSTALL_PREFIX})
endif ()
endif ()

View File

@ -25,11 +25,11 @@ if [[ "x$DAMASK_BIN" != "x" && ! $(echo ":$PATH:" | grep $DAMASK_BIN:) ]]; then
export PATH=$DAMASK_BIN:$PATH export PATH=$DAMASK_BIN:$PATH
fi fi
SOLVER=$(which DAMASK_spectral 2>/dev/null) SOLVER=$(which DAMASK_spectral || true 2>/dev/null)
if [ "x$SOLVER" == "x" ]; then if [ "x$SOLVER" == "x" ]; then
SOLVER='Not found!' SOLVER='Not found!'
fi fi
PROCESSING=$(which postResults 2>/dev/null) PROCESSING=$(which postResults || true 2>/dev/null)
if [ "x$PROCESSING" == "x" ]; then if [ "x$PROCESSING" == "x" ]; then
PROCESSING='Not found!' PROCESSING='Not found!'
fi fi
@ -39,12 +39,15 @@ fi
# according to http://software.intel.com/en-us/forums/topic/501500 # according to http://software.intel.com/en-us/forums/topic/501500
# this seems to make sense for the stack size # this seems to make sense for the stack size
FREE=$(which free 2>/dev/null) FREE=$(type -p free 2>/dev/null)
if [ "x$FREE" != "x" ]; then if [ "x$FREE" != "x" ]; then
freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}') freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}')
# http://superuser.com/questions/220059/what-parameters-has-ulimit # http://superuser.com/questions/220059/what-parameters-has-ulimit
ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB) ulimit -d unlimited 2>/dev/null \
ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB) || ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB)
ulimit -s unlimited 2>/dev/null \
|| echo "cannot unlimit stack..." \
&& ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB)
fi fi
ulimit -v unlimited 2>/dev/null # maximum virtual memory size ulimit -v unlimited 2>/dev/null # maximum virtual memory size
ulimit -m unlimited 2>/dev/null # maximum physical memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size

View File

@ -19,8 +19,8 @@ if [[ ( "x$DAMASK_BIN" != "x" ) && ( "x$MATCH" = "x" ) ]]; then
export PATH=$DAMASK_BIN:$PATH export PATH=$DAMASK_BIN:$PATH
fi fi
SOLVER=`which DAMASK_spectral 2>/dev/null` SOLVER=`which DAMASK_spectral || True 2>/dev/null`
PROCESSING=`which postResults 2>/dev/null` PROCESSING=`which postResults || True 2>/dev/null`
if [ "x$DAMASK_NUM_THREADS" = "x" ]; then if [ "x$DAMASK_NUM_THREADS" = "x" ]; then
DAMASK_NUM_THREADS=1 DAMASK_NUM_THREADS=1
fi fi

32
Makefile Executable file → Normal file
View File

@ -3,30 +3,36 @@ SHELL = /bin/sh
# Makefile for the installation of DAMASK # Makefile for the installation of DAMASK
######################################################################################## ########################################################################################
.PHONY: all .PHONY: all
all: spectral marc processing all: spectral FEM marc processing
.PHONY: spectral .PHONY: spectral
spectral: spectral: build/spectral
$(MAKE) DAMASK_spectral.exe -C code @(cd build/spectral;make --no-print-directory -ws all install VERBOSE=1;)
.PHONY: FEM .PHONY: FEM
FEM: FEM: build/FEM
$(MAKE) DAMASK_FEM.exe -C code @(cd build/FEM; make --no-print-directory -ws all install;)
.PHONY: build/spectral
build/spectral:
@mkdir -p build/spectral
@(cd build/spectral; cmake -Wno-dev -DDAMASK_SOLVER=SPECTRAL -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=${BUILDCMD_POST} -DBUILDCMD_PRE=${BUILDCMD_PRE} -DOPTIMIZATION=${OPTIMIZATION} -DOPENMP=${OPENMP} ../../;)
.PHONY: build/FEM
build/FEM:
@mkdir -p build/FEM
@(cd build/FEM; cmake -Wno-dev -DDAMASK_SOLVER=FEM -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=${BUILDCMD_POST} -DBUILDCMD_PRE=${BUILDCMD_PRE} -DOPTIMIZATION=${OPTIMIZATION} -DOPENMP=${OPENMP} ../../;)
.PHONY: marc .PHONY: marc
marc: marc:
@./installation/symLink_Code.sh
@./installation/mods_MarcMentat/apply_DAMASK_modifications.sh ${MAKEFLAGS} @./installation/mods_MarcMentat/apply_DAMASK_modifications.sh ${MAKEFLAGS}
.PHONY: tidy
tidy:
@$(MAKE) tidy -C code >/dev/null
.PHONY: clean .PHONY: clean
clean: clean:
@$(MAKE) cleanDAMASK -C code >/dev/null @rm -rf build
.PHONY: install .PHONY: processing
install: processing:
@./installation/symlink_Code.py ${MAKEFLAGS}
@./installation/symlink_Processing.py ${MAKEFLAGS} @./installation/symlink_Processing.py ${MAKEFLAGS}

2
README
View File

@ -8,4 +8,4 @@ Max-Planck-Str. 1
Germany Germany
Email: DAMASK@mpie.de Email: DAMASK@mpie.de
http://damask.mpie.de https://damask.mpie.de

View File

@ -1 +1 @@
v2.0.1-414-g81d0752 v2.0.1-642-g3e52e8b

8
code/.gitattributes vendored
View File

@ -1,8 +0,0 @@
# from https://help.github.com/articles/dealing-with-line-endings/
#
# always use LF, even if the files are edited on windows, they need to be compiled/used on unix
* text eol=lf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary

View File

@ -1,740 +0,0 @@
SHELL = /bin/sh
########################################################################################
# Makefile to compile the Material subroutine for BVP solution using spectral method
########################################################################################
# Be sure to remove all files compiled with different options by using "make clean"
########################################################################################
# OPTIONS = standard (alternative): meaning
#-------------------------------------------------------------
# F90 = ifort (gfortran): compiler type, choose Intel or GNU
# FCOMPILERNAME = name of the compiler executable (if not the same as the type), e.g. using mpich-g90 instead of ifort
# PORTABLE = TRUE (FALSE): decision, if executable is optimized for the machine on which it was built.
# OPTIMIZATION = DEFENSIVE (OFF,AGGRESSIVE,ULTRA): Optimization mode: O2, O0, O3 + further options for most files, O3 + further options for all files
# OPENMP = TRUE (FALSE): OpenMP multiprocessor support
# PREFIX = arbitrary prefix (before FCOMPILERNAME)
# OPTION = arbitrary option (just before file to compile)
# SUFFIX = arbitrary suffix (after file to compile)
# STANDARD_CHECK = checking for Fortran 2008, compiler dependend
########################################################################################
# including PETSc files. PETSC_ARCH is loaded from these files.
DAMASKVERSION :=$(shell cat ../VERSION)
include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules
INCLUDE_DIRS := $(PETSC_FC_INCLUDES) -DPETSc
LIBRARIES := $(PETSC_WITH_EXTERNAL_LIB)
FCOMPILERNAME ?= $(FC)
CCOMPILERNAME ?= $(CC)
LINKERNAME ?= $(FLINKER)
# MPI compiler wrappers will tell if they are pointing to ifort or gfortran
COMPILEROUT :=$(shell $(FC) -show)
# search in FC or COMPILEROUT for gfortran/ifort if not defined
ifeq ($(strip $(F90)),)
F90 :=$(findstring gfortran,$(FC) $(COMPILEROUT))
endif
ifeq ($(strip $(F90)),)
F90 :=$(findstring ifort,$(FC) $(COMPILEROUT))
endif
OPENMP ?= ON
OPTIMIZATION ?= DEFENSIVE
ifeq "$(OPTIMIZATION)" "OFF"
OPTI := OFF
MAXOPTI := OFF
endif
ifeq "$(OPTIMIZATION)" "DEFENSIVE"
OPTI := DEFENSIVE
MAXOPTI := DEFENSIVE
endif
ifeq "$(OPTIMIZATION)" "AGGRESSIVE"
OPTI := AGGRESSIVE
MAXOPTI := AGGRESSIVE
endif
ifeq "$(OPTIMIZATION)" "ULTRA"
OPTI := AGGRESSIVE
MAXOPTI := AGGRESSIVE
endif
ifndef OPTI
OPTI := DEFENSIVE
MAXOPTI := DEFENSIVE
endif
# settings for shared memory multicore support
ifeq "$(OPENMP)" "ON"
OPENMP_FLAG_ifort =-qopenmp -parallel
OPENMP_FLAG_gfortran =-fopenmp
endif
ifdef STANDARD_CHECK
STANDARD_CHECK_ifort =$(STANDARD_CHECK)
STANDARD_CHECK_gfortran =$(STANDARD_CHECK)
endif
STANDARD_CHECK_ifort ?=-stand f08 -standard-semantics
STANDARD_CHECK_gfortran ?=-std=f2008ts -pedantic-errors
#-pedantic: more strict on standard, enables some warnings
# -pedantic-errors: like pedantic, but errors instead of warnings
OPTIMIZATION_OFF_ifort :=-O0 -no-ip
OPTIMIZATION_OFF_gfortran :=-O0
OPTIMIZATION_DEFENSIVE_ifort :=-O2
OPTIMIZATION_DEFENSIVE_gfortran :=-O2
OPTIMIZATION_AGGRESSIVE_ifort :=-ipo -O3 -no-prec-div -fp-model fast=2 -xHost #-fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost
OPTIMIZATION_AGGRESSIVE_gfortran :=-O3 -ffast-math -funroll-loops -ftree-vectorize
LINK_OPTIONS_ifort :=-shared-intel
COMPILE_OPTIONS_ifort :=-DDAMASKVERSION=\"${DAMASKVERSION}\"\
-fpp\
-ftz\
-assume byterecl,fpe_summary\
-diag-disable 5268\
-warn declarations\
-warn general\
-warn usage\
-warn interfaces\
-warn ignore_loc\
-warn alignments\
-warn unused
###################################################################################################
#COMPILE SWITCHES
#-shared-intel: Link against shared Intel libraries instead of static ones
#-fpp: preprocessor
#-ftz: flush unterflow to zero, automatically set if O<0,1,2,3> >0
#-assume byterecl record length is given in bytes (also set by -standard-semantics)
# fpe_summary print list of floating point exceptions occured during execution
#-fimplicit-none: assume "implicit-none" even if not present in source
#-diag-disable: disables warnings, where
# warning ID 5268: the text exceeds right hand column allowed on the line (we have only comments there)
#-warn: enables warnings, where
# declarations: any undeclared names (alternative name: -implicitnone)
# general: warning messages and informational messages are issued by the compiler
# usage: questionable programming practices
# interfaces: checks the interfaces of all SUBROUTINEs called and FUNCTIONs invoked in your compilation against an external set of interface blocks
# ignore_loc: %LOC is stripped from an actual argument
# alignments: data that is not naturally aligned
# unused: declared variables that are never used
# stderrors: warnings about Fortran standard violations are changed to errors (STANDARD_CHECK)
#
###################################################################################################
#MORE OPTIONS FOR DEBUGGING DURING COMPILATION
#-warn: enables warnings, where
# truncated_source: Determines whether warnings occur when source exceeds the maximum column width in fixed-format files. (too many warnings because we have comments beyond character 132)
# uncalled: Determines whether warnings occur when a statement function is never called
# all:
# -name as_is: case sensitive Fortran!
DEBUG_OPTIONS_ifort :=-g\
-traceback\
-gen-interfaces\
-fp-stack-check\
-fp-model strict\
-check bounds,format,output_conversion,pointers,uninit\
-ftrapuv\
-fpe-all0\
-warn errors\
-warn stderrors\
-debug-parameters all
###################################################################################################
#COMPILE SWITCHES FOR RUNTIME DEBUGGING
#-g: Generate symbolic debugging information in the object file
#-traceback: Generate extra information in the object file to provide source file traceback information when a severe error occurs at run time.
#-gen-interfaces: Generate an interface block for each routine. http://software.intel.com/en-us/blogs/2012/01/05/doctor-fortran-gets-explicit-again/
#-fp-stack-check: Generate extra code after every function call to ensure that the floating-point (FP) stack is in the expected state.
#-ftrapuv Trap uninitalized variables
#-check: checks at runtime, where
# bounds: check if an array index is too small (<1) or too large!
# format: Checking for the data type of an item being formatted for output.
# output_conversion: Checking for the fit of data items within a designated format descriptor field.
# pointers: Checking for certain disassociated or uninitialized pointers or unallocated allocatable objects.
# uninit: Checking for uninitialized variables.
#-fpe-all0 capture all floating-point exceptions, sets -ftz automatically
#-warn: enables warnings, where
# errors: warnings are changed to errors
# stderrors: warnings about Fortran standard violations are changed to errors
# information on http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/
###################################################################################################
#MORE OPTIONS FOR RUNTIME DEBUGGING
#-heap-arrays: should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits
#-check: checks at runtime, where
# arg_temp_created: will cause a lot of warnings because we create a bunch of temporary arrays (performance?)
# stack:
LINK_OPTIONS_gfortran :=-Wl,-undefined,dynamic_lookup
COMPILE_OPTIONS_gfortran :=-DDAMASKVERSION=\"${DAMASKVERSION}\"\
-xf95-cpp-input\
-ffree-line-length-132\
-fimplicit-none\
-fmodule-private\
-Wall\
-Wextra\
-Wcharacter-truncation\
-Wunderflow\
-Wsuggest-attribute=pure\
-Wsuggest-attribute=noreturn\
-Wconversion-extra\
-Wimplicit-procedure\
-Wno-unused-parameter
#-ffpe-summary=all only for newer gfortran
###################################################################################################
#COMPILE SWITCHES
#-shared
#-Wl,-undefined,dynamic_lookup:ensure to link against dynamic libraries
#-xf95-cpp-input: preprocessor
#-ffree-line-length-132: restrict line length to the standard 132 characters
#-ffpe-summary: print summary of floating point exeptions (invalid, zero, overflow, underflow, inexact and denormal)
#-fimplicit-none: assume "implicit-none" even if not present in source
#-fmodule-private: assume "private" even if not present in source
#-Wcharacter-truncation: warn if character expressions (strings) are truncated
#-Wunderflow: produce a warning when numerical constant expressions are encountered, which yield an UNDERFLOW during compilation
#-Wsuggest-attribute=pure:
#-Wsuggest-attribute=noreturn:
#-Wconversion-extra
#-Wimplicit-procedure
#-Wall: sets the following Fortran options:
# -Waliasing: warn about possible aliasing of dummy arguments. Specifically, it warns if the same actual argument is associated with a dummy argument with "INTENT(IN)" and a dummy argument with "INTENT(OUT)" in a call with an explicit interface.
# -Wampersand: checks if a character expression is continued proberly by an ampersand at the end of the line and at the beginning of the new line
# -Warray-bounds: checks if array reference is out of bounds at compile time. use -fcheck-bounds to also check during runtime
# -Wconversion: warn about implicit conversions between different type
# -Wsurprising: warn when "suspicious" code constructs are encountered. While technically legal these usually indicate that an error has been made.
# -Wc-binding-type:
# -Wintrinsics-std: only standard intrisics are available, e.g. "call flush(6)" will cause an error
# -Wno-tabs: do not allow tabs in source
# -Wintrinsic-shadow: warn if a user-defined procedure or module procedure has the same name as an intrinsic
# -Wline-truncation:
# -Wtarget-lifetime:
# -Wreal-q-constant: warn about real-literal-constants with 'q' exponent-letter
# -Wunused: a number of unused-xxx warnings
# these are general (non -Fortran options) implied by -Wall
# -Waddress
# -Warray-bounds (only with -O2)
# -Wc++11-compat
# -Wchar-subscripts
# -Wcomment
# -Wformat
# -Wmaybe-uninitialized
# -Wnonnull
# -Wparentheses
# -Wpointer-sign
# -Wreorder
# -Wreturn-type
# -Wsequence-point
# -Wstrict-aliasing
# -Wstrict-overflow=1
# -Wswitch
# -Wtrigraphs
# -Wuninitialized
# -Wunknown-pragmas
# -Wunused-function
# -Wunused-label
# -Wunused-value
# -Wunused-variable
# -Wvolatile-register-var
#-Wextra: sets the following Fortran options:
# -Wunuses-parameter:
# -Wcompare-reals:
# these are general (non -Fortran options) implied by -Wextra
# -Wclobbered
# -Wempty-body
# -Wignored-qualifiers
# -Wmissing-field-initializers
# -Woverride-init
# -Wsign-compare
# -Wtype-limits
# -Wuninitialized
# -Wunused-but-set-parameter (only with -Wunused or -Wall)
# -Wno-globals
###################################################################################################
#MORE OPTIONS FOR DEBUGGING DURING COMPILATION
#-Warray-temporarieswarnings: because we have many temporary arrays (performance issue?):
#-Wimplicit-interface: no interfaces for lapack routines
#-Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions.
#-Wstrict-overflow:
DEBUG_OPTIONS_gfortran :=-g \
-fbacktrace \
-fdump-core \
-fcheck=all \
-ffpe-trap=invalid,zero,overflow
###################################################################################################
#COMPILE SWITCHES FOR RUNTIME DEBUGGING
#-ffpe-trap=invalid,\ stop execution if floating point exception is detected (NaN is silent)
# zero,\
# overflow
#-fcheck=all: sets the following Fortran options:
#array-temps
#bounds
#do
#mem
#pointer
#recursion
###################################################################################################
#MORE OPTIONS FOR RUNTIME DEBUGGING
#-ffpe-trap=precision,\
# denormal, \
# underflow
ifeq "$(DEBUG)" "ON"
COMPILE_OPTIONS_$(F90) +=$(DEBUG_OPTIONS_$(F90))
LINK_OPTIONS_$(F90) +=$(DEBUG_OPTIONS_$(F90))
endif
LINK_OPTIONS_$(F90) += $(OPTIMIZATION_$(MAXOPTI)_$(F90))
PRECISION_ifort :=-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4
#-real-size 32: set precision to one of those 32/64/128 (= 4/8/16 bytes) for standard real (=8 for pReal)
#-integer-size 16: set precision to one of those 16/32/64 (= 2/4/8 bytes) for standard integer (=4 for pInt)
PRECISION_gfortran :=-fdefault-real-8 -fdefault-double-8 -DFLOAT=8 -DINT=4
#-fdefault-real-8: set precision to 8 bytes for standard real (=8 for pReal). Will set size of double to 16 bytes as long as -fdefault-double-8 is not set
#-fdefault-double-8: set precision to 8 bytes for double real, would be 16 bytes because -fdefault-real-8 is used
#-fdefault-integer-8: Use it to set precision to 8 bytes for integer, don't use it for the standard case of pInt=4 (there is no -fdefault-integer-4)
###################################################################################################
COMPILE =$(OPENMP_FLAG_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(OPTI)_$(F90)) $(COMPILE_OPTIONS_$(F90)) $(INCLUDE_DIRS) $(PRECISION_$(F90))
COMPILE_MAXOPTI =$(OPENMP_FLAG_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(MAXOPTI)_$(F90)) $(COMPILE_OPTIONS_$(F90)) $(INCLUDE_DIRS) $(PRECISION_$(F90))
###################################################################################################
SOURCE_FILES = \
source_thermal_dissipation.o \
source_thermal_externalheat.o \
source_damage_isoBrittle.o \
source_damage_isoDuctile.o \
source_damage_anisoBrittle.o \
source_damage_anisoDuctile.o \
source_vacancy_phenoplasticity.o \
source_vacancy_irradiation.o \
source_vacancy_thermalfluc.o
KINEMATICS_FILES = \
kinematics_cleavage_opening.o \
kinematics_slipplane_opening.o \
kinematics_thermal_expansion.o \
kinematics_vacancy_strain.o \
kinematics_hydrogen_strain.o
PLASTIC_FILES = \
plastic_dislotwin.o \
plastic_disloUCLA.o \
plastic_isotropic.o \
plastic_phenopowerlaw.o \
plastic_titanmod.o \
plastic_nonlocal.o \
plastic_none.o \
plastic_phenoplus.o
THERMAL_FILES = \
thermal_isothermal.o \
thermal_adiabatic.o \
thermal_conduction.o
DAMAGE_FILES = \
damage_none.o \
damage_local.o \
damage_nonlocal.o
VACANCYFLUX_FILES = \
vacancyflux_isoconc.o \
vacancyflux_isochempot.o \
vacancyflux_cahnhilliard.o
POROSITY_FILES = \
porosity_none.o \
porosity_phasefield.o
HYDROGENFLUX_FILES = \
hydrogenflux_isoconc.o \
hydrogenflux_cahnhilliard.o
HOMOGENIZATION_FILES = \
homogenization_RGC.o \
homogenization_isostrain.o \
homogenization_none.o
#####################
# Spectral Solver
#####################
DAMASK_spectral.exe: IGNORE := \#
DAMASK_spectral.exe: COMPILE += -DSpectral
DAMASK_spectral.exe: COMPILE_MAXOPTI += -DSpectral
DAMASK_spectral.exe: MESHNAME := mesh.f90
DAMASK_spectral.exe: INTERFACENAME := spectral_interface.f90
DAMASK_spectral.o: IGNORE := \#
DAMASK_spectral.o: COMPILE += -DSpectral
DAMASK_spectral.o: COMPILE_MAXOPTI += -DSpectral
DAMASK_spectral.o: MESHNAME := mesh.f90
DAMASK_spectral.o: INTERFACENAME := spectral_interface.f90
SPECTRAL_SOLVER_FILES = spectral_mech_AL.o spectral_mech_Basic.o spectral_mech_Polarisation.o \
spectral_thermal.o spectral_damage.o
SPECTRAL_FILES = C_routines.o \
system_routines.o \
prec.o \
DAMASK_interface.o \
IO.o \
numerics.o \
debug.o \
math.o \
FEsolving.o \
mesh.o \
material.o \
lattice.o \
$(SOURCE_FILES) \
$(KINEMATICS_FILES) \
$(PLASTIC_FILES) \
constitutive.o \
crystallite.o \
$(THERMAL_FILES) \
$(DAMAGE_FILES) \
$(VACANCYFLUX_FILES) \
$(HYDROGENFLUX_FILES) \
$(POROSITY_FILES) \
$(HOMOGENIZATION_FILES) homogenization.o \
CPFEM2.o \
spectral_utilities.o \
$(SPECTRAL_SOLVER_FILES)
DAMASK_spectral.exe: DAMASK_spectral.o
$(PREFIX) $(LINKERNAME) $(OPENMP_FLAG_$(F90)) $(LINK_OPTIONS_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(MAXOPTI)_$(F90)) \
-o DAMASK_spectral.exe DAMASK_spectral.o \
$(SPECTRAL_FILES) $(LIBRARIES) $(SUFFIX)
DAMASK_spectral.o: DAMASK_spectral.f90 \
$(SPECTRAL_SOLVER_FILES)
$(PREFIX) $(FCOMPILERNAME) $(COMPILE_MAXOPTI) -c DAMASK_spectral.f90 $(SUFFIX)
spectral_mech_AL.o: spectral_mech_AL.f90 \
spectral_utilities.o
spectral_mech_Polarisation.o: spectral_mech_Polarisation.f90 \
spectral_utilities.o
spectral_mech_Basic.o: spectral_mech_Basic.f90 \
spectral_utilities.o
spectral_thermal.o: spectral_thermal.f90 \
spectral_utilities.o
spectral_damage.o: spectral_damage.f90 \
spectral_utilities.o
spectral_utilities.o: spectral_utilities.f90 \
CPFEM2.o
#####################
# FEM Solver
#####################
VPATH := ../private/FEM/code
DAMASK_FEM.exe: COMPILE += -DFEM
DAMASK_FEM.exe: COMPILE_MAXOPTI += -DFEM
DAMASK_FEM.exe: MESHNAME := ../private/FEM/code/meshFEM.f90
DAMASK_FEM.exe: INTERFACENAME := ../private/FEM/code/DAMASK_FEM_interface.f90
DAMASK_FEM.exe: INCLUDE_DIRS += -I./
FEM_SOLVER_FILES = FEM_mech.o FEM_thermal.o FEM_damage.o FEM_vacancyflux.o FEM_porosity.o FEM_hydrogenflux.o
FEM_FILES = prec.o \
DAMASK_interface.o \
FEZoo.o \
IO.o \
numerics.o \
debug.o \
math.o \
FEsolving.o \
mesh.o \
material.o \
lattice.o \
$(SOURCE_FILES) \
$(KINEMATICS_FILES) \
$(PLASTIC_FILES) \
constitutive.o \
crystallite.o \
$(THERMAL_FILES) \
$(DAMAGE_FILES) \
$(VACANCYFLUX_FILES) \
$(HYDROGENFLUX_FILES) \
$(POROSITY_FILES) \
$(HOMOGENIZATION_FILES) homogenization.o \
CPFEM.o \
FEM_utilities.o \
$(FEM_SOLVER_FILES)
DAMASK_FEM.exe: DAMASK_FEM_driver.o
$(PREFIX) $(LINKERNAME) $(OPENMP_FLAG_$(F90)) $(LINK_OPTIONS_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(MAXOPTI)_$(F90)) \
-o DAMASK_FEM.exe DAMASK_FEM_driver.o \
$(FEM_FILES) $(LIBRARIES) $(SUFFIX)
DAMASK_FEM_driver.o: DAMASK_FEM_driver.f90 $(FEM_SOLVER_FILES)
$(PREFIX) $(FCOMPILERNAME) $(COMPILE_MAXOPTI) -c ../private/FEM/code/DAMASK_FEM_driver.f90 $(SUFFIX)
FEM_mech.o: FEM_mech.f90 \
FEM_utilities.o
FEM_thermal.o: FEM_thermal.f90 \
FEM_utilities.o
FEM_damage.o: FEM_damage.f90 \
FEM_utilities.o
FEM_vacancyflux.o: FEM_vacancyflux.f90 \
FEM_utilities.o
FEM_porosity.o: FEM_porosity.f90 \
FEM_utilities.o
FEM_hydrogenflux.o: FEM_hydrogenflux.f90 \
FEM_utilities.o
FEM_utilities.o: FEM_utilities.f90 \
CPFEM.o
FEZoo.o: $(wildcard FEZoo.f90) \
IO.o
$(IGNORE) $(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c ../private/FEM/code/FEZoo.f90 $(SUFFIX)
touch FEZoo.o
CPFEM.o: CPFEM.f90 \
homogenization.o
CPFEM2.o: CPFEM2.f90 \
homogenization.o
homogenization.o: homogenization.f90 \
$(THERMAL_FILES) \
$(DAMAGE_FILES) \
$(VACANCYFLUX_FILES) \
$(POROSITY_FILES) \
$(HYDROGENFLUX_FILES) \
$(HOMOGENIZATION_FILES)
thermal_isothermal.o: thermal_isothermal.f90 \
crystallite.o
thermal_adiabatic.o: thermal_adiabatic.f90 \
crystallite.o
thermal_conduction.o: thermal_conduction.f90 \
crystallite.o
damage_none.o: damage_none.f90 \
crystallite.o
damage_local.o: damage_local.f90 \
crystallite.o
damage_nonlocal.o: damage_nonlocal.f90 \
crystallite.o
thermal_conduction.o: thermal_conduction.f90 \
crystallite.o
vacancyflux_isoconc.o: vacancyflux_isoconc.f90 \
crystallite.o
vacancyflux_isochempot.o: vacancyflux_isochempot.f90 \
crystallite.o
vacancyflux_cahnhilliard.o: vacancyflux_cahnhilliard.f90 \
crystallite.o
porosity_none.o: porosity_none.f90 \
crystallite.o
porosity_phasefield.o: porosity_phasefield.f90 \
crystallite.o
hydrogenflux_isoconc.o: hydrogenflux_isoconc.f90 \
crystallite.o
hydrogenflux_cahnhilliard.o: hydrogenflux_cahnhilliard.f90 \
crystallite.o
homogenization_RGC.o: homogenization_RGC.f90 \
crystallite.o
homogenization_isostrain.o: homogenization_isostrain.f90 \
crystallite.o
homogenization_none.o: homogenization_none.f90 \
crystallite.o
crystallite.o: crystallite.f90 \
constitutive.o
constitutive.o: constitutive.f90 \
$(SOURCE_FILES) \
$(KINEMATICS_FILES) \
$(PLASTIC_FILES)
source_thermal_dissipation.o: source_thermal_dissipation.f90 \
lattice.o
source_thermal_externalheat.o: source_thermal_externalheat.f90 \
lattice.o
source_damage_isoBrittle.o: source_damage_isoBrittle.f90 \
lattice.o
source_damage_isoDuctile.o: source_damage_isoDuctile.f90 \
lattice.o
source_damage_anisoBrittle.o: source_damage_anisoBrittle.f90 \
lattice.o
source_damage_anisoDuctile.o: source_damage_anisoDuctile.f90 \
lattice.o
source_vacancy_phenoplasticity.o: source_vacancy_phenoplasticity.f90 \
lattice.o
source_vacancy_irradiation.o: source_vacancy_irradiation.f90 \
lattice.o
source_vacancy_thermalfluc.o: source_vacancy_thermalfluc.f90 \
lattice.o
kinematics_cleavage_opening.o: kinematics_cleavage_opening.f90 \
lattice.o
kinematics_slipplane_opening.o: kinematics_slipplane_opening.f90 \
lattice.o
kinematics_thermal_expansion.o: kinematics_thermal_expansion.f90 \
lattice.o
kinematics_vacancy_strain.o: kinematics_vacancy_strain.f90 \
lattice.o
kinematics_hydrogen_strain.o: kinematics_hydrogen_strain.f90 \
lattice.o
plastic_nonlocal.o: plastic_nonlocal.f90 \
lattice.o
plastic_titanmod.o: plastic_titanmod.f90 \
lattice.o
plastic_disloUCLA.o: plastic_disloUCLA.f90 \
lattice.o
plastic_dislotwin.o: plastic_dislotwin.f90 \
lattice.o
plastic_phenopowerlaw.o: plastic_phenopowerlaw.f90 \
lattice.o
plastic_phenoplus.o: plastic_phenoplus.f90 \
lattice.o
plastic_isotropic.o: plastic_isotropic.f90 \
lattice.o
plastic_none.o: plastic_none.f90 \
lattice.o
ifeq "$(F90)" "gfortran"
lattice.o: lattice.f90 \
material.o
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -ffree-line-length-240 -c lattice.f90 $(SUFFIX)
# long lines for interaction matrix
else
lattice.o: lattice.f90 \
material.o
endif
material.o: material.f90 \
mesh.o
mesh.o: mesh.f90 \
$(wildcard meshFEM.f90) \
FEsolving.o \
math.o \
FEZoo.o
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c $(MESHNAME) -o mesh.o $(SUFFIX)
FEsolving.o: FEsolving.f90 \
debug.o
math.o: math.f90 \
debug.o
debug.o: debug.f90 \
numerics.o
numerics.o: numerics.f90 \
IO.o
IO.o: IO.f90 \
DAMASK_interface.o
DAMASK_interface.o: spectral_interface.f90 \
$(wildcard DAMASK_FEM_interface.f90) \
prec.o
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c $(INTERFACENAME) -o DAMASK_interface.o $(SUFFIX)
ifeq "$(F90)" "gfortran"
prec.o: prec.f90 \
system_routines.o
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c prec.f90 -fno-range-check -fall-intrinsics -fno-fast-math $(SUFFIX)
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
# --> allows the definition of DAMASK_NaN
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
# and no user-defined procedure with the same name as any intrinsic will be called except when it is explicitly declared external
# --> allows the use of 'isnan'
#-fno-fast-math:
# --> otherwise, when setting -ffast-math, isnan always evaluates to false (I would call it a bug)
else
prec.o: prec.f90 \
system_routines.o
endif
system_routines.o: system_routines.f90 \
C_routines.o
C_routines.o: C_routines.c
%.o : %.f90
$(PREFIX) $(FCOMPILERNAME) $(COMPILE) -c $< $(SUFFIX)
%.o : %.c
$(CCOMPILERNAME) -c $<
.PHONY: tidy
tidy:
@rm -rf *.o
@rm -rf *.mod
@rm -rf *.optrpt
@rm -rf *.inst.f90 # for instrumentation
@rm -rf *.pomp.f90 # for instrumentation
@rm -rf *.pp.f90 # for instrumentation
@rm -rf *.pdb # for instrumentation
@rm -rf *.opari.inc # for instrumentation
.PHONY: cleanDAMASK
cleanDAMASK:
@rm -rf *.exe
@rm -rf *.marc
@rm -rf *.o
@rm -rf *.mod
@rm -rf *.optrpt
@rm -rf *.inst.f90 # for instrumentation
@rm -rf *.pomp.f90 # for instrumentation
@rm -rf *.pp.f90 # for instrumentation
@rm -rf *.pdb # for instrumentation
@rm -rf *.opari.inc # for instrumentation
.PHONY: help
help:
F90="$(F90)"
FCOMPILERNAME="$(FCOMPILERNAME)"
COMPILEROUT="$(COMPILEROUT)"

View File

@ -50,7 +50,7 @@ interactionSlipSlip 0.122 0.122 0.625 0.07 0.137 0.122 # Interaction coefficient
### Shearband parameters ### ### Shearband parameters ###
shearbandresistance 180e6 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] QedgePerSbSystem 3.7e-19 # Activation energy for shear banding [J]
p_shearband 1.0 # p-exponent in glide velocity p_shearband 1.0 # p-exponent in glide velocity
q_shearband 1.0 # q-exponent in glide velocity q_shearband 1.0 # q-exponent in glide velocity

View File

@ -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 tausat_slip 222.e6 412.7e6 # per family, optimization long simplex 109
h0_slipslip 1000.0e6 h0_slipslip 1000.0e6
interaction_slipslip 1 1 1.4 1.4 1.4 1.4 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 w0_slip 2.0
(output) totalshear (output) totalshear

View File

@ -18,8 +18,5 @@ tau0_slip 405.8e6 456.7e6 # per family
tausat_slip 872.9e6 971.2e6 # per family tausat_slip 872.9e6 971.2e6 # per family
h0_slipslip 563.0e9 h0_slipslip 563.0e9
interaction_slipslip 1 1 1.4 1.4 1.4 1.4 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 w0_slip 2.0
(output) totalshear (output) totalshear

View File

@ -35,18 +35,7 @@ tausat_slip 53.00e6 # per family
a_slip 1.0 a_slip 1.0
gdot0_twin 0.001 gdot0_twin 0.001
n_twin 20 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_slipslip 75e6
h0_twinslip 0
h0_twintwin 0
interaction_slipslip 1 1 1.4 1.4 1.4 1.4 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 atol_resistance 1

View File

@ -29,18 +29,8 @@ a_slip 2.25
gdot0_twin 0.001 gdot0_twin 0.001
n_twin 20 n_twin 20
tau0_twin 31e6 # per family 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_slipslip 75e6
h0_twinslip 0
h0_twintwin 0
interaction_slipslip 1 1 1.4 1.4 1.4 1.4 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 atol_resistance 1
(stiffness_degradation) damage (stiffness_degradation) damage

View File

@ -52,22 +52,8 @@ n_slip 20
tau0_slip 31e6 # per family tau0_slip 31e6 # per family
tausat_slip 63e6 # per family tausat_slip 63e6 # per family
a_slip 2.25 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_slipslip 75e6
h0_sliptwin 0
h0_twinslip 0
h0_twintwin 0
interaction_slipslip 1 1 1.4 1.4 1.4 1.4 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 atol_resistance 1

View File

@ -31,7 +31,7 @@ fortCmd = "ifort"
# -integer-size 32 -DINT=4 assume size of integer to be 4 bytes, matches our definition of pInt # -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 " + 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 " + "-ftz -diag-disable 5268 " +
"-implicitnone -assume byterecl -stand f08 -standard-semantics " + "-implicitnone -assume byterecl -stand f08 -standard-semantics " +
"-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 " + "-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 " +

View File

@ -31,7 +31,7 @@ fortCmd = "ifort"
# -integer-size 32 -DINT=4 assume size of integer to be 4 bytes, matches our definition of pInt # -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 " + compile_fortran = (fortCmd + " -c -fPIC -auto -shared-intel " +
"-I%I -I../lib -free -O1 -fpp " + "-I%I -free -O1 -fpp " +
"-ftz -diag-disable 5268 " + "-ftz -diag-disable 5268 " +
"-implicitnone -assume byterecl -stand f08 -standard-semantics " + "-implicitnone -assume byterecl -stand f08 -standard-semantics " +
"-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 " + "-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 " +

View File

@ -56,7 +56,7 @@ echo "Editor: $EDITOR"
# tools # tools
echo '' echo ''
echo 'copying Marc tools...' echo 'adapting Marc tools...'
theDIR=$INSTALLDIR/marc$VERSION/tools theDIR=$INSTALLDIR/marc$VERSION/tools
for filename in 'comp_damask' \ for filename in 'comp_damask' \
'comp_damask_l' \ 'comp_damask_l' \
@ -79,7 +79,7 @@ done
# Mentat scripts # Mentat scripts
echo '' echo ''
echo 'copying Mentat scripts...' echo 'adapting Mentat scripts...'
theDIR=$INSTALLDIR/mentat$VERSION/bin theDIR=$INSTALLDIR/mentat$VERSION/bin
for filename in 'edit_window' \ for filename in 'edit_window' \
'submit4' \ 'submit4' \
@ -103,7 +103,7 @@ done
# Mentat scripts # Mentat scripts
echo '' echo ''
echo 'copying Mentat menus...' echo 'adapting Mentat menus...'
theDIR=$INSTALLDIR/mentat$VERSION/menus theDIR=$INSTALLDIR/mentat$VERSION/menus
for filename in 'job_run.ms'; do for filename in 'job_run.ms'; do
cp $SCRIPTLOCATION/$VERSION/Mentat_menus/$filename $theDIR cp $SCRIPTLOCATION/$VERSION/Mentat_menus/$filename $theDIR
@ -114,16 +114,20 @@ done
# compile menus # compile menus
echo '' echo ''
echo 'compiling menus...' echo 'compiling Mentat menu binaries...'
$INSTALLDIR/mentat$VERSION/bin/mentat -compile $INSTALLDIR/mentat$VERSION/menus/linux64/main.msb $(which xvfb-run 2>/dev/null) $INSTALLDIR/mentat$VERSION/bin/mentat -compile $INSTALLDIR/mentat$VERSION/menus/linux64/main.msb
[[ $? != 0 ]] && echo '...failed. Try installing xvfb-run on your system.'
# setting access rights # setting access rights
echo '' echo ''
echo 'setting file access rights...' echo 'setting file access rights...'
chmod 755 $INSTALLDIR/marc$VERSION/tools/run_damask* for filename in marc$VERSION/tools/run_damask* \
chmod 755 $INSTALLDIR/marc$VERSION/tools/comp_damask* marc$VERSION/tools/comp_damask* \
chmod 755 $INSTALLDIR/mentat$VERSION/bin/submit{4..9} mentat$VERSION/bin/submit{4..9} \
chmod 755 $INSTALLDIR/mentat$VERSION/bin/kill{4..9} mentat$VERSION/bin/kill{4..9} \
chmod 755 $INSTALLDIR/${filename}
done
#creating symlinks for run_damask_scripts in /usr/local/bin #creating symlinks for run_damask_scripts in /usr/local/bin
@ -154,5 +158,15 @@ if [ -d "$BIN_DIR" ]; then
esac esac
fi fi
# cloning user subroutine
echo ''
echo 'cloning $VERSION HYPELA2 user subroutine...'
ln -s DAMASK_marc.f90 ${DAMASK_ROOT}/src/DAMASK_marc${VERSION}.f90
# precompiling user subroutine
echo ''
echo 'precompiling $VERSION HYPELA2 user subroutine...'
echo 'not yet implemented..!'
echo '' echo ''
echo 'done.' echo 'done.'

View File

@ -1,65 +0,0 @@
#!/usr/bin/env python2.7
# -*- coding: UTF-8 no BOM -*-
import os,sys
import damask
bin_link = { \
'.' : [
'DAMASK_spectral.exe',
'DAMASK_FEM.exe'
],
}
MarcReleases =[ \
'2014',
'2014.2',
'2015',
'2016'
]
damaskEnv = damask.Environment()
baseDir = damaskEnv.relPath('code/')
binDir = damaskEnv.options['DAMASK_BIN']
if not os.path.isdir(binDir):
os.mkdir(binDir)
sys.stdout.write('\nsymbolic linking...\n')
for subDir in bin_link:
theDir = os.path.abspath(os.path.join(baseDir,subDir))
sys.stdout.write('\n'+binDir+' ->\n'+theDir+damask.util.deemph(' ...')+'\n')
for theFile in bin_link[subDir]:
theName,theExt = os.path.splitext(theFile)
src = os.path.abspath(os.path.join(theDir,theFile))
if os.path.exists(src):
sym_link = os.path.abspath(os.path.join(binDir,subDir if theFile == '' else theName))
if os.path.lexists(sym_link):
os.remove(sym_link)
output = theName+damask.util.deemph(theExt)
else:
output = damask.util.emph(theName)+damask.util.deemph(theExt)
sys.stdout.write(damask.util.deemph('... ')+output+'\n')
os.symlink(src,sym_link)
sys.stdout.write('\nMSC.Marc versioning...\n\n')
theMaster = 'DAMASK_marc.f90'
for version in MarcReleases:
src = os.path.abspath(os.path.join(baseDir,theMaster))
if os.path.exists(src):
sym_link = os.path.abspath(os.path.join(baseDir,'DAMASK_marc{}.f90'.format(version)))
if os.path.lexists(sym_link):
os.remove(sym_link)
output = version
else:
output = damask.util.emph(version)
sys.stdout.write(' '+output+'\n')
os.symlink(theMaster,sym_link)

View File

@ -2,6 +2,7 @@
from .solver import Solver from .solver import Solver
import damask import damask
import subprocess,re
class Abaqus(Solver): class Abaqus(Solver):
@ -20,8 +21,6 @@ class Abaqus(Solver):
raise Exception('unknown Abaqus solver %'%solver) raise Exception('unknown Abaqus solver %'%solver)
def return_run_command(self,model): def return_run_command(self,model):
import subprocess
import re
env=damask.Environment() env=damask.Environment()
shortVersion = re.sub('[\.,-]', '',self.version) shortVersion = re.sub('[\.,-]', '',self.version)
try: try:
@ -33,4 +32,4 @@ class Abaqus(Solver):
detectedVersion = process.stdout.readlines()[1].split()[1] detectedVersion = process.stdout.readlines()[1].split()[1]
if self.version != detectedVersion: if self.version != detectedVersion:
raise Exception('found Abaqus version %s, but requested %s'%(detectedVersion,self.version)) raise Exception('found Abaqus version %s, but requested %s'%(detectedVersion,self.version))
return '%s -job %s -user %s/code/DAMASK_abaqus_%s interactive'%(cmd,model,env.rootDir(),self.solver) return '%s -job %s -user %s/src/DAMASK_abaqus_%s interactive'%(cmd,model,env.rootDir(),self.solver)

View File

@ -13,9 +13,6 @@ class Marc(Solver):
'2015': ['linux64',''], '2015': ['linux64',''],
'2014.2':['linux64',''], '2014.2':['linux64',''],
'2014' :['linux64',''], '2014' :['linux64',''],
'2013.1':['linux64',''],
'2013': ['linux64',''],
'2012': ['linux64',''],
} }
@ -86,13 +83,13 @@ class Marc(Solver):
damaskEnv = damask.environment.Environment() damaskEnv = damask.environment.Environment()
user = os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc') # might be updated if special version (symlink) is found user = os.path.join(damaskEnv.relPath('src/'),'DAMASK_marc') # might be updated if special version (symlink) is found
if compile: if compile:
if os.path.isfile(os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc%s.f90'%release)): if os.path.isfile(os.path.join(damaskEnv.relPath('src/'),'DAMASK_marc%s.f90'%release)):
user = os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc%s'%release) user = os.path.join(damaskEnv.relPath('src/'),'DAMASK_marc%s'%release)
else: else:
if os.path.isfile(os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc%s.marc'%release)): if os.path.isfile(os.path.join(damaskEnv.relPath('src/'),'DAMASK_marc%s.marc'%release)):
user = os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc%s'%release) user = os.path.join(damaskEnv.relPath('src/'),'DAMASK_marc%s'%release)
# Define options [see Marc Installation and Operation Guide, pp 23] # Define options [see Marc Installation and Operation Guide, pp 23]
script = 'run_damask%s'%({False:'',True:'_'}[optimization!='' or openMP]) script = 'run_damask%s'%({False:'',True:'_'}[optimization!='' or openMP])

View File

@ -51,23 +51,22 @@ parser.add_option( '--nonperiodic', dest='periodic', action='store_false',
parser.add_option( '--voxelspace', dest='voxelspace', action='store_true', 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) \ help = '-c and -d are given in (0 to grid) coordinates instead of (origin to origin+size) \
coordinates [%default]') coordinates [%default]')
parser.set_defaults(center = [0,0,0], parser.set_defaults(center = (.0,.0,.0),
fill = 0, fill = 0,
quaternion = [],
angleaxis = [],
degrees = False, degrees = False,
exponent = [1e10,1e10,1e10], # box shape by default exponent = (1e10,1e10,1e10), # box shape by default
periodic = True, periodic = True,
voxelspace = False voxelspace = False
) )
(options, filenames) = parser.parse_args() (options, filenames) = parser.parse_args()
if options.dimension is None:
if options.angleaxis != []: parser.error('no dimension specified.')
if options.angleaxis is not None:
options.angleaxis = map(float,options.angleaxis) options.angleaxis = map(float,options.angleaxis)
rotation = damask.Quaternion().fromAngleAxis(np.radians(options.angleaxis[0]) if options.degrees else options.angleaxis[0], rotation = damask.Quaternion().fromAngleAxis(np.radians(options.angleaxis[0]) if options.degrees else options.angleaxis[0],
options.angleaxis[1:4]) options.angleaxis[1:4])
elif options.quaternion != []: elif options.quaternion is not None:
options.quaternion = map(float,options.quaternion) options.quaternion = map(float,options.quaternion)
rotation = damask.Quaternion(options.quaternion) rotation = damask.Quaternion(options.quaternion)
else: else:

257
processing/pre/mentat_pbcOnBoxMesh.py Executable file → Normal file
View File

@ -1,67 +1,101 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# -*- coding: UTF-8 no BOM -*- # -*- coding: UTF-8 no BOM -*-
import sys,os import sys,os,re,time,tempfile
import numpy as np import numpy as np
from optparse import OptionParser from optparse import OptionParser
import damask import damask
sys.path.append(damask.solver.Marc().libraryPath())
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
sys.path.append(damask.solver.Marc().libraryPath()) # Convert .mfd file into a usable format
# Broken into labeled sections (eg. nodes, links, etc)
# Each section has a list of labeled elements with formatted numerical data
def parseMFD(dat):
formatted = []
section = 0
formatted.append({'label': 'header', 'uid': -1, 'els': []})
# in between =beg= and =end= part of file
in_block = False
for line in dat:
if in_block: # currently in a section
# lines that start with a space are numerical data
if line[0] == ' ':
formatted[section]['els'].append([])
active=[True,True,True] # directions on which to add PBC # grab numbers
def outMentat(cmd,locals): nums = re.split(r'\s+', line.strip())
if cmd[0:3] == '(!)':
exec(cmd[3:]) for num in nums:
elif cmd[0:3] == '(?)': # floating point has format ' -x.xxxxxxxxxxxxe+yy'
cmd = eval(cmd[3:]) # scientific notation is used for float
py_mentat.py_send(cmd) if (len(num) >= 4) and (num[-4] == 'e'):
formatted[section]['els'][-1].append(float(num))
else: # integer
formatted[section]['els'][-1].append(int(num))
else: # not numerical data, so it is a label for an element or section end
if line[0] == '=' and re.search(r'=end=$', line) is not None: # End of section, avoiding regex if possible
in_block = False
else: else:
py_mentat.py_send(cmd) formatted[section]['els'].append([])
return formatted[section]['els'][-1] = line
#------------------------------------------------------------------------------------------------- else: # Not in a section, we are looking for a =beg= now
def outFile(cmd,locals,dest): search = re.search(r'=beg=\s+(\d+)\s\((.*?)\)', line)
if cmd[0:3] == '(!)': if search is not None: # found start of a new section
exec(cmd[3:]) section += 1
elif cmd[0:3] == '(?)': in_block = True
cmd = eval(cmd[3:]) formatted.append({'label': search.group(2), 'uid': int(search.group(1)), 'els': []})
dest.write(cmd+'\n') else: # No =beg= found, probably in the header
# Either header or somthing we didn't plan for - just save the line so it isn't lost
if formatted[section]['uid'] > 0:
section += 1
formatted.append({'label': '', 'uid': -2, 'els': []}) # make dummy section to store unrecognized data
formatted[section]['els'].append(line)
return formatted
def asMFD(mfd_data):
result = ''
for section in mfd_data:
if section['uid'] > 0:
result += '=beg={0:5d} ({1})\n'.format(section['uid'], section['label'])
for el in section['els']:
if type(el) == str:
result += el
elif type(el) == list:
for num in el:
if type(num) == int:
result += '{:20d}'.format(num)
elif type(num) == float:
result += '{:20.12e}'.format(num)
else: else:
dest.write(cmd+'\n') damask.util.croak('WARNING: encountered unknown type: ' + str(type(el)))
return result += '\n'
#-------------------------------------------------------------------------------------------------
def output(cmds,locals,dest):
for cmd in cmds:
if isinstance(cmd,list):
output(cmd,locals,dest)
else: else:
if dest == 'Mentat': damask.util.croak('WARNING: encountered unknown type: ' + str(type(el)))
outMentat(str(cmd),locals) if section['uid'] > 0:
else: result += '=end=\n'
outFile(str(cmd),locals,dest) return result.strip()
return
def add_servoLinks(mfd_data,active=[True,True,True]): # directions on which to add PBC
def servoLink():
cmds = []
base = ['x','y','z'] base = ['x','y','z']
box = {'min': np.zeros(3,dtype='d'), box = {'min': np.zeros(3,dtype='d'),
'max': np.zeros(3,dtype='d'), 'max': np.zeros(3,dtype='d'),
'delta': np.zeros(3,dtype='d'), 'delta': np.zeros(3,dtype='d'),
} }
Nnodes = py_mentat.py_get_int("nnodes()")
NodeCoords = np.zeros((Nnodes,3),dtype='d') mfd_dict = {}
for node in range(Nnodes): for i in range(len(mfd_data)):
NodeCoords[node,0] = py_mentat.py_get_float("node_x(%i)"%(node+1)) mfd_dict[mfd_data[i]['label']] = i
NodeCoords[node,1] = py_mentat.py_get_float("node_y(%i)"%(node+1))
NodeCoords[node,2] = py_mentat.py_get_float("node_z(%i)"%(node+1)) NodeCoords = np.array(mfd_data[mfd_dict['nodes']]['els'][0::4])[:,1:4]
Nnodes = NodeCoords.shape[0]
box['min'] = NodeCoords.min(axis=0) # find the bounding box box['min'] = NodeCoords.min(axis=0) # find the bounding box
box['max'] = NodeCoords.max(axis=0) box['max'] = NodeCoords.max(axis=0)
box['delta'] = box['max']-box['min'] box['delta'] = box['max']-box['min']
@ -108,9 +142,12 @@ def servoLink():
if any([maxFlag[i] and active[i] for i in range(3)]): if any([maxFlag[i] and active[i] for i in range(3)]):
linkNodes.append({'id': node+1,'coord': NodeCoords[node], 'faceMember': [maxFlag[i] and active[i] for i in range(3)]}) linkNodes.append({'id': node+1,'coord': NodeCoords[node], 'faceMember': [maxFlag[i] and active[i] for i in range(3)]})
mfd_data[mfd_dict['entities']]['els'][0][0] += len(linkNodes) * 3
baseCorner = baseNode["%.8e"%box['min'][0]]["%.8e"%box['min'][1]]["%.8e"%box['min'][2]] # detect ultimate base node baseCorner = baseNode["%.8e"%box['min'][0]]["%.8e"%box['min'][1]]["%.8e"%box['min'][2]] # detect ultimate base node
links = {'uid': 1705, 'label': 'links', 'els': [[7,0],[9,0]]}
linkID = 0
for node in linkNodes: # loop over all linked nodes for node in linkNodes: # loop over all linked nodes
linkCoord = [node['coord']] # start list of control node coords with my coords linkCoord = [node['coord']] # start list of control node coords with my coords
for dir in range(3): # check for each direction for dir in range(3): # check for each direction
@ -121,76 +158,104 @@ def servoLink():
nLinks = len(linkCoord) nLinks = len(linkCoord)
for dof in [1,2,3]: for dof in [1,2,3]:
cmds.append([ tied_node = node['id']
"*new_link *link_class servo", nterms = 1 + nLinks
"*link_class servo *tied_node %i"%node['id'],
"*link_class servo *tied_dof %i"%dof, linkID += 1
"*servo_nterms %i"%(1+nLinks), # Link header
]) links['els'].append('link{0}\n'.format(linkID))
for i in range(nLinks): links['els'].append([linkID, 1])
cmds.append([ links['els'].append([0])
"*link_class servo *servo_ret_node %i %i"\ links['els'].append([0])
%(i+1,baseNode["%.8e"%linkCoord[i][0]]["%.8e"%linkCoord[i][1]]["%.8e"%linkCoord[i][2]]), links['els'].append([0, 0, 0, tied_node])
"*link_class servo *servo_ret_dof %i %i"%(i+1,dof),
"*link_class servo *servo_ret_coef %i 1"%(i+1), # these need to be put in groups of four
]) link_payload = [dof, 0, nterms]
cmds.append([
"*link_class servo *servo_ret_node %i %i"%(1+nLinks,baseCorner), # Individual node contributions (node, dof, coef.)
"*link_class servo *servo_ret_dof %i %i"%(1+nLinks,dof), for i in range(nterms):
"*link_class servo *servo_ret_coef %i -%i"%(1+nLinks,nLinks-1), if i == nLinks:
]) link_payload.append(baseCorner)
return cmds else:
link_payload.append(baseNode["%.8e"%linkCoord[i][0]]["%.8e"%linkCoord[i][1]]["%.8e"%linkCoord[i][2]])
for i in range(nterms):
link_payload.append(dof)
for i in range(nterms):
if i == nLinks:
link_payload.append(1.0 - nLinks)
else:
link_payload.append(1.0)
# Needs to be formatted 4 data points per row, character width of 20, so 80 total
for j in range(0, len(link_payload), 4):
links['els'].append(link_payload[j:j+4])
if j+4 < len(link_payload):
links['els'].append(link_payload[j+4:])
i = 0
while i < len(mfd_data) and mfd_data[i]['uid'] < 1705: i += 1
if mfd_data[i]['uid'] == 1705: del mfd_data[i]
mfd_data.insert(i, links)
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
# MAIN # MAIN
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage = '%prog [options]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """
Set up servo linking to achieve periodic boundary conditions for a regular hexahedral mesh presently opened in MSC.Mentat Set up servo linking to achieve periodic boundary conditions for a regular hexahedral mesh.
Use *py_connection to operate on model presently opened in MSC.Mentat.
""", version = scriptID) """, version = scriptID)
parser.add_option("-p", "--port", type="int", dest="port", metavar='int', parser.add_option('-p', '--port',
help="Mentat connection port [%default]") type = int, metavar = 'int', default = None,
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help = 'Mentat connection port')
help="write Mentat command stream also to stdout [%default]") parser.add_option('-x',
parser.set_defaults(port = 40007) action = 'store_false', default = True,
parser.set_defaults(verbose = False) help = 'no PBC along x direction')
parser.add_option('-y',
action = 'store_false', default = True,
help = 'no PBC along y direction')
parser.add_option('-z',
action = 'store_false', default = True,
help = 'no PBC along z direction')
(options, args) = parser.parse_args() (options, filenames) = parser.parse_args()
if options.verbose: remote = options.port is not None
file={'croak':sys.stderr}
else:
file={'croak':sys.stdout}
try: if remote and filenames != []:
import py_mentat parser.error('file can not be specified when port is given.')
if filenames == []: filenames = [None]
if remote:
try: import py_mentat
except: except:
file['croak'].write('error: no valid Mentat release found') damask.util.croak('no valid Mentat release found.')
sys.exit(-1) sys.exit(-1)
outputLocals = {} damask.util.report(scriptName, 'waiting to connect...')
filenames = [os.path.join(tempfile._get_default_tempdir(), next(tempfile._get_candidate_names()) + '.mfd')]
file['croak'].write('\033[1m'+scriptName+'\033[0m\n\n')
file['croak'].write( 'waiting to connect...\n')
try: try:
py_mentat.py_connect('',options.port) py_mentat.py_connect('',options.port)
# prevent redrawing in Mentat, should be much faster. Since py_connect has no return value, try this to determine if failed or not py_mentat.py_send('*set_save_formatted on')
output(['*draw_manual'],outputLocals,'Mentat') py_mentat.py_send('*save_as_model "{}" yes'.format(filenames[0]))
py_mentat.py_get_int("nnodes()") # hopefully blocks until file is written
except: except:
file['croak'].write('Could not connect. Set Tools/Python/"Run as Separate Process" & "Initiate"...\n') damask.util.croak('failed. try setting Tools/Python/"Run as Separate Process" & "Initiate".')
sys.exit() sys.exit()
file['croak'].write( 'connected...\n') damask.util.croak( 'connected...')
output(['*remove_all_servos', for name in filenames:
'*sweep_all', while remote and not os.path.exists(name): time.sleep(0.5) # wait for Mentat to write MFD file
'*renumber_nodes', with open( name,'r') if name is not None else sys.stdin as fileIn:
'*set_links off', damask.util.report(scriptName, name)
],outputLocals,'Mentat') # script depends on consecutive numbering of nodes mfd = parseMFD(fileIn)
cmds = servoLink() add_servoLinks(mfd,[options.x,options.y,options.z])
output(cmds,outputLocals,'Mentat') with open( name,'w') if name is not None else sys.stdout as fileOut:
py_mentat.py_disconnect() fileOut.write(asMFD(mfd))
if options.verbose: if remote:
output(cmds,outputLocals,sys.stdout) try: py_mentat.py_send('*open_model "{}"'.format(filenames[0]))
except: damask.util.croak('lost connection on sending open command for "{}".'.format(filenames[0]))

View File

@ -247,6 +247,7 @@ for name in filenames:
'*identify_sets', '*identify_sets',
'*show_model', '*show_model',
'*redraw', '*redraw',
'*draw_automatic',
] ]
outputLocals = {} outputLocals = {}

View File

@ -1,3 +1,5 @@
DAMASK_marc*.f90 DAMASK_marc*.f90
Makefile
cmake_install.cmake
quit__genmod.f90 quit__genmod.f90
*.marc *.marc

205
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,205 @@
# special flags for some files
if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
SET_SOURCE_FILES_PROPERTIES( "prec.f90" PROPERTIES
COMPILE_FLAGS "-fno-range-check -fall-intrinsics -fno-fast-math")
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
# --> allows the definition of DAMASK_NaN
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
# and no user-defined procedure with the same name as any intrinsic will be called except when it is explicitly declared external
# --> allows the use of 'isnan'
#-fno-fast-math:
# --> otherwise, when setting -ffast-math, isnan always evaluates to false (I would call it a bug)
SET_SOURCE_FILES_PROPERTIES( "lattice.f90" PROPERTIES
COMPILE_FLAGS "-ffree-line-length-240")
# long lines for interaction matrix
endif()
# The dependency detection in CMake is not functioning for Fortran,
# hence we declare the dependencies from top to bottom in the following
add_library(C_ROUTINES OBJECT "C_routines.c")
set(OBJECTFILES $<TARGET_OBJECTS:C_ROUTINES>)
add_library(SYSTEM_ROUTINES OBJECT "system_routines.f90")
add_dependencies(SYSTEM_ROUTINES C_ROUTINES)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:SYSTEM_ROUTINES>)
add_library(PREC OBJECT "prec.f90")
add_dependencies(PREC SYSTEM_ROUTINES)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:PREC>)
if ("${PROJECT_NAME}" STREQUAL "DAMASK_spectral")
add_library(DAMASK_INTERFACE OBJECT "spectral_interface.f90")
elseif ("${PROJECT_NAME}" STREQUAL "DAMASK_FEM")
add_library(DAMASK_INTERFACE OBJECT "FEM_interface.f90")
endif()
add_dependencies(DAMASK_INTERFACE PREC)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_INTERFACE>)
add_library(IO OBJECT "IO.f90")
add_dependencies(IO DAMASK_INTERFACE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:IO>)
add_library(NUMERICS OBJECT "numerics.f90")
add_dependencies(NUMERICS IO)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:NUMERICS>)
add_library(DEBUG OBJECT "debug.f90")
add_dependencies(DEBUG NUMERICS)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DEBUG>)
add_library(FEsolving OBJECT "FEsolving.f90")
add_dependencies(FEsolving DEBUG)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:FEsolving>)
add_library(DAMASK_MATH OBJECT "math.f90")
add_dependencies(DAMASK_MATH FEsolving)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_MATH>)
# SPECTRAL solver and FEM solver use different mesh files
if ("${PROJECT_NAME}" STREQUAL "DAMASK_spectral")
add_library(MESH OBJECT "mesh.f90")
add_dependencies(MESH DAMASK_MATH)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:MESH>)
elseif ("${PROJECT_NAME}" STREQUAL "DAMASK_FEM")
add_library(FEZoo OBJECT "FEZoo.f90")
add_dependencies(FEZoo DAMASK_MATH)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:FEZoo>)
add_library(MESH OBJECT "meshFEM.f90")
add_dependencies(MESH FEZoo)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:MESH>)
endif()
add_library(MATERIAL OBJECT "material.f90")
add_dependencies(MATERIAL MESH)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:MATERIAL>)
add_library(DAMASK_HELPERS OBJECT "lattice.f90")
add_dependencies(DAMASK_HELPERS MATERIAL)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_HELPERS>)
# For each modular section
add_library (PLASTIC OBJECT
"plastic_dislotwin.f90"
"plastic_disloUCLA.f90"
"plastic_isotropic.f90"
"plastic_phenopowerlaw.f90"
"plastic_titanmod.f90"
"plastic_nonlocal.f90"
"plastic_none.f90"
"plastic_phenoplus.f90")
add_dependencies(PLASTIC DAMASK_HELPERS)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:PLASTIC>)
add_library (KINEMATICS OBJECT
"kinematics_cleavage_opening.f90"
"kinematics_slipplane_opening.f90"
"kinematics_thermal_expansion.f90"
"kinematics_vacancy_strain.f90"
"kinematics_hydrogen_strain.f90")
add_dependencies(KINEMATICS DAMASK_HELPERS)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:KINEMATICS>)
add_library (SOURCE OBJECT
"source_thermal_dissipation.f90"
"source_thermal_externalheat.f90"
"source_damage_isoBrittle.f90"
"source_damage_isoDuctile.f90"
"source_damage_anisoBrittle.f90"
"source_damage_anisoDuctile.f90"
"source_vacancy_phenoplasticity.f90"
"source_vacancy_irradiation.f90"
"source_vacancy_thermalfluc.f90")
add_dependencies(SOURCE DAMASK_HELPERS)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:SOURCE>)
add_library(CONSTITUTIVE OBJECT "constitutive.f90")
add_dependencies(CONSTITUTIVE PLASTIC KINEMATICS SOURCE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:CONSTITUTIVE>)
add_library(CRYSTALLITE OBJECT "crystallite.f90")
add_dependencies(CRYSTALLITE CONSTITUTIVE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:CRYSTALLITE>)
add_library(HOMOGENIZATION OBJECT
"homogenization_RGC.f90"
"homogenization_isostrain.f90"
"homogenization_none.f90")
add_dependencies(HOMOGENIZATION CRYSTALLITE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:HOMOGENIZATION>)
add_library(HYDROGENFLUX OBJECT
"hydrogenflux_isoconc.f90"
"hydrogenflux_cahnhilliard.f90")
add_dependencies(HYDROGENFLUX CRYSTALLITE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:HYDROGENFLUX>)
add_library(POROSITY OBJECT
"porosity_none.f90"
"porosity_phasefield.f90")
add_dependencies(POROSITY CRYSTALLITE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:POROSITY>)
add_library(VACANCYFLUX OBJECT
"vacancyflux_isoconc.f90"
"vacancyflux_isochempot.f90"
"vacancyflux_cahnhilliard.f90")
add_dependencies(VACANCYFLUX CRYSTALLITE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:VACANCYFLUX>)
add_library(DAMAGE OBJECT
"damage_none.f90"
"damage_local.f90"
"damage_nonlocal.f90")
add_dependencies(DAMAGE CRYSTALLITE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMAGE>)
add_library(THERMAL OBJECT
"thermal_isothermal.f90"
"thermal_adiabatic.f90"
"thermal_conduction.f90")
add_dependencies(THERMAL CRYSTALLITE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:THERMAL>)
add_library(DAMASK_ENGINE OBJECT "homogenization.f90")
add_dependencies(DAMASK_ENGINE THERMAL DAMAGE VACANCYFLUX POROSITY HYDROGENFLUX HOMOGENIZATION)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_ENGINE>)
add_library(DAMASK_CPFE OBJECT "CPFEM2.f90")
add_dependencies(DAMASK_CPFE DAMASK_ENGINE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_CPFE>)
if ("${PROJECT_NAME}" STREQUAL "DAMASK_spectral")
add_library(SPECTRAL_UTILITIES OBJECT "spectral_utilities.f90")
add_dependencies(SPECTRAL_UTILITIES DAMASK_CPFE)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:SPECTRAL_UTILITIES>)
add_library(SPECTRAL_SOLVER OBJECT
"spectral_thermal.f90"
"spectral_damage.f90"
"spectral_mech_AL.f90"
"spectral_mech_Polarisation.f90"
"spectral_mech_Basic.f90")
add_dependencies(SPECTRAL_SOLVER SPECTRAL_UTILITIES)
list(APPEND OBJECTFILES $<TARGET_OBJECTS:SPECTRAL_SOLVER>)
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "SYNTAXONLY")
add_executable(DAMASK_spectral "DAMASK_spectral.f90" ${OBJECTFILES})
add_dependencies(DAMASK_spectral SPECTRAL_SOLVER)
endif()
elseif ("${PROJECT_NAME}" STREQUAL "DAMASK_FEM")
add_library(FEM_UTILITIES OBJECT "FEM_utilities.f90")
add_dependencies(FEM_UTILITIES DAMASK_CPFE)
add_library(FEM_SOLVER OBJECT
"FEM_hydrogenflux.f90"
"FEM_porosity.f90"
"FEM_vacancyflux.f90"
"FEM_damage.f90"
"FEM_thermal.f90"
"FEM_mech.f90")
add_dependencies(FEM_SOLVER FEM_UTILITIES)
add_executable(DAMASK_FEM "DAMASK_FEM_driver.f90")
add_dependencies(DAMASK_FEM FEM_SOLVER)
endif()

View File

@ -302,6 +302,8 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt
phase_plasticity, & phase_plasticity, &
temperature, & temperature, &
thermalMapping, & thermalMapping, &
thermal_type, &
THERMAL_conduction_ID, &
phase_Nsources, & phase_Nsources, &
material_homog, & material_homog, &
material_Nhomogenization material_Nhomogenization
@ -489,8 +491,11 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt
!* If no parallel execution is required, there is no need to collect FEM input !* If no parallel execution is required, there is no need to collect FEM input
if (.not. parallelExecution) then if (.not. parallelExecution) then
chosenThermal1: select case (thermal_type(mesh_element(3,elCP)))
case (THERMAL_conduction_ID) chosenThermal1
temperature(material_homog(ip,elCP))%p(thermalMapping(material_homog(ip,elCP))%p(ip,elCP)) = & temperature(material_homog(ip,elCP))%p(thermalMapping(material_homog(ip,elCP))%p(ip,elCP)) = &
temperature_inp temperature_inp
end select chosenThermal1
materialpoint_F0(1:3,1:3,ip,elCP) = ffn materialpoint_F0(1:3,1:3,ip,elCP) = ffn
materialpoint_F(1:3,1:3,ip,elCP) = ffn1 materialpoint_F(1:3,1:3,ip,elCP) = ffn1
@ -499,8 +504,11 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt
if (rnd < 0.5_pReal) rnd = rnd - 1.0_pReal if (rnd < 0.5_pReal) rnd = rnd - 1.0_pReal
CPFEM_cs(1:6,ip,elCP) = rnd * CPFEM_odd_stress CPFEM_cs(1:6,ip,elCP) = rnd * CPFEM_odd_stress
CPFEM_dcsde(1:6,1:6,ip,elCP) = CPFEM_odd_jacobian * math_identity2nd(6) CPFEM_dcsde(1:6,1:6,ip,elCP) = CPFEM_odd_jacobian * math_identity2nd(6)
chosenThermal2: select case (thermal_type(mesh_element(3,elCP)))
case (THERMAL_conduction_ID) chosenThermal2
temperature(material_homog(ip,elCP))%p(thermalMapping(material_homog(ip,elCP))%p(ip,elCP)) = & temperature(material_homog(ip,elCP))%p(thermalMapping(material_homog(ip,elCP))%p(ip,elCP)) = &
temperature_inp temperature_inp
end select chosenThermal2
materialpoint_F0(1:3,1:3,ip,elCP) = ffn materialpoint_F0(1:3,1:3,ip,elCP) = ffn
materialpoint_F(1:3,1:3,ip,elCP) = ffn1 materialpoint_F(1:3,1:3,ip,elCP) = ffn1
CPFEM_calc_done = .false. CPFEM_calc_done = .false.

1
src/DAMASK_marc2011.f90 Symbolic link
View File

@ -0,0 +1 @@
DAMASK_marc.f90

1
src/DAMASK_marc2012.f90 Symbolic link
View File

@ -0,0 +1 @@
DAMASK_marc.f90

1
src/DAMASK_marc2013.1.f90 Symbolic link
View File

@ -0,0 +1 @@
DAMASK_marc.f90

1
src/DAMASK_marc2013.f90 Symbolic link
View File

@ -0,0 +1 @@
DAMASK_marc.f90

1
src/DAMASK_marc2014.2.f90 Symbolic link
View File

@ -0,0 +1 @@
DAMASK_marc.f90

1
src/DAMASK_marc2014.f90 Symbolic link
View File

@ -0,0 +1 @@
DAMASK_marc.f90

1
src/DAMASK_marc2015.f90 Symbolic link
View File

@ -0,0 +1 @@
DAMASK_marc.f90

View File

@ -1428,7 +1428,6 @@ subroutine crystallite_integrateStateRK4()
!$OMP DO !$OMP DO
do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains
if (crystallite_todo(g,i,e)) & if (crystallite_todo(g,i,e)) &
!***dirty way to pass orientation information
call constitutive_microstructure(crystallite_orientation, & call constitutive_microstructure(crystallite_orientation, &
crystallite_Fe(1:3,1:3,g,i,e), & crystallite_Fe(1:3,1:3,g,i,e), &
crystallite_Fp(1:3,1:3,g,i,e), & crystallite_Fp(1:3,1:3,g,i,e), &
@ -1754,7 +1753,6 @@ subroutine crystallite_integrateStateRKCK45()
!$OMP DO !$OMP DO
do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains
if (crystallite_todo(g,i,e)) & if (crystallite_todo(g,i,e)) &
!***dirty way to pass orientations to constitutive_microstructure
call constitutive_microstructure(crystallite_orientation, & call constitutive_microstructure(crystallite_orientation, &
crystallite_Fe(1:3,1:3,g,i,e), & crystallite_Fe(1:3,1:3,g,i,e), &
crystallite_Fp(1:3,1:3,g,i,e), & crystallite_Fp(1:3,1:3,g,i,e), &
@ -1974,7 +1972,6 @@ subroutine crystallite_integrateStateRKCK45()
!$OMP DO !$OMP DO
do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains
if (crystallite_todo(g,i,e)) & if (crystallite_todo(g,i,e)) &
!***dirty way to pass orientations to constitutive_microstructure
call constitutive_microstructure(crystallite_orientation, & call constitutive_microstructure(crystallite_orientation, &
crystallite_Fe(1:3,1:3,g,i,e), & crystallite_Fe(1:3,1:3,g,i,e), &
crystallite_Fp(1:3,1:3,g,i,e), & crystallite_Fp(1:3,1:3,g,i,e), &
@ -2209,7 +2206,6 @@ subroutine crystallite_integrateStateAdaptiveEuler()
!$OMP DO !$OMP DO
do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains
if (crystallite_todo(g,i,e)) & if (crystallite_todo(g,i,e)) &
!***dirty way to pass orientations to constitutive_microstructure
call constitutive_microstructure(crystallite_orientation, & call constitutive_microstructure(crystallite_orientation, &
crystallite_Fe(1:3,1:3,g,i,e), & crystallite_Fe(1:3,1:3,g,i,e), &
crystallite_Fp(1:3,1:3,g,i,e), & crystallite_Fp(1:3,1:3,g,i,e), &
@ -2553,7 +2549,6 @@ eIter = FEsolving_execElem(1:2)
!$OMP DO !$OMP DO
do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains
if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) & if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) &
!***dirty way to pass orientations to constitutive_microstructure
call constitutive_microstructure(crystallite_orientation, & call constitutive_microstructure(crystallite_orientation, &
crystallite_Fe(1:3,1:3,g,i,e), & crystallite_Fe(1:3,1:3,g,i,e), &
crystallite_Fp(1:3,1:3,g,i,e), & crystallite_Fp(1:3,1:3,g,i,e), &
@ -2798,7 +2793,6 @@ subroutine crystallite_integrateStateFPI()
!$OMP DO PRIVATE(p,c) !$OMP DO PRIVATE(p,c)
do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains do e = eIter(1),eIter(2); do i = iIter(1,e),iIter(2,e); do g = gIter(1,e),gIter(2,e) ! iterate over elements, ips and grains
if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) & if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) &
!***dirty way to pass orientations to constitutive_micrsotructure
call constitutive_microstructure(crystallite_orientation, & call constitutive_microstructure(crystallite_orientation, &
crystallite_Fe(1:3,1:3,g,i,e), & crystallite_Fe(1:3,1:3,g,i,e), &
crystallite_Fp(1:3,1:3,g,i,e), & crystallite_Fp(1:3,1:3,g,i,e), &

View File

@ -1266,8 +1266,6 @@ subroutine lattice_init
debug_level, & debug_level, &
debug_lattice, & debug_lattice, &
debug_levelBasic debug_levelBasic
use numerics, only: &
worldrank
implicit none implicit none
integer(pInt), parameter :: FILEUNIT = 200_pInt integer(pInt), parameter :: FILEUNIT = 200_pInt

View File

@ -729,6 +729,8 @@ end subroutine material_parseHomogenization
!> @brief parses the microstructure part in the material configuration file !> @brief parses the microstructure part in the material configuration file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_parseMicrostructure(fileUnit,myPart) subroutine material_parseMicrostructure(fileUnit,myPart)
use prec, only: &
dNeq
use IO use IO
use mesh, only: & use mesh, only: &
mesh_element, & mesh_element, &
@ -738,7 +740,6 @@ subroutine material_parseMicrostructure(fileUnit,myPart)
character(len=*), intent(in) :: myPart character(len=*), intent(in) :: myPart
integer(pInt), intent(in) :: fileUnit integer(pInt), intent(in) :: fileUnit
integer(pInt), allocatable, dimension(:) :: chunkPos integer(pInt), allocatable, dimension(:) :: chunkPos
integer(pInt) :: Nsections, section, constituent, e, i integer(pInt) :: Nsections, section, constituent, e, i
character(len=65536) :: & character(len=65536) :: &
@ -818,9 +819,10 @@ subroutine material_parseMicrostructure(fileUnit,myPart)
!sanity check !sanity check
do section = 1_pInt, Nsections do section = 1_pInt, Nsections
if (sum(microstructure_fraction(:,section)) /= 1.0_pReal) & if (dNeq(sum(microstructure_fraction(:,section)),1.0_pReal)) &
call IO_error(153_pInt,ext_msg=microstructure_name(section)) call IO_error(153_pInt,ext_msg=microstructure_name(section))
enddo enddo
end subroutine material_parseMicrostructure end subroutine material_parseMicrostructure

View File

@ -452,7 +452,6 @@ pure function math_tensorproduct(A,B)
implicit none implicit none
real(pReal), dimension(:), intent(in) :: A,B real(pReal), dimension(:), intent(in) :: A,B
real(pReal), dimension(size(A,1),size(B,1)) :: math_tensorproduct real(pReal), dimension(size(A,1),size(B,1)) :: math_tensorproduct
integer(pInt) :: i,j integer(pInt) :: i,j
forall (i=1_pInt:size(A,1),j=1_pInt:size(B,1)) math_tensorproduct(i,j) = A(i)*B(j) forall (i=1_pInt:size(A,1),j=1_pInt:size(B,1)) math_tensorproduct(i,j) = A(i)*B(j)

View File

@ -921,10 +921,8 @@ subroutine mesh_build_ipCoordinates
integer(pInt) :: e,t,g,c,i,n integer(pInt) :: e,t,g,c,i,n
real(pReal), dimension(3) :: myCoords real(pReal), dimension(3) :: myCoords
if (.not. allocated(mesh_ipCoordinates)) then if (.not. allocated(mesh_ipCoordinates)) &
allocate(mesh_ipCoordinates(3,mesh_maxNips,mesh_NcpElems)) allocate(mesh_ipCoordinates(3,mesh_maxNips,mesh_NcpElems),source=0.0_pReal)
mesh_ipCoordinates = 0.0_pReal
endif
!$OMP PARALLEL DO PRIVATE(t,g,c,myCoords) !$OMP PARALLEL DO PRIVATE(t,g,c,myCoords)
do e = 1_pInt,mesh_NcpElems ! loop over cpElems do e = 1_pInt,mesh_NcpElems ! loop over cpElems
@ -936,7 +934,7 @@ subroutine mesh_build_ipCoordinates
do n = 1_pInt,FE_NcellnodesPerCell(c) ! loop over cell nodes in this cell do n = 1_pInt,FE_NcellnodesPerCell(c) ! loop over cell nodes in this cell
myCoords = myCoords + mesh_cellnode(1:3,mesh_cell(n,i,e)) myCoords = myCoords + mesh_cellnode(1:3,mesh_cell(n,i,e))
enddo enddo
mesh_ipCoordinates(1:3,i,e) = myCoords / FE_NcellnodesPerCell(c) mesh_ipCoordinates(1:3,i,e) = myCoords / real(FE_NcellnodesPerCell(c),pReal)
enddo enddo
enddo enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
@ -955,7 +953,6 @@ pure function mesh_cellCenterCoordinates(ip,el)
real(pReal), dimension(3) :: mesh_cellCenterCoordinates !< x,y,z coordinates of the cell center of the requested IP cell real(pReal), dimension(3) :: mesh_cellCenterCoordinates !< x,y,z coordinates of the cell center of the requested IP cell
integer(pInt) :: t,g,c,n integer(pInt) :: t,g,c,n
t = mesh_element(2_pInt,el) ! get element type t = mesh_element(2_pInt,el) ! get element type
g = FE_geomtype(t) ! get geometry type g = FE_geomtype(t) ! get geometry type
c = FE_celltype(g) ! get cell type c = FE_celltype(g) ! get cell type
@ -963,7 +960,7 @@ pure function mesh_cellCenterCoordinates(ip,el)
do n = 1_pInt,FE_NcellnodesPerCell(c) ! loop over cell nodes in this cell do n = 1_pInt,FE_NcellnodesPerCell(c) ! loop over cell nodes in this cell
mesh_cellCenterCoordinates = mesh_cellCenterCoordinates + mesh_cellnode(1:3,mesh_cell(n,ip,el)) mesh_cellCenterCoordinates = mesh_cellCenterCoordinates + mesh_cellnode(1:3,mesh_cell(n,ip,el))
enddo enddo
mesh_cellCenterCoordinates = mesh_cellCenterCoordinates / FE_NcellnodesPerCell(c) mesh_cellCenterCoordinates = mesh_cellCenterCoordinates / real(FE_NcellnodesPerCell(c),pReal)
end function mesh_cellCenterCoordinates end function mesh_cellCenterCoordinates
@ -1511,8 +1508,8 @@ function mesh_nodesAroundCentres(gDim,Favg,centres) result(nodes)
shift = sign(abs(iRes+diag-2_pInt*me)/(iRes+diag),iRes+diag-2_pInt*me) shift = sign(abs(iRes+diag-2_pInt*me)/(iRes+diag),iRes+diag-2_pInt*me)
lookup = me-diag+shift*iRes lookup = me-diag+shift*iRes
wrappedCentres(1:3,i+1_pInt, j+1_pInt, k+1_pInt) = & wrappedCentres(1:3,i+1_pInt, j+1_pInt, k+1_pInt) = &
centres(1:3,lookup(1)+1_pInt,lookup(2)+1_pInt,lookup(3)+1_pInt) - & centres(1:3,lookup(1)+1_pInt,lookup(2)+1_pInt,lookup(3)+1_pInt) &
math_mul33x3(Favg, shift*gDim) - math_mul33x3(Favg, real(shift,pReal)*gDim)
endif endif
enddo; enddo; enddo enddo; enddo; enddo
@ -3352,15 +3349,10 @@ end function FE_mapElemtype
subroutine mesh_faceMatch(elem, face ,matchingElem, matchingFace) subroutine mesh_faceMatch(elem, face ,matchingElem, matchingFace)
implicit none implicit none
!*** output variables
integer(pInt), intent(out) :: matchingElem, & ! matching CP element ID integer(pInt), intent(out) :: matchingElem, & ! matching CP element ID
matchingFace ! matching face ID matchingFace ! matching face ID
!*** input variables
integer(pInt), intent(in) :: face, & ! face ID integer(pInt), intent(in) :: face, & ! face ID
elem ! CP elem ID elem ! CP elem ID
!*** local variables
integer(pInt), dimension(FE_NmatchingNodesPerFace(face,FE_geomtype(mesh_element(2,elem)))) :: & integer(pInt), dimension(FE_NmatchingNodesPerFace(face,FE_geomtype(mesh_element(2,elem)))) :: &
myFaceNodes ! global node ids on my face myFaceNodes ! global node ids on my face
integer(pInt) :: myType, & integer(pInt) :: myType, &

View File

@ -251,10 +251,8 @@ subroutine numerics_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! try to open the config file ! try to open the config file
fileExists: if(IO_open_file_stat(FILEUNIT,numerics_configFile)) then fileExists: if(IO_open_file_stat(FILEUNIT,numerics_configFile)) then
mainProcess2: if (worldrank == 0) then
write(6,'(a,/)') ' using values from config file' write(6,'(a,/)') ' using values from config file'
flush(6) flush(6)
endif mainProcess2
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! read variables from config file and overwrite default parameters if keyword is present ! read variables from config file and overwrite default parameters if keyword is present
@ -694,9 +692,9 @@ subroutine numerics_init
.not. memory_efficient) call IO_error(error_ID = 847_pInt) .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_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_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_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 (err_curl_tolAbs <= 0.0_pReal) call IO_error(301_pInt,ext_msg='err_curl_tolAbs')
if (polarAlpha <= 0.0_pReal .or. & if (polarAlpha <= 0.0_pReal .or. &
polarAlpha > 2.0_pReal) call IO_error(301_pInt,ext_msg='polarAlpha') polarAlpha > 2.0_pReal) call IO_error(301_pInt,ext_msg='polarAlpha')

View File

@ -57,7 +57,9 @@ subroutine DAMASK_interface_init()
tag tag
integer :: & integer :: &
i, & i, &
#ifdef _OPENMP
threadLevel, & threadLevel, &
#endif
worldrank = 0, & worldrank = 0, &
worldsize = 0 worldsize = 0
integer, allocatable, dimension(:) :: & integer, allocatable, dimension(:) :: &

Some files were not shown because too many files have changed in this diff Show More