Merge remote-tracking branch 'origin/development' into Marc-spelling

This commit is contained in:
Martin Diehl 2021-11-12 09:25:41 +01:00
commit cd2ecef92f
28 changed files with 1678 additions and 450 deletions

View File

@ -46,29 +46,18 @@ variables:
# Names of module files to load
# ===============================================================================================
# ++++++++++++ Compiler +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IntelCompiler19_1: "Compiler/Intel/19.1.2 Libraries/IMKL/2020"
GNUCompiler10: "Compiler/GNU/10"
# ------------ Defaults ----------------------------------------------
IntelCompiler: "$IntelCompiler19_1"
GNUCompiler: "$GNUCompiler10"
IntelCompiler: "Compiler/Intel/19.1.2 Libraries/IMKL/2020"
GNUCompiler: "Compiler/GNU/10"
# ++++++++++++ MPI ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IMPI2020Intel19_1: "MPI/Intel/19.1.2/IntelMPI/2019"
OMPI4_0GNU10: "MPI/GNU/10/OpenMPI/4.0.5"
# ------------ Defaults ----------------------------------------------
MPI_Intel: "$IMPI2020Intel19_1"
MPI_GNU: "$OMPI4_0GNU10"
MPI_Intel: "MPI/Intel/19.1.2/IntelMPI/2019"
MPI_GNU: "MPI/GNU/10/OpenMPI/4.1.1"
# ++++++++++++ PETSc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PETSc3_14_2IMPI2020Intel19_1: "Libraries/PETSc/3.14.2/Intel-19.1.2-IntelMPI-2019"
PETSc3_14_2OMPI4_0GNU10: "Libraries/PETSc/3.14.2/GNU-10-OpenMPI-4.0.5"
# ------------ Defaults ----------------------------------------------
PETSc_Intel: "$PETSc3_14_2IMPI2020Intel19_1"
PETSc_GNU: "$PETSc3_14_2OMPI4_0GNU10"
# ++++++++++++ commercial FEM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSC2021: "FEM/MSC/2021.2"
# ------------ Defaults ----------------------------------------------
MSC: "$MSC2021"
IntelMarc: "$IntelCompiler19_1"
HDF5Marc: "HDF5/1.12.0/Intel-19.1.2"
PETSc_Intel: "Libraries/PETSc/3.16.1/Intel-19.1.2-IntelMPI-2019"
PETSc_GNU: "Libraries/PETSc/3.16.1/GNU-10-OpenMPI-4.1.1"
# ++++++++++++ MSC Marc +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSC: "FEM/MSC/2021.2"
IntelMarc: "Compiler/Intel/19.1.2 Libraries/IMKL/2020"
HDF5Marc: "HDF5/1.12.1/Intel-19.1.2"
###################################################################################################
checkout:
@ -92,7 +81,7 @@ checkout:
- release
###################################################################################################
processing:
pytest:
stage: python
script:
- cd $DAMASKROOT/python
@ -102,6 +91,15 @@ processing:
- master
- release
mypy:
stage: python
script:
- cd $DAMASKROOT/python
- mypy -m damask
except:
- master
- release
###################################################################################################
compile_grid_Intel:

View File

@ -1,117 +1,117 @@
cmake_minimum_required (VERSION 3.12.0)
include (FindPkgConfig REQUIRED)
cmake_minimum_required(VERSION 3.12.0)
include(FindPkgConfig REQUIRED)
if (DEFINED ENV{PETSC_DIR})
message ("PETSC_DIR:\n$ENV{PETSC_DIR}\n")
else ()
message (FATAL_ERROR "PETSc location (PETSC_DIR) is not defined")
endif ()
if(DEFINED ENV{PETSC_DIR})
message("PETSC_DIR:\n$ENV{PETSC_DIR}\n")
else()
message(FATAL_ERROR "PETSc location (PETSC_DIR) is not defined")
endif()
# Dummy project to determine compiler names and version
project (Prerequisites LANGUAGES)
project(Prerequisites LANGUAGES)
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig")
pkg_check_modules (PETSC REQUIRED PETSc>=3.12.0 PETSc<3.17.0)
pkg_get_variable (CMAKE_Fortran_COMPILER PETSc fcompiler)
pkg_get_variable (CMAKE_C_COMPILER PETSc ccompiler)
pkg_check_modules(PETSC REQUIRED PETSc>=3.12.0 PETSc<3.17.0)
pkg_get_variable(CMAKE_Fortran_COMPILER PETSc fcompiler)
pkg_get_variable(CMAKE_C_COMPILER PETSc ccompiler)
# Solver determines name of project
string(TOUPPER "${DAMASK_SOLVER}" DAMASK_SOLVER)
if (DAMASK_SOLVER STREQUAL "GRID")
project (damask-grid HOMEPAGE_URL https://damask.mpie.de LANGUAGES Fortran C)
elseif (DAMASK_SOLVER STREQUAL "MESH")
project (damask-mesh HOMEPAGE_URL https://damask.mpie.de LANGUAGES Fortran C)
else ()
message (FATAL_ERROR "Invalid solver: DAMASK_SOLVER=${DAMASK_SOLVER}")
endif ()
add_definitions ("-D${DAMASK_SOLVER}")
if(DAMASK_SOLVER STREQUAL "GRID")
project(damask-grid HOMEPAGE_URL https://damask.mpie.de LANGUAGES Fortran C)
elseif(DAMASK_SOLVER STREQUAL "MESH")
project(damask-mesh HOMEPAGE_URL https://damask.mpie.de LANGUAGES Fortran C)
else()
message(FATAL_ERROR "Invalid solver: DAMASK_SOLVER=${DAMASK_SOLVER}")
endif()
add_definitions("-D${DAMASK_SOLVER}")
file (STRINGS ${PROJECT_SOURCE_DIR}/VERSION DAMASK_VERSION)
file(STRINGS ${PROJECT_SOURCE_DIR}/VERSION DAMASK_VERSION)
message ("\nBuilding ${CMAKE_PROJECT_NAME} ${DAMASK_VERSION}\n")
message("\nBuilding ${CMAKE_PROJECT_NAME} ${DAMASK_VERSION}\n")
add_definitions (-DPETSC)
add_definitions (-DDAMASKVERSION="${DAMASK_VERSION}")
add_definitions (-DCMAKE_SYSTEM="${CMAKE_SYSTEM}")
add_definitions(-DPETSC)
add_definitions(-DDAMASKVERSION="${DAMASK_VERSION}")
add_definitions(-DCMAKE_SYSTEM="${CMAKE_SYSTEM}")
if (CMAKE_BUILD_TYPE STREQUAL "")
set (CMAKE_BUILD_TYPE "RELEASE")
endif ()
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "RELEASE")
endif()
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
# Predefined sets for OPTIMIZATION/OPENMP based on BUILD_TYPE
if (CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
set (DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG")
set (PARALLEL "OFF")
set (OPTI "OFF")
elseif (CMAKE_BUILD_TYPE STREQUAL "RELEASE")
set (PARALLEL "ON")
set (OPTI "DEFENSIVE")
elseif (CMAKE_BUILD_TYPE STREQUAL "DEBUGRELEASE")
set (DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG")
set (PARALLEL "ON")
set (OPTI "DEFENSIVE")
elseif (CMAKE_BUILD_TYPE STREQUAL "PERFORMANCE")
set (PARALLEL "ON")
set (OPTI "AGGRESSIVE")
else ()
message (FATAL_ERROR "Invalid build type: CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif ()
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
set(DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG")
set(PARALLEL "OFF")
set(OPTI "OFF")
elseif(CMAKE_BUILD_TYPE STREQUAL "RELEASE")
set(PARALLEL "ON")
set(OPTI "DEFENSIVE")
elseif(CMAKE_BUILD_TYPE STREQUAL "DEBUGRELEASE")
set(DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG")
set(PARALLEL "ON")
set(OPTI "DEFENSIVE")
elseif(CMAKE_BUILD_TYPE STREQUAL "PERFORMANCE")
set(PARALLEL "ON")
set(OPTI "AGGRESSIVE")
else()
message(FATAL_ERROR "Invalid build type: CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
# $OPTIMIZATION takes precedence over $BUILD_TYPE defaults
if (OPTIMIZATION STREQUAL "" OR NOT DEFINED OPTIMIZATION)
set (OPTIMIZATION "${OPTI}")
else ()
set (OPTIMIZATION "${OPTIMIZATION}")
endif ()
if(OPTIMIZATION STREQUAL "" OR NOT DEFINED OPTIMIZATION)
set(OPTIMIZATION "${OPTI}")
else()
set(OPTIMIZATION "${OPTIMIZATION}")
endif()
# $OPENMP takes precedence over $BUILD_TYPE defaults
if (OPENMP STREQUAL "" OR NOT DEFINED OPENMP)
set (OPENMP "${PARALLEL}")
else ()
if(OPENMP STREQUAL "" OR NOT DEFINED OPENMP)
set(OPENMP "${PARALLEL}")
else()
set(OPENMP "${OPENMP}")
endif ()
endif()
# syntax check only (mainly for pre-receive hook)
if (CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
set (BUILDCMD_POST "${BUILDCMD_POST} -fsyntax-only")
endif ()
# syntax check only(mainly for pre-receive hook)
if(CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
set(BUILDCMD_POST "${BUILDCMD_POST} -fsyntax-only")
endif()
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
include (Compiler-Intel)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
include(Compiler-Intel)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
include (Compiler-GNU)
else ()
message (FATAL_ERROR "Compiler type (CMAKE_Fortran_COMPILER_ID) not recognized")
endif ()
include(Compiler-GNU)
else()
message(FATAL_ERROR "Compiler type(CMAKE_Fortran_COMPILER_ID) not recognized")
endif()
file (STRINGS "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/petsc/conf/petscvariables" PETSC_EXTERNAL_LIB REGEX "PETSC_WITH_EXTERNAL_LIB = .*$?")
string (REGEX MATCHALL "-[lLW]([^\" ]+)" PETSC_EXTERNAL_LIB "${PETSC_EXTERNAL_LIB}")
list (REMOVE_DUPLICATES PETSC_EXTERNAL_LIB)
string (REPLACE ";" " " PETSC_EXTERNAL_LIB "${PETSC_EXTERNAL_LIB}")
message ("PETSC_EXTERNAL_LIB:\n${PETSC_EXTERNAL_LIB}\n")
file(STRINGS "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/petsc/conf/petscvariables" PETSC_EXTERNAL_LIB REGEX "PETSC_WITH_EXTERNAL_LIB = .*$?")
string(REGEX MATCHALL "-[lLW]([^\" ]+)" PETSC_EXTERNAL_LIB "${PETSC_EXTERNAL_LIB}")
list(REMOVE_DUPLICATES PETSC_EXTERNAL_LIB)
string(REPLACE ";" " " PETSC_EXTERNAL_LIB "${PETSC_EXTERNAL_LIB}")
message("PETSC_EXTERNAL_LIB:\n${PETSC_EXTERNAL_LIB}\n")
file (STRINGS "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/petsc/conf/petscvariables" PETSC_INCLUDES REGEX "PETSC_FC_INCLUDES = .*$?")
string (REGEX MATCHALL "-I([^\" ]+)" PETSC_INCLUDES "${PETSC_INCLUDES}")
list (REMOVE_DUPLICATES PETSC_INCLUDES)
string (REPLACE ";" " " PETSC_INCLUDES "${PETSC_INCLUDES}")
message ("PETSC_INCLUDES:\n${PETSC_INCLUDES}\n")
file(STRINGS "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/petsc/conf/petscvariables" PETSC_INCLUDES REGEX "PETSC_FC_INCLUDES = .*$?")
string(REGEX MATCHALL "-I([^\" ]+)" PETSC_INCLUDES "${PETSC_INCLUDES}")
list(REMOVE_DUPLICATES PETSC_INCLUDES)
string(REPLACE ";" " " PETSC_INCLUDES "${PETSC_INCLUDES}")
message("PETSC_INCLUDES:\n${PETSC_INCLUDES}\n")
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_Fortran_COMPILER} ${OPENMP_FLAGS} ${OPTIMIZATION_FLAGS} ${LINKER_FLAGS}")
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_Fortran_COMPILER} ${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 ()
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}} ${PETSC_INCLUDES} ${BUILDCMD_POST}")
set (CMAKE_Fortran_LINK_EXECUTABLE "${CMAKE_Fortran_LINK_EXECUTABLE} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB} -lz ${BUILDCMD_POST}")
set(CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE}} ${PETSC_INCLUDES} ${BUILDCMD_POST}")
set(CMAKE_Fortran_LINK_EXECUTABLE "${CMAKE_Fortran_LINK_EXECUTABLE} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB} -lz ${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")
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)
add_subdirectory(src)

@ -1 +1 @@
Subproject commit fabe69749425e8a7aceb3b7c2758b40d97d8b809
Subproject commit 532cfadc1fda4f0f7f6a993e2bd029f14a50668f

View File

@ -24,8 +24,403 @@ phase:
xi_inf_sl: [63.e+6]
material:
- homogenization: SX
constituents:
- phase: Aluminum
- constituents:
- O: [0.31638628373524325, 0.4606971763404367, -0.25136671882289513, 0.7902357900300152]
phase: Aluminum
v: 1.0
O: [0.9330127018922194, 0.25, 0.06698729810778066, 0.25]
homogenization: SX
- constituents:
- O: [0.17926942151539643, -0.8129164299504208, -0.5453207208299451, -0.09825814907531387]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.11156578191572807, -0.4904242197947781, -0.8051447086471791, 0.3142915192646224]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.050875167730042026, -0.4676541613791777, -0.3231762099798638, -0.8211385022980162]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.5736388730744205, 0.030011807121272376, 0.1793738934298104, -0.7986630961094017]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.3524596363123286, 0.8260984090345517, 0.4361208241824434, 0.05596650851705724]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.1475195192105493, -0.2681290123533707, -0.8885681859138441, -0.3417475722928759]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.3878621882257487, -0.4133490094014299, -0.5962575110690821, 0.5684914246189594]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.44765430421636465, 0.1688301032261743, 0.5590033642770855, 0.6772128608407416]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.3154783988579777, -0.893128078628195, 0.126738882437621, 0.294504449369408]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.01177697706652547, -0.8423157700616575, 0.4660610852557732, -0.2704672089677829]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.6023412506865766, 0.33897759335409144, -0.587639839755177, 0.42066450724741294]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.1457746940340264, 0.33010317541439926, 0.7204157567665017, 0.592269169857055]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.10885124011262147, 0.38223867611365064, -0.5398450127934588, -0.7420325896959369]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.3329465044039982, 0.005520408719519113, 0.4218135102429913, 0.843320527954356]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.2773927866814888, 0.282254093261412, -0.9094550709020325, -0.12758268983226237]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.22508894523834683, 0.3481870269276267, -0.6119961977184769, -0.673469683793499]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.7972172843203117, -0.42474780085647684, -0.2632560619322889, 0.3387183979420616]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.1856727896017474, 0.5407410320424911, 0.8064864929236231, 0.15067942194898976]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.35572128347826554, -0.21063165012009927, 0.7164748021511587, -0.561925737380588]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.951689791582057, -0.18424932026485139, 0.24330606914616992, 0.03377699360630425]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.7518830912041409, -0.6350086418080308, 0.03666967302842633, -0.17346808660504054]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.45893176203555247, -0.10107069709110554, -0.8532524342056044, -0.22611199770616278]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.6863555826979106, 0.7132418012703317, -0.12068837363804946, -0.07507638436064179]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.5031196491913161, 0.7534072343296819, -0.418000862383123, 0.0672565008327974]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.5354367280219723, 0.1489275079865293, -0.5066200327507001, 0.6591390218047527]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.7481103019200436, -0.6384221488364733, 0.14256832672505068, -0.11145585785834745]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.02565565294273664, 0.5032076562445432, -0.10524431346049941, -0.8573490984734187]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.09677483527453862, 0.42211465960588607, 0.39550590793620377, -0.8099561236208737]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.5682732488475628, -0.018709507415836685, 0.5596636589678777, 0.6029030252098423]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.520651625785196, 0.5331055583395244, -0.1753591314180096, 0.6434046341634921]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.7323990700263593, 0.5135195038892626, -0.28947480564659256, -0.34072519461542217]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.2379144266672964, 0.9451799147482833, -0.022386636015155, 0.2225544716870999]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.6929401940723844, 0.6921675787458842, 0.04806193711709397, 0.196030560302569]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.114679536930033, -0.02786128070118354, -0.2458076367959361, -0.9621075607955694]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.5536359330028813, 0.3398797644491804, 0.6552731815916284, -0.3854686198548249]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.9501825140749718, -0.17348508997627773, -0.023693401768133945, 0.2578657329207251]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.5269902873788485, -0.38600076480335854, 0.7335400729523406, -0.18762624537269798]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.16353281877366127, -0.8502634877258836, 0.2921682908502614, -0.4061363175656595]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.2506727462997232, 0.38078481221063915, -0.8812340677720474, -0.12487040822466101]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.53797656304294, 0.04453446570800863, -0.73466834243862, -0.41092618023082744]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.5147765687773858, -0.012009003671292302, 0.8506194553313438, -0.10633630744205957]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.45770418863630163, 0.46122438992768267, -0.5413625109006552, 0.5335780820385708]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.12028049877433303, 0.5509971760365859, 0.5424247126754088, 0.6226637493007807]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.1208751835697386, -0.11646202949704858, 0.1842663733100575, -0.9684377570859003]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.24961872240151486, 0.29610154171987574, -0.885460753706652, 0.2568533123457741]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.4494732523235404, 0.8130366919200476, -0.22342614248113637, -0.2950015116798619]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.3566054427707518, 0.6009999195769142, 0.6204413194609187, 0.35592727341468655]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.041340362458678996, -0.7766310224212297, -0.446615292586641, 0.4423460295656439]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.3143906305984617, 0.637462215667549, -0.06250872515926072, -0.7006376483369167]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.15960096982054908, 0.0154505822997579, -0.6938445646590042, 0.7020459600568152]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.10937013835716297, 0.005361991476876583, 0.07892487169799395, -0.9908482661389645]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.5566919673747123, 0.12234937037008195, 0.03295758799282205, 0.8209984667611823]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.03242357741517866, -0.1003019572329824, -0.25727891603352054, -0.9605705535604615]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.07439180141351488, 0.222039714860086, 0.9710557663706901, 0.04706297382800665]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.386406745139845, -0.3485065110202708, 0.0213726326755233, -0.8536839284298527]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.9148730990764601, 0.0859699947503276, -0.2653710064737939, 0.29188114278237975]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.05351534255347124, -0.47484306303499174, -0.4424245873225889, -0.7588943655946909]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.1850990827256794, -0.7850365894615515, 0.5790701003651098, 0.11888524569444774]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.2293488176462691, 0.8155102586104775, 0.36252844203460916, -0.3884781418063178]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.6824605981608404, -0.07237666863890763, 0.6154543161215582, 0.38758887311431783]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.7240310183899645, -0.1492281437355668, -0.5793271457602446, 0.3433512832533411]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.4130306435878869, -0.08991141120131982, -0.8934593257803132, 0.15182904455126872]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.9217038188689652, -0.2551303946186847, 0.2760910380891145, 0.09562578475994342]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.49248590418849286, 0.7555385277692129, 0.01782522408264428, -0.4316264920256593]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.288763491302084, 0.26595000602129804, -0.8721581902166229, 0.29193549223478765]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.18741690177717063, -0.959586229086916, -0.01605960190298382, -0.2093114021302156]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.6141655879532604, 0.44351951295059505, 0.35530824864623534, 0.5475829806066271]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.2814752417920179, 0.7638077896809081, -0.5255180392616715, 0.24738661865884956]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.16603578951305883, -0.6913575628365758, -0.6767106315334661, -0.1911009107226411]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.7317089905438434, -0.4610621713555634, -0.01149547471101715, -0.5018879171322728]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.12911750380868442, -0.775968622433847, -0.5524437669202766, -0.27569412688569794]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.18347252569039887, -0.3000323311682173, -0.9120086722006003, -0.21108911483411225]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.2453327661435727, -0.041601186144862225, -0.967732952958631, 0.039675016391321906]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.9885220121542625, 0.08409037295425872, -0.06115390693360882, -0.1096049284004023]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.3506668690363713, 0.8300197131399097, 0.3314704911076744, -0.2796915019878287]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.43424700094705143, -0.6863040633023977, -0.3990882505417852, -0.4256111407642043]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.09516090822469872, -0.09694359326006573, 0.7244026181255996, -0.6758603318174947]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.6299976256081414, -0.6188326478138776, 0.4105304204739873, 0.22718697056217957]
phase: Aluminum
v: 1.0
homogenization: SX
- constituents:
- O: [0.1624065072613073, -0.6001819140771016, 0.5096769212668724, -0.5946723739521216]
phase: Aluminum
v: 1.0
homogenization: SX

View File

@ -1,5 +1,5 @@
title r-value
$....MARC input file produced by Marc Mentat 2019 (64bit)
title R-Wert
$....MARC input file produced by Marc Mentat 2021.2 (64bit)
$...................................
$....input file using extended precision
extended
@ -7,11 +7,11 @@ $...................................
sizing 0 80 165 0
alloc 25
elements 7
version 14 1 0 1
version 15 1 0 1
table 0 0 2 1 1 0 0 1
processor 1 1 1 0
$no list
large stra 2 1 0 0 0 0 0
large stra 2 1 0 0 0 0 0 0
all points
no echo 1 2 3 4
state vars 2
@ -269,8 +269,6 @@ coordinates
163 3.999999999999999+1 9.999999999999996+0-5.000000000000000-1
164 3.999999999999999+1 9.999999999999996+0 0.000000000000000+0
165 3.999999999999999+1 9.999999999999996+0 5.000000000000000-1
define element set DAMASK_elements
1 to 80
define node set unten_y_nodes
2 5 8 11 14
define node set oben_y_nodes
@ -283,6 +281,166 @@ define node set unten_z_nodes
7 to 9
define node set oben_z_nodes
157 to 159
define element set material0_elements
1
define element set material1_elements
2
define element set material2_elements
3
define element set material3_elements
4
define element set material4_elements
5
define element set material5_elements
6
define element set material6_elements
7
define element set material7_elements
8
define element set material8_elements
9
define element set material9_elements
10
define element set material10_elements
11
define element set material11_elements
12
define element set material12_elements
13
define element set material13_elements
14
define element set material14_elements
15
define element set material15_elements
16
define element set material16_elements
17
define element set material17_elements
18
define element set material18_elements
19
define element set material19_elements
20
define element set material20_elements
21
define element set material21_elements
22
define element set material22_elements
23
define element set material23_elements
24
define element set material24_elements
25
define element set material25_elements
26
define element set material26_elements
27
define element set material27_elements
28
define element set material28_elements
29
define element set material29_elements
30
define element set material30_elements
31
define element set material31_elements
32
define element set material32_elements
33
define element set material33_elements
34
define element set material34_elements
35
define element set material35_elements
36
define element set material36_elements
37
define element set material37_elements
38
define element set material38_elements
39
define element set material39_elements
40
define element set material40_elements
41
define element set material41_elements
42
define element set material42_elements
43
define element set material43_elements
44
define element set material44_elements
45
define element set material45_elements
46
define element set material46_elements
47
define element set material47_elements
48
define element set material48_elements
49
define element set material49_elements
50
define element set material50_elements
51
define element set material51_elements
52
define element set material52_elements
53
define element set material53_elements
54
define element set material54_elements
55
define element set material55_elements
56
define element set material56_elements
57
define element set material57_elements
58
define element set material58_elements
59
define element set material59_elements
60
define element set material60_elements
61
define element set material61_elements
62
define element set material62_elements
63
define element set material63_elements
64
define element set material64_elements
65
define element set material65_elements
66
define element set material66_elements
67
define element set material67_elements
68
define element set material68_elements
69
define element set material69_elements
70
define element set material70_elements
71
define element set material71_elements
72
define element set material72_elements
73
define element set material73_elements
74
define element set material74_elements
75
define element set material75_elements
76
define element set material76_elements
77
define element set material77_elements
78
define element set material78_elements
79
define element set material79_elements
80
hypoelastic
1 0 1 0 1TKS 0
@ -294,13 +452,13 @@ mat color
1 1 230 0 0
table weg_x
1 1 0 0 2
1 2 2 0 0 2 0 0 2 0 0 2
1 2 2 0 0 2 0 0 2 0 0 2 0 0 0 0
0.000000000000000+0 0.000000000000000+0
2.000000000000000+2 1.600000000000000+1
geometry
0 0 2
1 9 1 230 0 0
r-value-sample
r-wert-probe
0.000000000000000+0 0.000000000000000+0 0.000000000000000+0 0.000000000000000+0 0.000000000000000+0 0.000000000000000+0 0.000000000000000+0
usdata 1
@ -344,20 +502,655 @@ unten_fest_nodes
oben_ziehen_nodes
initial state
2 6 1 0 0 0DAMASK
2 6 1 0 0 0material0
0.000000000000000+0
0
1
DAMASK_elements
loadcase r-value
5
DAMASK
material0_elements
initial state
2 6 1 0 0 0material1
1.000000000000000+0
0
1
material1_elements
initial state
2 6 1 0 0 0material2
2.000000000000000+0
0
1
material2_elements
initial state
2 6 1 0 0 0material3
3.000000000000000+0
0
1
material3_elements
initial state
2 6 1 0 0 0material4
4.000000000000000+0
0
1
material4_elements
initial state
2 6 1 0 0 0material5
5.000000000000000+0
0
1
material5_elements
initial state
2 6 1 0 0 0material6
6.000000000000000+0
0
1
material6_elements
initial state
2 6 1 0 0 0material7
7.000000000000000+0
0
1
material7_elements
initial state
2 6 1 0 0 0material8
8.000000000000000+0
0
1
material8_elements
initial state
2 6 1 0 0 0material9
9.000000000000000+0
0
1
material9_elements
initial state
2 6 1 0 0 0material10
10.000000000000000+0
0
1
material10_elements
initial state
2 6 1 0 0 0material11
11.000000000000000+0
0
1
material11_elements
initial state
2 6 1 0 0 0material12
12.000000000000000+0
0
1
material12_elements
initial state
2 6 1 0 0 0material13
13.000000000000000+0
0
1
material13_elements
initial state
2 6 1 0 0 0material14
14.000000000000000+0
0
1
material14_elements
initial state
2 6 1 0 0 0material15
15.000000000000000+0
0
1
material15_elements
initial state
2 6 1 0 0 0material16
16.000000000000000+0
0
1
material16_elements
initial state
2 6 1 0 0 0material17
17.000000000000000+0
0
1
material17_elements
initial state
2 6 1 0 0 0material18
18.000000000000000+0
0
1
material18_elements
initial state
2 6 1 0 0 0material19
19.000000000000000+0
0
1
material19_elements
initial state
2 6 1 0 0 0material20
20.000000000000000+0
0
1
material20_elements
initial state
2 6 1 0 0 0material21
21.000000000000000+0
0
1
material21_elements
initial state
2 6 1 0 0 0material22
22.000000000000000+0
0
1
material22_elements
initial state
2 6 1 0 0 0material23
23.000000000000000+0
0
1
material23_elements
initial state
2 6 1 0 0 0material24
24.000000000000000+0
0
1
material24_elements
initial state
2 6 1 0 0 0material25
25.000000000000000+0
0
1
material25_elements
initial state
2 6 1 0 0 0material26
26.000000000000000+0
0
1
material26_elements
initial state
2 6 1 0 0 0material27
27.000000000000000+0
0
1
material27_elements
initial state
2 6 1 0 0 0material28
28.000000000000000+0
0
1
material28_elements
initial state
2 6 1 0 0 0material29
29.000000000000000+0
0
1
material29_elements
initial state
2 6 1 0 0 0material30
30.000000000000000+0
0
1
material30_elements
initial state
2 6 1 0 0 0material31
31.000000000000000+0
0
1
material31_elements
initial state
2 6 1 0 0 0material32
32.000000000000000+0
0
1
material32_elements
initial state
2 6 1 0 0 0material33
33.000000000000000+0
0
1
material33_elements
initial state
2 6 1 0 0 0material34
34.000000000000000+0
0
1
material34_elements
initial state
2 6 1 0 0 0material35
35.000000000000000+0
0
1
material35_elements
initial state
2 6 1 0 0 0material36
36.000000000000000+0
0
1
material36_elements
initial state
2 6 1 0 0 0material37
37.000000000000000+0
0
1
material37_elements
initial state
2 6 1 0 0 0material38
38.000000000000000+0
0
1
material38_elements
initial state
2 6 1 0 0 0material39
39.000000000000000+0
0
1
material39_elements
initial state
2 6 1 0 0 0material40
40.000000000000000+0
0
1
material40_elements
initial state
2 6 1 0 0 0material41
41.000000000000000+0
0
1
material41_elements
initial state
2 6 1 0 0 0material42
42.000000000000000+0
0
1
material42_elements
initial state
2 6 1 0 0 0material43
43.000000000000000+0
0
1
material43_elements
initial state
2 6 1 0 0 0material44
44.000000000000000+0
0
1
material44_elements
initial state
2 6 1 0 0 0material45
45.000000000000000+0
0
1
material45_elements
initial state
2 6 1 0 0 0material46
46.000000000000000+0
0
1
material46_elements
initial state
2 6 1 0 0 0material47
47.000000000000000+0
0
1
material47_elements
initial state
2 6 1 0 0 0material48
48.000000000000000+0
0
1
material48_elements
initial state
2 6 1 0 0 0material49
49.000000000000000+0
0
1
material49_elements
initial state
2 6 1 0 0 0material50
50.000000000000000+0
0
1
material50_elements
initial state
2 6 1 0 0 0material51
51.000000000000000+0
0
1
material51_elements
initial state
2 6 1 0 0 0material52
52.000000000000000+0
0
1
material52_elements
initial state
2 6 1 0 0 0material53
53.000000000000000+0
0
1
material53_elements
initial state
2 6 1 0 0 0material54
54.000000000000000+0
0
1
material54_elements
initial state
2 6 1 0 0 0material55
55.000000000000000+0
0
1
material55_elements
initial state
2 6 1 0 0 0material56
56.000000000000000+0
0
1
material56_elements
initial state
2 6 1 0 0 0material57
57.000000000000000+0
0
1
material57_elements
initial state
2 6 1 0 0 0material58
58.000000000000000+0
0
1
material58_elements
initial state
2 6 1 0 0 0material59
59.000000000000000+0
0
1
material59_elements
initial state
2 6 1 0 0 0material60
60.000000000000000+0
0
1
material60_elements
initial state
2 6 1 0 0 0material61
61.000000000000000+0
0
1
material61_elements
initial state
2 6 1 0 0 0material62
62.000000000000000+0
0
1
material62_elements
initial state
2 6 1 0 0 0material63
63.000000000000000+0
0
1
material63_elements
initial state
2 6 1 0 0 0material64
64.000000000000000+0
0
1
material64_elements
initial state
2 6 1 0 0 0material65
65.000000000000000+0
0
1
material65_elements
initial state
2 6 1 0 0 0material66
66.000000000000000+0
0
1
material66_elements
initial state
2 6 1 0 0 0material67
67.000000000000000+0
0
1
material67_elements
initial state
2 6 1 0 0 0material68
68.000000000000000+0
0
1
material68_elements
initial state
2 6 1 0 0 0material69
69.000000000000000+0
0
1
material69_elements
initial state
2 6 1 0 0 0material70
70.000000000000000+0
0
1
material70_elements
initial state
2 6 1 0 0 0material71
71.000000000000000+0
0
1
material71_elements
initial state
2 6 1 0 0 0material72
72.000000000000000+0
0
1
material72_elements
initial state
2 6 1 0 0 0material73
73.000000000000000+0
0
1
material73_elements
initial state
2 6 1 0 0 0material74
74.000000000000000+0
0
1
material74_elements
initial state
2 6 1 0 0 0material75
75.000000000000000+0
0
1
material75_elements
initial state
2 6 1 0 0 0material76
76.000000000000000+0
0
1
material76_elements
initial state
2 6 1 0 0 0material77
77.000000000000000+0
0
1
material77_elements
initial state
2 6 1 0 0 0material78
78.000000000000000+0
0
1
material78_elements
initial state
2 6 1 0 0 0material79
79.000000000000000+0
0
1
material79_elements
loadcase R-Wert
83
material0
material1
material2
material3
material4
material5
material6
material7
material8
material9
material10
material11
material12
material13
material14
material15
material16
material17
material18
material19
material20
material21
material22
material23
material24
material25
material26
material27
material28
material29
material30
material31
material32
material33
material34
material35
material36
material37
material38
material39
material40
material41
material42
material43
material44
material45
material46
material47
material48
material49
material50
material51
material52
material53
material54
material55
material56
material57
material58
material59
material60
material61
material62
material63
material64
material65
material66
material67
material68
material69
material70
material71
material72
material73
material74
material75
material76
material77
material78
material79
unten_z
unten_y
unten_fest
no print
post
6 16 17 0 0 19 20 0 1 0 0 0 0 0 0 0
3 16 17 0 0 19 20 0 1 0 0 0 0 0 0 0
17 0
301 0
311 0
parameters
1.000000000000000+0 1.000000000000000+9 1.000000000000000+2 1.000000000000000+6 2.500000000000000-1 5.000000000000000-1 1.500000000000000+0-5.000000000000000-1
8.625000000000000+0 2.000000000000000+1 1.000000000000000-4 1.000000000000000-6 1.000000000000000+0 1.000000000000000-4
@ -367,9 +1160,9 @@ parameters
3.000000000000000+0 4.000000000000000-1
end option
$...................
$....start of loadcase Tensile
title Tensile
loadcase Tensile
$....start of loadcase Ziehen
title Ziehen
loadcase Ziehen
6
unten_z
unten_y
@ -392,5 +1185,5 @@ auto load
time step
2.000000000000000+0
continue
$....end of loadcase Tensile
$....end of loadcase Ziehen
$...................

View File

@ -1,26 +0,0 @@
type: dislotungsten
N_sl: [12]
rho_mob_0: [1.0e+9]
rho_dip_0: [1.0]
nu_a: [9.1e+11]
b_sl: [2.72e-10]
Delta_H_kp,0: [2.61154e-19] # 1.63 eV, Delta_H0
tau_Peierls: [2.03e+9]
p_sl: [0.86]
q_sl: [1.69]
h: [2.566e-10]
w: [2.992e-09]
B: [8.3e-5]
D_a: 1.0 # d_edge
# climb (disabled)
D_0: 0.0
Q_cl: 0.0
V_cl: [0.0]
h_sl-sl: [0.009, 0.72, 0.009, 0.05, 0.05, 0.06, 0.09]
a_nonSchmid: [0.938, 0.71, 4.43]

View File

@ -1,4 +1,4 @@
references:
- https://en.wikipedia.org/wiki/Tungsten
lattice: cF
lattice: cI
rho: 19300.0

View File

@ -0,0 +1,35 @@
type: dislotungsten
references:
- D. Cereceda et al.,
International Journal of Plasticity 78:242-265, 2016,
http://dx.doi.org/10.1016/j.ijplas.2015.09.002
- R. Gröger et al.,
Acta Materialia 56(19):5412-5425, 2008,
https://doi.org/10.1016/j.actamat.2008.07.037
output: [Lambda_sl]
N_sl: [12]
b_sl: [2.72e-10]
rho_mob_0: [1.0e+9] # estimated from section 3.2
rho_dip_0: [1.0] # not given
Q_s: [2.61154e-19] # 1.63 eV, Delta_H0
B: [8.3e-5]
omega: [9.1e+11] # nu_0
p_sl: [0.86]
q_sl: [1.69]
tau_Peierls: [2.03e+9]
h: [2.566e-10]
h_sl-sl: [0.009, 0.72, 0.009, 0.05, 0.05, 0.06, 0.09]
w: [2.992e-09] # 11b
# values in Cereceda et al. are high, using parameters from Gröger et al.
a_nonSchmid: [0.0, 0.56, 0.75] # Table 2
# (almost) no annhilation, adjustment needed for simulations beyond the yield point
i_sl: [1] # c, eq. (25)
D: 1.0e+20 # d_g, eq. (25)
D_a: 1.0 # d_edge = D_a*b
# disable climb (not discussed in Cereceda et al.)
D_0: 0.0
f_at: 1
Q_cl: 1.0

View File

@ -1 +1 @@
v3.0.0-alpha5-7-gee537ff5e
v3.0.0-alpha5-72-g8138d3a18

View File

@ -14,8 +14,8 @@ from . import tensor # noqa
from . import mechanics # noqa
from . import solver # noqa
from . import grid_filters # noqa
#Modules that contain only one class (of the same name), are prefixed by a '_'.
#For example, '_colormap' containsa class called 'Colormap' which is imported as 'damask.Colormap'.
# Modules that contain only one class (of the same name), are prefixed by a '_'.
# For example, '_colormap' contains a class called 'Colormap' which is imported as 'damask.Colormap'.
from ._rotation import Rotation # noqa
from ._crystal import Crystal # noqa
from ._orientation import Orientation # noqa

View File

@ -9,27 +9,6 @@ from . import util
from . import tensor
lattice_symmetries = {
'aP': 'triclinic',
'mP': 'monoclinic',
'mS': 'monoclinic',
'oP': 'orthorhombic',
'oS': 'orthorhombic',
'oI': 'orthorhombic',
'oF': 'orthorhombic',
'tP': 'tetragonal',
'tI': 'tetragonal',
'hP': 'hexagonal',
'cP': 'cubic',
'cI': 'cubic',
'cF': 'cubic',
}
_parameter_doc = \
"""
family : {'triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic'}, optional.
@ -146,7 +125,7 @@ class Orientation(Rotation,Crystal):
"""Create deep copy."""
dup = copy.deepcopy(self)
if rotation is not None:
dup.quaternion = Orientation(rotation,family='cubic').quaternion
dup.quaternion = Rotation(rotation).quaternion
return dup
copy = __copy__

View File

@ -1,3 +1,5 @@
import copy
import numpy as np
from . import tensor
@ -85,9 +87,12 @@ class Rotation:
+ str(self.quaternion)
def __copy__(self,**kwargs):
def __copy__(self,rotation=None):
"""Create deep copy."""
return self.__class__(rotation=kwargs['rotation'] if 'rotation' in kwargs else self.quaternion)
dup = copy.deepcopy(self)
if rotation is not None:
dup.quaternion = Rotation(rotation).quaternion
return dup
copy = __copy__

View File

@ -11,10 +11,14 @@ the following operations are required for tensorial data:
- D1 = D3.reshape(cells+(-1,)).reshape(-1,9,order='F')
"""
from typing import Sequence, Tuple, Union
from scipy import spatial as _spatial
import numpy as _np
def _ks(size,cells,first_order=False):
def _ks(size: _np.ndarray, cells: Union[_np.ndarray,Sequence[int]], first_order: bool = False) -> _np.ndarray:
"""
Get wave numbers operator.
@ -41,7 +45,7 @@ def _ks(size,cells,first_order=False):
return _np.stack(_np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij'), axis=-1)
def curl(size,f):
def curl(size: _np.ndarray, f: _np.ndarray) -> _np.ndarray:
u"""
Calculate curl of a vector or tensor field in Fourier space.
@ -72,7 +76,7 @@ def curl(size,f):
return _np.fft.irfftn(curl_,axes=(0,1,2),s=f.shape[:3])
def divergence(size,f):
def divergence(size: _np.ndarray, f: _np.ndarray) -> _np.ndarray:
u"""
Calculate divergence of a vector or tensor field in Fourier space.
@ -99,7 +103,7 @@ def divergence(size,f):
return _np.fft.irfftn(div_,axes=(0,1,2),s=f.shape[:3])
def gradient(size,f):
def gradient(size: _np.ndarray, f: _np.ndarray) -> _np.ndarray:
u"""
Calculate gradient of a scalar or vector fieldin Fourier space.
@ -126,7 +130,9 @@ def gradient(size,f):
return _np.fft.irfftn(grad_,axes=(0,1,2),s=f.shape[:3])
def coordinates0_point(cells,size,origin=_np.zeros(3)):
def coordinates0_point(cells: Union[ _np.ndarray,Sequence[int]],
size: _np.ndarray,
origin: _np.ndarray = _np.zeros(3)) -> _np.ndarray:
"""
Cell center positions (undeformed).
@ -145,8 +151,8 @@ def coordinates0_point(cells,size,origin=_np.zeros(3)):
Undeformed cell center coordinates.
"""
start = origin + size/cells*.5
end = origin + size - size/cells*.5
start = origin + size/_np.array(cells)*.5
end = origin + size - size/_np.array(cells)*.5
return _np.stack(_np.meshgrid(_np.linspace(start[0],end[0],cells[0]),
_np.linspace(start[1],end[1],cells[1]),
@ -154,7 +160,7 @@ def coordinates0_point(cells,size,origin=_np.zeros(3)):
axis = -1)
def displacement_fluct_point(size,F):
def displacement_fluct_point(size: _np.ndarray, F: _np.ndarray) -> _np.ndarray:
"""
Cell center displacement field from fluctuation part of the deformation gradient field.
@ -186,7 +192,7 @@ def displacement_fluct_point(size,F):
return _np.fft.irfftn(displacement,axes=(0,1,2),s=F.shape[:3])
def displacement_avg_point(size,F):
def displacement_avg_point(size: _np.ndarray, F: _np.ndarray) -> _np.ndarray:
"""
Cell center displacement field from average part of the deformation gradient field.
@ -207,7 +213,7 @@ def displacement_avg_point(size,F):
return _np.einsum('ml,ijkl->ijkm',F_avg - _np.eye(3),coordinates0_point(F.shape[:3],size))
def displacement_point(size,F):
def displacement_point(size: _np.ndarray, F: _np.ndarray) -> _np.ndarray:
"""
Cell center displacement field from deformation gradient field.
@ -227,7 +233,7 @@ def displacement_point(size,F):
return displacement_avg_point(size,F) + displacement_fluct_point(size,F)
def coordinates_point(size,F,origin=_np.zeros(3)):
def coordinates_point(size: _np.ndarray, F: _np.ndarray, origin: _np.ndarray = _np.zeros(3)) -> _np.ndarray:
"""
Cell center positions.
@ -249,7 +255,8 @@ def coordinates_point(size,F,origin=_np.zeros(3)):
return coordinates0_point(F.shape[:3],size,origin) + displacement_point(size,F)
def cellsSizeOrigin_coordinates0_point(coordinates0,ordered=True):
def cellsSizeOrigin_coordinates0_point(coordinates0: _np.ndarray,
ordered: bool = True) -> Tuple[_np.ndarray,_np.ndarray,_np.ndarray]:
"""
Return grid 'DNA', i.e. cells, size, and origin from 1D array of point positions.
@ -292,13 +299,15 @@ def cellsSizeOrigin_coordinates0_point(coordinates0,ordered=True):
raise ValueError('Regular cell spacing violated.')
if ordered and not _np.allclose(coordinates0.reshape(tuple(cells)+(3,),order='F'),
coordinates0_point(cells,size,origin),atol=atol):
coordinates0_point(list(cells),size,origin),atol=atol):
raise ValueError('Input data is not ordered (x fast, z slow).')
return (cells,size,origin)
def coordinates0_node(cells,size,origin=_np.zeros(3)):
def coordinates0_node(cells: Union[_np.ndarray,Sequence[int]],
size: _np.ndarray,
origin: _np.ndarray = _np.zeros(3)) -> _np.ndarray:
"""
Nodal positions (undeformed).
@ -323,7 +332,7 @@ def coordinates0_node(cells,size,origin=_np.zeros(3)):
axis = -1)
def displacement_fluct_node(size,F):
def displacement_fluct_node(size: _np.ndarray, F: _np.ndarray) -> _np.ndarray:
"""
Nodal displacement field from fluctuation part of the deformation gradient field.
@ -343,7 +352,7 @@ def displacement_fluct_node(size,F):
return point_to_node(displacement_fluct_point(size,F))
def displacement_avg_node(size,F):
def displacement_avg_node(size: _np.ndarray, F: _np.ndarray) -> _np.ndarray:
"""
Nodal displacement field from average part of the deformation gradient field.
@ -364,7 +373,7 @@ def displacement_avg_node(size,F):
return _np.einsum('ml,ijkl->ijkm',F_avg - _np.eye(3),coordinates0_node(F.shape[:3],size))
def displacement_node(size,F):
def displacement_node(size: _np.ndarray, F: _np.ndarray) -> _np.ndarray:
"""
Nodal displacement field from deformation gradient field.
@ -384,7 +393,7 @@ def displacement_node(size,F):
return displacement_avg_node(size,F) + displacement_fluct_node(size,F)
def coordinates_node(size,F,origin=_np.zeros(3)):
def coordinates_node(size: _np.ndarray, F: _np.ndarray, origin: _np.ndarray = _np.zeros(3)) -> _np.ndarray:
"""
Nodal positions.
@ -406,7 +415,8 @@ def coordinates_node(size,F,origin=_np.zeros(3)):
return coordinates0_node(F.shape[:3],size,origin) + displacement_node(size,F)
def cellsSizeOrigin_coordinates0_node(coordinates0,ordered=True):
def cellsSizeOrigin_coordinates0_node(coordinates0: _np.ndarray,
ordered: bool = True) -> Tuple[_np.ndarray,_np.ndarray,_np.ndarray]:
"""
Return grid 'DNA', i.e. cells, size, and origin from 1D array of nodal positions.
@ -441,13 +451,13 @@ def cellsSizeOrigin_coordinates0_node(coordinates0,ordered=True):
raise ValueError('Regular cell spacing violated.')
if ordered and not _np.allclose(coordinates0.reshape(tuple(cells+1)+(3,),order='F'),
coordinates0_node(cells,size,origin),atol=atol):
coordinates0_node(list(cells),size,origin),atol=atol):
raise ValueError('Input data is not ordered (x fast, z slow).')
return (cells,size,origin)
def point_to_node(cell_data):
def point_to_node(cell_data: _np.ndarray) -> _np.ndarray:
"""
Interpolate periodic point data to nodal data.
@ -469,7 +479,7 @@ def point_to_node(cell_data):
return _np.pad(n,((0,1),(0,1),(0,1))+((0,0),)*len(cell_data.shape[3:]),mode='wrap')
def node_to_point(node_data):
def node_to_point(node_data: _np.ndarray) -> _np.ndarray:
"""
Interpolate periodic nodal data to point data.
@ -491,7 +501,7 @@ def node_to_point(node_data):
return c[1:,1:,1:]
def coordinates0_valid(coordinates0):
def coordinates0_valid(coordinates0: _np.ndarray) -> bool:
"""
Check whether coordinates form a regular grid.
@ -513,7 +523,7 @@ def coordinates0_valid(coordinates0):
return False
def regrid(size,F,cells):
def regrid(size: _np.ndarray, F: _np.ndarray, cells: Union[_np.ndarray,Sequence[int]]) -> _np.ndarray:
"""
Return mapping from coordinates in deformed configuration to a regular grid.

View File

@ -5,13 +5,15 @@ All routines operate on numpy.ndarrays of shape (...,3,3).
"""
from . import tensor as _tensor
from . import _rotation
from typing import Sequence
import numpy as _np
from . import tensor as _tensor
from . import _rotation
def deformation_Cauchy_Green_left(F):
def deformation_Cauchy_Green_left(F: _np.ndarray) -> _np.ndarray:
"""
Calculate left Cauchy-Green deformation tensor (Finger deformation tensor).
@ -29,7 +31,7 @@ def deformation_Cauchy_Green_left(F):
return _np.matmul(F,_tensor.transpose(F))
def deformation_Cauchy_Green_right(F):
def deformation_Cauchy_Green_right(F: _np.ndarray) -> _np.ndarray:
"""
Calculate right Cauchy-Green deformation tensor.
@ -47,7 +49,7 @@ def deformation_Cauchy_Green_right(F):
return _np.matmul(_tensor.transpose(F),F)
def equivalent_strain_Mises(epsilon):
def equivalent_strain_Mises(epsilon: _np.ndarray) -> _np.ndarray:
"""
Calculate the Mises equivalent of a strain tensor.
@ -65,7 +67,7 @@ def equivalent_strain_Mises(epsilon):
return _equivalent_Mises(epsilon,2.0/3.0)
def equivalent_stress_Mises(sigma):
def equivalent_stress_Mises(sigma: _np.ndarray) -> _np.ndarray:
"""
Calculate the Mises equivalent of a stress tensor.
@ -83,7 +85,7 @@ def equivalent_stress_Mises(sigma):
return _equivalent_Mises(sigma,3.0/2.0)
def maximum_shear(T_sym):
def maximum_shear(T_sym: _np.ndarray) -> _np.ndarray:
"""
Calculate the maximum shear component of a symmetric tensor.
@ -102,7 +104,7 @@ def maximum_shear(T_sym):
return (w[...,0] - w[...,2])*0.5
def rotation(T):
def rotation(T: _np.ndarray) -> _rotation.Rotation:
"""
Calculate the rotational part of a tensor.
@ -120,7 +122,7 @@ def rotation(T):
return _rotation.Rotation.from_matrix(_polar_decomposition(T,'R')[0])
def strain(F,t,m):
def strain(F: _np.ndarray, t: str, m: float) -> _np.ndarray:
"""
Calculate strain tensor (SethHill family).
@ -160,7 +162,7 @@ def strain(F,t,m):
return eps
def stress_Cauchy(P,F):
def stress_Cauchy(P: _np.ndarray, F: _np.ndarray) -> _np.ndarray:
"""
Calculate the Cauchy stress (true stress).
@ -182,7 +184,7 @@ def stress_Cauchy(P,F):
return _tensor.symmetric(_np.einsum('...,...ij,...kj',1.0/_np.linalg.det(F),P,F))
def stress_second_Piola_Kirchhoff(P,F):
def stress_second_Piola_Kirchhoff(P: _np.ndarray, F: _np.ndarray) -> _np.ndarray:
"""
Calculate the second Piola-Kirchhoff stress.
@ -205,7 +207,7 @@ def stress_second_Piola_Kirchhoff(P,F):
return _tensor.symmetric(_np.einsum('...ij,...jk',_np.linalg.inv(F),P))
def stretch_left(T):
def stretch_left(T: _np.ndarray) -> _np.ndarray:
"""
Calculate left stretch of a tensor.
@ -223,7 +225,7 @@ def stretch_left(T):
return _polar_decomposition(T,'V')[0]
def stretch_right(T):
def stretch_right(T: _np.ndarray) -> _np.ndarray:
"""
Calculate right stretch of a tensor.
@ -241,7 +243,7 @@ def stretch_right(T):
return _polar_decomposition(T,'U')[0]
def _polar_decomposition(T,requested):
def _polar_decomposition(T: _np.ndarray, requested: Sequence[str]) -> tuple:
"""
Perform singular value decomposition.
@ -257,21 +259,21 @@ def _polar_decomposition(T,requested):
u, _, vh = _np.linalg.svd(T)
R = _np.einsum('...ij,...jk',u,vh)
output = ()
output = []
if 'R' in requested:
output+=(R,)
output+=[R]
if 'V' in requested:
output+=(_np.einsum('...ij,...kj',T,R),)
output+=[_np.einsum('...ij,...kj',T,R)]
if 'U' in requested:
output+=(_np.einsum('...ji,...jk',R,T),)
output+=[_np.einsum('...ji,...jk',R,T)]
if len(output) == 0:
raise ValueError('output needs to be out of V, R, U')
return output
return tuple(output)
def _equivalent_Mises(T_sym,s):
def _equivalent_Mises(T_sym: _np.ndarray, s: float) -> _np.ndarray:
"""
Base equation for Mises equivalent of a stress or strain tensor.

View File

@ -1,5 +1,7 @@
"""Functionality for generation of seed points for Voronoi or Laguerre tessellation."""
from typing import Sequence,Tuple
from scipy import spatial as _spatial
import numpy as _np
@ -7,7 +9,7 @@ from . import util as _util
from . import grid_filters as _grid_filters
def from_random(size,N_seeds,cells=None,rng_seed=None):
def from_random(size: _np.ndarray, N_seeds: int, cells: _np.ndarray = None, rng_seed=None) -> _np.ndarray:
"""
Place seeds randomly in space.
@ -41,7 +43,8 @@ def from_random(size,N_seeds,cells=None,rng_seed=None):
return coords
def from_Poisson_disc(size,N_seeds,N_candidates,distance,periodic=True,rng_seed=None):
def from_Poisson_disc(size: _np.ndarray, N_seeds: int, N_candidates: int, distance: float,
periodic: bool = True, rng_seed=None) -> _np.ndarray:
"""
Place seeds according to a Poisson disc distribution.
@ -75,18 +78,17 @@ def from_Poisson_disc(size,N_seeds,N_candidates,distance,periodic=True,rng_seed=
i = 0
progress = _util._ProgressBar(N_seeds+1,'',50)
while s < N_seeds:
i += 1
candidates = rng.random((N_candidates,3))*_np.broadcast_to(size,(N_candidates,3))
tree = _spatial.cKDTree(coords[:s],boxsize=size) if periodic else \
_spatial.cKDTree(coords[:s])
distances = tree.query(candidates)[0]
best = distances.argmax()
if distances[best] > distance: # require minimum separation
i = 0
coords[s] = candidates[best] # maximum separation to existing point cloud
s += 1
progress.update(s)
i = 0
else:
i += 1
if i == 100:
raise ValueError('Seeding not possible')
@ -94,22 +96,23 @@ def from_Poisson_disc(size,N_seeds,N_candidates,distance,periodic=True,rng_seed=
return coords
def from_grid(grid,selection=None,invert=False,average=False,periodic=True):
def from_grid(grid, selection: Sequence[int] = None,
invert: bool = False, average: bool = False, periodic: bool = True) -> Tuple[_np.ndarray, _np.ndarray]:
"""
Create seeds from grid description.
Parameters
----------
grid : damask.Grid
Grid, from which the material IDs are used as seeds.
Grid from which the material IDs are used as seeds.
selection : iterable of integers, optional
Material IDs to consider.
invert : boolean, false
Do not consider the material IDs given in selection. Defaults to False.
Consider all material IDs except those in selection. Defaults to False.
average : boolean, optional
Seed corresponds to center of gravity of material ID cloud.
periodic : boolean, optional
Center of gravity with periodic boundaries.
Center of gravity accounts for periodic boundaries.
Returns
-------

View File

@ -8,7 +8,7 @@ All routines operate on numpy.ndarrays of shape (...,3,3).
import numpy as _np
def deviatoric(T):
def deviatoric(T: _np.ndarray) -> _np.ndarray:
"""
Calculate deviatoric part of a tensor.
@ -26,7 +26,7 @@ def deviatoric(T):
return T - spherical(T,tensor=True)
def eigenvalues(T_sym):
def eigenvalues(T_sym: _np.ndarray) -> _np.ndarray:
"""
Eigenvalues, i.e. principal components, of a symmetric tensor.
@ -45,7 +45,7 @@ def eigenvalues(T_sym):
return _np.linalg.eigvalsh(symmetric(T_sym))
def eigenvectors(T_sym,RHS=False):
def eigenvectors(T_sym: _np.ndarray, RHS: bool = False) -> _np.ndarray:
"""
Eigenvectors of a symmetric tensor.
@ -70,7 +70,7 @@ def eigenvectors(T_sym,RHS=False):
return v
def spherical(T,tensor=True):
def spherical(T: _np.ndarray, tensor: bool = True) -> _np.ndarray:
"""
Calculate spherical part of a tensor.
@ -92,7 +92,7 @@ def spherical(T,tensor=True):
return _np.einsum('...jk,...',_np.eye(3),sph) if tensor else sph
def symmetric(T):
def symmetric(T: _np.ndarray) -> _np.ndarray:
"""
Symmetrize tensor.
@ -110,7 +110,7 @@ def symmetric(T):
return (T+transpose(T))*0.5
def transpose(T):
def transpose(T: _np.ndarray) -> _np.ndarray:
"""
Transpose tensor.

14
python/mypy.ini Normal file
View File

@ -0,0 +1,14 @@
[mypy-scipy.*]
ignore_missing_imports = True
[mypy-h5py.*]
ignore_missing_imports = True
[mypy-vtk.*]
ignore_missing_imports = True
[mypy-PIL.*]
ignore_missing_imports = True
[mypy-matplotlib.*]
ignore_missing_imports = True
[mypy-pandas.*]
ignore_missing_imports = True
[mypy-wx.*]
ignore_missing_imports = True

View File

@ -7,9 +7,9 @@ from damask import Orientation
from damask import Table
from damask import util
from damask import grid_filters
from damask import _orientation
from damask import _crystal
crystal_families = set(_orientation.lattice_symmetries.values())
crystal_families = set(_crystal.lattice_symmetries.values())
@pytest.fixture

View File

@ -1,5 +1,5 @@
# special flags for some files
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
# long lines for interaction matrix
SET_SOURCE_FILES_PROPERTIES("lattice.f90" PROPERTIES COMPILE_FLAGS "-ffree-line-length-240")
endif()
@ -12,25 +12,24 @@ list(FILTER damask-sources EXCLUDE REGEX ".*DAMASK_Marc.*.f90")
list(FILTER damask-sources EXCLUDE REGEX ".*commercialFEM_fileList.*.f90")
if (PROJECT_NAME STREQUAL "damask-grid")
if(PROJECT_NAME STREQUAL "damask-grid")
set(executable-name "DAMASK_grid")
file(GLOB solver-sources CONFIGURE_DEPENDS grid/*.f90)
elseif(PROJECT_NAME STREQUAL "damask-mesh")
set(executable-name "DAMASK_mesh")
file(GLOB solver-sources CONFIGURE_DEPENDS mesh/*.f90)
endif()
file(GLOB grid-sources CONFIGURE_DEPENDS grid/*.f90)
if(NOT CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
add_executable(${executable-name} ${damask-sources} ${solver-sources})
install(TARGETS ${executable-name} RUNTIME DESTINATION bin)
else()
add_library(${executable-name} OBJECT ${damask-sources} ${solver-sources})
exec_program(mktemp OUTPUT_VARIABLE nothing)
exec_program(mktemp ARGS -d OUTPUT_VARIABLE black_hole)
install(PROGRAMS ${nothing} DESTINATION ${black_hole})
endif()
if (NOT CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
add_executable(DAMASK_grid ${damask-sources} ${grid-sources})
install (TARGETS DAMASK_grid RUNTIME DESTINATION bin)
else ()
add_library(DAMASK_grid OBJECT ${damask-sources} ${grid-sources})
exec_program (mktemp OUTPUT_VARIABLE nothing)
exec_program (mktemp ARGS -d OUTPUT_VARIABLE black_hole)
install (PROGRAMS ${nothing} DESTINATION ${black_hole})
endif ()
elseif (PROJECT_NAME STREQUAL "damask-mesh")
file(GLOB mesh-sources CONFIGURE_DEPENDS mesh/*.f90)
add_executable(DAMASK_mesh ${damask-sources} ${mesh-sources})
install (TARGETS DAMASK_mesh RUNTIME DESTINATION bin)
endif ()
string(REPLACE ";" "\n" sources "${damask-sources};${solver-sources}")
message(${CMAKE_BINARY_DIR})
file(WRITE ${CMAKE_BINARY_DIR}/sources.txt ${sources})

View File

@ -432,7 +432,7 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg)
msg = 'Nconstituents mismatch between homogenization and material'
!--------------------------------------------------------------------------------------------------
! material error messages and related messages in mesh
! material error messages and related messages in geometry
case (150)
msg = 'index out of bounds'
case (153)
@ -499,6 +499,11 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg)
case (710)
msg = 'Closing quotation mark missing in string'
!-------------------------------------------------------------------------------------------------
! errors related to the mesh solver
case (821)
msg = 'order not supported'
!-------------------------------------------------------------------------------------------------
! errors related to the grid solver
case (831)

View File

@ -75,7 +75,7 @@ subroutine discretization_grid_init(restart)
print'(/,a)', ' <<<+- discretization_grid init -+>>>'; flush(IO_STDOUT)
if(worldrank == 0) then
if (worldrank == 0) then
fileContent = IO_read(interface_geomFile)
call readVTI(grid,geomSize,origin,materialAt_global,fileContent)
fname = interface_geomFile
@ -85,7 +85,7 @@ subroutine discretization_grid_init(restart)
call results_closeJobFile
else
allocate(materialAt_global(0)) ! needed for IntelMPI
endif
end if
call MPI_Bcast(grid,3,MPI_INTEGER,0,MPI_COMM_WORLD, ierr)
@ -100,7 +100,7 @@ subroutine discretization_grid_init(restart)
print'(a,3(es12.5))', ' size x y z: ', geomSize
print'(a,3(es12.5))', ' origin x y z: ', origin
if(worldsize>grid(3)) call IO_error(894, ext_msg='number of processes exceeds grid(3)')
if (worldsize>grid(3)) call IO_error(894, ext_msg='number of processes exceeds grid(3)')
call fftw_mpi_init
devNull = fftw_mpi_local_size_3d(int(grid(3),C_INTPTR_T), &
@ -109,7 +109,7 @@ subroutine discretization_grid_init(restart)
PETSC_COMM_WORLD, &
z, & ! domain grid size along z
z_offset) ! domain grid offset along z
if(z==0_C_INTPTR_T) call IO_error(894, ext_msg='Cannot distribute MPI processes')
if (z==0_C_INTPTR_T) call IO_error(894, ext_msg='Cannot distribute MPI processes')
grid3 = int(z)
grid3Offset = int(z_offset)
@ -136,14 +136,14 @@ subroutine discretization_grid_init(restart)
!--------------------------------------------------------------------------------------------------
! store geometry information for post processing
if(.not. restart) then
if (.not. restart) then
call results_openJobFile
call results_closeGroup(results_addGroup('geometry'))
call results_addAttribute('cells', grid, '/geometry')
call results_addAttribute('size', geomSize,'/geometry')
call results_addAttribute('origin',origin, '/geometry')
call results_closeJobFile
endif
end if
!--------------------------------------------------------------------------------------------------
! geometry information required by the nonlocal CP model
@ -202,20 +202,20 @@ subroutine readVTI(grid,geomSize,origin,material, &
if (endPos < startPos) endPos = len(fileContent,kind=pI64) ! end of file without new line
if (.not. inFile) then
if(index(fileContent(startPos:endPos),'<VTKFile',kind=pI64) /= 0_pI64) then
if (index(fileContent(startPos:endPos),'<VTKFile',kind=pI64) /= 0_pI64) then
inFile = .true.
if (.not. fileFormatOk(fileContent(startPos:endPos))) call IO_error(error_ID = 844, ext_msg='file format')
headerType = merge('UInt64','UInt32',getXMLValue(fileContent(startPos:endPos),'header_type')=='UInt64')
compressed = getXMLValue(fileContent(startPos:endPos),'compressor') == 'vtkZLibDataCompressor'
endif
end if
else
if (.not. inImage) then
if (index(fileContent(startPos:endPos),'<ImageData',kind=pI64) /= 0_pI64) then
inImage = .true.
call cellsSizeOrigin(grid,geomSize,origin,fileContent(startPos:endPos))
endif
end if
else
if (index(fileContent(startPos:endPos),'<CellData>',kind=pI64) /= 0_pI64) then
if (index(fileContent(startPos:endPos),'<CellData',kind=pI64) /= 0_pI64) then
gotCellData = .true.
do while (index(fileContent(startPos:endPos),'</CellData>',kind=pI64) == 0_pI64)
if (index(fileContent(startPos:endPos),'<DataArray',kind=pI64) /= 0_pI64 .and. &
@ -230,25 +230,25 @@ subroutine readVTI(grid,geomSize,origin,material, &
s = startPos + verify(fileContent(startPos:endPos),IO_WHITESPACE,kind=pI64) -1_pI64 ! start (no leading whitespace)
material = as_Int(fileContent(s:endPos),headerType,compressed,dataType)
exit
endif
end if
startPos = endPos + 2_pI64
endPos = startPos + index(fileContent(startPos:),IO_EOL,kind=pI64) - 2_pI64
enddo
endif
endif
endif
end do
end if
end if
end if
if (gotCellData) exit
startPos = endPos + 2_pI64
enddo
end do
if(.not. allocated(material)) call IO_error(error_ID = 844, ext_msg='material data not found')
if(size(material) /= product(grid)) call IO_error(error_ID = 844, ext_msg='size(material)')
if(any(geomSize<=0)) call IO_error(error_ID = 844, ext_msg='size')
if(any(grid<1)) call IO_error(error_ID = 844, ext_msg='grid')
if (.not. allocated(material)) call IO_error(error_ID = 844, ext_msg='material data not found')
if (size(material) /= product(grid)) call IO_error(error_ID = 844, ext_msg='size(material)')
if (any(geomSize<=0)) call IO_error(error_ID = 844, ext_msg='size')
if (any(grid<1)) call IO_error(error_ID = 844, ext_msg='grid')
material = material + 1
if(any(material<1)) call IO_error(error_ID = 844, ext_msg='material ID < 0')
if (any(material<1)) call IO_error(error_ID = 844, ext_msg='material ID < 0')
contains
@ -352,11 +352,11 @@ subroutine readVTI(grid,geomSize,origin,material, &
integer(C_SIGNED_CHAR), dimension(:), allocatable :: bytes
if(compressed) then
if (compressed) then
bytes = asBytes_compressed(base64_str,headerType)
else
bytes = asBytes_uncompressed(base64_str,headerType)
endif
end if
end function asBytes
@ -379,17 +379,18 @@ subroutine readVTI(grid,geomSize,origin,material, &
integer(pI64), dimension(:), allocatable :: temp, size_inflated, size_deflated
integer(pI64) :: headerLen, nBlock, b,s,e
if (headerType == 'UInt32') then
if (headerType == 'UInt32') then
temp = int(prec_bytesToC_INT32_T(base64_to_bytes(base64_str(:base64_nChar(4_pI64)))),pI64)
nBlock = int(temp(1),pI64)
headerLen = 4_pI64 * (3_pI64 + nBlock)
temp = int(prec_bytesToC_INT32_T(base64_to_bytes(base64_str(:base64_nChar(headerLen)))),pI64)
elseif(headerType == 'UInt64') then
else if (headerType == 'UInt64') then
temp = int(prec_bytesToC_INT64_T(base64_to_bytes(base64_str(:base64_nChar(8_pI64)))),pI64)
nBlock = int(temp(1),pI64)
headerLen = 8_pI64 * (3_pI64 + nBlock)
temp = int(prec_bytesToC_INT64_T(base64_to_bytes(base64_str(:base64_nChar(headerLen)))),pI64)
endif
end if
allocate(size_inflated(nBlock),source=temp(2))
size_inflated(nBlock) = merge(temp(3),temp(2),temp(3)/=0_pI64)
@ -402,7 +403,7 @@ subroutine readVTI(grid,geomSize,origin,material, &
s = e + 1_pI64
e = s + size_deflated(b) - 1_pI64
bytes(sum(size_inflated(:b-1))+1_pI64:sum(size_inflated(:b))) = zlib_inflate(bytes_inflated(s:e),size_inflated(b))
enddo
end do
end function asBytes_compressed
@ -424,19 +425,19 @@ subroutine readVTI(grid,geomSize,origin,material, &
allocate(bytes(0))
s=0_pI64
if (headerType == 'UInt32') then
if (headerType == 'UInt32') then
do while(s+base64_nChar(4_pI64)<(len(base64_str,pI64)))
nByte = int(prec_bytesToC_INT32_T(base64_to_bytes(base64_str(s+1_pI64:s+base64_nChar(4_pI64)))),pI64)
bytes = [bytes,base64_to_bytes(base64_str(s+1_pI64:s+base64_nChar(4_pI64+nByte(1))),5_pI64)]
s = s + base64_nChar(4_pI64+nByte(1))
enddo
elseif(headerType == 'UInt64') then
end do
else if (headerType == 'UInt64') then
do while(s+base64_nChar(8_pI64)<(len(base64_str,pI64)))
nByte = int(prec_bytesToC_INT64_T(base64_to_bytes(base64_str(s+1_pI64:s+base64_nChar(8_pI64)))),pI64)
bytes = [bytes,base64_to_bytes(base64_str(s+1_pI64:s+base64_nChar(8_pI64+nByte(1))),9_pI64)]
s = s + base64_nChar(8_pI64+nByte(1))
enddo
endif
end do
end if
end function asBytes_uncompressed
@ -455,11 +456,11 @@ subroutine readVTI(grid,geomSize,origin,material, &
#endif
s = index(line," "//key,back=.true.)
if(s==0) then
if (s==0) then
getXMLValue = ''
else
e = s + 1 + scan(line(s+1:),"'"//'"')
if(scan(line(s:e-2),'=') == 0) then
if (scan(line(s:e-2),'=') == 0) then
getXMLValue = ''
else
s = e
@ -471,8 +472,8 @@ subroutine readVTI(grid,geomSize,origin,material, &
e = s + index(line(s:),merge("'",'"',line(s-1:s-1)=="'")) - 1
#endif
getXMLValue = line(s:e-1)
endif
endif
end if
end if
end function
@ -510,11 +511,12 @@ function IPcoordinates0(grid,geomSize,grid3Offset)
a,b,c, &
i
i = 0
do c = 1, grid(3); do b = 1, grid(2); do a = 1, grid(1)
i = i + 1
IPcoordinates0(1:3,i) = geomSize/real(grid,pReal) * (real([a,b,grid3Offset+c],pReal) -0.5_pReal)
enddo; enddo; enddo
end do; end do; end do
end function IPcoordinates0
@ -538,7 +540,7 @@ pure function nodes0(grid,geomSize,grid3Offset)
do c = 0, grid3; do b = 0, grid(2); do a = 0, grid(1)
n = n + 1
nodes0(1:3,n) = geomSize/real(grid,pReal) * real([a,b,grid3Offset+c],pReal)
enddo; enddo; enddo
end do; end do; end do
end function nodes0
@ -553,6 +555,7 @@ pure function cellSurfaceArea(geomSize,grid)
real(pReal), dimension(6,1,product(grid)) :: cellSurfaceArea
cellSurfaceArea(1:2,1,:) = geomSize(2)/real(grid(2)) * geomSize(3)/real(grid(3))
cellSurfaceArea(3:4,1,:) = geomSize(3)/real(grid(3)) * geomSize(1)/real(grid(1))
cellSurfaceArea(5:6,1,:) = geomSize(1)/real(grid(1)) * geomSize(2)/real(grid(2))
@ -631,7 +634,7 @@ pure function IPneighborhood(grid)
IPneighborhood(3,5,1,e) = 6
IPneighborhood(3,6,1,e) = 5
enddo; enddo; enddo
end do; end do; end do
end function IPneighborhood

View File

@ -392,8 +392,8 @@ subroutine utilities_updateGamma(C)
xiDyad_cmplx(l,m) = conjg(-xi1st(l,i,j,k-grid3Offset))*xi1st(m,i,j,k-grid3Offset)
forall(l = 1:3, m = 1:3) &
temp33_complex(l,m) = sum(cmplx(C_ref(l,1:3,m,1:3),0.0_pReal)*xiDyad_cmplx)
A(1:3,1:3) = real(temp33_complex); A(4:6,4:6) = real(temp33_complex)
A(1:3,4:6) = aimag(temp33_complex); A(4:6,1:3) = -aimag(temp33_complex)
A(1:3,1:3) = temp33_complex%re; A(4:6,4:6) = temp33_complex%re
A(1:3,4:6) = temp33_complex%im; A(4:6,1:3) = -temp33_complex%im
if (abs(math_det33(A(1:3,1:3))) > 1e-16) then
call math_invert(A_inv, err, A)
temp33_complex = cmplx(A_inv(1:3,1:3),A_inv(1:3,4:6),pReal)
@ -509,8 +509,8 @@ subroutine utilities_fourierGammaConvolution(fieldAim)
xiDyad_cmplx(l,m) = conjg(-xi1st(l,i,j,k))*xi1st(m,i,j,k)
forall(l = 1:3, m = 1:3) &
temp33_complex(l,m) = sum(cmplx(C_ref(l,1:3,m,1:3),0.0_pReal)*xiDyad_cmplx)
A(1:3,1:3) = real(temp33_complex); A(4:6,4:6) = real(temp33_complex)
A(1:3,4:6) = aimag(temp33_complex); A(4:6,1:3) = -aimag(temp33_complex)
A(1:3,1:3) = temp33_complex%re; A(4:6,4:6) = temp33_complex%re
A(1:3,4:6) = temp33_complex%im; A(4:6,1:3) = -temp33_complex%im
if (abs(math_det33(A(1:3,1:3))) > 1e-16) then
call math_invert(A_inv, err, A)
temp33_complex = cmplx(A_inv(1:3,1:3),A_inv(1:3,4:6),pReal)
@ -630,7 +630,7 @@ real(pReal) function utilities_curlRMS()
-tensorField_fourier(l,1,i,j,k)*xi1st(2,i,j,k)*rescaledGeom(2))
enddo
utilities_curlRMS = utilities_curlRMS &
+2.0_pReal*sum(real(curl_fourier)**2.0_pReal+aimag(curl_fourier)**2.0_pReal)! Has somewhere a conj. complex counterpart. Therefore count it twice.
+2.0_pReal*sum(curl_fourier%re**2.0_pReal+curl_fourier%im**2.0_pReal) ! Has somewhere a conj. complex counterpart. Therefore count it twice.
enddo
do l = 1, 3
curl_fourier = (+tensorField_fourier(l,3,1,j,k)*xi1st(2,1,j,k)*rescaledGeom(2) &
@ -641,7 +641,7 @@ real(pReal) function utilities_curlRMS()
-tensorField_fourier(l,1,1,j,k)*xi1st(2,1,j,k)*rescaledGeom(2))
enddo
utilities_curlRMS = utilities_curlRMS &
+ sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal) ! this layer (DC) does not have a conjugate complex counterpart (if grid(1) /= 1)
+ sum(curl_fourier%re**2.0_pReal + curl_fourier%im**2.0_pReal) ! this layer (DC) does not have a conjugate complex counterpart (if grid(1) /= 1)
do l = 1, 3
curl_fourier = (+tensorField_fourier(l,3,grid1Red,j,k)*xi1st(2,grid1Red,j,k)*rescaledGeom(2) &
-tensorField_fourier(l,2,grid1Red,j,k)*xi1st(3,grid1Red,j,k)*rescaledGeom(3))
@ -651,7 +651,7 @@ real(pReal) function utilities_curlRMS()
-tensorField_fourier(l,1,grid1Red,j,k)*xi1st(2,grid1Red,j,k)*rescaledGeom(2))
enddo
utilities_curlRMS = utilities_curlRMS &
+ sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal) ! this layer (Nyquist) does not have a conjugate complex counterpart (if grid(1) /= 1)
+ sum(curl_fourier%re**2.0_pReal + curl_fourier%im**2.0_pReal) ! this layer (Nyquist) does not have a conjugate complex counterpart (if grid(1) /= 1)
enddo; enddo
call MPI_Allreduce(MPI_IN_PLACE,utilities_curlRMS,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD,ierr)

View File

@ -19,6 +19,7 @@ module FEM_utilities
use IO
use discretization_mesh
use homogenization
use FEM_quadrature
implicit none
private
@ -29,8 +30,8 @@ module FEM_utilities
!--------------------------------------------------------------------------------------------------
! field labels information
character(len=*), parameter, public :: &
FIELD_MECH_label = 'mechanical'
character(len=*), parameter, public :: &
FIELD_MECH_label = 'mechanical'
enum, bind(c); enumerator :: &
FIELD_UNDEFINED_ID, &
@ -86,7 +87,9 @@ subroutine FEM_utilities_init
class(tNode), pointer :: &
num_mesh, &
debug_mesh ! pointer to mesh debug options
integer :: structOrder !< order of displacement shape functions
integer :: &
p_s, & !< order of shape functions
p_i !< integration order (quadrature rule)
character(len=*), parameter :: &
PETSCDEBUG = ' -snes_view -snes_monitor '
PetscErrorCode :: ierr
@ -96,7 +99,14 @@ subroutine FEM_utilities_init
print'(/,a)', ' <<<+- FEM_utilities init -+>>>'
num_mesh => config_numerics%get('mesh',defaultVal=emptyDict)
structOrder = num_mesh%get_asInt('structOrder', defaultVal = 2)
p_s = num_mesh%get_asInt('p_s',defaultVal = 2)
p_i = num_mesh%get_asInt('p_i',defaultVal = p_s)
if (p_s < 1_pInt .or. p_s > size(FEM_nQuadrature,2)) &
call IO_error(821,ext_msg='shape function order (p_s) out of bounds')
if (p_i < max(1_pInt,p_s-1_pInt) .or. p_i > p_s) &
call IO_error(821,ext_msg='integration order (p_i) out of bounds')
debug_mesh => config_debug%get('mesh',defaultVal=emptyList)
debugPETSc = debug_mesh%contains('PETSc')
@ -113,13 +123,11 @@ subroutine FEM_utilities_init
call PetscOptionsInsertString(PETSC_NULL_OPTIONS,'-mechanical_snes_type newtonls &
&-mechanical_snes_linesearch_type cp -mechanical_snes_ksp_ew &
&-mechanical_snes_ksp_ew_rtol0 0.01 -mechanical_snes_ksp_ew_rtolmax 0.01 &
&-mechanical_ksp_type fgmres -mechanical_ksp_max_it 25 &
&-mechanical_pc_type ml -mechanical_mg_levels_ksp_type chebyshev &
&-mechanical_mg_levels_pc_type sor -mechanical_pc_ml_nullspace user',ierr)
&-mechanical_ksp_type fgmres -mechanical_ksp_max_it 25', ierr)
CHKERRQ(ierr)
call PetscOptionsInsertString(PETSC_NULL_OPTIONS,num_mesh%get_asString('PETSc_options',defaultVal=''),ierr)
CHKERRQ(ierr)
write(petsc_optionsOrder,'(a,i0)') '-mechFE_petscspace_degree ', structOrder
write(petsc_optionsOrder,'(a,i0)') '-mechFE_petscspace_degree ', p_s
call PetscOptionsInsertString(PETSC_NULL_OPTIONS,trim(petsc_optionsOrder),ierr)
CHKERRQ(ierr)
@ -141,6 +149,7 @@ subroutine utilities_constitutiveResponse(timeinc,P_av,forwardData)
PetscErrorCode :: ierr
print'(/,a)', ' ... evaluating constitutive response ......................................'
call homogenization_mechanical_response(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) ! calculate P field
@ -168,6 +177,7 @@ subroutine utilities_projectBCValues(localVec,section,field,comp,bcPointsIS,BCVa
PetscScalar :: BCValue,BCDotValue,timeinc
PetscErrorCode :: ierr
call PetscSectionGetFieldComponents(section,field,numComp,ierr); CHKERRQ(ierr)
call ISGetSize(bcPointsIS,nBcPoints,ierr); CHKERRQ(ierr)
if (nBcPoints > 0) call ISGetIndicesF90(bcPointsIS,bcPoints,ierr)
@ -179,8 +189,8 @@ subroutine utilities_projectBCValues(localVec,section,field,comp,bcPointsIS,BCVa
CHKERRQ(ierr)
do dof = offset+comp+1, offset+numDof, numComp
localArray(dof) = localArray(dof) + BCValue + BCDotValue*timeinc
enddo
enddo
end do
end do
call VecRestoreArrayF90(localVec,localArray,ierr); CHKERRQ(ierr)
call VecAssemblyBegin(localVec, ierr); CHKERRQ(ierr)
call VecAssemblyEnd (localVec, ierr); CHKERRQ(ierr)

View File

@ -85,7 +85,7 @@ subroutine discretization_mesh_init(restart)
materialAt
class(tNode), pointer :: &
num_mesh
integer :: integrationOrder !< order of quadrature rule required
integer :: p_i !< integration order (quadrature rule)
type(tvec) :: coords_node0
print'(/,a)', ' <<<+- discretization_mesh init -+>>>'
@ -93,7 +93,7 @@ subroutine discretization_mesh_init(restart)
!--------------------------------------------------------------------------------
! read numerics parameter
num_mesh => config_numerics%get('mesh',defaultVal=emptyDict)
integrationOrder = num_mesh%get_asInt('integrationorder',defaultVal = 2)
p_i = num_mesh%get_asInt('p_i',defaultVal = 2)
!---------------------------------------------------------------------------------
! read debug parameters
@ -150,9 +150,9 @@ subroutine discretization_mesh_init(restart)
call VecGetArrayF90(coords_node0, mesh_node0_temp,ierr)
CHKERRQ(ierr)
mesh_maxNips = FEM_nQuadrature(dimPlex,integrationOrder)
mesh_maxNips = FEM_nQuadrature(dimPlex,p_i)
call mesh_FEM_build_ipCoordinates(dimPlex,FEM_quadrature_points(dimPlex,integrationOrder)%p)
call mesh_FEM_build_ipCoordinates(dimPlex,FEM_quadrature_points(dimPlex,p_i)%p)
call mesh_FEM_build_ipVolumes(dimPlex)
allocate(materialAt(mesh_NcpElems))

View File

@ -41,7 +41,7 @@ module mesh_mechanical_FEM
type, private :: tNumerics
integer :: &
integrationOrder, & !< order of quadrature rule required
p_i, & !< integration order (quadrature rule)
itmax
logical :: &
BBarStabilisation
@ -118,7 +118,7 @@ subroutine FEM_mechanical_init(fieldBC)
!-----------------------------------------------------------------------------
! read numerical parametes and do sanity checks
num_mesh => config_numerics%get('mesh',defaultVal=emptyDict)
num%integrationOrder = num_mesh%get_asInt('integrationorder',defaultVal = 2)
num%p_i = num_mesh%get_asInt('p_i',defaultVal = 2)
num%itmax = num_mesh%get_asInt('itmax',defaultVal=250)
num%BBarStabilisation = num_mesh%get_asBool('bbarstabilisation',defaultVal = .false.)
num%eps_struct_atol = num_mesh%get_asFloat('eps_struct_atol', defaultVal = 1.0e-10_pReal)
@ -135,9 +135,9 @@ subroutine FEM_mechanical_init(fieldBC)
!--------------------------------------------------------------------------------------------------
! Setup FEM mech discretization
qPoints = FEM_quadrature_points( dimPlex,num%integrationOrder)%p
qWeights = FEM_quadrature_weights(dimPlex,num%integrationOrder)%p
nQuadrature = FEM_nQuadrature( dimPlex,num%integrationOrder)
qPoints = FEM_quadrature_points( dimPlex,num%p_i)%p
qWeights = FEM_quadrature_weights(dimPlex,num%p_i)%p
nQuadrature = FEM_nQuadrature( dimPlex,num%p_i)
qPointsP => qPoints
qWeightsP => qWeights
call PetscQuadratureCreate(PETSC_COMM_SELF,mechQuad,ierr); CHKERRQ(ierr)
@ -146,7 +146,7 @@ subroutine FEM_mechanical_init(fieldBC)
call PetscQuadratureSetData(mechQuad,dimPlex,nc,nQuadrature,qPointsP,qWeightsP,ierr)
CHKERRQ(ierr)
call PetscFECreateDefault(PETSC_COMM_SELF,dimPlex,nc,PETSC_TRUE,prefix, &
num%integrationOrder,mechFE,ierr); CHKERRQ(ierr)
num%p_i,mechFE,ierr); CHKERRQ(ierr)
call PetscFESetQuadrature(mechFE,mechQuad,ierr); CHKERRQ(ierr)
call PetscFEGetDimension(mechFE,nBasis,ierr); CHKERRQ(ierr)
nBasis = nBasis/nc

View File

@ -24,7 +24,6 @@ submodule(phase:plastic) dislotungsten
tau_Peierls, & !< Peierls stress
!* mobility law parameters
Q_s, & !< activation energy for glide [J]
v_0, & !< dislocation velocity prefactor [m/s]
p, & !< p-exponent in glide velocity
q, & !< q-exponent in glide velocity
B, & !< friction coefficient
@ -148,7 +147,7 @@ module function plastic_dislotungsten_init() result(myPlasticity)
else
prm%P_nS_pos = prm%P_sl
prm%P_nS_neg = prm%P_sl
endif
end if
prm%h_sl_sl = lattice_interaction_SlipBySlip(N_sl,pl%get_as1dFloat('h_sl-sl'), &
phase_lattice(ph))
@ -158,7 +157,6 @@ module function plastic_dislotungsten_init() result(myPlasticity)
rho_mob_0 = pl%get_as1dFloat('rho_mob_0', requiredSize=size(N_sl))
rho_dip_0 = pl%get_as1dFloat('rho_dip_0', requiredSize=size(N_sl))
prm%v_0 = pl%get_as1dFloat('v_0', requiredSize=size(N_sl))
prm%b_sl = pl%get_as1dFloat('b_sl', requiredSize=size(N_sl))
prm%Q_s = pl%get_as1dFloat('Q_s', requiredSize=size(N_sl))
@ -189,18 +187,16 @@ module function plastic_dislotungsten_init() result(myPlasticity)
prm%w = math_expand(prm%w, N_sl)
prm%omega = math_expand(prm%omega, N_sl)
prm%tau_Peierls = math_expand(prm%tau_Peierls, N_sl)
prm%v_0 = math_expand(prm%v_0, N_sl)
prm%B = math_expand(prm%B, N_sl)
prm%i_sl = math_expand(prm%i_sl, N_sl)
prm%f_at = math_expand(prm%f_at, N_sl)
prm%d_caron = pl%get_asFloat('D_a') * prm%b_sl
! sanity checks
if ( prm%D_0 <= 0.0_pReal) extmsg = trim(extmsg)//' D_0'
if ( prm%D_0 < 0.0_pReal) extmsg = trim(extmsg)//' D_0'
if ( prm%Q_cl <= 0.0_pReal) extmsg = trim(extmsg)//' Q_cl'
if (any(rho_mob_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rho_mob_0'
if (any(rho_dip_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rho_dip_0'
if (any(prm%v_0 < 0.0_pReal)) extmsg = trim(extmsg)//' v_0'
if (any(prm%b_sl <= 0.0_pReal)) extmsg = trim(extmsg)//' b_sl'
if (any(prm%Q_s <= 0.0_pReal)) extmsg = trim(extmsg)//' Q_s'
if (any(prm%tau_Peierls < 0.0_pReal)) extmsg = trim(extmsg)//' tau_Peierls'
@ -209,13 +205,13 @@ module function plastic_dislotungsten_init() result(myPlasticity)
if (any(prm%f_at <= 0.0_pReal)) extmsg = trim(extmsg)//' f_at or b_sl'
else slipActive
rho_mob_0= emptyRealArray; rho_dip_0 = emptyRealArray
rho_mob_0 = emptyRealArray; rho_dip_0 = emptyRealArray
allocate(prm%b_sl,prm%d_caron,prm%i_sl,prm%f_at,prm%tau_Peierls, &
prm%Q_s,prm%v_0,prm%p,prm%q,prm%B,prm%h,prm%w,prm%omega, &
prm%Q_s,prm%p,prm%q,prm%B,prm%h,prm%w,prm%omega, &
source = emptyRealArray)
allocate(prm%forestProjection(0,0))
allocate(prm%h_sl_sl (0,0))
endif slipActive
end if slipActive
!--------------------------------------------------------------------------------------------------
! allocate state arrays
@ -258,7 +254,7 @@ module function plastic_dislotungsten_init() result(myPlasticity)
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'(dislotungsten)')
enddo
end do
end function plastic_dislotungsten_init
@ -267,7 +263,7 @@ end function plastic_dislotungsten_init
!> @brief Calculate plastic velocity gradient and its tangent.
!--------------------------------------------------------------------------------------------------
pure module subroutine dislotungsten_LpAndItsTangent(Lp,dLp_dMp, &
Mp,T,ph,en)
Mp,T,ph,en)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
@ -287,19 +283,20 @@ pure module subroutine dislotungsten_LpAndItsTangent(Lp,dLp_dMp, &
dot_gamma_pos,dot_gamma_neg, &
ddot_gamma_dtau_pos,ddot_gamma_dtau_neg
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
associate(prm => param(ph))
call kinetics(Mp,T,ph,en,dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg)
do i = 1, prm%sum_N_sl
Lp = Lp + (dot_gamma_pos(i)+dot_gamma_neg(i))*prm%P_sl(1:3,1:3,i)
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_pos(i) * prm%P_sl(k,l,i) * prm%P_nS_pos(m,n,i) &
+ ddot_gamma_dtau_neg(i) * prm%P_sl(k,l,i) * prm%P_nS_neg(m,n,i)
enddo
call kinetics(Mp,T,ph,en,dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg)
do i = 1, prm%sum_N_sl
Lp = Lp + (dot_gamma_pos(i)+dot_gamma_neg(i))*prm%P_sl(1:3,1:3,i)
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_pos(i) * prm%P_sl(k,l,i) * prm%P_nS_pos(m,n,i) &
+ ddot_gamma_dtau_neg(i) * prm%P_sl(k,l,i) * prm%P_nS_neg(m,n,i)
end do
end associate
@ -328,35 +325,36 @@ module subroutine dislotungsten_dotState(Mp,T,ph,en)
dot_rho_dip_climb, &
d_hat
associate(prm => param(ph), stt => state(ph), dot => dotState(ph), dst => dependentState(ph))
call kinetics(Mp,T,ph,en,&
dot_gamma_pos,dot_gamma_neg, &
tau_pos_out = tau_pos,tau_neg_out = tau_neg)
call kinetics(Mp,T,ph,en,&
dot_gamma_pos,dot_gamma_neg, &
tau_pos_out = tau_pos,tau_neg_out = tau_neg)
dot%gamma_sl(:,en) = abs(dot_gamma_pos+dot_gamma_neg)
dot%gamma_sl(:,en) = abs(dot_gamma_pos+dot_gamma_neg)
where(dEq0(tau_pos)) ! ToDo: use avg of +/-
dot_rho_dip_formation = 0.0_pReal
dot_rho_dip_climb = 0.0_pReal
else where
d_hat = math_clip(3.0_pReal*prm%mu*prm%b_sl/(16.0_pReal*PI*abs(tau_pos)), & ! ToDo: use avg of +/-
prm%d_caron, & ! lower limit
dst%Lambda_sl(:,en)) ! upper limit
dot_rho_dip_formation = merge(2.0_pReal*(d_hat-prm%d_caron)*stt%rho_mob(:,en)*dot%gamma_sl(:,en)/prm%b_sl, &
0.0_pReal, &
prm%dipoleformation)
v_cl = (3.0_pReal*prm%mu*prm%D_0*exp(-prm%Q_cl/(kB*T))*prm%f_at/(2.0_pReal*PI*kB*T)) &
* (1.0_pReal/(d_hat+prm%d_caron))
dot_rho_dip_climb = (4.0_pReal*v_cl*stt%rho_dip(:,en))/(d_hat-prm%d_caron) ! ToDo: Discuss with Franz: Stress dependency?
end where
where(dEq0((tau_pos+tau_neg)*0.5_pReal))
dot_rho_dip_formation = 0.0_pReal
dot_rho_dip_climb = 0.0_pReal
else where
d_hat = math_clip(3.0_pReal*prm%mu*prm%b_sl/(16.0_pReal*PI*abs(tau_pos+tau_neg)*0.5_pReal), &
prm%d_caron, & ! lower limit
dst%Lambda_sl(:,en)) ! upper limit
dot_rho_dip_formation = merge(2.0_pReal*(d_hat-prm%d_caron)*stt%rho_mob(:,en)*dot%gamma_sl(:,en)/prm%b_sl, &
0.0_pReal, &
prm%dipoleformation)
v_cl = (3.0_pReal*prm%mu*prm%D_0*exp(-prm%Q_cl/(kB*T))*prm%f_at/(2.0_pReal*PI*kB*T)) &
* (1.0_pReal/(d_hat+prm%d_caron))
dot_rho_dip_climb = (4.0_pReal*v_cl*stt%rho_dip(:,en))/(d_hat-prm%d_caron) ! ToDo: Discuss with Franz: Stress dependency?
end where
dot%rho_mob(:,en) = dot%gamma_sl(:,en)/(prm%b_sl*dst%Lambda_sl(:,en)) & ! multiplication
- dot_rho_dip_formation &
- (2.0_pReal*prm%d_caron)/prm%b_sl*stt%rho_mob(:,en)*dot%gamma_sl(:,en) ! Spontaneous annihilation of 2 edges
dot%rho_dip(:,en) = dot_rho_dip_formation &
- (2.0_pReal*prm%d_caron)/prm%b_sl*stt%rho_dip(:,en)*dot%gamma_sl(:,en) & ! Spontaneous annihilation of an edge with a dipole
- dot_rho_dip_climb
dot%rho_mob(:,en) = dot%gamma_sl(:,en)/(prm%b_sl*dst%Lambda_sl(:,en)) & ! multiplication
- dot_rho_dip_formation &
- (2.0_pReal*prm%d_caron)/prm%b_sl*stt%rho_mob(:,en)*dot%gamma_sl(:,en) ! Spontaneous annihilation of 2 edges
dot%rho_dip(:,en) = dot_rho_dip_formation &
- (2.0_pReal*prm%d_caron)/prm%b_sl*stt%rho_dip(:,en)*dot%gamma_sl(:,en) & ! Spontaneous annihilation of an edge with a dipole
- dot_rho_dip_climb
end associate
@ -368,21 +366,22 @@ end subroutine dislotungsten_dotState
!--------------------------------------------------------------------------------------------------
module subroutine dislotungsten_dependentState(ph,en)
integer, intent(in) :: &
integer, intent(in) :: &
ph, &
en
real(pReal), dimension(param(ph)%sum_N_sl) :: &
dislocationSpacing
Lambda_sl_inv
associate(prm => param(ph), stt => state(ph), dst => dependentState(ph))
dislocationSpacing = sqrt(matmul(prm%forestProjection,stt%rho_mob(:,en)+stt%rho_dip(:,en)))
dst%tau_pass(:,en) = prm%mu*prm%b_sl &
* sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,en)+stt%rho_dip(:,en)))
dst%Lambda_sl(:,en) = prm%D/(1.0_pReal+prm%D*dislocationSpacing/prm%i_sl)
Lambda_sl_inv = 1.0_pReal/prm%D &
+ sqrt(matmul(prm%forestProjection,stt%rho_mob(:,en)+stt%rho_dip(:,en)))/prm%i_sl
dst%Lambda_sl(:,en) = Lambda_sl_inv**(-1.0_pReal)
end associate
@ -423,7 +422,7 @@ module subroutine plastic_dislotungsten_results(ph,group)
'threshold stress for slip','Pa',prm%systems_sl)
end select
enddo
end do
end associate
@ -456,88 +455,91 @@ pure subroutine kinetics(Mp,T,ph,en, &
ddot_gamma_dtau_neg, &
tau_pos_out, &
tau_neg_out
real(pReal), dimension(param(ph)%sum_N_sl) :: &
StressRatio, &
StressRatio_p,StressRatio_pminus1, &
dvel, vel, &
tau_pos,tau_neg, &
dvel, &
tau_pos, tau_neg, tau_eff, &
t_n, t_k, dtk,dtn
integer :: j
associate(prm => param(ph), stt => state(ph), dst => dependentState(ph))
do j = 1, prm%sum_N_sl
tau_pos(j) = math_tensordot(Mp,prm%P_nS_pos(1:3,1:3,j))
tau_neg(j) = math_tensordot(Mp,prm%P_nS_neg(1:3,1:3,j))
enddo
do j = 1, prm%sum_N_sl
tau_pos(j) = math_tensordot(Mp,prm%P_nS_pos(1:3,1:3,j))
tau_neg(j) = math_tensordot(Mp,prm%P_nS_neg(1:3,1:3,j))
end do
if (present(tau_pos_out)) tau_pos_out = tau_pos
if (present(tau_neg_out)) tau_neg_out = tau_neg
if (present(tau_pos_out)) tau_pos_out = tau_pos
if (present(tau_neg_out)) tau_neg_out = tau_neg
associate(BoltzmannRatio => prm%Q_s/(kB*T), &
b_rho_half => stt%rho_mob(:,en) * prm%b_sl * 0.5_pReal, &
effectiveLength => dst%Lambda_sl(:,en) - prm%w)
associate(BoltzmannRatio => prm%Q_s/(kB*T), &
dot_gamma_0 => stt%rho_mob(:,en)*prm%b_sl*prm%v_0, &
effectiveLength => dst%Lambda_sl(:,en) - prm%w)
tau_eff = abs(tau_pos)-dst%tau_pass(:,en)
significantPositiveTau: where(abs(tau_pos)-dst%tau_pass(:,en) > tol_math_check)
StressRatio = (abs(tau_pos)-dst%tau_pass(:,en))/prm%tau_Peierls
StressRatio_p = StressRatio** prm%p
StressRatio_pminus1 = StressRatio**(prm%p-1.0_pReal)
significantPositiveTau: where(tau_eff > tol_math_check)
StressRatio = tau_eff/prm%tau_Peierls
StressRatio_p = StressRatio** prm%p
StressRatio_pminus1 = StressRatio**(prm%p-1.0_pReal)
t_n = prm%b_sl/(exp(-BoltzmannRatio*(1-StressRatio_p) ** prm%q)*prm%omega*effectiveLength)
t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_pos)
t_n = prm%b_sl*exp(BoltzmannRatio*(1.0_pReal-StressRatio_p) ** prm%q) &
/ (prm%omega*effectiveLength)
t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_eff) ! corrected eq. (14)
vel = prm%h/(t_n + t_k)
dot_gamma_pos = b_rho_half * sign(prm%h/(t_n + t_k),tau_pos)
else where significantPositiveTau
dot_gamma_pos = 0.0_pReal
end where significantPositiveTau
dot_gamma_pos = dot_gamma_0 * sign(vel,tau_pos) * 0.5_pReal
else where significantPositiveTau
dot_gamma_pos = 0.0_pReal
end where significantPositiveTau
if (present(ddot_gamma_dtau_pos)) then
significantPositiveTau2: where(abs(tau_pos)-dst%tau_pass(:,en) > tol_math_check)
dtn = -1.0_pReal * t_n * BoltzmannRatio * prm%p * prm%q * (1.0_pReal-StressRatio_p)**(prm%q - 1.0_pReal) &
* StressRatio_pminus1 / prm%tau_Peierls
dtk = -1.0_pReal * t_k / tau_pos
if (present(ddot_gamma_dtau_pos)) then
significantPositiveTau2: where(abs(tau_pos)-dst%tau_pass(:,en) > tol_math_check)
dtn = -1.0_pReal * t_n * BoltzmannRatio * prm%p * prm%q * (1.0_pReal-StressRatio_p)**(prm%q - 1.0_pReal) &
* (StressRatio)**(prm%p - 1.0_pReal) / prm%tau_Peierls
dtk = -1.0_pReal * t_k / tau_pos
dvel = -1.0_pReal * prm%h * (dtk + dtn) / (t_n + t_k)**2.0_pReal
dvel = -1.0_pReal * prm%h * (dtk + dtn) / (t_n + t_k)**2.0_pReal
ddot_gamma_dtau_pos = b_rho_half * dvel
else where significantPositiveTau2
ddot_gamma_dtau_pos = 0.0_pReal
end where significantPositiveTau2
end if
ddot_gamma_dtau_pos = dot_gamma_0 * dvel* 0.5_pReal
else where significantPositiveTau2
ddot_gamma_dtau_pos = 0.0_pReal
end where significantPositiveTau2
endif
tau_eff = abs(tau_neg)-dst%tau_pass(:,en)
significantNegativeTau: where(abs(tau_neg)-dst%tau_pass(:,en) > tol_math_check)
StressRatio = (abs(tau_neg)-dst%tau_pass(:,en))/prm%tau_Peierls
StressRatio_p = StressRatio** prm%p
StressRatio_pminus1 = StressRatio**(prm%p-1.0_pReal)
significantNegativeTau: where(tau_eff > tol_math_check)
StressRatio = tau_eff/prm%tau_Peierls
StressRatio_p = StressRatio** prm%p
StressRatio_pminus1 = StressRatio**(prm%p-1.0_pReal)
t_n = prm%b_sl/(exp(-BoltzmannRatio*(1-StressRatio_p) ** prm%q)*prm%omega*effectiveLength)
t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_pos)
t_n = prm%b_sl*exp(BoltzmannRatio*(1.0_pReal-StressRatio_p) ** prm%q) &
/ (prm%omega*effectiveLength)
t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_eff) ! corrected eq. (14)
vel = prm%h/(t_n + t_k)
dot_gamma_neg = b_rho_half * sign(prm%h/(t_n + t_k),tau_neg)
else where significantNegativeTau
dot_gamma_neg = 0.0_pReal
end where significantNegativeTau
dot_gamma_neg = dot_gamma_0 * sign(vel,tau_neg) * 0.5_pReal
else where significantNegativeTau
dot_gamma_neg = 0.0_pReal
end where significantNegativeTau
if (present(ddot_gamma_dtau_neg)) then
significantNegativeTau2: where(abs(tau_neg)-dst%tau_pass(:,en) > tol_math_check)
dtn = -1.0_pReal * t_n * BoltzmannRatio * prm%p * prm%q * (1.0_pReal-StressRatio_p)**(prm%q - 1.0_pReal) &
* StressRatio_pminus1 / prm%tau_Peierls
dtk = -1.0_pReal * t_k / tau_neg
if (present(ddot_gamma_dtau_neg)) then
significantNegativeTau2: where(abs(tau_neg)-dst%tau_pass(:,en) > tol_math_check)
dtn = -1.0_pReal * t_n * BoltzmannRatio * prm%p * prm%q * (1.0_pReal-StressRatio_p)**(prm%q - 1.0_pReal) &
* (StressRatio)**(prm%p - 1.0_pReal) / prm%tau_Peierls
dtk = -1.0_pReal * t_k / tau_neg
dvel = -1.0_pReal * prm%h * (dtk + dtn) / (t_n + t_k)**2.0_pReal
dvel = -1.0_pReal * prm%h * (dtk + dtn) / (t_n + t_k)**2.0_pReal
ddot_gamma_dtau_neg = b_rho_half * dvel
else where significantNegativeTau2
ddot_gamma_dtau_neg = 0.0_pReal
end where significantNegativeTau2
end if
ddot_gamma_dtau_neg = dot_gamma_0 * dvel * 0.5_pReal
else where significantNegativeTau2
ddot_gamma_dtau_neg = 0.0_pReal
end where significantNegativeTau2
end if
end associate
end associate
end associate
end subroutine kinetics

View File

@ -890,7 +890,8 @@ pure subroutine kinetics_sl(Mp,T,ph,en, &
stressRatio = tau_eff/prm%tau_0
StressRatio_p = stressRatio** prm%p
Q_kB_T = prm%Q_sl/(kB*T)
v_wait_inverse = prm%v_0**(-1.0_pReal) * exp(Q_kB_T*(1.0_pReal-StressRatio_p)** prm%q)
v_wait_inverse = exp(Q_kB_T*(1.0_pReal-StressRatio_p)** prm%q) &
/ prm%v_0
v_run_inverse = prm%B/(tau_eff*prm%b_sl)
dot_gamma_sl = sign(stt%rho_mob(:,en)*prm%b_sl/(v_wait_inverse+v_run_inverse),tau)

View File

@ -101,7 +101,7 @@ logical elemental pure function dEq(a,b,tol)
dEq = abs(a-b) <= tol
else
dEq = abs(a-b) <= PREAL_EPSILON * maxval(abs([a,b]))
endif
end if
end function dEq
@ -139,7 +139,7 @@ logical elemental pure function dEq0(a,tol)
dEq0 = abs(a) <= tol
else
dEq0 = abs(a) <= PREAL_MIN * 10.0_pReal
endif
end if
end function dEq0
@ -178,7 +178,7 @@ logical elemental pure function cEq(a,b,tol)
cEq = abs(a-b) <= tol
else
cEq = abs(a-b) <= PREAL_EPSILON * maxval(abs([a,b]))
endif
end if
end function cEq
@ -273,27 +273,27 @@ subroutine selfTest
realloc_lhs_test = [1,2]
if (any(realloc_lhs_test/=[1,2])) error stop 'LHS allocation'
if (any(realloc_lhs_test/=[1,2])) error stop 'LHS allocation'
call random_number(r)
r = r/minval(r)
if(.not. all(dEq(r,r+PREAL_EPSILON))) error stop 'dEq'
if(dEq(r(1),r(2)) .and. dNeq(r(1),r(2))) error stop 'dNeq'
if(.not. all(dEq0(r-(r+PREAL_MIN)))) error stop 'dEq0'
if (.not. all(dEq(r,r+PREAL_EPSILON))) error stop 'dEq'
if (dEq(r(1),r(2)) .and. dNeq(r(1),r(2))) error stop 'dNeq'
if (.not. all(dEq0(r-(r+PREAL_MIN)))) error stop 'dEq0'
! https://www.binaryconvert.com
! https://www.rapidtables.com/convert/number/binary-to-decimal.html
f = real(prec_bytesToC_FLOAT(int([-65,+11,-102,+75],C_SIGNED_CHAR)),pReal)
if(dNeq(f(1),20191102.0_pReal,0.0_pReal)) error stop 'prec_bytesToC_FLOAT'
if (dNeq(f(1),20191102.0_pReal,0.0_pReal)) error stop 'prec_bytesToC_FLOAT'
f = real(prec_bytesToC_DOUBLE(int([0,0,0,-32,+119,+65,+115,65],C_SIGNED_CHAR)),pReal)
if(dNeq(f(1),20191102.0_pReal,0.0_pReal)) error stop 'prec_bytesToC_DOUBLE'
if (dNeq(f(1),20191102.0_pReal,0.0_pReal)) error stop 'prec_bytesToC_DOUBLE'
i = int(prec_bytesToC_INT32_T(int([+126,+23,+52,+1],C_SIGNED_CHAR)),pInt)
if(i(1) /= 20191102_pInt) error stop 'prec_bytesToC_INT32_T'
if (i(1) /= 20191102_pInt) error stop 'prec_bytesToC_INT32_T'
i = int(prec_bytesToC_INT64_T(int([+126,+23,+52,+1,0,0,0,0],C_SIGNED_CHAR)),pInt)
if(i(1) /= 20191102_pInt) error stop 'prec_bytesToC_INT64_T'
if (i(1) /= 20191102_pInt) error stop 'prec_bytesToC_INT64_T'
end subroutine selfTest