From c628c028dc4dca68da2acc4316b63ff0ab7a3e59 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Oct 2021 22:14:37 +0200 Subject: [PATCH 01/52] SYNTAXONLY for mesh, avoid code duplication --- src/CMakeLists.txt | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ffa26441..cb1436579 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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,20 @@ 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(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 () +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(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() From 519bb857d7f61e93cbf3dd887748aa1ca8e39fe3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Oct 2021 22:15:08 +0200 Subject: [PATCH 02/52] save list of files used for compilation helpful for debugging and creating automated documentation --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cb1436579..17a693b9d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,3 +29,7 @@ else() exec_program(mktemp ARGS -d OUTPUT_VARIABLE black_hole) install(PROGRAMS ${nothing} DESTINATION ${black_hole}) endif() + +string(REPLACE ";" "\n" sources "${damask-sources};${solver-sources}") +message(${CMAKE_BINARY_DIR}) +file(WRITE ${CMAKE_BINARY_DIR}/sources.txt ${sources}) From d086162350e92a5405f4ba937ab034eca43b1a50 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Oct 2021 22:16:47 +0200 Subject: [PATCH 03/52] consistent style there is no space before opening brackets in the CMake doc --- CMakeLists.txt | 170 ++++++++++++++++++++++++------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 856b430cd..56416d0fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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} -o ${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} -o ${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) From 2e340d34890d054448e7a3092423f3389ea6cef1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Oct 2021 22:19:58 +0200 Subject: [PATCH 04/52] forgotten rename --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 17a693b9d..82efe8748 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,7 +24,7 @@ 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(DAMASK_grid OBJECT ${damask-sources} ${grid-sources}) + 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}) From d1a9b7333cc0cbd2de86ddfbe876949e27e484da Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Tue, 19 Oct 2021 14:07:46 +0200 Subject: [PATCH 05/52] corrected number of boundary conditions --- examples/Marc/sheet_r-value.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Marc/sheet_r-value.dat b/examples/Marc/sheet_r-value.dat index 176bd34eb..5b344c9c9 100644 --- a/examples/Marc/sheet_r-value.dat +++ b/examples/Marc/sheet_r-value.dat @@ -350,7 +350,7 @@ initial state 1 DAMASK_elements loadcase r-value - 5 + 4 DAMASK unten_z unten_y From b7436ec0f2935fbfd2f611b972e2d724270f1edb Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 19 Oct 2021 15:44:17 +0200 Subject: [PATCH 06/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-9-gd1a9b7333 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 6ca7886a4..969c43b41 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-7-gee537ff5e +v3.0.0-alpha5-9-gd1a9b7333 From 256c48831e63d5827b5c162596c5c0db0ddc38f7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 19 Oct 2021 23:08:21 +0200 Subject: [PATCH 07/52] better readable --- src/grid/spectral_utilities.f90 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index e33ee94d0..579397104 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -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) From fb1d3a62de13e080a46a22b332877358d5840fae Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 22 Oct 2021 13:55:19 +0200 Subject: [PATCH 08/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-15-g5995a7877 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 969c43b41..49307bf84 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-9-gd1a9b7333 +v3.0.0-alpha5-15-g5995a7877 From c66c1d0af695785993ec9ceb144b47d2e50e9926 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 22 Oct 2021 15:35:32 +0200 Subject: [PATCH 09/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-17-gfc4266583 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 969c43b41..23ed696e4 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-9-gd1a9b7333 +v3.0.0-alpha5-17-gfc4266583 From a00c6743c3c65bb350996d7622ec198330c01fec Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 26 Oct 2021 11:48:54 +0200 Subject: [PATCH 10/52] symbolic notation in numerics.yaml - p_i: integration order - p_s: shape function order ensure working combination (p_s = p_i: full integration, p_s = p_i+1: reduced integration) --- PRIVATE | 2 +- src/IO.f90 | 7 ++++++- src/mesh/FEM_utilities.f90 | 20 +++++++++++++++----- src/mesh/discretization_mesh.f90 | 8 ++++---- src/mesh/mesh_mech_FEM.f90 | 12 ++++++------ 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/PRIVATE b/PRIVATE index fabe69749..0ff1d7540 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit fabe69749425e8a7aceb3b7c2758b40d97d8b809 +Subproject commit 0ff1d7540fede9611d46d2885bebbbe60dcbbfb0 diff --git a/src/IO.f90 b/src/IO.f90 index cd7c09c75..717493006 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -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) diff --git a/src/mesh/FEM_utilities.f90 b/src/mesh/FEM_utilities.f90 index 64bcc3896..a3856ccaa 100644 --- a/src/mesh/FEM_utilities.f90 +++ b/src/mesh/FEM_utilities.f90 @@ -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') @@ -119,7 +129,7 @@ subroutine FEM_utilities_init 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) diff --git a/src/mesh/discretization_mesh.f90 b/src/mesh/discretization_mesh.f90 index e5f989484..f1d38760d 100644 --- a/src/mesh/discretization_mesh.f90 +++ b/src/mesh/discretization_mesh.f90 @@ -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)) diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index d6d314a42..58429992c 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -41,7 +41,7 @@ module mesh_mechanical_FEM type, private :: tNumerics integer :: & - integrationOrder, & !< order of quadrature rule required + p_i, & !< integration order 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 From b4ff89f3040e3a96d9616e0a0e20cfef1662bb8b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 26 Oct 2021 13:06:55 +0200 Subject: [PATCH 11/52] improved test --- PRIVATE | 2 +- src/mesh/mesh_mech_FEM.f90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PRIVATE b/PRIVATE index 0ff1d7540..bb73a35f3 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 0ff1d7540fede9611d46d2885bebbbe60dcbbfb0 +Subproject commit bb73a35f334831eed10d0e293aafea6c0900b7bd diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index 58429992c..496a82fc5 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -41,7 +41,7 @@ module mesh_mechanical_FEM type, private :: tNumerics integer :: & - p_i, & !< integration order + p_i, & !< integration order (quadrature rule) itmax logical :: & BBarStabilisation From f0a33b452fa50b281a0c98fe1300fe0f3303770f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 28 Oct 2021 07:05:14 +0200 Subject: [PATCH 12/52] unifying style --- src/prec.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/prec.f90 b/src/prec.f90 index 2e67ae76a..d6d161a94 100644 --- a/src/prec.f90 +++ b/src/prec.f90 @@ -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 From cb796f97d736b63e2bfcd6bde46fcdecdcb753ae Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Thu, 28 Oct 2021 10:47:36 +0200 Subject: [PATCH 13/52] new Marc example, sheet is now polycrystalline --- examples/Marc/material.yaml | 404 ++++++++- ...{sheet_r-value.dat => r-value_texture.dat} | 829 +++++++++++++++++- 2 files changed, 1211 insertions(+), 22 deletions(-) rename examples/Marc/{sheet_r-value.dat => r-value_texture.dat} (55%) diff --git a/examples/Marc/material.yaml b/examples/Marc/material.yaml index bebd5dd81..56bff51bb 100644 --- a/examples/Marc/material.yaml +++ b/examples/Marc/material.yaml @@ -24,8 +24,404 @@ 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 + diff --git a/examples/Marc/sheet_r-value.dat b/examples/Marc/r-value_texture.dat similarity index 55% rename from examples/Marc/sheet_r-value.dat rename to examples/Marc/r-value_texture.dat index 5b344c9c9..e8e77a1e6 100644 --- a/examples/Marc/sheet_r-value.dat +++ b/examples/Marc/r-value_texture.dat @@ -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 - 4 -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 $................... From d131dc76bfe01fc9cdca34bae184ab4b8cc1c260 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Thu, 28 Oct 2021 10:54:40 +0200 Subject: [PATCH 14/52] removed trailing spaces --- examples/Marc/material.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Marc/material.yaml b/examples/Marc/material.yaml index 56bff51bb..c7f61a4ce 100644 --- a/examples/Marc/material.yaml +++ b/examples/Marc/material.yaml @@ -424,4 +424,4 @@ material: phase: Aluminum v: 1.0 homogenization: SX - + From 8a2f503f5fa35175decdb6d2a1b4602191a8c6cc Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Thu, 28 Oct 2021 10:56:03 +0200 Subject: [PATCH 15/52] removed empty last line --- examples/Marc/material.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/Marc/material.yaml b/examples/Marc/material.yaml index c7f61a4ce..c0a7be647 100644 --- a/examples/Marc/material.yaml +++ b/examples/Marc/material.yaml @@ -424,4 +424,3 @@ material: phase: Aluminum v: 1.0 homogenization: SX - From c34855952e5fe20eda76f5dacde22370303936dd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 28 Oct 2021 14:10:40 +0200 Subject: [PATCH 16/52] toolchains are updated --- .gitlab-ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58da1db1d..d4124411a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,22 +53,22 @@ variables: GNUCompiler: "$GNUCompiler10" # ++++++++++++ MPI ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ IMPI2020Intel19_1: "MPI/Intel/19.1.2/IntelMPI/2019" - OMPI4_0GNU10: "MPI/GNU/10/OpenMPI/4.0.5" + OMPI4_1GNU10: "MPI/GNU/10/OpenMPI/4.1.1" # ------------ Defaults ---------------------------------------------- MPI_Intel: "$IMPI2020Intel19_1" - MPI_GNU: "$OMPI4_0GNU10" + MPI_GNU: "$OMPI4_1GNU10" # ++++++++++++ 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" + PETSc3_16_0IMPI2020Intel19_1: "Libraries/PETSc/3.16.0/Intel-19.1.2-IntelMPI-2019" + PETSc3_16_0OMPI4_1GNU10: "Libraries/PETSc/3.16.0/GNU-10-OpenMPI-4.1.1" # ------------ Defaults ---------------------------------------------- - PETSc_Intel: "$PETSc3_14_2IMPI2020Intel19_1" - PETSc_GNU: "$PETSc3_14_2OMPI4_0GNU10" + PETSc_Intel: "$PETSc3_16_0IMPI2020Intel19_1" + PETSc_GNU: "$PETSc3_16_0OMPI4_1GNU10" # ++++++++++++ commercial FEM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MSC2021: "FEM/MSC/2021.2" # ------------ Defaults ---------------------------------------------- MSC: "$MSC2021" IntelMarc: "$IntelCompiler19_1" - HDF5Marc: "HDF5/1.12.0/Intel-19.1.2" + HDF5Marc: "HDF5/1.12.1/Intel-19.1.2" ################################################################################################### checkout: From 0ac857599c3a1dac9ade08f0b7cb7c280e6d5857 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 28 Oct 2021 21:36:04 +0200 Subject: [PATCH 17/52] simplified we don't test multiple versions anymore --- .gitlab-ci.yml | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4124411a..8680b2873 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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_1GNU10: "MPI/GNU/10/OpenMPI/4.1.1" - # ------------ Defaults ---------------------------------------------- - MPI_Intel: "$IMPI2020Intel19_1" - MPI_GNU: "$OMPI4_1GNU10" + MPI_Intel: "MPI/Intel/19.1.2/IntelMPI/2019" + MPI_GNU: "MPI/GNU/10/OpenMPI/4.1.1" # ++++++++++++ PETSc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - PETSc3_16_0IMPI2020Intel19_1: "Libraries/PETSc/3.16.0/Intel-19.1.2-IntelMPI-2019" - PETSc3_16_0OMPI4_1GNU10: "Libraries/PETSc/3.16.0/GNU-10-OpenMPI-4.1.1" - # ------------ Defaults ---------------------------------------------- - PETSc_Intel: "$PETSc3_16_0IMPI2020Intel19_1" - PETSc_GNU: "$PETSc3_16_0OMPI4_1GNU10" - # ++++++++++++ commercial FEM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - MSC2021: "FEM/MSC/2021.2" - # ------------ Defaults ---------------------------------------------- - MSC: "$MSC2021" - IntelMarc: "$IntelCompiler19_1" - HDF5Marc: "HDF5/1.12.1/Intel-19.1.2" + PETSc_Intel: "Libraries/PETSc/3.16.0/Intel-19.1.2-IntelMPI-2019" + PETSc_GNU: "Libraries/PETSc/3.16.0/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: From d2a83e5cc1e7541e9d43d1103ff60ed9dce62c5c Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 29 Oct 2021 10:52:40 +0200 Subject: [PATCH 18/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-29-g84df8b71f --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 49307bf84..4ab41203b 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-15-g5995a7877 +v3.0.0-alpha5-29-g84df8b71f From ddb25ad0e56a0d9dcdfef149101f20396f26d3f7 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 29 Oct 2021 20:04:09 -0400 Subject: [PATCH 19/52] remove duplicate lattice_symmetries dictionary --- python/damask/_orientation.py | 21 --------------------- python/tests/test_Orientation.py | 4 ++-- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index a568eb0f1..3d4d259ff 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -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. diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index 686ed66c2..9f623fc6c 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -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 From 9f152aca0daaf253b52f49b3c39e9b370f829fcd Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 30 Oct 2021 10:03:53 +0200 Subject: [PATCH 20/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-31-gddb25ad0e --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 4ab41203b..98903601b 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-29-g84df8b71f +v3.0.0-alpha5-31-gddb25ad0e From bb757cf82e27f1bd72c1d5a243e71d58a55fad98 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Oct 2021 10:36:47 +0200 Subject: [PATCH 21/52] style adjustments --- ...phase_mechanical_plastic_dislotungsten.f90 | 191 +++++++++--------- 1 file changed, 97 insertions(+), 94 deletions(-) diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index 1e5e120e5..fce013bb2 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -148,7 +148,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)) @@ -209,13 +209,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, & source = emptyRealArray) allocate(prm%forestProjection(0,0)) allocate(prm%h_sl_sl (0,0)) - endif slipActive + end if slipActive !-------------------------------------------------------------------------------------------------- ! allocate state arrays @@ -258,7 +258,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 +267,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 +287,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 +329,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)) ! 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 - 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,7 +370,7 @@ end subroutine dislotungsten_dotState !-------------------------------------------------------------------------------------------------- module subroutine dislotungsten_dependentState(ph,en) - integer, intent(in) :: & + integer, intent(in) :: & ph, & en @@ -423,7 +425,7 @@ module subroutine plastic_dislotungsten_results(ph,group) 'threshold stress for slip','Pa',prm%systems_sl) end select - enddo + end do end associate @@ -456,6 +458,7 @@ 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, & @@ -464,80 +467,80 @@ pure subroutine kinetics(Mp,T,ph,en, & 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), & + dot_gamma_0 => stt%rho_mob(:,en)*prm%b_sl*prm%v_0, & + 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) + 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(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) + 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-StressRatio_p) ** prm%q)*prm%omega*effectiveLength) - t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_pos) + vel = prm%h/(t_n + t_k) - vel = prm%h/(t_n + t_k) + 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 - 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)**(prm%p - 1.0_pReal) / 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 = dot_gamma_0 * dvel* 0.5_pReal + 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 + 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(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) + 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-StressRatio_p) ** prm%q)*prm%omega*effectiveLength) - t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_pos) + vel = prm%h/(t_n + t_k) - vel = prm%h/(t_n + t_k) + 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 - 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)**(prm%p - 1.0_pReal) / 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 = dot_gamma_0 * dvel * 0.5_pReal + 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 From bff186051c47e1f62170cb234a5a4fa704c4c8b4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Oct 2021 22:08:55 +0200 Subject: [PATCH 22/52] simplified --- src/phase_mechanical_plastic_dislotungsten.f90 | 16 +++++++--------- src/phase_mechanical_plastic_dislotwin.f90 | 3 ++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index fce013bb2..6b2e65796 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -462,7 +462,7 @@ pure subroutine kinetics(Mp,T,ph,en, & real(pReal), dimension(param(ph)%sum_N_sl) :: & StressRatio, & StressRatio_p,StressRatio_pminus1, & - dvel, vel, & + dvel, & tau_pos,tau_neg, & t_n, t_k, dtk,dtn integer :: j @@ -487,12 +487,11 @@ pure subroutine kinetics(Mp,T,ph,en, & 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_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_pos) - vel = prm%h/(t_n + t_k) - - dot_gamma_pos = dot_gamma_0 * sign(vel,tau_pos) * 0.5_pReal + dot_gamma_pos = dot_gamma_0 * sign(prm%h/(t_n + t_k),tau_pos) * 0.5_pReal else where significantPositiveTau dot_gamma_pos = 0.0_pReal end where significantPositiveTau @@ -516,12 +515,11 @@ pure subroutine kinetics(Mp,T,ph,en, & 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_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_pos) - vel = prm%h/(t_n + t_k) - - dot_gamma_neg = dot_gamma_0 * sign(vel,tau_neg) * 0.5_pReal + dot_gamma_neg = dot_gamma_0 * sign(prm%h/(t_n + t_k),tau_neg) * 0.5_pReal else where significantNegativeTau dot_gamma_neg = 0.0_pReal end where significantNegativeTau diff --git a/src/phase_mechanical_plastic_dislotwin.f90 b/src/phase_mechanical_plastic_dislotwin.f90 index ac179d775..de73cee04 100644 --- a/src/phase_mechanical_plastic_dislotwin.f90 +++ b/src/phase_mechanical_plastic_dislotwin.f90 @@ -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) From e20b705f5416ee81935b8b2e70747f33076ea2c5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Oct 2021 23:02:51 +0200 Subject: [PATCH 23/52] following dislotwin --- src/phase_mechanical_plastic_dislotungsten.f90 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index 6b2e65796..6a947cc70 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -463,7 +463,7 @@ pure subroutine kinetics(Mp,T,ph,en, & StressRatio, & StressRatio_p,StressRatio_pminus1, & dvel, & - tau_pos,tau_neg, & + tau_pos, tau_neg, tau_eff, & t_n, t_k, dtk,dtn integer :: j @@ -482,8 +482,10 @@ pure subroutine kinetics(Mp,T,ph,en, & dot_gamma_0 => stt%rho_mob(:,en)*prm%b_sl*prm%v_0, & effectiveLength => dst%Lambda_sl(:,en) - prm%w) - significantPositiveTau: where(abs(tau_pos)-dst%tau_pass(:,en) > tol_math_check) - StressRatio = (abs(tau_pos)-dst%tau_pass(:,en))/prm%tau_Peierls + tau_eff = abs(tau_pos)-dst%tau_pass(:,en) + + 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) @@ -510,8 +512,10 @@ pure subroutine kinetics(Mp,T,ph,en, & end where significantPositiveTau2 end if - significantNegativeTau: where(abs(tau_neg)-dst%tau_pass(:,en) > tol_math_check) - StressRatio = (abs(tau_neg)-dst%tau_pass(:,en))/prm%tau_Peierls + tau_eff = abs(tau_neg)-dst%tau_pass(:,en) + + 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) From f5fe0b9dca43ff022f9de1154814821a5821b32d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Oct 2021 23:03:27 +0200 Subject: [PATCH 24/52] bugfix: change of behavior negative values for the resolved stress do not make sense. The paper does not take this into account (eq (14), Cereceda et. al 2016). According to my understanding, only the non-thermal contributions should be substracted, so abs(tau_pos)/abs(tau_neg) would not be sufficient. --- src/phase_mechanical_plastic_dislotungsten.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index 6a947cc70..9f565df67 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -491,7 +491,7 @@ pure subroutine kinetics(Mp,T,ph,en, & 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_pos) + t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_eff) ! corrected eq. (14) dot_gamma_pos = dot_gamma_0 * sign(prm%h/(t_n + t_k),tau_pos) * 0.5_pReal else where significantPositiveTau @@ -521,7 +521,7 @@ pure subroutine kinetics(Mp,T,ph,en, & 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_pos) + t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_eff) ! corrected eq. (14) dot_gamma_neg = dot_gamma_0 * sign(prm%h/(t_n + t_k),tau_neg) * 0.5_pReal else where significantNegativeTau From 25ca77c38e96a6e99f0c1fc295efc4d77e1dc4e2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 13:32:24 +0100 Subject: [PATCH 25/52] parameters from original paper (mostly) --- examples/config/Phase_Dislotungsten_W.yaml | 26 ---------------- .../mechanical/plastic/dislotungsten_W.yaml | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 26 deletions(-) delete mode 100644 examples/config/Phase_Dislotungsten_W.yaml create mode 100644 examples/config/phase/mechanical/plastic/dislotungsten_W.yaml diff --git a/examples/config/Phase_Dislotungsten_W.yaml b/examples/config/Phase_Dislotungsten_W.yaml deleted file mode 100644 index bf8796cfa..000000000 --- a/examples/config/Phase_Dislotungsten_W.yaml +++ /dev/null @@ -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] diff --git a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml new file mode 100644 index 000000000..ea6ea5383 --- /dev/null +++ b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml @@ -0,0 +1,30 @@ +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 +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] # there is also tau_c^* = 2.92GPa, not clear in the paper +h: [2.566e-10] +a_nonSchmid: [0.938, 0.71, 4.43] +h_sl-sl: [0.009, 0.72, 0.009, 0.05, 0.05, 0.06, 0.09] +w: [2.992e-09] # 11b +i_sl: [1] # c, eq. (25) +D: 1.0e+10 # d_g, eq. (25) +D_a: 1.0 # d_edge = D_a*b + +# climb (disabled) +D_0: 0.0 # disable climb +f_at: 1 +Q_cl: 1.0 +output: [Lambda_sl] + +v_0: [1] From fbc4865c30c2a306fdec8af0f11c8fcfdaba22ad Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 15:42:18 +0100 Subject: [PATCH 26/52] mathematically equivalent re-formulation allows to disable contribution from grain size by setting it to a large value --- .../config/phase/mechanical/plastic/dislotungsten_W.yaml | 3 +-- src/phase_mechanical_plastic_dislotungsten.f90 | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml index ea6ea5383..6a0e4dcc2 100644 --- a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml +++ b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml @@ -18,10 +18,9 @@ a_nonSchmid: [0.938, 0.71, 4.43] h_sl-sl: [0.009, 0.72, 0.009, 0.05, 0.05, 0.06, 0.09] w: [2.992e-09] # 11b i_sl: [1] # c, eq. (25) -D: 1.0e+10 # d_g, eq. (25) +D: 1.0e+20 # d_g, eq. (25) D_a: 1.0 # d_edge = D_a*b -# climb (disabled) D_0: 0.0 # disable climb f_at: 1 Q_cl: 1.0 diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index 9f565df67..21ea34611 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -196,7 +196,7 @@ module function plastic_dislotungsten_init() result(myPlasticity) 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' @@ -375,16 +375,17 @@ module subroutine dislotungsten_dependentState(ph,en) 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 From a352f8deebcef3a8c4681066a55c8dc625dd9358 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 16:05:22 +0100 Subject: [PATCH 27/52] reasonable convergence --- .../phase/mechanical/plastic/dislotungsten_W.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml index 6a0e4dcc2..6efe77644 100644 --- a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml +++ b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml @@ -3,6 +3,10 @@ references: - D. Cereceda et al., International Journal of Plasticity 78:242-265, 2016, http://dx.doi.org/10.1016/j.ijplas.2015.09.002 + - A. Koester et al., + Acta Materialia 60:3894-3901, 2012 + http://dx.doi.org/10.1016/j.actamat.2012.03.053 +output: [Lambda_sl] N_sl: [12] b_sl: [2.72e-10] rho_mob_0: [1.0e+9] # estimated from section 3.2 @@ -12,18 +16,19 @@ B: [8.3e-5] omega: [9.1e+11] # nu_0 p_sl: [0.86] q_sl: [1.69] -tau_Peierls: [2.03e+9] # there is also tau_c^* = 2.92GPa, not clear in the paper +tau_Peierls: [2.03e+9] h: [2.566e-10] -a_nonSchmid: [0.938, 0.71, 4.43] h_sl-sl: [0.009, 0.72, 0.009, 0.05, 0.05, 0.06, 0.09] w: [2.992e-09] # 11b i_sl: [1] # c, eq. (25) D: 1.0e+20 # d_g, eq. (25) D_a: 1.0 # d_edge = D_a*b +# values in Cereceda et al. are high, using parameters from Koester et al. +a_nonSchmid: [0.61, 0.23, 0.55] # Table 1 + D_0: 0.0 # disable climb f_at: 1 Q_cl: 1.0 -output: [Lambda_sl] v_0: [1] From 6d117882c5965e0b5cc9583bd46bce5779b17a46 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 17:29:35 +0100 Subject: [PATCH 28/52] use precalculated value --- src/phase_mechanical_plastic_dislotungsten.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index 21ea34611..d1b932619 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -502,7 +502,7 @@ pure subroutine kinetics(Mp,T,ph,en, & 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 + * StressRatio_pminus1 / 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 @@ -532,7 +532,7 @@ pure subroutine kinetics(Mp,T,ph,en, & 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 + * StressRatio_pminus1 / 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 From 737eff91793e8b794124878f5a22bfb42b0699e4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 17:31:01 +0100 Subject: [PATCH 29/52] bugfix: change of behavior v_0 was erroneously introduced use tau = (tau_pos+tau_neg)/2 --- PRIVATE | 2 +- .../phase/mechanical/plastic/dislotungsten_W.yaml | 2 -- src/phase_mechanical_plastic_dislotungsten.f90 | 12 ++++-------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/PRIVATE b/PRIVATE index fabe69749..00a536a78 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit fabe69749425e8a7aceb3b7c2758b40d97d8b809 +Subproject commit 00a536a78508cb273071517128a7edc7c387088b diff --git a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml index 6efe77644..8f474d2a3 100644 --- a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml +++ b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml @@ -30,5 +30,3 @@ a_nonSchmid: [0.61, 0.23, 0.55] # Table 1 D_0: 0.0 # disable climb f_at: 1 Q_cl: 1.0 - -v_0: [1] diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index d1b932619..8970fd53c 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -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 @@ -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,7 +187,6 @@ 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) @@ -200,7 +197,6 @@ module function plastic_dislotungsten_init() result(myPlasticity) 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' @@ -211,7 +207,7 @@ module function plastic_dislotungsten_init() result(myPlasticity) else slipActive 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)) @@ -338,11 +334,11 @@ module subroutine dislotungsten_dotState(Mp,T,ph,en) dot%gamma_sl(:,en) = abs(dot_gamma_pos+dot_gamma_neg) - where(dEq0(tau_pos)) ! ToDo: use avg of +/- + 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)), & ! ToDo: use avg of +/- + 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, & @@ -480,7 +476,7 @@ pure subroutine kinetics(Mp,T,ph,en, & if (present(tau_neg_out)) tau_neg_out = tau_neg associate(BoltzmannRatio => prm%Q_s/(kB*T), & - dot_gamma_0 => stt%rho_mob(:,en)*prm%b_sl*prm%v_0, & + dot_gamma_0 => stt%rho_mob(:,en)*prm%b_sl, & effectiveLength => dst%Lambda_sl(:,en) - prm%w) tau_eff = abs(tau_pos)-dst%tau_pass(:,en) From 3f3224a9cb0734df1de18f04211f40d590dc43ec Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 18:59:57 +0100 Subject: [PATCH 30/52] found better source --- .../phase/mechanical/plastic/dislotungsten_W.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml index 8f474d2a3..cb1d837a1 100644 --- a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml +++ b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml @@ -3,9 +3,9 @@ references: - D. Cereceda et al., International Journal of Plasticity 78:242-265, 2016, http://dx.doi.org/10.1016/j.ijplas.2015.09.002 - - A. Koester et al., - Acta Materialia 60:3894-3901, 2012 - http://dx.doi.org/10.1016/j.actamat.2012.03.053 + - 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] @@ -24,8 +24,8 @@ i_sl: [1] # c, eq. (25) D: 1.0e+20 # d_g, eq. (25) D_a: 1.0 # d_edge = D_a*b -# values in Cereceda et al. are high, using parameters from Koester et al. -a_nonSchmid: [0.61, 0.23, 0.55] # Table 1 +# values in Cereceda et al. are high, using parameters from Gröger et al. +a_nonSchmid: [0.0, 0.56, 0.75] # Table 2 D_0: 0.0 # disable climb f_at: 1 From e0b6a28b4800a2438baa19aa9f8285df203c654b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 22:13:36 +0100 Subject: [PATCH 31/52] better matching name --- src/phase_mechanical_plastic_dislotungsten.f90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index 8970fd53c..c759cdaad 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -476,7 +476,7 @@ pure subroutine kinetics(Mp,T,ph,en, & if (present(tau_neg_out)) tau_neg_out = tau_neg associate(BoltzmannRatio => prm%Q_s/(kB*T), & - dot_gamma_0 => stt%rho_mob(:,en)*prm%b_sl, & + b_rho_half => stt%rho_mob(:,en) * prm%b_sl * 0.5_pReal, & effectiveLength => dst%Lambda_sl(:,en) - prm%w) tau_eff = abs(tau_pos)-dst%tau_pass(:,en) @@ -490,7 +490,7 @@ pure subroutine kinetics(Mp,T,ph,en, & / (prm%omega*effectiveLength) t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_eff) ! corrected eq. (14) - dot_gamma_pos = dot_gamma_0 * sign(prm%h/(t_n + t_k),tau_pos) * 0.5_pReal + 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 @@ -503,7 +503,7 @@ pure subroutine kinetics(Mp,T,ph,en, & dvel = -1.0_pReal * prm%h * (dtk + dtn) / (t_n + t_k)**2.0_pReal - ddot_gamma_dtau_pos = dot_gamma_0 * dvel* 0.5_pReal + ddot_gamma_dtau_pos = b_rho_half * dvel else where significantPositiveTau2 ddot_gamma_dtau_pos = 0.0_pReal end where significantPositiveTau2 @@ -520,7 +520,7 @@ pure subroutine kinetics(Mp,T,ph,en, & / (prm%omega*effectiveLength) t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_eff) ! corrected eq. (14) - dot_gamma_neg = dot_gamma_0 * sign(prm%h/(t_n + t_k),tau_neg) * 0.5_pReal + 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 @@ -533,7 +533,7 @@ pure subroutine kinetics(Mp,T,ph,en, & dvel = -1.0_pReal * prm%h * (dtk + dtn) / (t_n + t_k)**2.0_pReal - ddot_gamma_dtau_neg = dot_gamma_0 * dvel * 0.5_pReal + ddot_gamma_dtau_neg = b_rho_half * dvel else where significantNegativeTau2 ddot_gamma_dtau_neg = 0.0_pReal end where significantNegativeTau2 From 509835bf0bed72a2e3842e368caeb80b996d2e95 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 22:37:54 +0100 Subject: [PATCH 32/52] type hints for tensor adjustments to Rotation/Orientation needed to enable type checking with mypy --- python/damask/_orientation.py | 2 +- python/damask/_rotation.py | 9 +++++++-- python/damask/tensor.py | 12 ++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index 3d4d259ff..bb14fd38b 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -125,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__ diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index 74a3f7419..ac921d70a 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -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__ diff --git a/python/damask/tensor.py b/python/damask/tensor.py index cf5d94020..a735b355e 100644 --- a/python/damask/tensor.py +++ b/python/damask/tensor.py @@ -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. From 2d25dfcdf2811d1671e66d57bfc94fb5da2f8f9b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 22:43:06 +0100 Subject: [PATCH 33/52] automated type checking --- .gitlab-ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8680b2873..1fd5a6555 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,7 +81,7 @@ checkout: - release ################################################################################################### -processing: +pytest: stage: python script: - cd $DAMASKROOT/python @@ -91,6 +91,16 @@ processing: - master - release +mypy: + stage: python + script: + - cd $DAMASKROOT/python + - mypy damask/mechanics.py + except: + - master + - release + + ################################################################################################### compile_grid_Intel: From 0bc267c76b6101e9886101b522343eff6445df41 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Oct 2021 22:50:41 +0100 Subject: [PATCH 34/52] automated type checking for mechanics --- .gitlab-ci.yml | 3 +-- python/damask/mechanics.py | 42 ++++++++++++++++++++------------------ python/mypy.ini | 16 +++++++++++++++ 3 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 python/mypy.ini diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fd5a6555..83e9f8934 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,13 +95,12 @@ mypy: stage: python script: - cd $DAMASKROOT/python - - mypy damask/mechanics.py + - mypy damask/tensor.py damask/mechanics.py except: - master - release - ################################################################################################### compile_grid_Intel: stage: compile diff --git a/python/damask/mechanics.py b/python/damask/mechanics.py index 0e160523b..1a03f390b 100644 --- a/python/damask/mechanics.py +++ b/python/damask/mechanics.py @@ -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 (Seth–Hill 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. diff --git a/python/mypy.ini b/python/mypy.ini new file mode 100644 index 000000000..e6900781c --- /dev/null +++ b/python/mypy.ini @@ -0,0 +1,16 @@ +[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-yaml.*] +ignore_missing_imports = True +[mypy-pandas.*] +ignore_missing_imports = True +[mypy-wx.*] +ignore_missing_imports = True From 34e04fa45e98c522280c5832758d907c07d8445e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 1 Nov 2021 10:00:13 +0100 Subject: [PATCH 35/52] tests should work after updating test server typehints for numpy and pyyaml are now available --- python/mypy.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/mypy.ini b/python/mypy.ini index e6900781c..01001daa6 100644 --- a/python/mypy.ini +++ b/python/mypy.ini @@ -8,8 +8,6 @@ ignore_missing_imports = True ignore_missing_imports = True [mypy-matplotlib.*] ignore_missing_imports = True -[mypy-yaml.*] -ignore_missing_imports = True [mypy-pandas.*] ignore_missing_imports = True [mypy-wx.*] From 2e3de727ccf396d021116f2398d20126c2bbccfb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 2 Nov 2021 07:27:08 +0100 Subject: [PATCH 36/52] hint at issues with the current parametrization --- .../phase/mechanical/plastic/dislotungsten_W.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml index cb1d837a1..55814c3f8 100644 --- a/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml +++ b/examples/config/phase/mechanical/plastic/dislotungsten_W.yaml @@ -20,13 +20,16 @@ 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 -i_sl: [1] # c, eq. (25) -D: 1.0e+20 # d_g, eq. (25) -D_a: 1.0 # d_edge = D_a*b # values in Cereceda et al. are high, using parameters from Gröger et al. a_nonSchmid: [0.0, 0.56, 0.75] # Table 2 -D_0: 0.0 # disable climb +# (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 From 493a0969eb15837177e999add4d366377da6793e Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 2 Nov 2021 16:42:50 +0100 Subject: [PATCH 37/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-45-g1a558db83 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 98903601b..8c8e85679 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-31-gddb25ad0e +v3.0.0-alpha5-45-g1a558db83 From 32aff9d96619c68b85652efdb69157b2bd099851 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 2 Nov 2021 13:01:32 -0400 Subject: [PATCH 38/52] added typehints to seeds.py --- .gitlab-ci.yml | 2 +- python/damask/seeds.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 83e9f8934..e064cb0af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,7 +95,7 @@ mypy: stage: python script: - cd $DAMASKROOT/python - - mypy damask/tensor.py damask/mechanics.py + - mypy damask/tensor.py damask/mechanics.py damask/seeds.py except: - master - release diff --git a/python/damask/seeds.py b/python/damask/seeds.py index 26aa3084b..2203c9495 100644 --- a/python/damask/seeds.py +++ b/python/damask/seeds.py @@ -1,13 +1,16 @@ """Functionality for generation of seed points for Voronoi or Laguerre tessellation.""" from scipy import spatial as _spatial +from typing import Sequence + import numpy as _np from . import util as _util from . import grid_filters as _grid_filters +from . import _grid -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 +44,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 +79,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,7 +97,8 @@ 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: _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. From 735952bd32013b182b9c599c77e8d2b37ebd1404 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 2 Nov 2021 13:40:09 -0400 Subject: [PATCH 39/52] fixed typo --- python/damask/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/damask/__init__.py b/python/damask/__init__.py index 001e46276..231fa8b30 100644 --- a/python/damask/__init__.py +++ b/python/damask/__init__.py @@ -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 From 8636c5dad4be71fee5805c6394634ee7b146bbeb Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 2 Nov 2021 13:41:05 -0400 Subject: [PATCH 40/52] removed grid typehint <-- no clue how to break circular import --- python/damask/seeds.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/damask/seeds.py b/python/damask/seeds.py index 2203c9495..85b28850b 100644 --- a/python/damask/seeds.py +++ b/python/damask/seeds.py @@ -7,7 +7,6 @@ import numpy as _np from . import util as _util from . import grid_filters as _grid_filters -from . import _grid def from_random(size: _np.ndarray, N_seeds: int, cells: _np.ndarray = None, rng_seed=None) -> _np.ndarray: @@ -97,7 +96,7 @@ def from_Poisson_disc(size: _np.ndarray, N_seeds: int, N_candidates: int, distan return coords -def from_grid(grid: _grid.Grid, selection: Sequence[int] = None, +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. @@ -105,15 +104,15 @@ def from_grid(grid: _grid.Grid, selection: Sequence[int] = None, 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 ------- From ccfe276ae1283a2806b0b1dd9ad08119d7371b7e Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 2 Nov 2021 14:28:54 -0400 Subject: [PATCH 41/52] fixed type hinting for seeds.py and grid_filters.py --- python/damask/grid_filters.py | 56 ++++++++++++++++++++--------------- python/damask/seeds.py | 4 +-- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/python/damask/grid_filters.py b/python/damask/grid_filters.py index 816c727cd..cb6388f41 100644 --- a/python/damask/grid_filters.py +++ b/python/damask/grid_filters.py @@ -12,9 +12,11 @@ the following operations are required for tensorial data: """ from scipy import spatial as _spatial +from typing import Sequence, Tuple, Union + 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 +43,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 +74,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 +101,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 +128,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 +149,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 +158,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 +190,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 +211,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 +231,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 +253,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 +297,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 +330,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 +350,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 +371,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 +391,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 +413,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 +449,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 +477,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 +499,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 +521,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. diff --git a/python/damask/seeds.py b/python/damask/seeds.py index 85b28850b..1d7dfc58e 100644 --- a/python/damask/seeds.py +++ b/python/damask/seeds.py @@ -1,7 +1,7 @@ """Functionality for generation of seed points for Voronoi or Laguerre tessellation.""" from scipy import spatial as _spatial -from typing import Sequence +from typing import Sequence,Tuple import numpy as _np @@ -97,7 +97,7 @@ def from_Poisson_disc(size: _np.ndarray, N_seeds: int, N_candidates: int, distan def from_grid(grid, selection: Sequence[int] = None, - invert: bool = False, average: bool = False, periodic: bool = True) -> tuple[_np.ndarray, _np.ndarray]: + invert: bool = False, average: bool = False, periodic: bool = True) -> Tuple[_np.ndarray, _np.ndarray]: """ Create seeds from grid description. From 59a6dc365277d9eb3b997c5cd43f15bf18034ba4 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 2 Nov 2021 14:40:09 -0400 Subject: [PATCH 42/52] run mypy on all python/damask --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e064cb0af..14783263d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,7 +95,7 @@ mypy: stage: python script: - cd $DAMASKROOT/python - - mypy damask/tensor.py damask/mechanics.py damask/seeds.py + - mypy damask/*.py except: - master - release From f0c587d4aa468446201cdf850735a98728547332 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 3 Nov 2021 07:53:38 +0100 Subject: [PATCH 43/52] polishing oder of imports is build-in, 3rd party, internal --- .gitlab-ci.yml | 2 +- python/damask/grid_filters.py | 4 +++- python/damask/seeds.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14783263d..165cdc68f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,7 +95,7 @@ mypy: stage: python script: - cd $DAMASKROOT/python - - mypy damask/*.py + - mypy -m damask except: - master - release diff --git a/python/damask/grid_filters.py b/python/damask/grid_filters.py index cb6388f41..42b5a16c4 100644 --- a/python/damask/grid_filters.py +++ b/python/damask/grid_filters.py @@ -11,11 +11,13 @@ the following operations are required for tensorial data: - D1 = D3.reshape(cells+(-1,)).reshape(-1,9,order='F') """ -from scipy import spatial as _spatial + from typing import Sequence, Tuple, Union +from scipy import spatial as _spatial import numpy as _np + def _ks(size: _np.ndarray, cells: Union[_np.ndarray,Sequence[int]], first_order: bool = False) -> _np.ndarray: """ Get wave numbers operator. diff --git a/python/damask/seeds.py b/python/damask/seeds.py index 1d7dfc58e..4d5a8c624 100644 --- a/python/damask/seeds.py +++ b/python/damask/seeds.py @@ -1,8 +1,8 @@ """Functionality for generation of seed points for Voronoi or Laguerre tessellation.""" -from scipy import spatial as _spatial from typing import Sequence,Tuple +from scipy import spatial as _spatial import numpy as _np from . import util as _util From ba66d7b8164693d31efb94d36d87e1e5678710bf Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 4 Nov 2021 21:19:55 +0100 Subject: [PATCH 44/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-52-g5b0ad1eb8 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 8c8e85679..9ddbae920 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-45-g1a558db83 +v3.0.0-alpha5-52-g5b0ad1eb8 From 5142813a9879117cd11652bab75c10b8bbd55ba8 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 5 Nov 2021 10:23:36 +0100 Subject: [PATCH 45/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-64-g8e08af31e --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 9ddbae920..bd451b119 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-52-g5b0ad1eb8 +v3.0.0-alpha5-64-g8e08af31e From 292449aca9a4b550b5c21fe8d1c1644d1f633555 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 9 Nov 2021 19:30:35 +0000 Subject: [PATCH 46/52] W has cI, not cF --- examples/config/phase/W.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/config/phase/W.yaml b/examples/config/phase/W.yaml index 8be7d38a6..740fe0992 100644 --- a/examples/config/phase/W.yaml +++ b/examples/config/phase/W.yaml @@ -1,4 +1,4 @@ references: - https://en.wikipedia.org/wiki/Tungsten -lattice: cF +lattice: cI rho: 19300.0 From 186b688b04f0440ab59d967869243525f91a391e Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 9 Nov 2021 15:10:19 -0500 Subject: [PATCH 47/52] only look for opening part of tag --- src/grid/discretization_grid.f90 | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/grid/discretization_grid.f90 b/src/grid/discretization_grid.f90 index e16001feb..515f9977f 100644 --- a/src/grid/discretization_grid.f90 +++ b/src/grid/discretization_grid.f90 @@ -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 @@ -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,7 +136,7 @@ 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') @@ -202,7 +202,7 @@ 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),'',kind=pI64) /= 0_pI64) then + if (index(fileContent(startPos:endPos),'',kind=pI64) == 0_pI64) if (index(fileContent(startPos:endPos),' Date: Wed, 10 Nov 2021 16:56:47 +0100 Subject: [PATCH 48/52] 'standard' style --- src/grid/discretization_grid.f90 | 53 +++++++++++++++++--------------- src/prec.f90 | 16 +++++----- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/grid/discretization_grid.f90 b/src/grid/discretization_grid.f90 index 515f9977f..69746bbe3 100644 --- a/src/grid/discretization_grid.f90 +++ b/src/grid/discretization_grid.f90 @@ -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) @@ -143,7 +143,7 @@ subroutine discretization_grid_init(restart) 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 @@ -207,13 +207,13 @@ subroutine readVTI(grid,geomSize,origin,material, & 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),' Date: Thu, 11 Nov 2021 23:04:00 +0100 Subject: [PATCH 49/52] use fixed PETSc already includes new version of ML proposed in https://gitlab.com/petsc/petsc/-/merge_requests/4549 --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 165cdc68f..5fdd9869c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,8 +52,8 @@ variables: MPI_Intel: "MPI/Intel/19.1.2/IntelMPI/2019" MPI_GNU: "MPI/GNU/10/OpenMPI/4.1.1" # ++++++++++++ PETSc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - PETSc_Intel: "Libraries/PETSc/3.16.0/Intel-19.1.2-IntelMPI-2019" - PETSc_GNU: "Libraries/PETSc/3.16.0/GNU-10-OpenMPI-4.1.1" + 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" From ba31ff726337c770a5063ac4195f3efcd689fcb4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 11 Nov 2021 23:23:14 +0100 Subject: [PATCH 50/52] do not rely on ML per default --- PRIVATE | 2 +- src/mesh/FEM_utilities.f90 | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/PRIVATE b/PRIVATE index 5a769ec75..532cfadc1 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 5a769ec759d9dacc1866c35c6663cd0001e198c5 +Subproject commit 532cfadc1fda4f0f7f6a993e2bd029f14a50668f diff --git a/src/mesh/FEM_utilities.f90 b/src/mesh/FEM_utilities.f90 index a3856ccaa..d9e985ebd 100644 --- a/src/mesh/FEM_utilities.f90 +++ b/src/mesh/FEM_utilities.f90 @@ -123,9 +123,7 @@ 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) @@ -151,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 From 8138d3a180b121c81727f2550e42b1121e4d83e1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 11 Nov 2021 23:59:48 +0100 Subject: [PATCH 51/52] style adjustments --- src/mesh/FEM_utilities.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesh/FEM_utilities.f90 b/src/mesh/FEM_utilities.f90 index d9e985ebd..fde8831db 100644 --- a/src/mesh/FEM_utilities.f90 +++ b/src/mesh/FEM_utilities.f90 @@ -177,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) @@ -188,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) From e8d2281bb58519a579aa68ba7800a3fa0b3d28a7 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 12 Nov 2021 08:43:50 +0100 Subject: [PATCH 52/52] [skip ci] updated version information after successful test of v3.0.0-alpha5-72-g8138d3a18 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index bd451b119..7b46fdedc 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-64-g8e08af31e +v3.0.0-alpha5-72-g8138d3a18