From 26ab0365be98cff7444ae81baebfb3dea8f96d15 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Apr 2022 17:30:37 +0200 Subject: [PATCH 01/88] only used by the grid solver --- src/{ => grid}/VTI.f90 | 0 src/{ => grid}/base64.f90 | 0 src/{ => grid}/zlib.f90 | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename src/{ => grid}/VTI.f90 (100%) rename src/{ => grid}/base64.f90 (100%) rename src/{ => grid}/zlib.f90 (100%) diff --git a/src/VTI.f90 b/src/grid/VTI.f90 similarity index 100% rename from src/VTI.f90 rename to src/grid/VTI.f90 diff --git a/src/base64.f90 b/src/grid/base64.f90 similarity index 100% rename from src/base64.f90 rename to src/grid/base64.f90 diff --git a/src/zlib.f90 b/src/grid/zlib.f90 similarity index 100% rename from src/zlib.f90 rename to src/grid/zlib.f90 From d41d03015a8db35b8a0bacb2c2c5da6297592406 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Apr 2022 17:35:59 +0200 Subject: [PATCH 02/88] better matching name --- src/CMakeLists.txt | 2 +- src/DAMASK_Marc.f90 | 24 ++--- src/commercialFEM_fileList.f90 | 2 +- src/grid/DAMASK_grid.f90 | 12 +-- src/{CPFEM.f90 => materialpoint.f90} | 126 ++++++++++++------------- src/{CPFEM2.f90 => materialpoint2.f90} | 28 +++--- src/mesh/DAMASK_mesh.f90 | 8 +- 7 files changed, 101 insertions(+), 101 deletions(-) rename src/{CPFEM.f90 => materialpoint.f90} (67%) rename src/{CPFEM2.f90 => materialpoint2.f90} (88%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 82efe8748..ff24066de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,7 +7,7 @@ endif() file(GLOB damask-sources CONFIGURE_DEPENDS *.f90 *.c) # probably we should have a subfolder for MSC.Marc -list(FILTER damask-sources EXCLUDE REGEX ".*CPFEM.f90") +list(FILTER damask-sources EXCLUDE REGEX ".*materialpoint.f90") list(FILTER damask-sources EXCLUDE REGEX ".*DAMASK_Marc.*.f90") list(FILTER damask-sources EXCLUDE REGEX ".*commercialFEM_fileList.*.f90") diff --git a/src/DAMASK_Marc.f90 b/src/DAMASK_Marc.f90 index 6e969ced4..22e6261ca 100644 --- a/src/DAMASK_Marc.f90 +++ b/src/DAMASK_Marc.f90 @@ -160,7 +160,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & use YAML_types use discretization_marc use homogenization - use CPFEM + use materialpoint implicit none include "omp_lib.h" ! the openMP function library @@ -232,7 +232,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & logical, save :: & lastIncConverged = .false., & !< needs description outdatedByNewInc = .false., & !< needs description - CPFEM_init_done = .false., & !< remember whether init has been done already + materialpoint_init_done = .false., & !< remember whether init has been done already debug_basic = .true. class(tNode), pointer :: & debug_Marc ! pointer to Marc debug options @@ -255,9 +255,9 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc call omp_set_num_threads(1_pI32) ! no openMP - if (.not. CPFEM_init_done) then - CPFEM_init_done = .true. - call CPFEM_initAll + if (.not. materialpoint_init_done) then + materialpoint_init_done = .true. + call materialpoint_initAll debug_Marc => config_debug%get('Marc',defaultVal=emptyList) debug_basic = debug_Marc%contains('basic') endif @@ -265,9 +265,9 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & computationMode = 0 ! save initialization value, since it does not result in any calculation if (lovl == 4 ) then ! jacobian requested by marc if (timinc < theDelta .and. theInc == inc .and. lastLovl /= lovl) & ! first after cutback - computationMode = CPFEM_RESTOREJACOBIAN + computationMode = materialpoint_RESTOREJACOBIAN elseif (lovl == 6) then ! stress requested by marc - computationMode = CPFEM_CALCRESULTS + computationMode = materialpoint_CALCRESULTS if (cptim > theTime .or. inc /= theInc) then ! reached "convergence" terminallyIll = .false. cycleCounter = -1 ! first calc step increments this to cycle = 0 @@ -300,11 +300,11 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & !call mesh_build_ipCoordinates() ! update ip coordinates endif if (outdatedByNewInc) then - computationMode = ior(computationMode,CPFEM_AGERESULTS) + computationMode = ior(computationMode,materialpoint_AGERESULTS) outdatedByNewInc = .false. endif if (lastIncConverged) then - computationMode = ior(computationMode,CPFEM_BACKUPJACOBIAN) + computationMode = ior(computationMode,materialpoint_BACKUPJACOBIAN) lastIncConverged = .false. endif @@ -315,7 +315,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & endif lastLovl = lovl - call CPFEM_general(computationMode,ffn,ffn1,t(1),timinc,m(1),nn,stress,ddsdde) + call materialpoint_general(computationMode,ffn,ffn1,t(1),timinc,m(1),nn,stress,ddsdde) d = ddsdde(1:ngens,1:ngens) s = stress(1:ndi+nshear) @@ -359,7 +359,7 @@ subroutine flux(f,ts,n,time) !-------------------------------------------------------------------------------------------------- subroutine uedinc(inc,incsub) use prec - use CPFEM + use materialpoint use discretization_marc implicit none @@ -380,7 +380,7 @@ subroutine uedinc(inc,incsub) enddo call discretization_marc_UpdateNodeAndIpCoords(d_n) - call CPFEM_results(inc,cptim) + call materialpoint_results(inc,cptim) inc_written = inc endif diff --git a/src/commercialFEM_fileList.f90 b/src/commercialFEM_fileList.f90 index 8dbbea706..8bcf2f454 100644 --- a/src/commercialFEM_fileList.f90 +++ b/src/commercialFEM_fileList.f90 @@ -51,4 +51,4 @@ #include "homogenization_thermal_isotemperature.f90" #include "homogenization_damage.f90" #include "homogenization_damage_pass.f90" -#include "CPFEM.f90" +#include "materialpoint.f90" diff --git a/src/grid/DAMASK_grid.f90 b/src/grid/DAMASK_grid.f90 index 39870a8ff..e42912b23 100644 --- a/src/grid/DAMASK_grid.f90 +++ b/src/grid/DAMASK_grid.f90 @@ -19,7 +19,7 @@ program DAMASK_grid use IO use config use math - use CPFEM2 + use materialpoint2 use material use spectral_utilities use grid_mechanical_spectral_basic @@ -116,7 +116,7 @@ program DAMASK_grid !-------------------------------------------------------------------------------------------------- ! init DAMASK (all modules) - call CPFEM_initAll + call materialpoint_initAll() print'(/,1x,a)', '<<<+- DAMASK_grid init -+>>>'; flush(IO_STDOUT) print'(/,1x,a)', 'P. Shanthraj et al., Handbook of Mechanics of Materials, 2019' @@ -326,7 +326,7 @@ program DAMASK_grid writeUndeformed: if (interface_restartInc < 1) then print'(/,1x,a)', '... writing initial configuration to file .................................' flush(IO_STDOUT) - call CPFEM_results(0,0.0_pReal) + call materialpoint_results(0,0.0_pReal) endif writeUndeformed loadCaseLooping: do l = 1, size(loadCases) @@ -386,7 +386,7 @@ program DAMASK_grid case(FIELD_DAMAGE_ID); call grid_damage_spectral_forward(cutBack) end select enddo - if (.not. cutBack) call CPFEM_forward + if (.not. cutBack) call materialpoint_forward !-------------------------------------------------------------------------------------------------- ! solve fields @@ -453,7 +453,7 @@ program DAMASK_grid if (mod(inc,loadCases(l)%f_out) == 0 .or. signal) then print'(/,1x,a)', '... writing results to file ...............................................' flush(IO_STDOUT) - call CPFEM_results(totalIncsCounter,t) + call materialpoint_results(totalIncsCounter,t) endif if (signal) call interface_setSIGUSR1(.false.) call MPI_Allreduce(interface_SIGUSR2,signal,1_MPI_INTEGER_KIND,MPI_LOGICAL,MPI_LOR,MPI_COMM_WORLD,err_MPI) @@ -467,7 +467,7 @@ program DAMASK_grid call grid_thermal_spectral_restartWrite end select end do - call CPFEM_restartWrite + call materialpoint_restartWrite endif if (signal) call interface_setSIGUSR2(.false.) call MPI_Allreduce(interface_SIGTERM,signal,1_MPI_INTEGER_KIND,MPI_LOGICAL,MPI_LOR,MPI_COMM_WORLD,err_MPI) diff --git a/src/CPFEM.f90 b/src/materialpoint.f90 similarity index 67% rename from src/CPFEM.f90 rename to src/materialpoint.f90 index 37e4ba737..743113036 100644 --- a/src/CPFEM.f90 +++ b/src/materialpoint.f90 @@ -1,9 +1,9 @@ !-------------------------------------------------------------------------------------------------- !> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH -!> @brief CPFEM engine +!> @brief materialpoint engine !-------------------------------------------------------------------------------------------------- -module CPFEM +module materialpoint use DAMASK_interface use prec use IO @@ -27,24 +27,24 @@ module CPFEM private real(pReal), dimension (:,:,:), allocatable, private :: & - CPFEM_cs !< Cauchy stress + materialpoint_cs !< Cauchy stress real(pReal), dimension (:,:,:,:), allocatable, private :: & - CPFEM_dcsdE !< Cauchy stress tangent + materialpoint_dcsdE !< Cauchy stress tangent real(pReal), dimension (:,:,:,:), allocatable, private :: & - CPFEM_dcsdE_knownGood !< known good tangent + materialpoint_dcsdE_knownGood !< known good tangent integer, public :: & cycleCounter = 0 !< needs description integer, parameter, public :: & - CPFEM_CALCRESULTS = 2**0, & - CPFEM_AGERESULTS = 2**1, & - CPFEM_BACKUPJACOBIAN = 2**2, & - CPFEM_RESTOREJACOBIAN = 2**3 + materialpoint_CALCRESULTS = 2**0, & + materialpoint_AGERESULTS = 2**1, & + materialpoint_BACKUPJACOBIAN = 2**2, & + materialpoint_RESTOREJACOBIAN = 2**3 type, private :: tNumerics integer :: & - iJacoStiffness !< frequency of stiffness update + iJacoStiffness !< frequency of stiffness update end type tNumerics type(tNumerics), private :: num @@ -59,12 +59,12 @@ module CPFEM ip end type tDebugOptions - type(tDebugOptions), private :: debugCPFEM + type(tDebugOptions), private :: debugmaterialpoint public :: & - CPFEM_general, & - CPFEM_initAll, & - CPFEM_results + materialpoint_general, & + materialpoint_initAll, & + materialpoint_results contains @@ -72,7 +72,7 @@ contains !-------------------------------------------------------------------------------------------------- !> @brief Initialize all modules. !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_initAll +subroutine materialpoint_initAll call DAMASK_interface_init call prec_init @@ -90,50 +90,50 @@ subroutine CPFEM_initAll call material_init(.false.) call phase_init call homogenization_init - call CPFEM_init + call materialpoint_init call config_deallocate -end subroutine CPFEM_initAll +end subroutine materialpoint_initAll !-------------------------------------------------------------------------------------------------- -!> @brief allocate the arrays defined in module CPFEM and initialize them +!> @brief allocate the arrays defined in module materialpoint and initialize them !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_init +subroutine materialpoint_init class(tNode), pointer :: & - debug_CPFEM + debug_materialpoint - print'(/,1x,a)', '<<<+- CPFEM init -+>>>'; flush(IO_STDOUT) + print'(/,1x,a)', '<<<+- materialpoint init -+>>>'; flush(IO_STDOUT) - allocate(CPFEM_cs( 6,discretization_nIPs,discretization_Nelems), source= 0.0_pReal) - allocate(CPFEM_dcsdE( 6,6,discretization_nIPs,discretization_Nelems), source= 0.0_pReal) - allocate(CPFEM_dcsdE_knownGood(6,6,discretization_nIPs,discretization_Nelems), source= 0.0_pReal) + allocate(materialpoint_cs( 6,discretization_nIPs,discretization_Nelems), source= 0.0_pReal) + allocate(materialpoint_dcsdE( 6,6,discretization_nIPs,discretization_Nelems), source= 0.0_pReal) + allocate(materialpoint_dcsdE_knownGood(6,6,discretization_nIPs,discretization_Nelems), source= 0.0_pReal) !------------------------------------------------------------------------------ ! read debug options - debug_CPFEM => config_debug%get('CPFEM',defaultVal=emptyList) - debugCPFEM%basic = debug_CPFEM%contains('basic') - debugCPFEM%extensive = debug_CPFEM%contains('extensive') - debugCPFEM%selective = debug_CPFEM%contains('selective') - debugCPFEM%element = config_debug%get_asInt('element',defaultVal = 1) - debugCPFEM%ip = config_debug%get_asInt('integrationpoint',defaultVal = 1) + debug_materialpoint => config_debug%get('materialpoint',defaultVal=emptyList) + debugmaterialpoint%basic = debug_materialpoint%contains('basic') + debugmaterialpoint%extensive = debug_materialpoint%contains('extensive') + debugmaterialpoint%selective = debug_materialpoint%contains('selective') + debugmaterialpoint%element = config_debug%get_asInt('element',defaultVal = 1) + debugmaterialpoint%ip = config_debug%get_asInt('integrationpoint',defaultVal = 1) - if(debugCPFEM%basic) then - print'(a32,1x,6(i8,1x))', 'CPFEM_cs: ', shape(CPFEM_cs) - print'(a32,1x,6(i8,1x))', 'CPFEM_dcsdE: ', shape(CPFEM_dcsdE) - print'(a32,1x,6(i8,1x),/)', 'CPFEM_dcsdE_knownGood: ', shape(CPFEM_dcsdE_knownGood) + if(debugmaterialpoint%basic) then + print'(a32,1x,6(i8,1x))', 'materialpoint_cs: ', shape(materialpoint_cs) + print'(a32,1x,6(i8,1x))', 'materialpoint_dcsdE: ', shape(materialpoint_dcsdE) + print'(a32,1x,6(i8,1x),/)', 'materialpoint_dcsdE_knownGood: ', shape(materialpoint_dcsdE_knownGood) flush(IO_STDOUT) endif -end subroutine CPFEM_init +end subroutine materialpoint_init !-------------------------------------------------------------------------------------------------- !> @brief perform initialization at first call, update variables and call the actual material model !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyStress, jacobian) +subroutine materialpoint_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyStress, jacobian) integer, intent(in) :: elFE, & !< FE element number ip !< integration point number @@ -161,7 +161,7 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS elCP = discretization_Marc_FEM2DAMASK_elem(elFE) ce = discretization_Marc_FEM2DAMASK_cell(ip,elFE) - if (debugCPFEM%basic .and. elCP == debugCPFEM%element .and. ip == debugCPFEM%ip) then + if (debugmaterialpoint%basic .and. elCP == debugmaterialpoint%element .and. ip == debugmaterialpoint%ip) then print'(/,a)', '#############################################' print'(a1,a22,1x,i8,a13)', '#','element', elCP, '#' print'(a1,a22,1x,i8,a13)', '#','ip', ip, '#' @@ -172,26 +172,26 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS print'(a,/)', '#############################################'; flush (6) endif - if (iand(mode, CPFEM_BACKUPJACOBIAN) /= 0) & - CPFEM_dcsde_knownGood = CPFEM_dcsde - if (iand(mode, CPFEM_RESTOREJACOBIAN) /= 0) & - CPFEM_dcsde = CPFEM_dcsde_knownGood + if (iand(mode, materialpoint_BACKUPJACOBIAN) /= 0) & + materialpoint_dcsde_knownGood = materialpoint_dcsde + if (iand(mode, materialpoint_RESTOREJACOBIAN) /= 0) & + materialpoint_dcsde = materialpoint_dcsde_knownGood - if (iand(mode, CPFEM_AGERESULTS) /= 0) call CPFEM_forward + if (iand(mode, materialpoint_AGERESULTS) /= 0) call materialpoint_forward homogenization_F0(1:3,1:3,ce) = ffn homogenization_F(1:3,1:3,ce) = ffn1 - if (iand(mode, CPFEM_CALCRESULTS) /= 0) then + if (iand(mode, materialpoint_CALCRESULTS) /= 0) then validCalculation: if (terminallyIll) then call random_number(rnd) if (rnd < 0.5_pReal) rnd = rnd - 1.0_pReal - CPFEM_cs(1:6,ip,elCP) = ODD_STRESS * rnd - CPFEM_dcsde(1:6,1:6,ip,elCP) = ODD_JACOBIAN * math_eye(6) + materialpoint_cs(1:6,ip,elCP) = ODD_STRESS * rnd + materialpoint_dcsde(1:6,1:6,ip,elCP) = ODD_JACOBIAN * math_eye(6) else validCalculation - if (debugCPFEM%extensive) print'(a,i8,1x,i2)', '<< CPFEM >> calculation for elFE ip ',elFE,ip + if (debugmaterialpoint%extensive) print'(a,i8,1x,i2)', '<< materialpoint >> calculation for elFE ip ',elFE,ip call homogenization_mechanical_response(dt,(elCP-1)*discretization_nIPs + ip,(elCP-1)*discretization_nIPs + ip) if (.not. terminallyIll) & call homogenization_mechanical_response2(dt,[ip,ip],[elCP,elCP]) @@ -200,15 +200,15 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS call random_number(rnd) if (rnd < 0.5_pReal) rnd = rnd - 1.0_pReal - CPFEM_cs(1:6,ip,elCP) = ODD_STRESS * rnd - CPFEM_dcsde(1:6,1:6,ip,elCP) = ODD_JACOBIAN * math_eye(6) + materialpoint_cs(1:6,ip,elCP) = ODD_STRESS * rnd + materialpoint_dcsde(1:6,1:6,ip,elCP) = ODD_JACOBIAN * math_eye(6) else terminalIllness ! translate from P to sigma Kirchhoff = matmul(homogenization_P(1:3,1:3,ce), transpose(homogenization_F(1:3,1:3,ce))) J_inverse = 1.0_pReal / math_det33(homogenization_F(1:3,1:3,ce)) - CPFEM_cs(1:6,ip,elCP) = math_sym33to6(J_inverse * Kirchhoff,weighted=.false.) + materialpoint_cs(1:6,ip,elCP) = math_sym33to6(J_inverse * Kirchhoff,weighted=.false.) ! translate from dP/dF to dCS/dE H = 0.0_pReal @@ -224,45 +224,45 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS forall(i=1:3, j=1:3,k=1:3,l=1:3) & H_sym(i,j,k,l) = 0.25_pReal * (H(i,j,k,l) + H(j,i,k,l) + H(i,j,l,k) + H(j,i,l,k)) - CPFEM_dcsde(1:6,1:6,ip,elCP) = math_sym3333to66(J_inverse * H_sym,weighted=.false.) + materialpoint_dcsde(1:6,1:6,ip,elCP) = math_sym3333to66(J_inverse * H_sym,weighted=.false.) endif terminalIllness endif validCalculation - if (debugCPFEM%extensive & - .and. ((debugCPFEM%element == elCP .and. debugCPFEM%ip == ip) .or. .not. debugCPFEM%selective)) then + if (debugmaterialpoint%extensive & + .and. ((debugmaterialpoint%element == elCP .and. debugmaterialpoint%ip == ip) .or. .not. debugmaterialpoint%selective)) then print'(a,i8,1x,i2,/,12x,6(f10.3,1x)/)', & - '<< CPFEM >> stress/MPa at elFE ip ', elFE, ip, CPFEM_cs(1:6,ip,elCP)*1.0e-6_pReal + '<< materialpoint >> stress/MPa at elFE ip ', elFE, ip, materialpoint_cs(1:6,ip,elCP)*1.0e-6_pReal print'(a,i8,1x,i2,/,6(12x,6(f10.3,1x)/))', & - '<< CPFEM >> Jacobian/GPa at elFE ip ', elFE, ip, transpose(CPFEM_dcsdE(1:6,1:6,ip,elCP))*1.0e-9_pReal + '<< materialpoint >> Jacobian/GPa at elFE ip ', elFE, ip, transpose(materialpoint_dcsdE(1:6,1:6,ip,elCP))*1.0e-9_pReal flush(IO_STDOUT) endif endif - if (all(abs(CPFEM_dcsdE(1:6,1:6,ip,elCP)) < 1e-10_pReal)) call IO_warning(601,elCP,ip) + if (all(abs(materialpoint_dcsdE(1:6,1:6,ip,elCP)) < 1e-10_pReal)) call IO_warning(601,elCP,ip) - cauchyStress = CPFEM_cs (1:6, ip,elCP) - jacobian = CPFEM_dcsdE(1:6,1:6,ip,elCP) + cauchyStress = materialpoint_cs (1:6, ip,elCP) + jacobian = materialpoint_dcsdE(1:6,1:6,ip,elCP) -end subroutine CPFEM_general +end subroutine materialpoint_general !-------------------------------------------------------------------------------------------------- !> @brief Forward data for new time increment. !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_forward +subroutine materialpoint_forward call homogenization_forward call phase_forward -end subroutine CPFEM_forward +end subroutine materialpoint_forward !-------------------------------------------------------------------------------------------------- !> @brief Trigger writing of results. !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_results(inc,time) +subroutine materialpoint_results(inc,time) integer, intent(in) :: inc real(pReal), intent(in) :: time @@ -275,6 +275,6 @@ subroutine CPFEM_results(inc,time) call results_finalizeIncrement call results_closeJobFile -end subroutine CPFEM_results +end subroutine materialpoint_results -end module CPFEM +end module materialpoint diff --git a/src/CPFEM2.f90 b/src/materialpoint2.f90 similarity index 88% rename from src/CPFEM2.f90 rename to src/materialpoint2.f90 index b24ba5480..36eefefb2 100644 --- a/src/CPFEM2.f90 +++ b/src/materialpoint2.f90 @@ -3,7 +3,7 @@ !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @brief needs a good name and description !-------------------------------------------------------------------------------------------------- -module CPFEM2 +module materialpoint2 use parallelization use DAMASK_interface use prec @@ -40,7 +40,7 @@ contains !-------------------------------------------------------------------------------------------------- !> @brief Initialize all modules. !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_initAll +subroutine materialpoint_initAll call parallelization_init call DAMASK_interface_init ! Spectral and FEM interface to commandline @@ -68,21 +68,21 @@ subroutine CPFEM_initAll call material_init(restart=interface_restartInc>0) call phase_init call homogenization_init - call CPFEM_init + call materialpoint_init call config_deallocate -end subroutine CPFEM_initAll +end subroutine materialpoint_initAll !-------------------------------------------------------------------------------------------------- !> @brief Read restart information if needed. !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_init +subroutine materialpoint_init integer(HID_T) :: fileHandle - print'(/,1x,a)', '<<<+- CPFEM init -+>>>'; flush(IO_STDOUT) + print'(/,1x,a)', '<<<+- materialpoint init -+>>>'; flush(IO_STDOUT) if (interface_restartInc > 0) then @@ -96,13 +96,13 @@ subroutine CPFEM_init call HDF5_closeFile(fileHandle) endif -end subroutine CPFEM_init +end subroutine materialpoint_init !-------------------------------------------------------------------------------------------------- !> @brief Write restart information. !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_restartWrite +subroutine materialpoint_restartWrite integer(HID_T) :: fileHandle @@ -116,24 +116,24 @@ subroutine CPFEM_restartWrite call HDF5_closeFile(fileHandle) -end subroutine CPFEM_restartWrite +end subroutine materialpoint_restartWrite !-------------------------------------------------------------------------------------------------- !> @brief Forward data for new time increment. !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_forward +subroutine materialpoint_forward call homogenization_forward call phase_forward -end subroutine CPFEM_forward +end subroutine materialpoint_forward !-------------------------------------------------------------------------------------------------- !> @brief Trigger writing of results. !-------------------------------------------------------------------------------------------------- -subroutine CPFEM_results(inc,time) +subroutine materialpoint_results(inc,time) integer, intent(in) :: inc real(pReal), intent(in) :: time @@ -146,6 +146,6 @@ subroutine CPFEM_results(inc,time) call results_finalizeIncrement call results_closeJobFile -end subroutine CPFEM_results +end subroutine materialpoint_results -end module CPFEM2 +end module materialpoint2 diff --git a/src/mesh/DAMASK_mesh.f90 b/src/mesh/DAMASK_mesh.f90 index 065eca1cb..b066611d8 100644 --- a/src/mesh/DAMASK_mesh.f90 +++ b/src/mesh/DAMASK_mesh.f90 @@ -14,7 +14,7 @@ program DAMASK_mesh use parallelization use IO use math - use CPFEM2 + use materialpoint2 use config use discretization_mesh use FEM_Utilities @@ -85,7 +85,7 @@ program DAMASK_mesh !-------------------------------------------------------------------------------------------------- ! init DAMASK (all modules) - call CPFEM_initAll + call materialpoint_initAll() print'(/,1x,a)', '<<<+- DAMASK_mesh init -+>>>'; flush(IO_STDOUT) !--------------------------------------------------------------------- @@ -239,7 +239,7 @@ program DAMASK_mesh print'(/,1x,a)', '... writing initial configuration to file .................................' flush(IO_STDOUT) - call CPFEM_results(0,0.0_pReal) + call materialpoint_results(0,0.0_pReal) loadCaseLooping: do currentLoadCase = 1, size(loadCases) time0 = time ! load case start time @@ -325,7 +325,7 @@ program DAMASK_mesh if (mod(inc,loadCases(currentLoadCase)%outputFrequency) == 0) then ! at output frequency print'(/,1x,a)', '... writing results to file ...............................................' call FEM_mechanical_updateCoords - call CPFEM_results(totalIncsCounter,time) + call materialpoint_results(totalIncsCounter,time) end if From 9979062c6ed35a2c2840bbf0af480766dcde4b67 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Apr 2022 17:44:20 +0200 Subject: [PATCH 03/88] use correct location and capitalized preprocessor macro --- install/MarcMentat/2020/Marc_tools/include_linux64.patch | 6 +++--- install/MarcMentat/2021.2/Marc_tools/include_linux64.patch | 6 +++--- .../MarcMentat/2021.3.1/Marc_tools/include_linux64.patch | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/install/MarcMentat/2020/Marc_tools/include_linux64.patch b/install/MarcMentat/2020/Marc_tools/include_linux64.patch index 133ca07cb..043b887f0 100644 --- a/install/MarcMentat/2020/Marc_tools/include_linux64.patch +++ b/install/MarcMentat/2020/Marc_tools/include_linux64.patch @@ -56,15 +56,15 @@ + +# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 +DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" +DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" +DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" diff --git a/install/MarcMentat/2021.2/Marc_tools/include_linux64.patch b/install/MarcMentat/2021.2/Marc_tools/include_linux64.patch index 452618457..e8dede2ea 100644 --- a/install/MarcMentat/2021.2/Marc_tools/include_linux64.patch +++ b/install/MarcMentat/2021.2/Marc_tools/include_linux64.patch @@ -56,15 +56,15 @@ + +# DAMASK compiler calls +DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2021.2 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2021.2 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2021.2 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" diff --git a/install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch b/install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch index 4adec9db1..f0276bb62 100644 --- a/install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch +++ b/install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch @@ -55,15 +55,15 @@ + +# DAMASK compiler calls +DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2021.3.1 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2021.3.1 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -+ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2021.3.1 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" + From 1b9c0713cbe630ea8a67ebe534ee1a539f340268 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Apr 2022 17:47:26 +0200 Subject: [PATCH 04/88] symlink was broken --- python/README | 1 - python/README.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 120000 python/README create mode 120000 python/README.md diff --git a/python/README b/python/README deleted file mode 120000 index 59a23c461..000000000 --- a/python/README +++ /dev/null @@ -1 +0,0 @@ -../README \ No newline at end of file diff --git a/python/README.md b/python/README.md new file mode 120000 index 000000000..32d46ee88 --- /dev/null +++ b/python/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file From 7a4097d52bab1f7dba48f8f569e6074a5fafcdd2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Apr 2022 18:50:23 +0200 Subject: [PATCH 05/88] Marc code belongs to Marc subfolder --- python/damask/solver/_marc.py | 2 +- src/CMakeLists.txt | 4 --- src/{ => Marc}/DAMASK_Marc.f90 | 59 ++++++++++++++++++++++++++++++---- src/commercialFEM_fileList.f90 | 54 ------------------------------- src/materialpoint.f90 | 2 +- 5 files changed, 55 insertions(+), 66 deletions(-) rename src/{ => Marc}/DAMASK_Marc.f90 (91%) delete mode 100644 src/commercialFEM_fileList.f90 diff --git a/python/damask/solver/_marc.py b/python/damask/solver/_marc.py index 135736d14..3d006d27b 100644 --- a/python/damask/solver/_marc.py +++ b/python/damask/solver/_marc.py @@ -64,7 +64,7 @@ class Marc: Defaults to ''. """ - usersub = (self.damask_root/'src/DAMASK_Marc').with_suffix('.f90' if compile else '.marc') + usersub = (self.damask_root/'src/Marc/DAMASK_Marc').with_suffix('.f90' if compile else '.marc') if not usersub.is_file(): raise FileNotFoundError(f'subroutine ({"source" if compile else "binary"}) "{usersub}" not found') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ff24066de..0d1f71b30 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,11 +6,7 @@ endif() file(GLOB damask-sources CONFIGURE_DEPENDS *.f90 *.c) -# probably we should have a subfolder for MSC.Marc list(FILTER damask-sources EXCLUDE REGEX ".*materialpoint.f90") -list(FILTER damask-sources EXCLUDE REGEX ".*DAMASK_Marc.*.f90") -list(FILTER damask-sources EXCLUDE REGEX ".*commercialFEM_fileList.*.f90") - if(PROJECT_NAME STREQUAL "damask-grid") set(executable-name "DAMASK_grid") diff --git a/src/DAMASK_Marc.f90 b/src/Marc/DAMASK_Marc.f90 similarity index 91% rename from src/DAMASK_Marc.f90 rename to src/Marc/DAMASK_Marc.f90 index 22e6261ca..da9702dc6 100644 --- a/src/DAMASK_Marc.f90 +++ b/src/Marc/DAMASK_Marc.f90 @@ -15,7 +15,7 @@ #define MARC4DAMASK Marc4DAMASK #endif -#include "prec.f90" +#include "../prec.f90" module DAMASK_interface use prec @@ -139,8 +139,55 @@ end function solverIsSymmetric end module DAMASK_interface - -#include "commercialFEM_fileList.f90" +#include "../parallelization.f90" +#include "../constants.f90" +#include "../IO.f90" +#include "../YAML_types.f90" +#include "../YAML_parse.f90" +#include "../HDF5_utilities.f90" +#include "../results.f90" +#include "../config.f90" +#include "../LAPACK_interface.f90" +#include "../math.f90" +#include "../rotations.f90" +#include "../polynomials.f90" +#include "../lattice.f90" +#include "../element.f90" +#include "../geometry_plastic_nonlocal.f90" +#include "../discretization.f90" +#include "discretization_Marc.f90" +#include "../material.f90" +#include "../phase.f90" +#include "../phase_mechanical.f90" +#include "../phase_mechanical_elastic.f90" +#include "../phase_mechanical_plastic.f90" +#include "../phase_mechanical_plastic_none.f90" +#include "../phase_mechanical_plastic_isotropic.f90" +#include "../phase_mechanical_plastic_phenopowerlaw.f90" +#include "../phase_mechanical_plastic_kinehardening.f90" +#include "../phase_mechanical_plastic_dislotwin.f90" +#include "../phase_mechanical_plastic_dislotungsten.f90" +#include "../phase_mechanical_plastic_nonlocal.f90" +#include "../phase_mechanical_eigen.f90" +#include "../phase_mechanical_eigen_cleavageopening.f90" +#include "../phase_mechanical_eigen_thermalexpansion.f90" +#include "../phase_thermal.f90" +#include "../phase_thermal_dissipation.f90" +#include "../phase_thermal_externalheat.f90" +#include "../phase_damage.f90" +#include "../phase_damage_isobrittle.f90" +#include "../phase_damage_anisobrittle.f90" +#include "../homogenization.f90" +#include "../homogenization_mechanical.f90" +#include "../homogenization_mechanical_pass.f90" +#include "../homogenization_mechanical_isostrain.f90" +#include "../homogenization_mechanical_RGC.f90" +#include "../homogenization_thermal.f90" +#include "../homogenization_thermal_pass.f90" +#include "../homogenization_thermal_isotemperature.f90" +#include "../homogenization_damage.f90" +#include "../homogenization_damage_pass.f90" +#include "../materialpoint.f90" !-------------------------------------------------------------------------------------------------- !> @brief This is the MSC.Marc user subroutine for defining material behavior @@ -214,8 +261,8 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & ! Marc common blocks are in fixed format so they have to be reformated to free format (f90) ! Beware of changes in newer Marc versions -#include QUOTE(PASTE(./Marc/include/concom,MARC4DAMASK)) ! concom is needed for inc, lovl -#include QUOTE(PASTE(./Marc/include/creeps,MARC4DAMASK)) ! creeps is needed for timinc (time increment) +#include QUOTE(PASTE(include/concom,MARC4DAMASK)) ! concom is needed for inc, lovl +#include QUOTE(PASTE(include/creeps,MARC4DAMASK)) ! creeps is needed for timinc (time increment) logical :: cutBack real(pReal), dimension(6) :: stress @@ -367,7 +414,7 @@ subroutine uedinc(inc,incsub) integer :: n, nqncomp, nqdatatype integer, save :: inc_written real(pReal), allocatable, dimension(:,:) :: d_n -#include QUOTE(PASTE(./Marc/include/creeps,MARC4DAMASK)) ! creeps is needed for timinc (time increment) +#include QUOTE(PASTE(include/creeps,MARC4DAMASK)) ! creeps is needed for timinc (time increment) if (inc > inc_written) then diff --git a/src/commercialFEM_fileList.f90 b/src/commercialFEM_fileList.f90 deleted file mode 100644 index 8bcf2f454..000000000 --- a/src/commercialFEM_fileList.f90 +++ /dev/null @@ -1,54 +0,0 @@ -!-------------------------------------------------------------------------------------------------- -!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH -!> @brief all DAMASK files without solver -!> @details List of files needed by MSC.Marc -!-------------------------------------------------------------------------------------------------- -#include "parallelization.f90" -#include "constants.f90" -#include "IO.f90" -#include "YAML_types.f90" -#include "YAML_parse.f90" -#include "HDF5_utilities.f90" -#include "results.f90" -#include "config.f90" -#include "LAPACK_interface.f90" -#include "math.f90" -#include "rotations.f90" -#include "polynomials.f90" -#include "lattice.f90" -#include "element.f90" -#include "geometry_plastic_nonlocal.f90" -#include "discretization.f90" -#include "Marc/discretization_Marc.f90" -#include "material.f90" -#include "phase.f90" -#include "phase_mechanical.f90" -#include "phase_mechanical_elastic.f90" -#include "phase_mechanical_plastic.f90" -#include "phase_mechanical_plastic_none.f90" -#include "phase_mechanical_plastic_isotropic.f90" -#include "phase_mechanical_plastic_phenopowerlaw.f90" -#include "phase_mechanical_plastic_kinehardening.f90" -#include "phase_mechanical_plastic_dislotwin.f90" -#include "phase_mechanical_plastic_dislotungsten.f90" -#include "phase_mechanical_plastic_nonlocal.f90" -#include "phase_mechanical_eigen.f90" -#include "phase_mechanical_eigen_cleavageopening.f90" -#include "phase_mechanical_eigen_thermalexpansion.f90" -#include "phase_thermal.f90" -#include "phase_thermal_dissipation.f90" -#include "phase_thermal_externalheat.f90" -#include "phase_damage.f90" -#include "phase_damage_isobrittle.f90" -#include "phase_damage_anisobrittle.f90" -#include "homogenization.f90" -#include "homogenization_mechanical.f90" -#include "homogenization_mechanical_pass.f90" -#include "homogenization_mechanical_isostrain.f90" -#include "homogenization_mechanical_RGC.f90" -#include "homogenization_thermal.f90" -#include "homogenization_thermal_pass.f90" -#include "homogenization_thermal_isotemperature.f90" -#include "homogenization_damage.f90" -#include "homogenization_damage_pass.f90" -#include "materialpoint.f90" diff --git a/src/materialpoint.f90 b/src/materialpoint.f90 index 743113036..1bf572bb0 100644 --- a/src/materialpoint.f90 +++ b/src/materialpoint.f90 @@ -131,7 +131,7 @@ end subroutine materialpoint_init !-------------------------------------------------------------------------------------------------- -!> @brief perform initialization at first call, update variables and call the actual material model +!> @brief Update variables and call the material model. !-------------------------------------------------------------------------------------------------- subroutine materialpoint_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyStress, jacobian) From b7a70ffe61f49cd05b2bea636aa4ca7146814803 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Apr 2022 20:35:37 +0200 Subject: [PATCH 06/88] new location --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c736136c..2c21b8d88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -164,8 +164,8 @@ setup_Marc: - cd $(mktemp -d) - cp ${CI_PROJECT_DIR}/examples/Marc/* . - python3 -c "import damask;damask.solver.Marc().submit_job('r-value','texture',True,'h')" - - mkdir ${TESTROOT}/src - - mv ${CI_PROJECT_DIR}/src/DAMASK_Marc.marc ${TESTROOT}/src + - mkdir -p ${TESTROOT}/src/Marc + - mv ${CI_PROJECT_DIR}/src/Marc/DAMASK_Marc.marc ${TESTROOT}/src/Marc ################################################################################################### From 8b3a0982c6cdc052062c9a576bb60dc69cd7cba8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Apr 2022 05:58:05 +0200 Subject: [PATCH 07/88] rename was missing (is already in code) --- examples/config/debug.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/config/debug.yaml b/examples/config/debug.yaml index 900873b25..fef3cedeb 100644 --- a/examples/config/debug.yaml +++ b/examples/config/debug.yaml @@ -1,5 +1,5 @@ phase: [basic, extensive, selective] -CPFEM: [basic, extensive, selective] +materialpoint: [basic, extensive, selective] # options for selective debugging element: 1 From 5c4d48115517b3dff0f353f1ba8d1cea5d12838b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 28 Apr 2022 01:33:33 +0200 Subject: [PATCH 08/88] common order is theta,phi --- python/damask/_rotation.py | 24 ++++++++++++++++++------ python/tests/test_Rotation.py | 4 ++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index f138fbb8a..083bea72a 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -1108,9 +1108,11 @@ class Rotation: Parameters ---------- crystal : numpy.ndarray, shape (2) - Polar coordinates (phi from x, theta from z) of fiber direction in crystal frame. + Polar coordinates (polar angle θ from [0 0 1], azimuthal angle φ from [1 0 0]) + of fiber direction in crystal frame. sample : numpy.ndarray, shape (2) - Polar coordinates (phi from x, theta from z) of fiber direction in sample frame. + Polar coordinates (polar angle θ from z, azimuthal angle φ from x) + of fiber direction in sample frame. sigma : float, optional Standard deviation of (Gaussian) misorientation distribution. Defaults to 0. @@ -1122,13 +1124,23 @@ class Rotation: A seed to initialize the BitGenerator. Defaults to None, i.e. unpredictable entropy will be pulled from the OS. + Notes + ----- + Polar coordinates follow the conventions typically used in physics, + see https://en.wikipedia.org/wiki/Spherical_coordinate_system. + + The common ranges are 0≤θ≤π and 0≤φ≤2π for a unique set of coordinates. + + Examples + -------- + """ rng = np.random.default_rng(rng_seed) - sigma_,alpha_,beta_ = (np.radians(coordinate) for coordinate in (sigma,crystal,sample)) if degrees else \ - map(np.array, (sigma,crystal,sample)) + sigma_,alpha,beta = (np.radians(coordinate) for coordinate in (sigma,crystal,sample)) if degrees else \ + map(np.array, (sigma,crystal,sample)) - d_cr = np.array([np.sin(alpha_[0])*np.cos(alpha_[1]), np.sin(alpha_[0])*np.sin(alpha_[1]), np.cos(alpha_[0])]) - d_lab = np.array([np.sin( beta_[0])*np.cos( beta_[1]), np.sin( beta_[0])*np.sin( beta_[1]), np.cos( beta_[0])]) + d_cr = np.array([np.sin(alpha[1])*np.cos(alpha[0]), np.sin(alpha[1])*np.sin(alpha[0]), np.cos(alpha[1])]) + d_lab = np.array([np.sin( beta[1])*np.cos( beta[0]), np.sin( beta[1])*np.sin( beta[0]), np.cos( beta[1])]) ax_align = np.append(np.cross(d_lab,d_cr), np.arccos(np.dot(d_lab,d_cr))) if np.isclose(ax_align[3],0.0): ax_align[:3] = np.array([1,0,0]) R_align = Rotation.from_axis_angle(ax_align if ax_align[3] > 0.0 else -ax_align,normalize=True) # rotate fiber axis from sample to crystal frame diff --git a/python/tests/test_Rotation.py b/python/tests/test_Rotation.py index a9b8b36f0..cb58c4452 100644 --- a/python/tests/test_Rotation.py +++ b/python/tests/test_Rotation.py @@ -1080,8 +1080,8 @@ class TestRotation: alpha = np.random.random()*2*np.pi,np.arccos(np.random.random()) beta = np.random.random()*2*np.pi,np.arccos(np.random.random()) - f_in_C = np.array([np.sin(alpha[0])*np.cos(alpha[1]), np.sin(alpha[0])*np.sin(alpha[1]), np.cos(alpha[0])]) - f_in_S = np.array([np.sin(beta[0] )*np.cos(beta[1] ), np.sin(beta[0] )*np.sin(beta[1] ), np.cos(beta[0] )]) + f_in_C = np.array([np.sin(alpha[1])*np.cos(alpha[0]), np.sin(alpha[1])*np.sin(alpha[0]), np.cos(alpha[1])]) + f_in_S = np.array([np.sin(beta[1] )*np.cos(beta[0] ), np.sin(beta[1] )*np.sin(beta[0] ), np.cos(beta[1] )]) ax = np.append(np.cross(f_in_C,f_in_S), - np.arccos(np.dot(f_in_C,f_in_S))) n = Rotation.from_axis_angle(ax if ax[3] > 0.0 else ax*-1.0 ,normalize=True) # rotation to align fiber axis in crystal and sample system From a0455cadf32edad084f85c4f4cb3b57d1b5ff624 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 28 Apr 2022 15:35:50 +0200 Subject: [PATCH 09/88] consistently have input in radians --- python/damask/_rotation.py | 16 ++++++++++------ python/tests/test_Rotation.py | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index 083bea72a..7c183ff98 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -1010,7 +1010,7 @@ class Rotation: def from_ODF(weights: np.ndarray, phi: np.ndarray, shape: Union[int, IntSequence] = None, - degrees: bool = True, + degrees: bool = False, fractions: bool = True, rng_seed: NumpyRngSeed = None) -> 'Rotation': """ @@ -1063,7 +1063,7 @@ class Rotation: def from_spherical_component(center: 'Rotation', sigma: float, shape: Union[int, IntSequence] = None, - degrees: bool = True, + degrees: bool = False, rng_seed: NumpyRngSeed = None) -> 'Rotation': """ Initialize with samples from a Gaussian distribution around a given center. @@ -1100,7 +1100,7 @@ class Rotation: sample: IntSequence, sigma: float = 0.0, shape: Union[int, IntSequence] = None, - degrees: bool = True, + degrees: bool = False, rng_seed: NumpyRngSeed = None): """ Initialize with samples from a Gaussian distribution around a given direction. @@ -1126,10 +1126,14 @@ class Rotation: Notes ----- - Polar coordinates follow the conventions typically used in physics, - see https://en.wikipedia.org/wiki/Spherical_coordinate_system. + The default crystal direction (θ=0,φ=0) direction is [0 0 1], + the default sample direction (θ=0,φ=0) is z. - The common ranges are 0≤θ≤π and 0≤φ≤2π for a unique set of coordinates. + Polar coordinates follow the ISO 80000-2:2019 convention + typically used in physics. + See https://en.wikipedia.org/wiki/Spherical_coordinate_system. + + Ranges 0≤θ≤π and 0≤φ≤2π give a unique set of coordinates. Examples -------- diff --git a/python/tests/test_Rotation.py b/python/tests/test_Rotation.py index cb58c4452..2db08bc69 100644 --- a/python/tests/test_Rotation.py +++ b/python/tests/test_Rotation.py @@ -1061,7 +1061,7 @@ class TestRotation: p = [] for run in range(5): c = Rotation.from_random() - o = Rotation.from_spherical_component(c,sigma,shape) + o = Rotation.from_spherical_component(c,sigma,shape,degrees=True) _, angles = c.misorientation(o).as_axis_angle(pair=True,degrees=True) angles[::2] *= -1 # flip angle for every second to symmetrize distribution From 06cef4292767d067a3b57c25de909f21ad65790e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 28 Apr 2022 15:56:24 +0200 Subject: [PATCH 10/88] use physical/ISO convention --- python/damask/_rotation.py | 5 +++-- python/tests/test_Rotation.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index 7c183ff98..a0baf1a0b 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -1137,14 +1137,15 @@ class Rotation: Examples -------- + tbd """ rng = np.random.default_rng(rng_seed) sigma_,alpha,beta = (np.radians(coordinate) for coordinate in (sigma,crystal,sample)) if degrees else \ map(np.array, (sigma,crystal,sample)) - d_cr = np.array([np.sin(alpha[1])*np.cos(alpha[0]), np.sin(alpha[1])*np.sin(alpha[0]), np.cos(alpha[1])]) - d_lab = np.array([np.sin( beta[1])*np.cos( beta[0]), np.sin( beta[1])*np.sin( beta[0]), np.cos( beta[1])]) + d_cr = np.array([np.sin(alpha[0])*np.cos(alpha[1]), np.sin(alpha[0])*np.sin(alpha[1]), np.cos(alpha[0])]) + d_lab = np.array([np.sin( beta[0])*np.cos( beta[1]), np.sin( beta[0])*np.sin( beta[1]), np.cos( beta[0])]) ax_align = np.append(np.cross(d_lab,d_cr), np.arccos(np.dot(d_lab,d_cr))) if np.isclose(ax_align[3],0.0): ax_align[:3] = np.array([1,0,0]) R_align = Rotation.from_axis_angle(ax_align if ax_align[3] > 0.0 else -ax_align,normalize=True) # rotate fiber axis from sample to crystal frame diff --git a/python/tests/test_Rotation.py b/python/tests/test_Rotation.py index 2db08bc69..c9dfc68b8 100644 --- a/python/tests/test_Rotation.py +++ b/python/tests/test_Rotation.py @@ -1077,11 +1077,11 @@ class TestRotation: def test_from_fiber_component(self,sigma,shape): p = [] for run in range(5): - alpha = np.random.random()*2*np.pi,np.arccos(np.random.random()) - beta = np.random.random()*2*np.pi,np.arccos(np.random.random()) + alpha = np.arccos(np.random.random()),np.random.random()*2*np.pi + beta = np.arccos(np.random.random()),np.random.random()*2*np.pi - f_in_C = np.array([np.sin(alpha[1])*np.cos(alpha[0]), np.sin(alpha[1])*np.sin(alpha[0]), np.cos(alpha[1])]) - f_in_S = np.array([np.sin(beta[1] )*np.cos(beta[0] ), np.sin(beta[1] )*np.sin(beta[0] ), np.cos(beta[1] )]) + f_in_C = np.array([np.sin(alpha[0])*np.cos(alpha[1]), np.sin(alpha[0])*np.sin(alpha[1]), np.cos(alpha[0])]) + f_in_S = np.array([np.sin( beta[0])*np.cos( beta[1]), np.sin( beta[0])*np.sin( beta[1]), np.cos( beta[0])]) ax = np.append(np.cross(f_in_C,f_in_S), - np.arccos(np.dot(f_in_C,f_in_S))) n = Rotation.from_axis_angle(ax if ax[3] > 0.0 else ax*-1.0 ,normalize=True) # rotation to align fiber axis in crystal and sample system From 730cda2020b5b4d7bff3fb1da8d41ff5a54a9070 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 29 Apr 2022 14:50:27 +0200 Subject: [PATCH 11/88] more explicit name --- src/Marc/DAMASK_Marc.f90 | 2 +- src/{materialpoint.f90 => Marc/materialpoint_Marc.f90} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/{materialpoint.f90 => Marc/materialpoint_Marc.f90} (100%) diff --git a/src/Marc/DAMASK_Marc.f90 b/src/Marc/DAMASK_Marc.f90 index da9702dc6..64b529aeb 100644 --- a/src/Marc/DAMASK_Marc.f90 +++ b/src/Marc/DAMASK_Marc.f90 @@ -187,7 +187,7 @@ end module DAMASK_interface #include "../homogenization_thermal_isotemperature.f90" #include "../homogenization_damage.f90" #include "../homogenization_damage_pass.f90" -#include "../materialpoint.f90" +#include "materialpoint_Marc.f90" !-------------------------------------------------------------------------------------------------- !> @brief This is the MSC.Marc user subroutine for defining material behavior diff --git a/src/materialpoint.f90 b/src/Marc/materialpoint_Marc.f90 similarity index 100% rename from src/materialpoint.f90 rename to src/Marc/materialpoint_Marc.f90 From e29a732d9fadbb606cb0cefd7de22005a7ce7259 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 29 Apr 2022 14:58:12 +0200 Subject: [PATCH 12/88] improved naming --- src/CMakeLists.txt | 2 -- src/{materialpoint2.f90 => materialpoint.f90} | 0 2 files changed, 2 deletions(-) rename src/{materialpoint2.f90 => materialpoint.f90} (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0d1f71b30..a473069b9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,8 +6,6 @@ endif() file(GLOB damask-sources CONFIGURE_DEPENDS *.f90 *.c) -list(FILTER damask-sources EXCLUDE REGEX ".*materialpoint.f90") - if(PROJECT_NAME STREQUAL "damask-grid") set(executable-name "DAMASK_grid") file(GLOB solver-sources CONFIGURE_DEPENDS grid/*.f90) diff --git a/src/materialpoint2.f90 b/src/materialpoint.f90 similarity index 100% rename from src/materialpoint2.f90 rename to src/materialpoint.f90 From 8168d435535bde5548f4d6027fad50f1fb558005 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Apr 2022 19:44:50 +0200 Subject: [PATCH 13/88] use libyaml-based loader factor 10 faster on my laptop --- python/damask/_config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/damask/_config.py b/python/damask/_config.py index 6dd6a8328..79fa228cc 100644 --- a/python/damask/_config.py +++ b/python/damask/_config.py @@ -6,6 +6,10 @@ from typing import Union, Dict, Any, Type, TypeVar import numpy as np import yaml +try: + from yaml import CSafeLoader as SafeLoader +except ImportError: + from yaml import SafeLoader from ._typehints import FileHandle from . import Rotation @@ -53,7 +57,7 @@ class Config(dict): **kwargs): """Initialize from YAML, dict, or key=value pairs.""" if isinstance(yml,str): - kwargs.update(yaml.safe_load(yml)) + kwargs.update(yaml.load(yml, Loader=SafeLoader)) elif isinstance(yml,dict): kwargs.update(yml) @@ -144,7 +148,7 @@ class Config(dict): Configuration from file. """ - return cls(yaml.safe_load(util.open_text(fname))) + return cls(yaml.load(util.open_text(fname), Loader=SafeLoader)) def save(self, fname: FileHandle, From 575de4b89b8ec6a0e62d8b281b93f8bcedd0e55f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Apr 2022 23:15:21 +0200 Subject: [PATCH 14/88] mypy does not like an import that can result in two types --- python/damask/_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/_config.py b/python/damask/_config.py index 79fa228cc..ff889bf5d 100644 --- a/python/damask/_config.py +++ b/python/damask/_config.py @@ -9,7 +9,7 @@ import yaml try: from yaml import CSafeLoader as SafeLoader except ImportError: - from yaml import SafeLoader + from yaml import SafeLoader # type: ignore from ._typehints import FileHandle from . import Rotation From be39865ff7adad51805f9cbda70ac521241d04a9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 May 2022 09:51:10 +0200 Subject: [PATCH 15/88] more systematic naming --- src/Marc/DAMASK_Marc.f90 | 8 ++++---- src/Marc/discretization_Marc.f90 | 1 - src/Marc/materialpoint_Marc.f90 | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Marc/DAMASK_Marc.f90 b/src/Marc/DAMASK_Marc.f90 index 64b529aeb..cc68dbbb1 100644 --- a/src/Marc/DAMASK_Marc.f90 +++ b/src/Marc/DAMASK_Marc.f90 @@ -205,9 +205,9 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & use DAMASK_interface use config use YAML_types - use discretization_marc + use discretization_Marc use homogenization - use materialpoint + use materialpoint_Marc implicit none include "omp_lib.h" ! the openMP function library @@ -406,8 +406,8 @@ subroutine flux(f,ts,n,time) !-------------------------------------------------------------------------------------------------- subroutine uedinc(inc,incsub) use prec - use materialpoint - use discretization_marc + use materialpoint_Marc + use discretization_Marc implicit none integer, intent(in) :: inc, incsub diff --git a/src/Marc/discretization_Marc.f90 b/src/Marc/discretization_Marc.f90 index fd6b8699d..53be07a6f 100644 --- a/src/Marc/discretization_Marc.f90 +++ b/src/Marc/discretization_Marc.f90 @@ -1212,5 +1212,4 @@ logical function containsRange(str,chunkPos) end function containsRange - end module discretization_Marc diff --git a/src/Marc/materialpoint_Marc.f90 b/src/Marc/materialpoint_Marc.f90 index 1bf572bb0..1501d981d 100644 --- a/src/Marc/materialpoint_Marc.f90 +++ b/src/Marc/materialpoint_Marc.f90 @@ -3,7 +3,7 @@ !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @brief materialpoint engine !-------------------------------------------------------------------------------------------------- -module materialpoint +module materialpoint_Marc use DAMASK_interface use prec use IO @@ -277,4 +277,4 @@ subroutine materialpoint_results(inc,time) end subroutine materialpoint_results -end module materialpoint +end module materialpoint_Marc From 0a42dba4537a1dba15c1b322d7ca1f70c3edade1 Mon Sep 17 00:00:00 2001 From: "d.mentock" Date: Mon, 2 May 2022 10:25:11 +0200 Subject: [PATCH 16/88] modified setup.cfg to include solver dir --- python/setup.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/setup.cfg b/python/setup.cfg index 30107fd10..bdc7cbb52 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -15,7 +15,9 @@ classifiers = Operating System :: OS Independent [options] -packages = damask +packages = + damask + damask.solver include_package_data = true python_requires = >= 3.8 install_requires = From 60190e8992339bb1dba62336a562e7a851c278b2 Mon Sep 17 00:00:00 2001 From: "d.mentock" Date: Mon, 2 May 2022 18:00:21 +0200 Subject: [PATCH 17/88] modified setup.cfg to automatically detect main package and subpackages --- python/setup.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/setup.cfg b/python/setup.cfg index bdc7cbb52..321040658 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -15,9 +15,7 @@ classifiers = Operating System :: OS Independent [options] -packages = - damask - damask.solver +packages = find: include_package_data = true python_requires = >= 3.8 install_requires = From fc4619189f3236d777125bb2eabc531aca23d051 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Tue, 3 May 2022 12:55:27 +0200 Subject: [PATCH 18/88] unified capitalization --- src/Marc/DAMASK_Marc.f90 | 6 +++--- src/Marc/discretization_Marc.f90 | 4 ++-- src/Marc/materialpoint_Marc.f90 | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Marc/DAMASK_Marc.f90 b/src/Marc/DAMASK_Marc.f90 index cc68dbbb1..4a42120ee 100644 --- a/src/Marc/DAMASK_Marc.f90 +++ b/src/Marc/DAMASK_Marc.f90 @@ -46,7 +46,7 @@ subroutine DAMASK_interface_init integer :: ierr character(len=pPathLen) :: wd - print'(/,1x,a)', '<<<+- DAMASK_marc init -+>>>' + print'(/,1x,a)', '<<<+- DAMASK_Marc init -+>>>' print*, 'Roters et al., Computational Materials Science 158:420–478, 2019' print*, 'https://doi.org/10.1016/j.commatsci.2018.04.030' @@ -380,7 +380,7 @@ end subroutine hypela2 subroutine flux(f,ts,n,time) use prec use homogenization - use discretization_marc + use discretization_Marc implicit none real(pReal), dimension(6), intent(in) :: & @@ -426,7 +426,7 @@ subroutine uedinc(inc,incsub) endif enddo - call discretization_marc_UpdateNodeAndIpCoords(d_n) + call discretization_Marc_UpdateNodeAndIpCoords(d_n) call materialpoint_results(inc,cptim) inc_written = inc diff --git a/src/Marc/discretization_Marc.f90 b/src/Marc/discretization_Marc.f90 index 53be07a6f..c1525b05e 100644 --- a/src/Marc/discretization_Marc.f90 +++ b/src/Marc/discretization_Marc.f90 @@ -136,7 +136,7 @@ end subroutine discretization_Marc_updateNodeAndIpCoords !-------------------------------------------------------------------------------------------------- !> @brief Calculate and set current nodal and IP positions (including cell nodes) !-------------------------------------------------------------------------------------------------- -function discretization_marc_FEM2DAMASK_cell(IP_FEM,elem_FEM) result(cell) +function discretization_Marc_FEM2DAMASK_cell(IP_FEM,elem_FEM) result(cell) integer, intent(in) :: IP_FEM, elem_FEM integer :: cell @@ -147,7 +147,7 @@ function discretization_marc_FEM2DAMASK_cell(IP_FEM,elem_FEM) result(cell) cell = (discretization_Marc_FEM2DAMASK_elem(elem_FEM)-1)*discretization_nIPs + IP_FEM -end function discretization_marc_FEM2DAMASK_cell +end function discretization_Marc_FEM2DAMASK_cell !-------------------------------------------------------------------------------------------------- diff --git a/src/Marc/materialpoint_Marc.f90 b/src/Marc/materialpoint_Marc.f90 index 1501d981d..79b06b80d 100644 --- a/src/Marc/materialpoint_Marc.f90 +++ b/src/Marc/materialpoint_Marc.f90 @@ -21,7 +21,7 @@ module materialpoint_Marc use homogenization use discretization - use discretization_marc + use discretization_Marc implicit none private @@ -86,7 +86,7 @@ subroutine materialpoint_initAll call rotations_init call polynomials_init call lattice_init - call discretization_marc_init + call discretization_Marc_init call material_init(.false.) call phase_init call homogenization_init From 6236ad52d17462e0a6b356a990ef0af9e12e38ac Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Tue, 3 May 2022 13:00:28 +0200 Subject: [PATCH 19/88] consistent naming --- src/grid/DAMASK_grid.f90 | 2 +- src/materialpoint.f90 | 4 ++-- src/mesh/DAMASK_mesh.f90 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/grid/DAMASK_grid.f90 b/src/grid/DAMASK_grid.f90 index 8bce2bc93..835e18b34 100644 --- a/src/grid/DAMASK_grid.f90 +++ b/src/grid/DAMASK_grid.f90 @@ -20,7 +20,7 @@ program DAMASK_grid use IO use config use math - use materialpoint2 + use materialpoint use material use spectral_utilities use grid_mechanical_spectral_basic diff --git a/src/materialpoint.f90 b/src/materialpoint.f90 index 90f6e9f4f..d83307738 100644 --- a/src/materialpoint.f90 +++ b/src/materialpoint.f90 @@ -3,7 +3,7 @@ !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @brief needs a good name and description !-------------------------------------------------------------------------------------------------- -module materialpoint2 +module materialpoint use parallelization use signals use CLI @@ -149,4 +149,4 @@ subroutine materialpoint_results(inc,time) end subroutine materialpoint_results -end module materialpoint2 +end module materialpoint diff --git a/src/mesh/DAMASK_mesh.f90 b/src/mesh/DAMASK_mesh.f90 index 20e797eba..f0f2a872e 100644 --- a/src/mesh/DAMASK_mesh.f90 +++ b/src/mesh/DAMASK_mesh.f90 @@ -14,7 +14,7 @@ program DAMASK_mesh use parallelization use IO use math - use materialpoint2 + use materialpoint use config use discretization_mesh use FEM_Utilities From f13691fadc1d0dd0f711ccacad6c756542099c42 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Wed, 4 May 2022 14:55:03 +0200 Subject: [PATCH 20/88] adjust permissions of all modified files --- install/MarcMentat/apply_DAMASK_modifications.py | 1 + 1 file changed, 1 insertion(+) diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index 9ffe187c5..a17120895 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -76,6 +76,7 @@ damask.util.run(f'xvfb-run -a {executable} -compile {menu_file}') print('setting file access rights...') for file in (glob.glob(str(marc_root/f'marc{marc_version}/tools/*_damask*')) + + glob.glob(str(marc_root/f'mentat{marc_version}/bin/edit_window')) + glob.glob(str(marc_root/f'mentat{marc_version}/bin/kill[4-6]')) + glob.glob(str(marc_root/f'mentat{marc_version}/bin/submit[4-6]'))): os.chmod(file , 0o755) From da595d46db29b6c22d3ddcbf7160f729d5de0647 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Wed, 4 May 2022 14:56:50 +0200 Subject: [PATCH 21/88] add support for Marc2022.1 --- .../2022.1/Marc_tools/comp_damask_hmp.patch | 49 ++ .../2022.1/Marc_tools/comp_damask_lmp.patch | 49 ++ .../2022.1/Marc_tools/comp_damask_mp.patch | 49 ++ .../2022.1/Marc_tools/include_linux64.patch | 100 +++ .../2022.1/Marc_tools/run_damask_hmp.patch | 710 +++++++++++++++++ .../2022.1/Marc_tools/run_damask_lmp.patch | 710 +++++++++++++++++ .../2022.1/Marc_tools/run_damask_mp.patch | 730 ++++++++++++++++++ .../2022.1/Mentat_bin/edit_window.patch | 24 + .../MarcMentat/2022.1/Mentat_bin/kill4.patch | 0 .../MarcMentat/2022.1/Mentat_bin/kill5.patch | 0 .../MarcMentat/2022.1/Mentat_bin/kill6.patch | 0 .../2022.1/Mentat_bin/submit4.patch | 38 + .../2022.1/Mentat_bin/submit5.patch | 38 + .../2022.1/Mentat_bin/submit6.patch | 38 + .../2022.1/Mentat_menus/job_run.ms.patch | 158 ++++ src/Marc/include/concom2022.1 | 464 +++++++++++ src/Marc/include/creeps2022.1 | 72 ++ 17 files changed, 3229 insertions(+) create mode 100644 install/MarcMentat/2022.1/Marc_tools/comp_damask_hmp.patch create mode 100644 install/MarcMentat/2022.1/Marc_tools/comp_damask_lmp.patch create mode 100644 install/MarcMentat/2022.1/Marc_tools/comp_damask_mp.patch create mode 100644 install/MarcMentat/2022.1/Marc_tools/include_linux64.patch create mode 100644 install/MarcMentat/2022.1/Marc_tools/run_damask_hmp.patch create mode 100644 install/MarcMentat/2022.1/Marc_tools/run_damask_lmp.patch create mode 100644 install/MarcMentat/2022.1/Marc_tools/run_damask_mp.patch create mode 100644 install/MarcMentat/2022.1/Mentat_bin/edit_window.patch create mode 100644 install/MarcMentat/2022.1/Mentat_bin/kill4.patch create mode 100644 install/MarcMentat/2022.1/Mentat_bin/kill5.patch create mode 100644 install/MarcMentat/2022.1/Mentat_bin/kill6.patch create mode 100644 install/MarcMentat/2022.1/Mentat_bin/submit4.patch create mode 100644 install/MarcMentat/2022.1/Mentat_bin/submit5.patch create mode 100644 install/MarcMentat/2022.1/Mentat_bin/submit6.patch create mode 100644 install/MarcMentat/2022.1/Mentat_menus/job_run.ms.patch create mode 100644 src/Marc/include/concom2022.1 create mode 100644 src/Marc/include/creeps2022.1 diff --git a/install/MarcMentat/2022.1/Marc_tools/comp_damask_hmp.patch b/install/MarcMentat/2022.1/Marc_tools/comp_damask_hmp.patch new file mode 100644 index 000000000..8dda8e1ce --- /dev/null +++ b/install/MarcMentat/2022.1/Marc_tools/comp_damask_hmp.patch @@ -0,0 +1,49 @@ +--- ++++ +@@ -6,18 +6,27 @@ + DIR=$1 + user=$3 + program=$4 ++usernoext=$user ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` ++ ++# add BLAS options for linking ++ BLAS="%BLAS%" ++ + . $DIR/tools/include + DIRJOB=$2 + cd $DIRJOB +-echo "Compiling and linking user subroutine $user.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,13 @@ echo "program: $program" + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod ++ /bin/rm $DIRJOB/*_genmod.f90 diff --git a/install/MarcMentat/2022.1/Marc_tools/comp_damask_lmp.patch b/install/MarcMentat/2022.1/Marc_tools/comp_damask_lmp.patch new file mode 100644 index 000000000..6ea9c098f --- /dev/null +++ b/install/MarcMentat/2022.1/Marc_tools/comp_damask_lmp.patch @@ -0,0 +1,49 @@ +--- ++++ +@@ -6,18 +6,27 @@ + DIR=$1 + user=$3 + program=$4 ++usernoext=$user ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` ++ ++# add BLAS options for linking ++ BLAS="%BLAS%" ++ + . $DIR/tools/include + DIRJOB=$2 + cd $DIRJOB +-echo "Compiling and linking user subroutine $user.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTRANLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,13 @@ echo "program: $program" + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod ++ /bin/rm $DIRJOB/*_genmod.f90 diff --git a/install/MarcMentat/2022.1/Marc_tools/comp_damask_mp.patch b/install/MarcMentat/2022.1/Marc_tools/comp_damask_mp.patch new file mode 100644 index 000000000..3316227d6 --- /dev/null +++ b/install/MarcMentat/2022.1/Marc_tools/comp_damask_mp.patch @@ -0,0 +1,49 @@ +--- ++++ +@@ -6,18 +6,27 @@ + DIR=$1 + user=$3 + program=$4 ++usernoext=$user ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` ++ ++# add BLAS options for linking ++ BLAS="%BLAS%" ++ + . $DIR/tools/include + DIRJOB=$2 + cd $DIRJOB +-echo "Compiling and linking user subroutine $user.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,13 @@ echo "program: $program" + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod ++ /bin/rm $DIRJOB/*_genmod.f90 diff --git a/install/MarcMentat/2022.1/Marc_tools/include_linux64.patch b/install/MarcMentat/2022.1/Marc_tools/include_linux64.patch new file mode 100644 index 000000000..d16e21403 --- /dev/null +++ b/install/MarcMentat/2022.1/Marc_tools/include_linux64.patch @@ -0,0 +1,100 @@ +--- ++++ +@@ -166,6 +166,11 @@ if test -n "$MSCCOSIM_HOME"; then + MARC_COSIM_LIB="$MSCCOSIM_HOME/Cosim$MSCCOSIM_VERSION/Dcosim$MSCCOSIM_VERSION/lib" + fi + ++# DAMASK uses the HDF5 compiler wrapper around the Intel compiler ++H5FC="$(h5fc -shlib -show)" ++HDF5_LIB=${H5FC//ifort/} ++FCOMP="$H5FC -DDAMASK_HDF5" ++ + # AEM + if test "$MARCDLLOUTDIR" = ""; then + DLLOUTDIR="$MARC_LIB" +@@ -477,8 +482,8 @@ if test "$MARC_INTEGER_SIZE" = "i4" ; then + I8DEFINES= + I8CDEFINES= + else +- I8FFLAGS="-i8" +- I8DEFINES="-DI64" ++ I8FFLAGS="-i8 -integer-size 64" ++ I8DEFINES="-DI64 -DINT=8" + I8CDEFINES="-U_DOUBLE -D_SINGLE" + fi + +@@ -594,7 +599,7 @@ then + PROFILE=" $PROFILE -pg" + fi + +-FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB -fp-model source" ++FORT_OPT="-c -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr -mp1 -WB -fp-model source" + if test "$MTHREAD" = "OPENMP" + then + FORT_OPT=" $FORT_OPT -qopenmp" +@@ -607,7 +612,7 @@ else + FORT_OPT=" $FORT_OPT -save -zero" + fi + if test "$MARCHDF_HDF" = "HDF"; then +- FORT_OPT="$FORT_OPT -DMARCHDF_HDF=$MARCHDF_HDF $HDF_INCLUDE" ++ FORT_OPT="$FORT_OPT -DMARCHDF=$MARCHDF_HDF" + fi + + FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ +@@ -621,6 +626,29 @@ FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + # for compiling free form f90 files. high opt, integer(4) + FORTF90="$FCOMP -c -O3" + ++# determine DAMASK version ++if test -n "$DAMASK_USER"; then ++ DAMASKROOT=`dirname $DAMASK_USER`/.. ++ read DAMASKVERSION < $DAMASKROOT/VERSION ++ DAMASKVERSION="'"$DAMASKVERSION"'" ++else ++ DAMASKVERSION="'N/A'" ++fi ++ ++# DAMASK compiler calls ++DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2022.1 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" ++DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2022.1 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" ++DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ ++ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMARC4DAMASK=2022.1 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" ++ + if test "$MARCDEBUG" = "ON" + then + FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ +@@ -778,7 +806,7 @@ SECLIBS="-L$MARC_LIB -llapi" + + SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ + -L$MARC_MKL \ +- $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $MARC_LIB/libtetmeshinterface.a $MARC_LIB/libcaefatigueinterface.a -L$MARC_LIB -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -ltetmesh -lmeshgems -lmg-tetra -lmeshgems_stubs $HDF_LIBS $SOLVER2LIBS" ++ $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $MARC_LIB/libtetmeshinterface.a $MARC_LIB/libcaefatigueinterface.a -L$MARC_LIB -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -ltetmesh -lmeshgems -lmg-tetra -lmeshgems_stubs $HDF5_LIB $SOLVER2LIBS" + + SOLVERLIBS_DLL=${SOLVERLIBS} + if test "$AEM_DLL" -eq 1 +@@ -802,7 +830,7 @@ then + OPENSSL=NONE + fi + +-SYSLIBS=" $OPENMP -lpthread -shared-intel -cxxlib $MARC_RPC_LIB" ++SYSLIBS=" $OPENMP -lpthread -cxxlib $MARC_RPC_LIB" + + # Uncomment the following lines to turn on the trace and comment out the next 4 lines + # if test $MPITYPE = intelmpi +@@ -812,7 +840,7 @@ SYSLIBS=" $OPENMP -lpthread -shared-intel -cxxlib $MARC_RPC_LIB" + # fi + if test $MPITYPE = intelmpi + then +- SYSLIBS="-L${MPI_ROOT}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -shared-intel -cxxlib $MARC_RPC_LIB" ++ SYSLIBS="-L${MPI_ROOT}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -cxxlib $MARC_RPC_LIB" + fi + + if test "$ZLIB" = "ZLIB"; then diff --git a/install/MarcMentat/2022.1/Marc_tools/run_damask_hmp.patch b/install/MarcMentat/2022.1/Marc_tools/run_damask_hmp.patch new file mode 100644 index 000000000..e3a364e00 --- /dev/null +++ b/install/MarcMentat/2022.1/Marc_tools/run_damask_hmp.patch @@ -0,0 +1,710 @@ +--- ++++ +@@ -302,7 +302,23 @@ fi + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -405,7 +421,7 @@ sid= + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -573,7 +589,7 @@ do + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -676,50 +692,19 @@ do + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ usernoext=$user ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" +@@ -739,19 +724,19 @@ do + ;; + esac + ;; +- -dl | -DL) +- case $value in +- y* | Y*) +- deletelog=yes +- ;; +- n* | N*) +- deletelog=no +- ;; +- *) +- ;; +- esac ++ -dl | -DL) ++ case $value in ++ y* | Y*) ++ deletelog=yes ++ ;; ++ n* | N*) ++ deletelog=no ++ ;; ++ *) ++ ;; ++ esac + +- ;; ++ ;; + -at | -AT) + att=$value + ;; +@@ -1207,12 +1192,12 @@ post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 or $DIRPID/$pid.h5 not accessible + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1386,7 +1371,7 @@ else + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1531,7 +1516,7 @@ Program name : $prog + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1564,7 +1549,7 @@ Program name : $prog + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1687,7 +1672,7 @@ Program name ($prog)? $ECHOTXT" + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1696,50 +1681,19 @@ Program name ($prog)? $ECHOTXT" + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ esac ++ usernoext=$user ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi +@@ -2274,11 +2228,12 @@ fi + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2391,7 +2346,7 @@ fi + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3274,44 +3229,27 @@ then + echo + if test "$user" + then +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname +- fi +- ++ userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then +- if test ${basefile##*.} = f +- then +- ln -sf "$user.f" "$usersub" +- fi + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3331,10 +3269,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -3344,6 +3283,9 @@ else + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + + # + # run marc +@@ -3390,7 +3332,7 @@ if test $dllrun -eq 0; then + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3556,7 +3498,7 @@ then + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3569,21 +3511,21 @@ then + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else +- echo "$0: compile failed for $user.f on host $i" ++ echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then +- $RSH $i /bin/rm $remoteuser.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3593,39 +3535,27 @@ then + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" +- fi +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname ++ echo "Compiling and linking user subroutine $user on host `hostname`" + fi ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3645,10 +3575,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" +@@ -3686,6 +3617,9 @@ else # if test $link + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + + # + # run marc +@@ -3744,42 +3678,42 @@ then + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ for i in `$AWK -v n=$numfield '{print $n}' $host_filt` ++ do ++ ibase=${i%%.*} ++ if test $ibase != $thishost ++ then ++ counter=$((counter+1)) ++ DIR1=$DIRJOB ++ line=`grep -v '^#' $userhost | grep "^$ibase "` ++ workdir=`echo $line | $AWK '{print $3}'` ++ if test -n "$workdir" + then +- counter=$((counter+1)) +- DIR1=$DIRJOB +- line=`grep -v '^#' $userhost | grep "^$ibase "` +- workdir=`echo $line | $AWK '{print $3}'` +- if test -n "$workdir" +- then +- DIR1=$workdir +- fi +- # if an incompatible host uses shared directory, +- # then the root machine deletes the executable +- if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" +- then +- hname=_$ibase +- /bin/rm ${execname}$hname +- fi +- # if local directory used, the remote machine +- # deletes the executable +- if test ${dirstatus[$counter]} = "local" +- then +- $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null +- fi ++ DIR1=$workdir + fi +- done +- fi ++ # if an incompatible host uses shared directory, ++ # then the root machine deletes the executable ++ if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" ++ then ++ hname=_$ibase ++ /bin/rm ${execname}$hname ++ fi ++ # if local directory used, the remote machine ++ # deletes the executable ++ if test ${dirstatus[$counter]} = "local" ++ then ++ $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null ++ fi ++ fi ++ done + fi + fi + fi ++fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3904,7 +3838,7 @@ then + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3917,20 +3851,20 @@ then + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else +- echo "$0: compile failed for $user.f on host $i" ++ echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then +- $RSH $i /bin/rm $remoteuser.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3940,37 +3874,25 @@ then + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" +- fi +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname ++ echo "Compiling and linking user subroutine $user on host `hostname`" + fi ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3990,10 +3912,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -4030,7 +3953,9 @@ else # if test $link + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4070,7 +3995,7 @@ if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4114,42 +4039,42 @@ then + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ for i in `$AWK -v n=$numfield '{print $n}' $host_filt` ++ do ++ ibase=${i%%.*} ++ if test $ibase != $thishost ++ then ++ counter=$((counter+1)) ++ DIR1=$DIRJOB ++ line=`grep -v '^#' $userhost | grep "^$ibase "` ++ workdir=`echo $line | $AWK '{print $3}'` ++ if test -n "$workdir" + then +- counter=$((counter+1)) +- DIR1=$DIRJOB +- line=`grep -v '^#' $userhost | grep "^$ibase "` +- workdir=`echo $line | $AWK '{print $3}'` +- if test -n "$workdir" +- then +- DIR1=$workdir +- fi +- # if an incompatible host uses shared directory, +- # then the root machine deletes the executable +- if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" +- then +- hname=_$ibase +- /bin/rm ${execname}$hname +- fi +- # if local directory used, the remote machine +- # deletes the executable +- if test ${dirstatus[$counter]} = "local" +- then +- $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null +- fi ++ DIR1=$workdir + fi +- done +- fi ++ # if an incompatible host uses shared directory, ++ # then the root machine deletes the executable ++ if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" ++ then ++ hname=_$ibase ++ /bin/rm ${execname}$hname ++ fi ++ # if local directory used, the remote machine ++ # deletes the executable ++ if test ${dirstatus[$counter]} = "local" ++ then ++ $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null ++ fi ++ fi ++ done + fi + fi + fi ++fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2022.1/Marc_tools/run_damask_lmp.patch b/install/MarcMentat/2022.1/Marc_tools/run_damask_lmp.patch new file mode 100644 index 000000000..a5989bfca --- /dev/null +++ b/install/MarcMentat/2022.1/Marc_tools/run_damask_lmp.patch @@ -0,0 +1,710 @@ +--- ++++ +@@ -302,7 +302,23 @@ fi + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -405,7 +421,7 @@ sid= + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -573,7 +589,7 @@ do + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -676,50 +692,19 @@ do + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ usernoext=$user ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" +@@ -739,19 +724,19 @@ do + ;; + esac + ;; +- -dl | -DL) +- case $value in +- y* | Y*) +- deletelog=yes +- ;; +- n* | N*) +- deletelog=no +- ;; +- *) +- ;; +- esac ++ -dl | -DL) ++ case $value in ++ y* | Y*) ++ deletelog=yes ++ ;; ++ n* | N*) ++ deletelog=no ++ ;; ++ *) ++ ;; ++ esac + +- ;; ++ ;; + -at | -AT) + att=$value + ;; +@@ -1207,12 +1192,12 @@ post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 or $DIRPID/$pid.h5 not accessible + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1386,7 +1371,7 @@ else + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1531,7 +1516,7 @@ Program name : $prog + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1564,7 +1549,7 @@ Program name : $prog + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1687,7 +1672,7 @@ Program name ($prog)? $ECHOTXT" + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1696,50 +1681,19 @@ Program name ($prog)? $ECHOTXT" + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ esac ++ usernoext=$user ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi +@@ -2274,11 +2228,12 @@ fi + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2391,7 +2346,7 @@ fi + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3274,44 +3229,27 @@ then + echo + if test "$user" + then +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname +- fi +- ++ userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then +- if test ${basefile##*.} = f +- then +- ln -sf "$user.f" "$usersub" +- fi + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3331,10 +3269,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -3344,6 +3283,9 @@ else + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + + # + # run marc +@@ -3390,7 +3332,7 @@ if test $dllrun -eq 0; then + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3556,7 +3498,7 @@ then + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3569,21 +3511,21 @@ then + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else +- echo "$0: compile failed for $user.f on host $i" ++ echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then +- $RSH $i /bin/rm $remoteuser.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3593,39 +3535,27 @@ then + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" +- fi +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname ++ echo "Compiling and linking user subroutine $user on host `hostname`" + fi ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3645,10 +3575,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" +@@ -3686,6 +3617,9 @@ else # if test $link + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + + # + # run marc +@@ -3744,42 +3678,42 @@ then + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ for i in `$AWK -v n=$numfield '{print $n}' $host_filt` ++ do ++ ibase=${i%%.*} ++ if test $ibase != $thishost ++ then ++ counter=$((counter+1)) ++ DIR1=$DIRJOB ++ line=`grep -v '^#' $userhost | grep "^$ibase "` ++ workdir=`echo $line | $AWK '{print $3}'` ++ if test -n "$workdir" + then +- counter=$((counter+1)) +- DIR1=$DIRJOB +- line=`grep -v '^#' $userhost | grep "^$ibase "` +- workdir=`echo $line | $AWK '{print $3}'` +- if test -n "$workdir" +- then +- DIR1=$workdir +- fi +- # if an incompatible host uses shared directory, +- # then the root machine deletes the executable +- if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" +- then +- hname=_$ibase +- /bin/rm ${execname}$hname +- fi +- # if local directory used, the remote machine +- # deletes the executable +- if test ${dirstatus[$counter]} = "local" +- then +- $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null +- fi ++ DIR1=$workdir + fi +- done +- fi ++ # if an incompatible host uses shared directory, ++ # then the root machine deletes the executable ++ if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" ++ then ++ hname=_$ibase ++ /bin/rm ${execname}$hname ++ fi ++ # if local directory used, the remote machine ++ # deletes the executable ++ if test ${dirstatus[$counter]} = "local" ++ then ++ $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null ++ fi ++ fi ++ done + fi + fi + fi ++fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3904,7 +3838,7 @@ then + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3917,20 +3851,20 @@ then + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else +- echo "$0: compile failed for $user.f on host $i" ++ echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then +- $RSH $i /bin/rm $remoteuser.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3940,37 +3874,25 @@ then + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" +- fi +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname ++ echo "Compiling and linking user subroutine $user on host `hostname`" + fi ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3990,10 +3912,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -4030,7 +3953,9 @@ else # if test $link + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4070,7 +3995,7 @@ if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4114,42 +4039,42 @@ then + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ for i in `$AWK -v n=$numfield '{print $n}' $host_filt` ++ do ++ ibase=${i%%.*} ++ if test $ibase != $thishost ++ then ++ counter=$((counter+1)) ++ DIR1=$DIRJOB ++ line=`grep -v '^#' $userhost | grep "^$ibase "` ++ workdir=`echo $line | $AWK '{print $3}'` ++ if test -n "$workdir" + then +- counter=$((counter+1)) +- DIR1=$DIRJOB +- line=`grep -v '^#' $userhost | grep "^$ibase "` +- workdir=`echo $line | $AWK '{print $3}'` +- if test -n "$workdir" +- then +- DIR1=$workdir +- fi +- # if an incompatible host uses shared directory, +- # then the root machine deletes the executable +- if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" +- then +- hname=_$ibase +- /bin/rm ${execname}$hname +- fi +- # if local directory used, the remote machine +- # deletes the executable +- if test ${dirstatus[$counter]} = "local" +- then +- $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null +- fi ++ DIR1=$workdir + fi +- done +- fi ++ # if an incompatible host uses shared directory, ++ # then the root machine deletes the executable ++ if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" ++ then ++ hname=_$ibase ++ /bin/rm ${execname}$hname ++ fi ++ # if local directory used, the remote machine ++ # deletes the executable ++ if test ${dirstatus[$counter]} = "local" ++ then ++ $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null ++ fi ++ fi ++ done + fi + fi + fi ++fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2022.1/Marc_tools/run_damask_mp.patch b/install/MarcMentat/2022.1/Marc_tools/run_damask_mp.patch new file mode 100644 index 000000000..924af6fbd --- /dev/null +++ b/install/MarcMentat/2022.1/Marc_tools/run_damask_mp.patch @@ -0,0 +1,730 @@ +diff --git "a/C:\\Users\\f.roters\\Documents\\Forschung\\FEM\\Kristallplastizit\303\244t\\Programme\\Userroutinen\\Marc\\Marc_mods\\2022.1\\Marc_tools\\run_marc.original" "b/C:\\Users\\f.roters\\Documents\\Forschung\\FEM\\Kristallplastizit\303\244t\\Programme\\Userroutinen\\Marc\\Marc_mods\\2022.1\\Marc_tools\\run_damask_mp" +index 88a3027..85beabe 100644 +--- "a/C:\\Users\\f.roters\\Documents\\Forschung\\FEM\\Kristallplastizit\303\244t\\Programme\\Userroutinen\\Marc\\Marc_mods\\2022.1\\Marc_tools\\run_marc.original" ++++ "b/C:\\Users\\f.roters\\Documents\\Forschung\\FEM\\Kristallplastizit\303\244t\\Programme\\Userroutinen\\Marc\\Marc_mods\\2022.1\\Marc_tools\\run_damask_mp" +@@ -302,7 +302,23 @@ fi + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -405,7 +421,7 @@ sid= + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -573,7 +589,7 @@ do + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -676,50 +692,19 @@ do + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ usernoext=$user ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" +@@ -739,19 +724,19 @@ do + ;; + esac + ;; +- -dl | -DL) +- case $value in +- y* | Y*) +- deletelog=yes +- ;; +- n* | N*) +- deletelog=no +- ;; +- *) +- ;; +- esac ++ -dl | -DL) ++ case $value in ++ y* | Y*) ++ deletelog=yes ++ ;; ++ n* | N*) ++ deletelog=no ++ ;; ++ *) ++ ;; ++ esac + +- ;; ++ ;; + -at | -AT) + att=$value + ;; +@@ -1207,12 +1192,12 @@ post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 or $DIRPID/$pid.h5 not accessible + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1386,7 +1371,7 @@ else + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1531,7 +1516,7 @@ Program name : $prog + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1548,8 +1533,6 @@ GPGPU option : $gpuids + Host file name : $host" > $jid.log + if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +- echo "Mapper directory : $MESHERDIR" >> $jid.log +- echo "Meshing directory : $MESHERDIR" >> $jid.log + fi + echo \ + "Message passing type : $itree +@@ -1564,7 +1547,7 @@ Program name : $prog + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1579,6 +1562,8 @@ Solver processes : $nsolverprint + Solver threads : $ntsprint" + if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" ++ echo "Mapper directory : $MESHERDIR" >> $jid.log ++ echo "Meshing directory : $MESHERDIR" >> $jid.log + fi + echo \ + "GPGPU option : $gpuids +@@ -1687,7 +1672,7 @@ Program name ($prog)? $ECHOTXT" + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1696,50 +1681,19 @@ Program name ($prog)? $ECHOTXT" + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ esac ++ usernoext=$user ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` ++ usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi +@@ -2274,11 +2228,12 @@ fi + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2391,7 +2346,7 @@ fi + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3274,44 +3229,27 @@ then + echo + if test "$user" + then +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname +- fi +- ++ userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then +- if test ${basefile##*.} = f +- then +- ln -sf "$user.f" "$usersub" +- fi + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3331,10 +3269,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -3344,6 +3283,9 @@ else + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + + # + # run marc +@@ -3390,7 +3332,7 @@ if test $dllrun -eq 0; then + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3556,7 +3498,7 @@ then + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3569,21 +3511,21 @@ then + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else +- echo "$0: compile failed for $user.f on host $i" ++ echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then +- $RSH $i /bin/rm $remoteuser.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3593,39 +3535,27 @@ then + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" +- fi +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname ++ echo "Compiling and linking user subroutine $user on host `hostname`" + fi ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3645,10 +3575,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" +@@ -3686,6 +3617,9 @@ else # if test $link + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + + # + # run marc +@@ -3744,42 +3678,42 @@ then + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ for i in `$AWK -v n=$numfield '{print $n}' $host_filt` ++ do ++ ibase=${i%%.*} ++ if test $ibase != $thishost ++ then ++ counter=$((counter+1)) ++ DIR1=$DIRJOB ++ line=`grep -v '^#' $userhost | grep "^$ibase "` ++ workdir=`echo $line | $AWK '{print $3}'` ++ if test -n "$workdir" + then +- counter=$((counter+1)) +- DIR1=$DIRJOB +- line=`grep -v '^#' $userhost | grep "^$ibase "` +- workdir=`echo $line | $AWK '{print $3}'` +- if test -n "$workdir" +- then +- DIR1=$workdir +- fi +- # if an incompatible host uses shared directory, +- # then the root machine deletes the executable +- if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" +- then +- hname=_$ibase +- /bin/rm ${execname}$hname +- fi +- # if local directory used, the remote machine +- # deletes the executable +- if test ${dirstatus[$counter]} = "local" +- then +- $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null +- fi ++ DIR1=$workdir + fi +- done +- fi ++ # if an incompatible host uses shared directory, ++ # then the root machine deletes the executable ++ if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" ++ then ++ hname=_$ibase ++ /bin/rm ${execname}$hname ++ fi ++ # if local directory used, the remote machine ++ # deletes the executable ++ if test ${dirstatus[$counter]} = "local" ++ then ++ $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null ++ fi ++ fi ++ done + fi + fi + fi ++fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3904,7 +3838,7 @@ then + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3917,20 +3851,20 @@ then + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else +- echo "$0: compile failed for $user.f on host $i" ++ echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then +- $RSH $i /bin/rm $remoteuser.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3940,37 +3874,25 @@ then + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" +- fi +- userobj=$DIRJOB/`$BASENAME $user .f`.o +- basefile=`$BASENAME $usersubname` +- if test ${basefile##*.} = f +- then +- usersub=$DIRJOB/`$BASENAME $user .f`.F +- ln -sf "$user.f" "$usersub" +- else +- usersub=$usersubname ++ echo "Compiling and linking user subroutine $user on host `hostname`" + fi ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3990,10 +3912,11 @@ then + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -4030,7 +3953,9 @@ else # if test $link + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null ++/bin/rm $DIRJOB/*_genmod.f90 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4070,7 +3995,7 @@ if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4114,42 +4039,42 @@ then + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ for i in `$AWK -v n=$numfield '{print $n}' $host_filt` ++ do ++ ibase=${i%%.*} ++ if test $ibase != $thishost ++ then ++ counter=$((counter+1)) ++ DIR1=$DIRJOB ++ line=`grep -v '^#' $userhost | grep "^$ibase "` ++ workdir=`echo $line | $AWK '{print $3}'` ++ if test -n "$workdir" + then +- counter=$((counter+1)) +- DIR1=$DIRJOB +- line=`grep -v '^#' $userhost | grep "^$ibase "` +- workdir=`echo $line | $AWK '{print $3}'` +- if test -n "$workdir" +- then +- DIR1=$workdir +- fi +- # if an incompatible host uses shared directory, +- # then the root machine deletes the executable +- if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" +- then +- hname=_$ibase +- /bin/rm ${execname}$hname +- fi +- # if local directory used, the remote machine +- # deletes the executable +- if test ${dirstatus[$counter]} = "local" +- then +- $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null +- fi ++ DIR1=$workdir + fi +- done +- fi ++ # if an incompatible host uses shared directory, ++ # then the root machine deletes the executable ++ if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" ++ then ++ hname=_$ibase ++ /bin/rm ${execname}$hname ++ fi ++ # if local directory used, the remote machine ++ # deletes the executable ++ if test ${dirstatus[$counter]} = "local" ++ then ++ $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null ++ fi ++ fi ++ done + fi + fi + fi ++fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2022.1/Mentat_bin/edit_window.patch b/install/MarcMentat/2022.1/Mentat_bin/edit_window.patch new file mode 100644 index 000000000..915af9bf6 --- /dev/null +++ b/install/MarcMentat/2022.1/Mentat_bin/edit_window.patch @@ -0,0 +1,24 @@ +--- ++++ +@@ -1,18 +1,5 @@ + #!/bin/sh +-# This script opens a window running an editor. The default window is an +-# xterm, and the default editor is vi. These may be customized. ++# This script opens a window running an editor. ++# The command to invoke the editor is specified during DAMASK installation + +-dir= +-for d in /usr/bin /usr/bin/X11; do +- if test -x "$d/xterm"; then +- dir="$d" +- break +- fi +-done +- +-if test -z "$dir"; then +- echo "$0: Could not find xterm" +- exit 1 +-fi +- +-"$dir/xterm" -T "vi $*" -n "vi $*" -e vi $* ++%EDITOR% $* diff --git a/install/MarcMentat/2022.1/Mentat_bin/kill4.patch b/install/MarcMentat/2022.1/Mentat_bin/kill4.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2022.1/Mentat_bin/kill5.patch b/install/MarcMentat/2022.1/Mentat_bin/kill5.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2022.1/Mentat_bin/kill6.patch b/install/MarcMentat/2022.1/Mentat_bin/kill6.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2022.1/Mentat_bin/submit4.patch b/install/MarcMentat/2022.1/Mentat_bin/submit4.patch new file mode 100644 index 000000000..3f1371fdb --- /dev/null +++ b/install/MarcMentat/2022.1/Mentat_bin/submit4.patch @@ -0,0 +1,38 @@ +--- ++++ +@@ -63,10 +64,10 @@ doe_nparallel=$6 + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -91,6 +92,7 @@ if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -189,12 +191,12 @@ unset PYTHONHOME + unset PYTHONPATH + + if [ "$doe_first" = "-" ]; then # submit of regular Marc job +- "${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++ "${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 + else # submit of a DoE Marc job +- "${DIR}/tools/run_marc" $slv -j $job -v n -b n $nprocds $nprocd \ ++ "${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b n $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu diff --git a/install/MarcMentat/2022.1/Mentat_bin/submit5.patch b/install/MarcMentat/2022.1/Mentat_bin/submit5.patch new file mode 100644 index 000000000..9614d8c69 --- /dev/null +++ b/install/MarcMentat/2022.1/Mentat_bin/submit5.patch @@ -0,0 +1,38 @@ +--- ++++ +@@ -63,10 +64,10 @@ doe_nparallel=$6 + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -91,6 +92,7 @@ if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -189,12 +191,12 @@ unset PYTHONHOME + unset PYTHONPATH + + if [ "$doe_first" = "-" ]; then # submit of regular Marc job +- "${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++ "${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 + else # submit of a DoE Marc job +- "${DIR}/tools/run_marc" $slv -j $job -v n -b n $nprocds $nprocd \ ++ "${DIR}/tools/run_damask_mp" $slv -j $job -v n -b n $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu diff --git a/install/MarcMentat/2022.1/Mentat_bin/submit6.patch b/install/MarcMentat/2022.1/Mentat_bin/submit6.patch new file mode 100644 index 000000000..a3ed16135 --- /dev/null +++ b/install/MarcMentat/2022.1/Mentat_bin/submit6.patch @@ -0,0 +1,38 @@ +--- ++++ +@@ -63,10 +64,10 @@ doe_nparallel=$6 + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -91,6 +92,7 @@ if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -189,12 +191,12 @@ unset PYTHONHOME + unset PYTHONPATH + + if [ "$doe_first" = "-" ]; then # submit of regular Marc job +- "${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++ "${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 + else # submit of a DoE Marc job +- "${DIR}/tools/run_marc" $slv -j $job -v n -b n $nprocds $nprocd \ ++ "${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b n $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu diff --git a/install/MarcMentat/2022.1/Mentat_menus/job_run.ms.patch b/install/MarcMentat/2022.1/Mentat_menus/job_run.ms.patch new file mode 100644 index 000000000..6cbcf895c --- /dev/null +++ b/install/MarcMentat/2022.1/Mentat_menus/job_run.ms.patch @@ -0,0 +1,158 @@ +--- ++++ +@@ -261,11 +261,18 @@ popmenu job_run_popmenu { + } + button { + position +25 = +- size 25 4 ++ size 18 4 + text "ADVANCED JOB SUBMISSION" + help "job_run#Job Submission And Control" + popmenu job_submit_adv_pm + } ++ button { ++ position +18 = ++ size 7 4 ++ text "DAMASK" ++ help "damask_run#Job Submission And Control" ++ popmenu damask ++ } + button { + position 0 +4 + size 12 4 +@@ -1189,6 +1196,135 @@ popmenu job_submit_adv_pm { + } + + ++#-------------------------------------------------------------------------------------------------- ++popmenu damask { ++ ++#ifdef QT_MENTAT ++ text "DAMASK.MPIE.DE" ++#endif ++ ++ group { ++#ifndef QT_MENTAT ++ label { ++ position 0 0 ++ size 50 4 ++ text "DAMASK.MPIE.DE" ++ } ++#endif ++ ++ label { ++ position 1 6 ++ size 13 6 ++ text "Optimzation" ++ border_width 1 ++ border_color black ++ } ++ ++ label { ++ position +13 = ++ size 20 6 ++ text "write Input" ++ border_width 1 ++ border_color black ++ } ++ ++ label { ++ position +18 = ++ size 30 6 ++ text "do not write Inp." ++ border_width 1 ++ border_color black ++ } ++ ++ label { ++ position -32 +6 ++ size 12 6 ++ text "O2 / OpenMP" ++ border_width 1 ++ border_color black ++ } ++ ++ popdown { ++ position +12 = ++ size 20 6 ++ text "Submit" ++ command "*submit_job 4 *monitor_job" ++ } ++ ++ popdown { ++ position +20 = ++ size 20 6 ++ text "Execute" ++ command "*execute_job 4 *monitor_job" ++ } ++ ++ label { ++ position -32 +6 ++ size 12 6 ++ text "O1 / OpenMP" ++ border_width 1 ++ border_color black ++ } ++ ++ popdown { ++ position +12 = ++ size 20 6 ++ text "Submit" ++ command "*submit_job 5 *monitor_job" ++ } ++ ++ popdown { ++ position +20 = ++ size 20 6 ++ text "Execute" ++ command "*execute_job 5 *monitor_job" ++ } ++ ++ label { ++ position -32 +6 ++ size 12 6 ++ text "O0 / OpenMP" ++ border_width 1 ++ border_color black ++ } ++ ++ popdown { ++ position +12 = ++ size 20 6 ++ text "Submit" ++ command "*submit_job 6 *monitor_job" ++ } ++ ++ popdown { ++ position +20 = ++ size 20 6 ++ text "Execute" ++ command "*execute_job 6 *monitor_job" ++ } ++ ++ popdown { ++ position 19 +8 ++ size 12 8 ++ text "CANCEL" ++ } ++} ++ ++ window { ++ parent mentat ++ origin 38 8 ++#ifdef DCOM ++ size 50 100 ++#else ++ size 50 94 ++#endif ++ background_color body ++ border_width 1 ++ border_color border ++ buffering single ++ } ++ mode permanent ++} ++ + #-------------------------------------------------------------------------------------------------- + popmenu job_exit_msg_pm { + diff --git a/src/Marc/include/concom2022.1 b/src/Marc/include/concom2022.1 new file mode 100644 index 000000000..86cd4440c --- /dev/null +++ b/src/Marc/include/concom2022.1 @@ -0,0 +1,464 @@ +! common block definition file taken from respective MSC.Marc release and reformated to free format +!*********************************************************************** +! +! File: concom.cmn +! +! MSC.Marc include file +! +integer & + iacous, iasmbl, iautth, ibear, icompl, iconj, icreep, ideva, idyn, idynt,& + ielas, ielcma, ielect, iform, ifour, iharm, ihcps, iheat, iheatt, ihresp,& + ijoule, ilem, ilnmom, iloren, inc, incext, incsub, ipass, iplres, ipois,& + ipoist, irpflo, ismall, ismalt, isoil, ispect, ispnow, istore, iswep, ithcrp,& + itherm, iupblg, iupdat, jacflg, jel, jparks, largst, lfond, loadup, loaduq,& + lodcor, lovl, lsub, magnet, ncycle, newtnt, newton, noshr, linear, ivscpl,& + icrpim, iradrt, ipshft, itshr, iangin, iupmdr, iconjf, jincfl, jpermg, jhour,& + isolvr, jritz, jtable, jshell, jdoubl, jform, jcentr, imini, kautth, iautof,& + ibukty, iassum, icnstd, icnstt, kmakmas, imethvp, iradrte, iradrtp, iupdate, iupdatp,& + ncycnt, marmen , idynme, ihavca, ispf, kmini, imixex, largtt, kdoela, iautofg,& + ipshftp, idntrc, ipore, jtablm, jtablc, isnecma, itrnspo, imsdif, jtrnspo, mcnear,& + imech, imecht, ielcmat, ielectt, magnett, imsdift, noplas, jtabls, jactch, jtablth,& + kgmsto , jpzo, ifricsh, iremkin, iremfor, ishearp, jspf, machining, jlshell, icompsol,& + iupblgfo, jcondir, nstcrp, nactive, ipassref, nstspnt, ibeart, icheckmpc, noline, icuring,& + ishrink, ioffsflg, isetoff, ioffsetm,iharmt, inc_incdat, iautspc, ibrake, icbush, istream_input,& + iprsinp, ivlsinp, ifirst_time,ipin_m, jgnstr_glb, imarc_return,iqvcinp, nqvceid, istpnx, imicro1,& + iaxisymm, jbreakglue,iglstif, jfastasm,iwear, iwearcf, imixmeth, ielcmadyn, idinout, igena_meth,& + magf_meth, non_assumed, iredoboudry, ioffsz0,icomplt, mesh_dual, iactrp, mgnewton, iusedens,igsigd0,& + iaem, icosim, inodels, nlharm, iampini, iphasetr, inonlcl, inonlct, iforminp,ispecerror,& + icsprg, imol, imolt, idatafit,iharmpar, inclcase, imultifreq,init_elas, ifatig, iftgmat,& + nchybrid, ibuckle +dimension :: ideva(60) +integer num_concom +parameter(num_concom=262) +common/marc_concom/& + iacous, iasmbl, iautth, ibear, icompl, iconj, icreep, ideva, idyn, idynt,& + ielas, ielcma, ielect, iform, ifour, iharm, ihcps, iheat, iheatt, ihresp,& + ijoule, ilem, ilnmom, iloren, inc, incext, incsub, ipass, iplres, ipois,& + ipoist, irpflo, ismall, ismalt, isoil, ispect, ispnow, istore, iswep, ithcrp,& + itherm, iupblg, iupdat, jacflg, jel, jparks, largst, lfond, loadup, loaduq,& + lodcor, lovl, lsub, magnet, ncycle, newtnt, newton, noshr, linear, ivscpl,& + icrpim, iradrt, ipshft, itshr, iangin, iupmdr, iconjf, jincfl, jpermg, jhour,& + isolvr, jritz, jtable, jshell, jdoubl, jform, jcentr, imini, kautth, iautof,& + ibukty, iassum, icnstd, icnstt, kmakmas, imethvp, iradrte, iradrtp, iupdate, iupdatp,& + ncycnt, marmen, idynme, ihavca, ispf, kmini, imixex, largtt, kdoela, iautofg,& + ipshftp, idntrc, ipore, jtablm, jtablc, isnecma, itrnspo, imsdif, jtrnspo, mcnear,& + imech, imecht, ielcmat, ielectt, magnett, imsdift, noplas, jtabls, jactch, jtablth,& + kgmsto , jpzo, ifricsh, iremkin, iremfor, ishearp, jspf, machining, jlshell, icompsol,& + iupblgfo, jcondir, nstcrp, nactive, ipassref, nstspnt, ibeart, icheckmpc, noline, icuring,& + ishrink, ioffsflg, isetoff, ioffsetm,iharmt, inc_incdat, iautspc, ibrake, icbush, istream_input,& + iprsinp, ivlsinp, ifirst_time,ipin_m, jgnstr_glb, imarc_return,iqvcinp, nqvceid, istpnx, imicro1,& + iaxisymm, jbreakglue,iglstif, jfastasm,iwear, iwearcf, imixmeth, ielcmadyn, idinout, igena_meth,& + magf_meth, non_assumed, iredoboudry, ioffsz0,icomplt, mesh_dual, iactrp, mgnewton, iusedens,igsigd0,& + iaem, icosim, inodels, nlharm, iampini, iphasetr, inonlcl, inonlct, iforminp,ispecerror,& + icsprg, imol, imolt, idatafit,iharmpar, inclcase, imultifreq,init_elas, ifatig, iftgmat,& + nchybrid, ibuckle +! +! comments of variables: +! +! iacous Control flag for acoustic analysis. Input data. +! iacous=1 modal acoustic analysis. +! iacous=2 harmonic acoustic-structural analysis. +! iasmbl Control flag to indicate that operator matrix should be +! recalculated. +! iautth Control flag for AUTO THERM option. +! ibear Control flag for bearing analysis. Input data. +! icompl Control variable to indicate that a complex analysis is +! being performed. Either a Harmonic analysis with damping, +! or a harmonic electro-magnetic analysis. Input data. +! iconj Flag for EBE conjugate gradient solver (=solver 1, retired) +! Also used for VKI iterative solver. +! icreep Control flag for creep analysis. Input data. +! ideva(60) - debug print out flag +! 1 print element stiffness matrices, mass matrix +! 2 output matrices used in tying +! 3 force the solution of a nonpositive definite matrix +! 4 print info of connections to each node +! 5 info of gap convergence, internal heat generated, contact +! touching and separation +! 6 nodal value array during rezoning +! 7 tying info in CONRAD GAP option, fluid element numbers in +! CHANNEL option +! 8 output incremental displacements in local coord. system +! 9 latent heat output +! 10 stress-strain in local coord. system +! 11 additional info on interlaminar stress +! 12 output right hand side and solution vector +! 13 info of CPU resources used and memory available on NT +! 14 info of mesh adaption process, 2D outline information +! info of penetration checking for remeshing +! save .fem files after afmesh3d meshing +! print local adaptivity info +! 15 surface energy balance flag +! 16 print info regarding pyrolysis +! 17 print info of "streamline topology" +! 18 print mesh data changes after remeshing +! 19 print material flow stress data read in from *.mat file +! if unit flag is on, print out flow stress after conversion +! 20 print information on table input +! 21 print out information regarding kinematic boundary conditions +! 22 print out information regarding dist loads, point loads, film +! and foundations +! 23 print out information about automatic domain decomposition +! 24 print out iteration information in SuperForm status report file +! 25 print out information for ablation +! 26 print out information for films - Table input +! 27 print out the tying forces +! 28 print out for CASI solver, convection, +! 29 DDM single file debug printout +! 30 print out cavity debug info +! 31 print out welding related info +! 32 prints categorized DDM memory usage +! 33 print out the cutting info regarding machining feature +! 34 print out the list of quantities which can be defined via a table +! and for each quantity the supported independent variables +! 35 print out detailed coupling region info +! 36 print out solver debug info level 1 (Least Detailed) +! 37 print out solver debug info level 1 (Medium Detailed) +! 38 print out solver debug info level 1 (Very Detailed) +! 39 print detailed memory allocation info +! 40 print out marc-adams debug info +! 41 output rezone mapping post file for debugging +! 42 output post file after calling oprofos() for debugging +! 43 debug printout for vcct +! 44 debug printout for progressive failure +! 45 print out automatically generated midside node coordinates (arecrd) +! 46 print out message about routine and location, where the ibort is raised (ibort_inc) +! 47 print out summary message of element variables on a +! group-basis after all the automatic changes have been +! made (em_ellibp) +! 48 Automatically generate check results based on max and min vals. +! These vals are stored in the checkr file, which is inserted +! into the *dat file by the generate_check_results script from /marc/tools +! 49 Automatically generate check results based on the real calculated values +! at the sppecified check result locations. +! These vals are stored in the checkr file, which is inserted +! into the *dat file by the update_check_results script from /marc/tools +! 50 generate a file containing the resistance or capacity matrix; +! this file can be used to compare results with a reference file +! 51 print out detailed information for segment-to-segment contact +! 52 print out detailed relative displacement information +! for uniaxial sliding contact +! 53 print out detailed sliding direction information for +! uniaxial sliding contact +! 54 print out detailed information for edges attached to a curve +! 55 print information related to viscoelasticity calculations +! 56 print out detailed information for element coloring for multithreading +! 57 print out extra overheads due to multi-threading. +! These overhead includes (i) time and (ii) memory. +! The memory report will be summed over all the children. +! 58 debug output for ELSTO usage +! 59 print out contact body forces and nodes in contact +! +! idyn Control flag for dynamics. Input data. +! 1 = eigenvalue extraction and / or modal superposition +! 2 = Newmark Beta and Single Step Houbolt (ssh with idynme=1) +! 3 = Houbolt +! 4 = Central difference +! 5 = Newer central difference +! idynt Copy of idyn at begining of increment +! ielas Control flag for ELASTIC analysis. Input data. +! Set by user or automatically turned on by Fourier option. +! Implies that each load case is treated separately. +! In Adaptive meshing analysis , forces re-analysis until +! convergence obtained. +! Also seriously misused to indicate no convergence. +! = 1 elastic option with fourier analysis +! = 2 elastic option without fourier analysis +! =-1 no convergence in recycles or max # increments reached +! Set to 1 if ELASTIC or SUBSTRUC parameter cards are used, +! or if fourier option is used. +! Then set to 2 if not fourier analysis. +! ielcma Control flag for electromagnetic analysis. Input data. +! ielcma = 1 Harmonic formulation +! ielcma = 2 Transient formulation +! ielect Control flag for electrostatic option. Input data. +! iform Control flag indicating that contact will be performed. +! ifour Control flag for Fourier analysis. +! 0 = Odd and even terms. +! 1 = symmetric (cosine) terms +! 2 = antisymmetric (sine) terms. +! iharm Control flag to indicate that a harmonic analysis will +! be performed. May change between passes. +! ihcps Control flag for coupled thermal - stress analysis. +! iheat Control flag for heat transfer analysis. Input data. +! iheatt Permanent control flag for heat transfer analysis. +! Note in coupled analysis iheatt will remain as one, +! but iheat will be zero in stress pass. +! ihresp Control flag to indicate to perform a harmonic subincrement. +! ijoule Control flag for Joule heating. +! ilem Control flag to determin which vector is to be transformed. +! Control flag to see where one is: +! ilem = 1 - elem.f +! ilem = 2 - initst.f +! ilem = 3 - pressr.f +! ilem = 3 - fstif.f +! ilem = 4 - jflux.f +! ilem = 4 - strass.f +! ilem = 5 - mass.f +! ilem = 5 - osolty.f +! ilnmom Control flag for soil - pore pressure calculation. Input data. +! ilnmom = 0 - perform only pore pressure calculation. +! = 1 - couples pore pressure - displacement analysis +! iloren Control flag for DeLorenzi J-Integral evaluation. Input data. +! inc Increment number. +! incext Control flag indicating that currently working on a +! subincrement. +! Could be due to harmonics , damping component (bearing), +! stiffness component (bearing), auto therm creep or +! old viscoplaticity +! incsub Sub-increment number. +! inonlcl control flag for nonlocal pass +! inonlct permanent control flag for nonlocal pass +! ipass Control flag for which part of coupled analysis. +! ipass = -1 - reset to base values +! ipass = 0 - do nothing +! ipass = 1 - stress part +! ipass = 2 - heat transfer part +! 3 - fluid pass +! 4 - joule heating pass +! 5 - pore pressure pass +! 6 - electrostatic pass +! 7 - magnetostatic pass +! 8 - electromagnetic pass +! 9 - diffusion pass +! ipass = 10 - nonlocal part +! iplres Flag indicating that either second matrix is stored. +! dynamic analysis - mass matrix +! heat transfer - specific heat matrix +! buckle - initial stress stiffness +! ipois Control flag indicating Poisson type analysis +! ipois = 1 for heat transfer +! = 1 for heat transfer part of coupled +! = 1 for bearing +! = 1 for electrostatic +! = 1 for magnetostatic +! = 1 for nonlocal part +! ipoist Permanent copy of ipois. In coupled analysis , ipois = 0 +! in stress portion, yet ipoist will still =1. +! irpflo global flag for rigid plastic flow analysis +! = 1 eularian formulation +! = 2 regular formulation; rigid material present in the analysis +! ismall control flag to indicate small displacement analysis. input data. +! ismall = 0 - large disp included. +! ismall = 1 - small displacement. +! the flag is changing between passes. +! ismalt permanent copy of ismall . in heat transfer portion of +! coupled analysis ismall =0 , but ismalt remains the same. +! isoil control flag indicating that soil / pore pressure +! calculation . input data. +! ispect control flag for response spectrum calculation. input data. +! ispnow control flag to indicate to perform a spectrum response +! calculation now. +! istore store stresses flag. +! istore = 0 in elem.f and if first pass of creep +! convergence checking in ogetst.f +! or harmonic analysis or thruc.f if not +! converged. +! iswep control flag for eigenvalue analysis. +! iswep=1 - go do extraction process +! ithcrp control flag for auto therm creep option. input data. +! itherm control flag for either temperature dependent material +! properties and/or thermal loads. +! iupblg control flag for follower force option. input data. +! iupdat control flag for update lagrange option for current element. +! jacflg control flag for lanczos iteration method. input data. +! jel control flag indicating that total load applied in +! increment, ignore previous solution. +! jel = 1 in increment 0 +! = 1 if elastic or fourier +! = 1 in subincrements with elastic and adaptive +! jparks control flag for j integral by parks method. input data. +! largst control flag for finite strain plasticity. input data. +! lfond control variable that indicates if doing elastic +! foundation or film calculation. influences whether +! this is volumetric or surface integration. +! loadup control flag that indicates that nonlinearity occurred +! during previous increment. +! loaduq control flag that indicates that nonlinearity occurred. +! lodcor control flag for switching on the residual load correction. +! notice in input stage lodcor=0 means no loadcor, +! after omarc lodcor=1 means no loadcor +! lovl control flag for determining which "overlay" is to +! be called from ellib. +! lovl = 1 omarc +! = 2 oaread +! = 3 opress +! = 4 oasemb +! = 5 osolty +! = 6 ogetst +! = 7 oscinc +! = 8 odynam +! = 9 opmesh +! = 10 omesh2 +! = 11 osetz +! = 12 oass +! = 13 oincdt +! = 14 oasmas +! = 15 ofluas +! = 16 ofluso +! = 17 oshtra +! = 18 ocass +! = 19 osoltc +! = 20 orezon +! = 21 otest +! = 22 oeigen +! lsub control variable to determine which part of element +! assembly function is being done. +! lsub = 1 - no longer used +! = 2 - beta* +! = 3 - cons* +! = 4 - ldef* +! = 5 - posw* +! = 6 - theta* +! = 7 - tmarx* +! = 8 - geom* +! magnet control flag for magnetostatic analysis. input data. +! ncycle cycle number. accumulated in osolty.f +! note first time through oasemb.f , ncycle = 0. +! newtnt control flag for permanent copy of newton. +! newton iteration type. input data. +! newton : = 1 full newton raphson +! 2 modified newton raphson +! 3 newton raphson with strain correct. +! 4 direct substitution +! 5 direct substitution followed by n.r. +! 6 direct substitution with line search +! 7 full newton raphson with secant initial stress +! 8 secant method +! 9 full newton raphson with line search +! noshr control flag for calculation interlaminar shears for +! elements 22,45, and 75. input data. +!ees +! +! jactch = 1 or 2 if elements are activated or deactivated +! = 3 if elements are adaptively remeshed or rezoned +! = 0 normally / reset to 0 when assembly is done +! ifricsh = 0 call to fricsh in otest not needed +! = 1 call to fricsh (nodal friction) in otest needed +! iremkin = 0 remove deactivated kinematic boundary conditions +! immediately - only in new input format (this is default) +! = 1 remove deactivated kinematic boundary conditions +! gradually - only in new input format +! iremfor = 0 remove force boundary conditions immediately - +! only in new input format (this is default) +! = 1 remove force boundary conditions gradually - +! only in new input format (this is default) +! ishearp set to 1 if shear panel elements are present in the model +! +! jspf = 0 not in spf loadcase +! > 0 in spf loadcase (jspf=1 during first increment) +! machining = 1 if the metal cutting feature is used, for memory allocation purpose +! = 0 (default) if no metal cutting feature required +! +! jlshell = 1 if there is a shell element in the mesh +! icompsol = 1 if there is a composite solid element in the mesh +! iupblgfo = 1 if follower force for point loads +! jcondir = 1 if contact priority option is used +! nstcrp = 0 (default) steady state creep flag (undocumented feature. +! if not 0, turns off special ncycle = 0 code in radial.f) +! nactive = number of active passes, if =1 then it's not a coupled analysis +! ipassref = reference ipass, if not in a multiphysics pass ipass=ipassref +! icheckmpc = value of mpc-check parameter option +! noline = set to 1 in osolty if no line seacrh should be done in ogetst +! icuring = set to 1 if the curing is included for the heat transfer analysis. +! ishrink = set to 1 if shrinkage strain is included for mechancial analysis. +! ioffsflg = 1 for small displacement beam/shell offsets +! = 2 for large displacement beam/shell offsets +! isetoff = 0 - do not apply beam/shell offsets +! = 1 - apply beam/shell offsets +! ioffsetm = min. value of offset flag +! iharmt = 1 global flag if a coupled analysis contains an harmonic pass +! inc_incdat = flag to record increment number of a new loadcase in incdat.f +! iautspc = flag for AutoSPC option +! ibrake = brake squeal in this increment +! icbush = set to 1 if cbush elements present in model +! istream_input = set to 1 for streaming input calling Marc as library +! iprsinp = set to 1 if pressure input, introduced so other variables +! such as h could be a function of pressure +! ivlsinp = set to 1 if velocity input, introduced so other variables +! such as h could be a function of velocity +! ipin_m = # of beam element with PIN flag +! jgnstr_glb = global control over pre or fast integrated composite shells +! imarc_return = Marc return flag for streaming input control +! iqvcimp = if non-zero, then the number of QVECT boundary conditions +! nqvceid = number of QVECT boundary conditions, where emisivity/absorbtion id entered +! istpnx = 1 if to stop at end of increment +! imicro1 = 1 if micro1 interface is used +! iaxisymm = set to 1 if axisymmetric analysis +! jbreakglue = set to 1 if breaking glued option is used +! iglstif = 1 if ddm and global stiffness matrix formed (sgi solver 6 or solver9) +! jfastasm = 1 do fast assembly using SuperForm code +! iwear = set to 1 if wear model, set to 2 if wear model and coordinates updated +! iwearcf = set to 1 to store nodal coefficient of friction for wear calculation +! imixmeth = set=1 then use nonlinear mixture material - allocate memory +! ielcmadyn = flag for magnetodynamics +! 0 - electromagnetics using newmark beta +! 1 - transient magnetics using backward euler +! idinout = flag to control if inside out elements should be deactivated +! igena_meth = 0 - generalized alpha parameters depend on whether or not contact +! is flagged (dynamic,7) +! 10 - generalized alpha parameters are optimized for a contact +! analysis (dynamic,8) +! 11 - generalized alpha parameters are optimized for an analysis +! without contact (dynamic,8) +! magf_meth = - Method to compute force in magnetostatic - structural +! = 1 - Virtual work method based on finite difference for the force computation +! = 2 - Maxwell stress tensor +! = 3 - Virtual work method based on local derivative for the force computation +! non_assumed = 1 no assumed strain formulation (forced) +! iredoboudry set to 1 if contact boundary needs to be recalculated +! ioffsz0 = 1 if composite are used with reference position.ne.0 +! icomplt = 1 global flag if a coupled analysis contains an complex pass +! mesh_dual = 1 two independent meshes are used in magnetodynamic/thermal/structural +! one for magnetodynamic and the other for the remaining passes +! iactrp = 1 in an analysis with global remeshing, include inactive +! rigid bodies on post file +! mgnewton = 1 Use full Newton Raphson iteration for magnetostatic pass +! +! iusedens > 0 if mass density is used in the analysis (dynamics, mass dependent loading) +! igsigd0 = 1 set varselem(igsigd) to zero in next oasemb +! iaem = 1 if marc is called from aem (0 - off - default) +! icosim = 1 if marc is used in co-simulation analysis with ADAMS using the CosimEngine +! = 2 if marc is used in co-simulation analysis with ADAMS using the ACSI interface +! = 3 if marc is used in co-simulation analysis with scFLOW using the CosimEngine +! = 4 if marc is used in co-simulation analysis with scFLOW and ADAMS using the CosimEngine +! inodels = 1 nodal integration elements 239/240/241 present +! nlharm = 0 harmonic subincrements are linear +! = 1 harmonic subincrements are nonlinear +! iampini = 0 amplitude of previous harmonic subinc is initial estimate (default) +! = 1 zero amplitude is initial estimate +! iphasetr = 1 phase transformation material model is used +! iforminp flag indicating that contact is switched on via the CONTACT +! option in the input file (as opposed to the case that contact +! is switched on internally due to cyclic symmetry or model +! section creation) +! ispecerror = a+10*b (only for spectrum response analysis with missing mass option) +! a=0 or a=1 (modal shape with non-zero shift) +! b=0 or b=1 (recover with new assembly of stiffness matrix) +! icsprg = set to 1 if spring elements present in model +! imol Control flag for molecualr diffusion pass +! imolt Permanent control flag for molecualr diffusion pass +! Note in coupled analysis imolt will remain as one, +! but imol will be zero in stress pass or thermal pass. +! idatafit = run Marc to fit parameters +! iharmpar = 1 if harmonic parameter option is used +! inclcase load case increment use for cyclic plasticity data fitting +! imultifreq flag to indicate how many harmonic magnetodynamic passes are computed in coupled +! magnetodynamic/thermal(/structural) analyses. +! 0 or 1 one pass 2 two passes 3 or more is not supported +! init_elas use elastic stress-strain law as the material tangent for +! the first cycle of an increment +! ifatig packed integer telling which fatigue mode is active +! 1 = elastomer +! 10 = stress-life +! 100 = strain-life +! = 2 strain-life fatigue +! iftgmat = 0 no fatigue material properties in the dat file +! = 1 fatigue material properties in the dat file +! nchybrid cycle count used for hybrid contact; meant to force an extra iteration +! if the overlap for a node in hybrid contact is too large +! ibuckle buckle parameter option is active +! +!*********************************************************************** +!$omp threadprivate(/marc_concom/) +!! diff --git a/src/Marc/include/creeps2022.1 b/src/Marc/include/creeps2022.1 new file mode 100644 index 000000000..8fa4c8401 --- /dev/null +++ b/src/Marc/include/creeps2022.1 @@ -0,0 +1,72 @@ +! common block definition file taken from respective MSC.Marc release and reformated to free format +!*********************************************************************** +! +! File: creeps.cmn +! +! MSC.Marc include file +! +real(pReal) cptim,timinc,timinc_p,timinc_s,timincm,timinc_a,timinc_b +integer icfte,icfst,icfeq,icftm,icetem,mcreep,jcreep,icpa,icftmp,icfstr,& + icfqcp,icfcpm,icrppr,icrcha,icpb,iicpmt,iicpa +real(pReal) time_beg_lcase,time_beg_inc,fractol,time_beg_pst +real(pReal) fraction_donn,timinc_ol2 +! +integer num_creepsr,num_creepsi,num_creeps2r +parameter(num_creepsr=7) +parameter(num_creepsi=17) +parameter(num_creeps2r=6) +common/marc_creeps/cptim,timinc,timinc_p,timinc_s,timincm,timinc_a,timinc_b,icfte,icfst,& + icfeq,icftm,icetem,mcreep,jcreep,icpa,icftmp,icfstr,icfqcp,icfcpm,icrppr,icrcha,icpb,iicpmt,iicpa +common/marc_creeps2/time_beg_lcase,time_beg_inc,fractol,time_beg_pst,fraction_donn,timinc_ol2 +! +! cptim Total time at begining of increment. +! timinc Incremental time for this step. +! icfte Local copy number of slopes of creep strain rate function +! versus temperature. Is -1 if exponent law used. +! icfst Local copy number of slopes of creep strain rate function +! versus equivalent stress. Is -1 if exponent law used. +! icfeq Local copy number of slopes of creep strain rate function +! versus equivalent strain. Is -1 if exponent law used. +! icftm Local copy number of slopes of creep strain rate function +! versus time. Is -1 if exponent law used. +! icetem Element number that needs to be checked for creep convergence +! or, if negative, the number of elements that need to +! be checked. In the latter case the elements to check +! are stored in ielcp. +! mcreep Maximum nuber of iterations for explicit creep. +! jcreep Counter of number of iterations for explicit creep +! procedure. jcreep must be .le. mcreep +! icpa(1-6) Pointer to constants in creep strain rate expression. +! icftmp Pointer to temperature dependent creep strain rate data. +! icfstr Pointer to equivalent stress dependent creep strain rate data. +! icfqcp Pointer to equivalent creep strain dependent creep strain +! rate data. +! icfcpm Pointer to equivalent creep strain rate dependent +! creep strain rate data. +! icrppr Permanent copy of icreep +! icrcha Control flag for creep convergence checking , if set to +! 1 then testing on absolute change in stress and creep +! strain, not relative testing. Input data. +! icpb(1-4) Pointer to storage of material id cross reference numbers. +! iicpmt creep law type ID +! =1 - power law +! =2 - solder +! =3 - steady-creep +! =4 - hyperbolic steady-creep +! iicpa Pointer to table IDs for constants in creep strain rate +! expression +! +! +! time_beg_lcase time at the beginning of the current load case +! time_beg_inc time at the beginning of the current increment +! fractol fraction of loadcase or increment time when we +! consider it to be finished +! time_beg_pst time corresponding to first increment to be +! read in from thermal post file for auto step +! +! timinc_old Time step of the previous increment +! +!*********************************************************************** +!!$omp threadprivate(/marc_creeps/) +!!$omp threadprivate(/marc_creeps2/) +!! From c58bbaa9add158bcad6bbb641d00964500c1d0f4 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 5 May 2022 03:50:41 +0200 Subject: [PATCH 22/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-270-gc6030f30d --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c5ac07ef6..8af106d0b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-266-g5776891b7 +3.0.0-alpha6-270-gc6030f30d From ca95282911261b546bfaa7cb41e750c9d1670667 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 6 May 2022 12:01:24 +0200 Subject: [PATCH 23/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-285-g4d131ec7b --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8af106d0b..1485aa8b8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-270-gc6030f30d +3.0.0-alpha6-285-g4d131ec7b From 58fab14c6c396a9778e7b03f402235e802a7e2fb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 6 May 2022 12:34:32 +0200 Subject: [PATCH 24/88] PETSc 3.17.1 adjustments --- .github/workflows/Fortran.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Fortran.yml b/.github/workflows/Fortran.yml index d93cdd27f..e9175bd53 100644 --- a/.github/workflows/Fortran.yml +++ b/.github/workflows/Fortran.yml @@ -2,7 +2,7 @@ name: Grid and Mesh Solver on: [push] env: - PETSC_VERSION: '3.17.0' + PETSC_VERSION: '3.17.1' HOMEBREW_NO_ANALYTICS: 'ON' # Make Homebrew installation a little quicker HOMEBREW_NO_AUTO_UPDATE: 'ON' HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 'ON' diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b341dbbe..d24d9b8b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ message("\nBuilding ${CMAKE_PROJECT_NAME} ${DAMASK_VERSION}\n") add_definitions(-DPETSC) add_definitions(-DDAMASKVERSION="${DAMASK_VERSION}") add_definitions(-DCMAKE_SYSTEM="${CMAKE_SYSTEM}") -if(PETSC_VERSION VERSION_GREATER_EQUAL 3.17.0) +if(PETSC_VERSION VERSION_EQUAL 3.17.0) add_definitions("-DCHKERRQ=PetscCall") endif() From 7cf3bcb9c9976c331c0dd1fb657d187a5e71e666 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 7 May 2022 21:39:43 +0200 Subject: [PATCH 25/88] easier to read --- src/polynomials.f90 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 155f54bf8..55aadf948 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -46,14 +46,14 @@ end subroutine polynomials_init !-------------------------------------------------------------------------------------------------- !> @brief Initialize a Polynomial from Coefficients. !-------------------------------------------------------------------------------------------------- -function polynomial_from_coef(coef,x_ref) result(p) +pure function polynomial_from_coef(coef,x_ref) result(p) - real(pReal), dimension(:), intent(in) :: coef + real(pReal), dimension(0:), intent(in) :: coef real(pReal), intent(in) :: x_ref type(tPolynomial) :: p - allocate(p%coef(0:size(coef)-1),source=coef) ! should be zero based + p%coef = coef p%x_ref = x_ref end function polynomial_from_coef @@ -77,9 +77,7 @@ function polynomial_from_dict(dict,y,x) result(p) if (dict%contains(y//','//x)) then x_ref = dict%get_asFloat(x//'_ref') coef = [coef,dict%get_asFloat(y//','//x)] - if (dict%contains(y//','//x//'^2')) then - coef = [coef,dict%get_asFloat(y//','//x//'^2')] - end if + if (dict%contains(y//','//x//'^2')) coef = [coef,dict%get_asFloat(y//','//x//'^2')] else x_ref = huge(0.0_pReal) ! Simplify debugging end if @@ -173,7 +171,6 @@ subroutine selfTest if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval(even)' if (dNeq(p1%der1_at(x_ref+x),-p1%der1_at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval_der(even)' - end subroutine selfTest end module polynomials From 45dc3d8f2beb744c9a426f55f4f3cdc3150bee94 Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 7 May 2022 22:20:56 +0200 Subject: [PATCH 26/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-288-g2792153ca --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 1485aa8b8..ff467c7e1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-285-g4d131ec7b +3.0.0-alpha6-288-g2792153ca From 70b9943920d17043e9cbd27eab7d3c2a5834b053 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 7 May 2022 22:47:13 +0200 Subject: [PATCH 27/88] allow to specify only quadratic term in Dict --- src/polynomials.f90 | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 55aadf948..6c11c4598 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -13,7 +13,7 @@ module polynomials type, public :: tPolynomial real(pReal), dimension(:), allocatable :: coef - real(pReal) :: x_ref + real(pReal) :: x_ref = huge(0.0_pReal) contains procedure, public :: at => eval procedure, public :: der1_at => eval_der1 @@ -70,6 +70,7 @@ function polynomial_from_dict(dict,y,x) result(p) real(pReal), dimension(:), allocatable :: coef real(pReal) :: x_ref + integer :: i allocate(coef(1),source=dict%get_asFloat(y)) @@ -77,9 +78,10 @@ function polynomial_from_dict(dict,y,x) result(p) if (dict%contains(y//','//x)) then x_ref = dict%get_asFloat(x//'_ref') coef = [coef,dict%get_asFloat(y//','//x)] - if (dict%contains(y//','//x//'^2')) coef = [coef,dict%get_asFloat(y//','//x//'^2')] - else - x_ref = huge(0.0_pReal) ! Simplify debugging + end if + if (dict%contains(y//','//x//'^2')) then + x_ref = dict%get_asFloat(x//'_ref') + coef = [coef,[(0.0_pReal,i=size(coef),2-1)],dict%get_asFloat(y//','//x//'^2')] end if p = Polynomial(coef,x_ref) @@ -130,15 +132,17 @@ end function eval_der1 !-------------------------------------------------------------------------------------------------- !> @brief Check correctness of polynomical functionality. !-------------------------------------------------------------------------------------------------- -subroutine selfTest +subroutine selfTest() type(tPolynomial) :: p1, p2 real(pReal), dimension(3) :: coef + integer :: i real(pReal) :: x_ref, x class(tNode), pointer :: dict - character(len=pStringLen), dimension(3) :: coef_s + character(len=pStringLen), dimension(size(coef)) :: coef_s character(len=pStringLen) :: x_ref_s, x_s, YAML_s + call random_number(coef) call random_number(x_ref) call random_number(x) @@ -150,9 +154,9 @@ subroutine selfTest p1 = polynomial(coef,x_ref) if (dNeq(p1%at(x_ref),coef(1))) error stop 'polynomial: @ref' - write(coef_s(1),*) coef(1) - write(coef_s(2),*) coef(2) - write(coef_s(3),*) coef(3) + do i = 1, size(coef_s) + write(coef_s(i),*) coef(i) + end do write(x_ref_s,*) x_ref write(x_s,*) x YAML_s = 'C: '//trim(adjustl(coef_s(1)))//IO_EOL//& @@ -163,11 +167,19 @@ subroutine selfTest p2 = polynomial(dict%asDict(),'C','T') if (dNeq(p1%at(x),p2%at(x),1.0e-10_pReal)) error stop 'polynomials: init' - p1 = polynomial(coef*[0.0_pReal,1.0_pReal,0.0_pReal],x_ref) + YAML_s = 'C: 0.0'//IO_EOL//& + 'C,T: '//trim(adjustl(coef_s(2)))//IO_EOL//& + 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL + Dict => YAML_parse_str(trim(YAML_s)) + p1 = polynomial(dict%asDict(),'C','T') if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(odd)' if (dNeq(p1%der1_at(x),p1%der1_at(5.0_pReal*x),1.0e-10_pReal)) error stop 'polynomials: eval_der(odd)' - p1 = polynomial(coef*[0.0_pReal,0.0_pReal,1.0_pReal],x_ref) + YAML_s = 'C: 0.0'//IO_EOL//& + 'C,T^2: '//trim(adjustl(coef_s(3)))//IO_EOL//& + 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL + Dict => YAML_parse_str(trim(YAML_s)) + p1 = polynomial(dict%asDict(),'C','T') if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval(even)' if (dNeq(p1%der1_at(x_ref+x),-p1%der1_at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval_der(even)' From 71e4fa222c6938033b03e16783c5f0e64bc4b314 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 7 May 2022 22:53:31 +0200 Subject: [PATCH 28/88] generic code for variable order --- src/polynomials.f90 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 6c11c4598..9f30fe5ac 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -70,7 +70,8 @@ function polynomial_from_dict(dict,y,x) result(p) real(pReal), dimension(:), allocatable :: coef real(pReal) :: x_ref - integer :: i + integer :: i, o + character(len=1) :: o_s allocate(coef(1),source=dict%get_asFloat(y)) @@ -79,10 +80,13 @@ function polynomial_from_dict(dict,y,x) result(p) x_ref = dict%get_asFloat(x//'_ref') coef = [coef,dict%get_asFloat(y//','//x)] end if - if (dict%contains(y//','//x//'^2')) then - x_ref = dict%get_asFloat(x//'_ref') - coef = [coef,[(0.0_pReal,i=size(coef),2-1)],dict%get_asFloat(y//','//x//'^2')] - end if + do o = 2,2 + write(o_s,'(I0.0)') o + if (dict%contains(y//','//x//'^'//o_s)) then + x_ref = dict%get_asFloat(x//'_ref') + coef = [coef,[(0.0_pReal,i=size(coef),o-1)],dict%get_asFloat(y//','//x//'^'//o_s)] + end if + end do p = Polynomial(coef,x_ref) From 9605a5c2decec34d7f133831cbc612eabe9d30f9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 7 May 2022 23:04:06 +0200 Subject: [PATCH 29/88] polynomial expansion up to order 4 --- src/polynomials.f90 | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 9f30fe5ac..321c24fb8 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -80,7 +80,7 @@ function polynomial_from_dict(dict,y,x) result(p) x_ref = dict%get_asFloat(x//'_ref') coef = [coef,dict%get_asFloat(y//','//x)] end if - do o = 2,2 + do o = 2,4 write(o_s,'(I0.0)') o if (dict%contains(y//','//x//'^'//o_s)) then x_ref = dict%get_asFloat(x//'_ref') @@ -139,7 +139,7 @@ end function eval_der1 subroutine selfTest() type(tPolynomial) :: p1, p2 - real(pReal), dimension(3) :: coef + real(pReal), dimension(5) :: coef integer :: i real(pReal) :: x_ref, x class(tNode), pointer :: dict @@ -166,6 +166,8 @@ subroutine selfTest() YAML_s = 'C: '//trim(adjustl(coef_s(1)))//IO_EOL//& 'C,T: '//trim(adjustl(coef_s(2)))//IO_EOL//& 'C,T^2: '//trim(adjustl(coef_s(3)))//IO_EOL//& + 'C,T^3: '//trim(adjustl(coef_s(4)))//IO_EOL//& + 'C,T^4: '//trim(adjustl(coef_s(5)))//IO_EOL//& 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p2 = polynomial(dict%asDict(),'C','T') @@ -176,16 +178,32 @@ subroutine selfTest() 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'C','T') - if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(odd)' - if (dNeq(p1%der1_at(x),p1%der1_at(5.0_pReal*x),1.0e-10_pReal)) error stop 'polynomials: eval_der(odd)' + if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(linear)' + if (dNeq(p1%der1_at(x),p1%der1_at(5.0_pReal*x),1.0e-10_pReal)) error stop 'polynomials: eval_der(linear)' YAML_s = 'C: 0.0'//IO_EOL//& 'C,T^2: '//trim(adjustl(coef_s(3)))//IO_EOL//& 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'C','T') - if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval(even)' - if (dNeq(p1%der1_at(x_ref+x),-p1%der1_at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval_der(even)' + if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval(quadratic)' + if (dNeq(p1%der1_at(x_ref+x),-p1%der1_at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval_der(quadratic)' + + YAML_s = 'Y: 0.0'//IO_EOL//& + 'Y,X^3: '//trim(adjustl(coef_s(2)))//IO_EOL//& + 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL + Dict => YAML_parse_str(trim(YAML_s)) + p1 = polynomial(dict%asDict(),'Y','X') + if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(cubic)' + + YAML_s = 'Y: 0.0'//IO_EOL//& + 'Y,X^4: '//trim(adjustl(coef_s(2)))//IO_EOL//& + 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL + Dict => YAML_parse_str(trim(YAML_s)) + p1 = polynomial(dict%asDict(),'Y','X') + if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(quartic)' + + end subroutine selfTest From ec184cb8feb135a95838bf5ea9c070c8ab23c2c6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 08:30:58 +0200 Subject: [PATCH 30/88] need to relax absolute tolerance absolute values for quartic become quite high --- src/polynomials.f90 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 321c24fb8..1a023eba1 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -190,19 +190,18 @@ subroutine selfTest() if (dNeq(p1%der1_at(x_ref+x),-p1%der1_at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval_der(quadratic)' YAML_s = 'Y: 0.0'//IO_EOL//& - 'Y,X^3: '//trim(adjustl(coef_s(2)))//IO_EOL//& + 'Y,X^3: '//trim(adjustl(coef_s(1)))//IO_EOL//& 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'Y','X') - if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(cubic)' + if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-8_pReal)) error stop 'polynomials: eval(cubic)' YAML_s = 'Y: 0.0'//IO_EOL//& - 'Y,X^4: '//trim(adjustl(coef_s(2)))//IO_EOL//& + 'Y,X^4: '//trim(adjustl(coef_s(1)))//IO_EOL//& 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'Y','X') - if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(quartic)' - + if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1.0e-6_pReal)) error stop 'polynomials: eval(quartic)' end subroutine selfTest From 2741fbd97768e5a914f33f354087d0bd57acabce Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 09:27:21 +0200 Subject: [PATCH 31/88] whitespace adjustments - 1 empty line between dummy arguments/return value - 2 empty lines between variable definition and actual code --- src/math.f90 | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index 75b9ddea2..94ad2c48d 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -127,8 +127,10 @@ pure recursive subroutine math_sort(a, istart, iend, sortDim) integer, dimension(:,:), intent(inout) :: a integer, intent(in),optional :: istart,iend, sortDim + integer :: ipivot,s,e,d + if (present(istart)) then s = istart else @@ -164,9 +166,11 @@ pure recursive subroutine math_sort(a, istart, iend, sortDim) integer, dimension(:,:), intent(inout) :: a integer, intent(out) :: p ! Pivot element integer, intent(in) :: istart,iend,sort - integer, dimension(size(a,1)) :: tmp + + integer, dimension(size(a,1)) :: tmp integer :: i,j + do ! find the first element on the right side less than or equal to the pivot point do j = iend, istart, -1 @@ -204,8 +208,10 @@ pure function math_expand(what,how) real(pReal), dimension(:), intent(in) :: what integer, dimension(:), intent(in) :: how real(pReal), dimension(sum(how)) :: math_expand + integer :: i + if (sum(how) == 0) return do i = 1, size(how) @@ -221,9 +227,11 @@ end function math_expand pure function math_range(N) integer, intent(in) :: N !< length of range - integer :: i integer, dimension(N) :: math_range + integer :: i + + math_range = [(i,i=1,N)] end function math_range @@ -235,9 +243,11 @@ end function math_range pure function math_eye(d) integer, intent(in) :: d !< tensor dimension - integer :: i real(pReal), dimension(d,d) :: math_eye + integer :: i + + math_eye = 0.0_pReal do i=1,d math_eye(i,i) = 1.0_pReal @@ -302,6 +312,7 @@ real(pReal) pure function math_delta(i,j) integer, intent (in) :: i,j + math_delta = merge(0.0_pReal, 1.0_pReal, i /= j) end function math_delta @@ -315,6 +326,7 @@ pure function math_cross(A,B) real(pReal), dimension(3), intent(in) :: A,B real(pReal), dimension(3) :: math_cross + math_cross = [ A(2)*B(3) -A(3)*B(2), & A(3)*B(1) -A(1)*B(3), & A(1)*B(2) -A(2)*B(1) ] @@ -329,6 +341,7 @@ pure function math_outer(A,B) real(pReal), dimension(:), intent(in) :: A,B real(pReal), dimension(size(A,1),size(B,1)) :: math_outer + integer :: i,j @@ -351,6 +364,7 @@ real(pReal) pure function math_inner(A,B) real(pReal), dimension(:), intent(in) :: A real(pReal), dimension(size(A,1)), intent(in) :: B + math_inner = sum(A*B) end function math_inner @@ -363,6 +377,7 @@ real(pReal) pure function math_tensordot(A,B) real(pReal), dimension(3,3), intent(in) :: A,B + math_tensordot = sum(A*B) end function math_tensordot @@ -376,6 +391,7 @@ pure function math_mul3333xx33(A,B) real(pReal), dimension(3,3,3,3), intent(in) :: A real(pReal), dimension(3,3), intent(in) :: B real(pReal), dimension(3,3) :: math_mul3333xx33 + integer :: i,j @@ -395,11 +411,12 @@ end function math_mul3333xx33 !-------------------------------------------------------------------------------------------------- pure function math_mul3333xx3333(A,B) - integer :: i,j,k,l real(pReal), dimension(3,3,3,3), intent(in) :: A real(pReal), dimension(3,3,3,3), intent(in) :: B real(pReal), dimension(3,3,3,3) :: math_mul3333xx3333 + integer :: i,j,k,l + #ifndef __INTEL_COMPILER do concurrent(i=1:3, j=1:3, k=1:3, l=1:3) @@ -424,6 +441,7 @@ pure function math_exp33(A,n) real(pReal) :: invFac integer :: n_,i + if (present(n)) then n_ = n else @@ -456,6 +474,7 @@ pure function math_inv33(A) real(pReal) :: DetA logical :: error + call math_invert33(math_inv33,DetA,error,A) if (error) math_inv33 = 0.0_pReal @@ -474,6 +493,7 @@ pure subroutine math_invert33(InvA, DetA, error, A) logical, intent(out) :: error real(pReal), dimension(3,3), intent(in) :: A + InvA(1,1) = A(2,2) * A(3,3) - A(2,3) * A(3,2) InvA(2,1) = -A(2,1) * A(3,3) + A(2,3) * A(3,1) InvA(3,1) = A(2,1) * A(3,2) - A(2,2) * A(3,1) @@ -504,7 +524,7 @@ end subroutine math_invert33 !-------------------------------------------------------------------------------------------------- pure function math_invSym3333(A) - real(pReal),dimension(3,3,3,3) :: math_invSym3333 + real(pReal),dimension(3,3,3,3) :: math_invSym3333 real(pReal),dimension(3,3,3,3),intent(in) :: A @@ -513,6 +533,7 @@ pure function math_invSym3333(A) real(pReal), dimension(6*6) :: work integer :: ierr_i, ierr_f + temp66 = math_sym3333to66(A) call dgetrf(6,6,temp66,6,ipiv6,ierr_i) call dgetri(6,temp66,6,ipiv6,work,size(work,1),ierr_f) @@ -538,6 +559,7 @@ pure subroutine math_invert(InvA, error, A) real(pReal), dimension(size(A,1)**2) :: work integer :: ierr + invA = A call dgetrf(size(A,1),size(A,1),invA,size(A,1),ipiv,ierr) error = (ierr /= 0) @@ -555,6 +577,7 @@ pure function math_symmetric33(m) real(pReal), dimension(3,3) :: math_symmetric33 real(pReal), dimension(3,3), intent(in) :: m + math_symmetric33 = 0.5_pReal * (m + transpose(m)) end function math_symmetric33 @@ -568,6 +591,7 @@ pure function math_skew33(m) real(pReal), dimension(3,3) :: math_skew33 real(pReal), dimension(3,3), intent(in) :: m + math_skew33 = m - math_symmetric33(m) end function math_skew33 @@ -581,6 +605,7 @@ pure function math_spherical33(m) real(pReal), dimension(3,3) :: math_spherical33 real(pReal), dimension(3,3), intent(in) :: m + math_spherical33 = math_I3 * math_trace33(m)/3.0_pReal end function math_spherical33 @@ -594,6 +619,7 @@ pure function math_deviatoric33(m) real(pReal), dimension(3,3) :: math_deviatoric33 real(pReal), dimension(3,3), intent(in) :: m + math_deviatoric33 = m - math_spherical33(m) end function math_deviatoric33 @@ -606,6 +632,7 @@ real(pReal) pure function math_trace33(m) real(pReal), dimension(3,3), intent(in) :: m + math_trace33 = m(1,1) + m(2,2) + m(3,3) end function math_trace33 @@ -618,6 +645,7 @@ real(pReal) pure function math_det33(m) real(pReal), dimension(3,3), intent(in) :: m + math_det33 = m(1,1)* (m(2,2)*m(3,3)-m(2,3)*m(3,2)) & - m(1,2)* (m(2,1)*m(3,3)-m(2,3)*m(3,1)) & + m(1,3)* (m(2,1)*m(3,2)-m(2,2)*m(3,1)) @@ -632,6 +660,7 @@ real(pReal) pure function math_detSym33(m) real(pReal), dimension(3,3), intent(in) :: m + math_detSym33 = -(m(1,1)*m(2,3)**2 + m(2,2)*m(1,3)**2 + m(3,3)*m(1,2)**2) & + m(1,1)*m(2,2)*m(3,3) + 2.0_pReal * m(1,2)*m(1,3)*m(2,3) @@ -761,6 +790,7 @@ pure function math_99to3333(m99) integer :: i,j + #ifndef __INTEL_COMPILER do concurrent(i=1:9, j=1:9) math_99to3333(MAPPLAIN(1,i),MAPPLAIN(2,i),MAPPLAIN(1,j),MAPPLAIN(2,j)) = m99(i,j) @@ -1012,6 +1042,7 @@ pure subroutine math_eigh33(w,v,m) real(pReal) :: T, U, norm, threshold logical :: error + w = math_eigvalsh33(m) v(1:3,2) = [ m(1, 2) * m(2, 3) - m(1, 3) * m(2, 2), & @@ -1066,6 +1097,7 @@ pure function math_rotationalPart(F) result(R) I_F ! first two invariants of F real(pReal) :: x,Phi + C = matmul(transpose(F),F) I_C = math_invariantsSym33(C) I_F = [math_trace33(F), 0.5*(math_trace33(F)**2 - math_trace33(matmul(F,F)))] @@ -1105,6 +1137,7 @@ pure function math_eigvalsh(m) integer :: ierr real(pReal), dimension(size(m,1)**2) :: work + m_= m ! copy matrix to input (will be destroyed) call dsyev('N','U',size(m,1),m_,size(m,1),math_eigvalsh,work,size(work,1),ierr) if (ierr /= 0) math_eigvalsh = IEEE_value(1.0_pReal,IEEE_quiet_NaN) @@ -1126,6 +1159,7 @@ pure function math_eigvalsh33(m) real(pReal) :: P, Q, rho, phi real(pReal), parameter :: TOL=1.e-14_pReal + I = math_invariantsSym33(m) ! invariants are coefficients in characteristic polynomial apart for the sign of c0 and c2 in http://arxiv.org/abs/physics/0610206 P = I(2)-I(1)**2/3.0_pReal ! different from http://arxiv.org/abs/physics/0610206 (this formulation was in DAMASK) @@ -1157,6 +1191,7 @@ pure function math_invariantsSym33(m) real(pReal), dimension(3,3), intent(in) :: m real(pReal), dimension(3) :: math_invariantsSym33 + math_invariantsSym33(1) = math_trace33(m) math_invariantsSym33(2) = m(1,1)*m(2,2) + m(1,1)*m(3,3) + m(2,2)*m(3,3) & -(m(1,2)**2 + m(1,3)**2 + m(2,3)**2) From 7d18ed307d9bae62132b2c5662862f11bdb698fe Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 09:30:26 +0200 Subject: [PATCH 32/88] hickup in documentation --- src/lattice.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lattice.f90 b/src/lattice.f90 index 79e3c1615..afff2a309 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -1966,8 +1966,8 @@ end function buildCoordinateSystem !-------------------------------------------------------------------------------------------------- !> @brief Helper function to define transformation systems ! Needed to calculate Schmid matrix and rotated stiffness matrices. -! @details: use c/a for cF -> cI transformation -! use a_cX for cF -> hP transformation +! @details: use c/a for cF -> hP transformation +! use a_cX for cF -> cI transformation !-------------------------------------------------------------------------------------------------- subroutine buildTransformationSystem(Q,S,Ntrans,cOverA,a_cF,a_cI) From 3854547ce80c58272a85c729e8c94472642e60cd Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 8 May 2022 12:40:58 +0200 Subject: [PATCH 33/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-291-g7d18ed307 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ff467c7e1..346a2ab96 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-288-g2792153ca +3.0.0-alpha6-291-g7d18ed307 From 72c29f744c3071001df8dd44815bb817574dc5b0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 12:12:42 +0200 Subject: [PATCH 34/88] better tests --- src/polynomials.f90 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 1a023eba1..2426ba48d 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -141,7 +141,7 @@ subroutine selfTest() type(tPolynomial) :: p1, p2 real(pReal), dimension(5) :: coef integer :: i - real(pReal) :: x_ref, x + real(pReal) :: x_ref, x, y class(tNode), pointer :: dict character(len=pStringLen), dimension(size(coef)) :: coef_s character(len=pStringLen) :: x_ref_s, x_s, YAML_s @@ -155,6 +155,9 @@ subroutine selfTest() x_ref = x_ref*10_pReal -0.5_pReal x = x*10_pReal -0.5_pReal + p1 = polynomial([coef(1)],x_ref) + if (dNeq(p1%at(x),coef(1))) error stop 'polynomial: eval(constant)' + p1 = polynomial(coef,x_ref) if (dNeq(p1%at(x_ref),coef(1))) error stop 'polynomial: @ref' @@ -172,6 +175,8 @@ subroutine selfTest() Dict => YAML_parse_str(trim(YAML_s)) p2 = polynomial(dict%asDict(),'C','T') if (dNeq(p1%at(x),p2%at(x),1.0e-10_pReal)) error stop 'polynomials: init' + y = coef(1)+coef(2)*(x-x_ref)+coef(3)*(x-x_ref)**2+coef(4)*(x-x_ref)**3+coef(5)*(x-x_ref)**4 + if (dNeq(p1%at(x),y,1.0e-7_pReal)) error stop 'polynomials: eval(full)' YAML_s = 'C: 0.0'//IO_EOL//& 'C,T: '//trim(adjustl(coef_s(2)))//IO_EOL//& @@ -189,15 +194,15 @@ subroutine selfTest() if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval(quadratic)' if (dNeq(p1%der1_at(x_ref+x),-p1%der1_at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval_der(quadratic)' - YAML_s = 'Y: 0.0'//IO_EOL//& - 'Y,X^3: '//trim(adjustl(coef_s(1)))//IO_EOL//& + YAML_s = 'Y: '//trim(adjustl(coef_s(1)))//IO_EOL//& + 'Y,X^3: '//trim(adjustl(coef_s(2)))//IO_EOL//& 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'Y','X') - if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-8_pReal)) error stop 'polynomials: eval(cubic)' + if (dNeq(p1%at(x_ref+x)-coef(1),-(p1%at(x_ref-x)-coef(1)),1.0e-8_pReal)) error stop 'polynomials: eval(cubic)' - YAML_s = 'Y: 0.0'//IO_EOL//& - 'Y,X^4: '//trim(adjustl(coef_s(1)))//IO_EOL//& + YAML_s = 'Y: '//trim(adjustl(coef_s(1)))//IO_EOL//& + 'Y,X^4: '//trim(adjustl(coef_s(2)))//IO_EOL//& 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'Y','X') From 240426402c95b1f9c5d13efd73e3e718d96afc87 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 13:32:14 +0200 Subject: [PATCH 35/88] using (faster) Horner evaluation https://rosettacode.org/wiki/Horner%27s_rule_for_polynomial_evaluation --- src/polynomials.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 2426ba48d..d26aa300f 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -105,9 +105,9 @@ pure function eval(self,x) result(y) integer :: i - y = self%coef(0) - do i = 1, ubound(self%coef,1) - y = y + self%coef(i) * (x-self%x_ref)**i + y = 0.0_pReal + do i = ubound(self%coef,1), 0 , -1 + y = y*(x-self%x_ref) + self%coef(i) enddo end function eval From 8f9fbb30e5a0062160cbccd3f9d83d58bac9ed43 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 15:02:57 +0200 Subject: [PATCH 36/88] use fused multiply-add where possible only possible for Intel compiler --- src/math.f90 | 28 +++++++++++++++++-------- src/phase_mechanical.f90 | 45 +++++++++++++++++++++++++++++++--------- src/polynomials.f90 | 8 +++++-- 3 files changed, 60 insertions(+), 21 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index 94ad2c48d..135d2b6fd 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -82,7 +82,7 @@ contains !-------------------------------------------------------------------------------------------------- !> @brief initialization of random seed generator and internal checks !-------------------------------------------------------------------------------------------------- -subroutine math_init +subroutine math_init() real(pReal), dimension(4) :: randTest integer :: randSize @@ -1045,24 +1045,34 @@ pure subroutine math_eigh33(w,v,m) w = math_eigvalsh33(m) - v(1:3,2) = [ m(1, 2) * m(2, 3) - m(1, 3) * m(2, 2), & - m(1, 3) * m(1, 2) - m(2, 3) * m(1, 1), & - m(1, 2)**2] + v(1:3,2) = [ m(1,2) * m(2,3) - m(1,3) * m(2,2), & + m(1,3) * m(1,2) - m(2,3) * m(1,1), & + m(1,2)**2] T = maxval(abs(w)) U = max(T, T**2) threshold = sqrt(5.68e-14_pReal * U**2) - v(1:3,1) = [ v(1,2) + m(1, 3) * w(1), & - v(2,2) + m(2, 3) * w(1), & +#ifndef __INTEL_COMPILER + v(1:3,1) = [m(1,3)*w(1) + v(1,2), & + m(2,3)*w(1) + v(2,2), & +#else + v(1:3,1) = [IEEE_FMA(m(1,3),w(1),v(1,2)), & + IEEE_FMA(m(2,3),w(1),v(2,2)), & +#endif (m(1,1) - w(1)) * (m(2,2) - w(1)) - v(3,2)] norm = norm2(v(1:3, 1)) fallback1: if (norm < threshold) then call math_eigh(w,v,error,m) else fallback1 v(1:3,1) = v(1:3, 1) / norm - v(1:3,2) = [ v(1,2) + m(1, 3) * w(2), & - v(2,2) + m(2, 3) * w(2), & +#ifndef __INTEL_COMPILER + v(1:3,2) = [m(1,3)*w(2) + v(1,2), & + m(2,3)*w(2) + v(2,2), & +#else + v(1:3,2) = [IEEE_FMA(m(1,3),w(2),v(1,2)), & + IEEE_FMA(m(2,3),w(2),v(2,2)), & +#endif (m(1,1) - w(2)) * (m(2,2) - w(2)) - v(3,2)] norm = norm2(v(1:3, 2)) fallback2: if (norm < threshold) then @@ -1300,7 +1310,7 @@ end function math_clip !-------------------------------------------------------------------------------------------------- !> @brief Check correctness of some math functions. !-------------------------------------------------------------------------------------------------- -subroutine selfTest +subroutine selfTest() integer, dimension(2,4) :: & sort_in_ = reshape([+1,+5, +5,+6, -1,-1, +3,-2],[2,4]) diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index b13675e38..66b9ff090 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -680,8 +680,11 @@ function integrateStateEuler(F_0,F,subFp0,subFi0,subState0,Delta_t,ph,en) result if (any(IEEE_is_NaN(dotState))) return sizeDotState = plasticState(ph)%sizeDotState - plasticState(ph)%state(1:sizeDotState,en) = subState0 & - + dotState * Delta_t +#ifndef __INTEL_COMPILER + plasticState(ph)%state(1:sizeDotState,en) = subState0 + dotState*Delta_t +#else + plasticState(ph)%state(1:sizeDotState,en) = IEEE_FMA(dotState,Delta_t,subState0) +#endif broken = plastic_deltaState(ph,en) if(broken) return @@ -720,8 +723,11 @@ function integrateStateAdaptiveEuler(F_0,F,subFp0,subFi0,subState0,Delta_t,ph,en sizeDotState = plasticState(ph)%sizeDotState r = - dotState * 0.5_pReal * Delta_t - plasticState(ph)%state(1:sizeDotState,en) = subState0 & - + dotState * Delta_t +#ifndef __INTEL_COMPILER + plasticState(ph)%state(1:sizeDotState,en) = subState0 + dotState*Delta_t +#else + plasticState(ph)%state(1:sizeDotState,en) = IEEE_FMA(dotState,Delta_t,subState0) +#endif broken = plastic_deltaState(ph,en) if(broken) return @@ -842,12 +848,18 @@ function integrateStateRK(F_0,F,subFp0,subFi0,subState0,Delta_t,ph,en,A,B,C,DB) dotState = A(1,stage) * plastic_RKdotState(1:sizeDotState,1) do n = 2, stage - dotState = dotState & - + A(n,stage) * plastic_RKdotState(1:sizeDotState,n) +#ifndef __INTEL_COMPILER + dotState = dotState + A(n,stage)*plastic_RKdotState(1:sizeDotState,n) +#else + dotState = IEEE_FMA(A(n,stage),plastic_RKdotState(1:sizeDotState,n),dotState) +#endif enddo - plasticState(ph)%state(1:sizeDotState,en) = subState0 & - + dotState * Delta_t +#ifndef __INTEL_COMPILER + plasticState(ph)%state(1:sizeDotState,en) = subState0 + dotState*Delta_t +#else + plasticState(ph)%state(1:sizeDotState,en) = IEEE_FMA(dotState,Delta_t,subState0) +#endif broken = integrateStress(F_0+(F-F_0)*Delta_t*C(stage),subFp0,subFi0,Delta_t*C(stage), ph,en) if(broken) exit @@ -861,8 +873,11 @@ function integrateStateRK(F_0,F,subFp0,subFi0,subState0,Delta_t,ph,en,A,B,C,DB) plastic_RKdotState(1:sizeDotState,size(B)) = dotState dotState = matmul(plastic_RKdotState,B) - plasticState(ph)%state(1:sizeDotState,en) = subState0 & - + dotState * Delta_t +#ifndef __INTEL_COMPILER + plasticState(ph)%state(1:sizeDotState,en) = subState0 + dotState*Delta_t +#else + plasticState(ph)%state(1:sizeDotState,en) = IEEE_FMA(dotState,Delta_t,subState0) +#endif if(present(DB)) & broken = .not. converged(matmul(plastic_RKdotState(1:sizeDotState,1:size(DB)),DB) * Delta_t, & @@ -1146,12 +1161,18 @@ module function phase_mechanical_dPdF(Delta_t,co,ce) result(dPdF) else lhs_3333 = 0.0_pReal; rhs_3333 = 0.0_pReal do o=1,3; do p=1,3 +#ifndef __INTEL_COMPILER lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) & + matmul(invSubFi0,dLidFi(1:3,1:3,o,p)) * Delta_t lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) & + invFi*invFi(p,o) rhs_3333(1:3,1:3,o,p) = rhs_3333(1:3,1:3,o,p) & - matmul(invSubFi0,dLidS(1:3,1:3,o,p)) * Delta_t +#else + lhs_3333(1:3,1:3,o,p) = IEEE_FMA(matmul(invSubFi0,dLidFi(1:3,1:3,o,p)),Delta_t,lhs_3333(1:3,1:3,o,p)) + lhs_3333(1:3,o,1:3,p) = IEEE_FMA(invFi,invFi(p,o),lhs_3333(1:3,o,1:3,p)) + rhs_3333(1:3,1:3,o,p) = IEEE_FMA(matmul(invSubFi0,dLidS(1:3,1:3,o,p)),-Delta_t,rhs_3333(1:3,1:3,o,p)) +#endif enddo; enddo call math_invert(temp_99,error,math_3333to99(lhs_3333)) if (error) then @@ -1180,8 +1201,12 @@ module function phase_mechanical_dPdF(Delta_t,co,ce) result(dPdF) temp_3333(1:3,1:3,p,o) = matmul(matmul(temp_33_2,dLpdS(1:3,1:3,p,o)), invFi) & + matmul(temp_33_3,dLidS(1:3,1:3,p,o)) enddo; enddo +#ifndef __INTEL_COMPILER lhs_3333 = math_mul3333xx3333(dSdFe,temp_3333) * Delta_t & + math_mul3333xx3333(dSdFi,dFidS) +#else + lhs_3333 = IEEE_FMA(math_mul3333xx3333(dSdFe,temp_3333),Delta_t,math_mul3333xx3333(dSdFi,dFidS)) +#endif call math_invert(temp_99,error,math_eye(9)+math_3333to99(lhs_3333)) if (error) then diff --git a/src/polynomials.f90 b/src/polynomials.f90 index d26aa300f..9b7386ec7 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -106,8 +106,12 @@ pure function eval(self,x) result(y) y = 0.0_pReal - do i = ubound(self%coef,1), 0 , -1 - y = y*(x-self%x_ref) + self%coef(i) + do i = ubound(self%coef,1), 0, -1 +#ifndef __INTEL_COMPILER + y = y*(x-self%x_ref) +self%coef(i) +#else + y = IEEE_FMA(y,x-self%x_ref,self%coef(i)) +#endif enddo end function eval From b2052cb3c7549ef4d558718c072b50727465ab86 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 16:41:19 +0200 Subject: [PATCH 37/88] less strict tolerances values can be in the order of 1e5, so 1e-6 precision is not too bad --- src/polynomials.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 9b7386ec7..ae7d1709c 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -178,9 +178,9 @@ subroutine selfTest() 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p2 = polynomial(dict%asDict(),'C','T') - if (dNeq(p1%at(x),p2%at(x),1.0e-10_pReal)) error stop 'polynomials: init' + if (dNeq(p1%at(x),p2%at(x),1.0e-6_pReal)) error stop 'polynomials: init' y = coef(1)+coef(2)*(x-x_ref)+coef(3)*(x-x_ref)**2+coef(4)*(x-x_ref)**3+coef(5)*(x-x_ref)**4 - if (dNeq(p1%at(x),y,1.0e-7_pReal)) error stop 'polynomials: eval(full)' + if (dNeq(p1%at(x),y,1.0e-6_pReal)) error stop 'polynomials: eval(full)' YAML_s = 'C: 0.0'//IO_EOL//& 'C,T: '//trim(adjustl(coef_s(2)))//IO_EOL//& @@ -203,7 +203,7 @@ subroutine selfTest() 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'Y','X') - if (dNeq(p1%at(x_ref+x)-coef(1),-(p1%at(x_ref-x)-coef(1)),1.0e-8_pReal)) error stop 'polynomials: eval(cubic)' + if (dNeq(p1%at(x_ref+x)-coef(1),-(p1%at(x_ref-x)-coef(1)),1.0e-8_pReal)) error stop 'polynomials: eval(cubic)' YAML_s = 'Y: '//trim(adjustl(coef_s(1)))//IO_EOL//& 'Y,X^4: '//trim(adjustl(coef_s(2)))//IO_EOL//& From d713026f7e31e060131c6c50733f9bcd0b7442c6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 16:49:30 +0200 Subject: [PATCH 38/88] fast evaluation for (most common) case of constant --- src/polynomials.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index ae7d1709c..ffd70b61c 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -105,8 +105,8 @@ pure function eval(self,x) result(y) integer :: i - y = 0.0_pReal - do i = ubound(self%coef,1), 0, -1 + y = self%coef(ubound(self%coef,1)) + do i = ubound(self%coef,1)-1, 0, -1 #ifndef __INTEL_COMPILER y = y*(x-self%x_ref) +self%coef(i) #else From 10d8a63cb656aed2a529abd2db63019f235941e2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 17:18:15 +0200 Subject: [PATCH 39/88] not used and current code is not good (not using Horner scheme) --- src/polynomials.f90 | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index ffd70b61c..61f20e796 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -16,7 +16,6 @@ module polynomials real(pReal) :: x_ref = huge(0.0_pReal) contains procedure, public :: at => eval - procedure, public :: der1_at => eval_der1 end type tPolynomial interface polynomial @@ -117,26 +116,6 @@ pure function eval(self,x) result(y) end function eval -!-------------------------------------------------------------------------------------------------- -!> @brief Evaluate a first derivative of Polynomial. -!-------------------------------------------------------------------------------------------------- -pure function eval_der1(self,x) result(y) - - class(tPolynomial), intent(in) :: self - real(pReal), intent(in) :: x - real(pReal) :: y - - integer :: i - - - y = 0.0_pReal - do i = 1, ubound(self%coef,1) - y = y + real(i,pReal)*self%coef(i) * (x-self%x_ref)**(i-1) - enddo - -end function eval_der1 - - !-------------------------------------------------------------------------------------------------- !> @brief Check correctness of polynomical functionality. !-------------------------------------------------------------------------------------------------- @@ -188,7 +167,6 @@ subroutine selfTest() Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'C','T') if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(linear)' - if (dNeq(p1%der1_at(x),p1%der1_at(5.0_pReal*x),1.0e-10_pReal)) error stop 'polynomials: eval_der(linear)' YAML_s = 'C: 0.0'//IO_EOL//& 'C,T^2: '//trim(adjustl(coef_s(3)))//IO_EOL//& @@ -196,7 +174,6 @@ subroutine selfTest() Dict => YAML_parse_str(trim(YAML_s)) p1 = polynomial(dict%asDict(),'C','T') if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval(quadratic)' - if (dNeq(p1%der1_at(x_ref+x),-p1%der1_at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval_der(quadratic)' YAML_s = 'Y: '//trim(adjustl(coef_s(1)))//IO_EOL//& 'Y,X^3: '//trim(adjustl(coef_s(2)))//IO_EOL//& From b376b10b7a876b0cb9c7fd2de7d4093a45b21a77 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 17:47:20 +0200 Subject: [PATCH 40/88] classic Intel gives FPE --- src/math.f90 | 4 ++-- src/phase_mechanical.f90 | 14 +++++++------- src/polynomials.f90 | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index 135d2b6fd..25c90ccf4 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -1053,7 +1053,7 @@ pure subroutine math_eigh33(w,v,m) U = max(T, T**2) threshold = sqrt(5.68e-14_pReal * U**2) -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER v(1:3,1) = [m(1,3)*w(1) + v(1,2), & m(2,3)*w(1) + v(2,2), & #else @@ -1066,7 +1066,7 @@ pure subroutine math_eigh33(w,v,m) call math_eigh(w,v,error,m) else fallback1 v(1:3,1) = v(1:3, 1) / norm -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER v(1:3,2) = [m(1,3)*w(2) + v(1,2), & m(2,3)*w(2) + v(2,2), & #else diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index 66b9ff090..fc9e40e02 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -680,7 +680,7 @@ function integrateStateEuler(F_0,F,subFp0,subFi0,subState0,Delta_t,ph,en) result if (any(IEEE_is_NaN(dotState))) return sizeDotState = plasticState(ph)%sizeDotState -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER plasticState(ph)%state(1:sizeDotState,en) = subState0 + dotState*Delta_t #else plasticState(ph)%state(1:sizeDotState,en) = IEEE_FMA(dotState,Delta_t,subState0) @@ -723,7 +723,7 @@ function integrateStateAdaptiveEuler(F_0,F,subFp0,subFi0,subState0,Delta_t,ph,en sizeDotState = plasticState(ph)%sizeDotState r = - dotState * 0.5_pReal * Delta_t -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER plasticState(ph)%state(1:sizeDotState,en) = subState0 + dotState*Delta_t #else plasticState(ph)%state(1:sizeDotState,en) = IEEE_FMA(dotState,Delta_t,subState0) @@ -848,14 +848,14 @@ function integrateStateRK(F_0,F,subFp0,subFi0,subState0,Delta_t,ph,en,A,B,C,DB) dotState = A(1,stage) * plastic_RKdotState(1:sizeDotState,1) do n = 2, stage -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER dotState = dotState + A(n,stage)*plastic_RKdotState(1:sizeDotState,n) #else dotState = IEEE_FMA(A(n,stage),plastic_RKdotState(1:sizeDotState,n),dotState) #endif enddo -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER plasticState(ph)%state(1:sizeDotState,en) = subState0 + dotState*Delta_t #else plasticState(ph)%state(1:sizeDotState,en) = IEEE_FMA(dotState,Delta_t,subState0) @@ -873,7 +873,7 @@ function integrateStateRK(F_0,F,subFp0,subFi0,subState0,Delta_t,ph,en,A,B,C,DB) plastic_RKdotState(1:sizeDotState,size(B)) = dotState dotState = matmul(plastic_RKdotState,B) -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER plasticState(ph)%state(1:sizeDotState,en) = subState0 + dotState*Delta_t #else plasticState(ph)%state(1:sizeDotState,en) = IEEE_FMA(dotState,Delta_t,subState0) @@ -1161,7 +1161,7 @@ module function phase_mechanical_dPdF(Delta_t,co,ce) result(dPdF) else lhs_3333 = 0.0_pReal; rhs_3333 = 0.0_pReal do o=1,3; do p=1,3 -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) & + matmul(invSubFi0,dLidFi(1:3,1:3,o,p)) * Delta_t lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) & @@ -1201,7 +1201,7 @@ module function phase_mechanical_dPdF(Delta_t,co,ce) result(dPdF) temp_3333(1:3,1:3,p,o) = matmul(matmul(temp_33_2,dLpdS(1:3,1:3,p,o)), invFi) & + matmul(temp_33_3,dLidS(1:3,1:3,p,o)) enddo; enddo -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER lhs_3333 = math_mul3333xx3333(dSdFe,temp_3333) * Delta_t & + math_mul3333xx3333(dSdFi,dFidS) #else diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 61f20e796..46e338b19 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -106,7 +106,7 @@ pure function eval(self,x) result(y) y = self%coef(ubound(self%coef,1)) do i = ubound(self%coef,1)-1, 0, -1 -#ifndef __INTEL_COMPILER +#ifndef __INTEL_LLVM_COMPILER y = y*(x-self%x_ref) +self%coef(i) #else y = IEEE_FMA(y,x-self%x_ref,self%coef(i)) From 53796fce7a6ea194981bb9165b22df95b5724eb7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 19:57:25 +0200 Subject: [PATCH 41/88] trustworthy reference --- src/polynomials.f90 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 46e338b19..c883528ca 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -94,6 +94,7 @@ end function polynomial_from_dict !-------------------------------------------------------------------------------------------------- !> @brief Evaluate a Polynomial. +!> @details https://nvlpubs.nist.gov/nistpubs/jres/71b/jresv71bn1p11_a1b.pdf (eq. 1.2) !-------------------------------------------------------------------------------------------------- pure function eval(self,x) result(y) @@ -101,15 +102,15 @@ pure function eval(self,x) result(y) real(pReal), intent(in) :: x real(pReal) :: y - integer :: i + integer :: o y = self%coef(ubound(self%coef,1)) - do i = ubound(self%coef,1)-1, 0, -1 + do o = ubound(self%coef,1)-1, 0, -1 #ifndef __INTEL_LLVM_COMPILER - y = y*(x-self%x_ref) +self%coef(i) + y = y*(x-self%x_ref) +self%coef(o) #else - y = IEEE_FMA(y,x-self%x_ref,self%coef(i)) + y = IEEE_FMA(y,x-self%x_ref,self%coef(o)) #endif enddo From 268ff26232b527a38a420a34980be8297d64011c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 22:09:10 +0200 Subject: [PATCH 42/88] need powershell commands --- .github/workflows/Python.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/Python.yml b/.github/workflows/Python.yml index 9329fb6fc..15e04fb18 100644 --- a/.github/workflows/Python.yml +++ b/.github/workflows/Python.yml @@ -32,6 +32,13 @@ jobs: export VERSION=$(cat VERSION) echo ${VERSION%-*} > VERSION + - name: Strip git hash (Windows) + if: runner.os == 'Windows' + run: | + $VERSION = Get-Content VERSION -first 1 + $VERSION,$_ = $VERSION -Split '-g',2,"simplematch" + $VERSION | Out-File VERSION + - name: Install and run unit tests (Unix) if: runner.os != 'Windows' run: | From f27969caf9ab3013705921c8c89b6963f8f2ecaf Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 23:22:03 +0200 Subject: [PATCH 43/88] documenting and testing --- python/damask/_rotation.py | 17 ++++++++++++++--- python/tests/test_Orientation.py | 7 +++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index a0baf1a0b..b24c864b3 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -1126,8 +1126,8 @@ class Rotation: Notes ----- - The default crystal direction (θ=0,φ=0) direction is [0 0 1], - the default sample direction (θ=0,φ=0) is z. + The crystal direction for (θ=0,φ=0) is [0 0 1], + the sample direction for (θ=0,φ=0) is z. Polar coordinates follow the ISO 80000-2:2019 convention typically used in physics. @@ -1137,7 +1137,18 @@ class Rotation: Examples -------- - tbd + Create an ideal α-fiber texture (<1 1 0> ǀǀ RD=x) consisting of + 200 orientations: + + >>> import damask + >>> import numpy as np + >>> alpha = damask.Rotation.from_fiber_component([np.pi/4.,0.],[np.pi/2.,0.],shape=200) + + Create an ideal γ-fiber texture (<1 1 1> ǀǀ ND=z) consisting of + 100 orientations: + + >>> import damask + >>> gamma = damask.Rotation.from_fiber_component([54.7,45.0],[0.,0.],shape=100,degrees=True) """ rng = np.random.default_rng(rng_seed) diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index 729967539..17da524d8 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -158,6 +158,13 @@ class TestOrientation: sigma=0.0,shape=None,rng_seed=0,lattice='cI').quaternion == r.quaternion) + @pytest.mark.parametrize('crystal,sample,direction,color',[([np.pi/4,0],[np.pi/2,0],[1,0,0],[0,1,0]), + ([np.arccos(3**(-.5)),np.pi/4,0],[0,0],[0,0,1],[0,0,1])]) + def test_fiber_IPF(self,crystal,sample,direction,color): + fiber = Orientation.from_fiber_component(crystal=crystal,sample=sample,family='cubic',shape=200) + print(np.allclose(fiber.IPF_color(direction),color)) + + @pytest.mark.parametrize('kwargs',[ dict(lattice='aP',a=1.0,b=1.1,c=1.2,alpha=np.pi/4.5,beta=np.pi/3.5,gamma=np.pi/2.5), dict(lattice='mP',a=1.0,b=1.1,c=1.2, beta=np.pi/3.5), From 0cfba2e6d8b875e3a4f8cd6fd6d1ee4ae70b81bd Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 9 May 2022 02:34:49 +0200 Subject: [PATCH 44/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-293-g268ff2623 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 346a2ab96..b8d1ebfe6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-291-g7d18ed307 +3.0.0-alpha6-293-g268ff2623 From 0b83a8ca10ac5ce2be5c9c255e7804fbc6d309fe Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Mon, 9 May 2022 14:05:30 +0200 Subject: [PATCH 45/88] new Marc version --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7cccb6bd..faaf66564 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ variables: PETSC_INTELLLVM: "Libraries/PETSc/3.16.3/oneAPI-2022.0.1-IntelMPI-2021.5.0" PETSC_INTEL: "Libraries/PETSc/3.16.5/Intel-2022.0.1-IntelMPI-2021.5.0" # ++++++++++++ MSC Marc +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - MSC: "FEM/MSC/2021.3.1" + MSC: "FEM/MSC/2022.1" IntelMarc: "Compiler/Intel/19.1.2 Libraries/IMKL/2020" HDF5Marc: "HDF5/1.12.1/Intel-19.1.2" From 675e9c911d120e7907fb94ad4bf000011627e7c3 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 9 May 2022 20:16:57 +0200 Subject: [PATCH 46/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-312-g6e7372f30 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b8d1ebfe6..9b4527e73 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-293-g268ff2623 +3.0.0-alpha6-312-g6e7372f30 From 087302a2a4a7c26f0af2543fa9773e3d7bb79ae6 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Tue, 10 May 2022 09:00:55 +0200 Subject: [PATCH 47/88] chnage Marc default version to 2022.1 --- python/damask/solver/_marc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/solver/_marc.py b/python/damask/solver/_marc.py index 3d006d27b..8b7f7acba 100644 --- a/python/damask/solver/_marc.py +++ b/python/damask/solver/_marc.py @@ -3,7 +3,7 @@ import shlex import re from pathlib import Path -_marc_version = '2021.3.1' +_marc_version = '2022.1' _marc_root = '/opt/msc' _damask_root = str(Path(__file__).parents[3]) From bdad6238114d7cfe82fdadc5c5a65f2fbc7c0f96 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 10 May 2022 20:23:53 +0200 Subject: [PATCH 48/88] correct name for test --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 3561f74a5..24b15b74b 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 3561f74a5852c32e2c3da4dc48090b517cfa8e90 +Subproject commit 24b15b74b16e0a58e0ab5a645825111deb259f98 From c9f344758acd8b64f6ff36d169ca8f55b7d36798 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 10 May 2022 15:25:45 -0400 Subject: [PATCH 49/88] use symmetry-aware Miller brackets in Result.add_pole --- python/damask/_result.py | 18 +++++++++++------- python/tests/test_Result.py | 17 ++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/python/damask/_result.py b/python/damask/_result.py index b5f08a87d..2eb4e585a 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -1025,17 +1025,21 @@ class Result: @staticmethod def _add_pole(q,uvw,hkl,with_symmetry): c = q['meta']['c/a'] if 'c/a' in q['meta'] else 1 + brackets = ['[]','()','〈〉','{}'][(uvw is None)*1+with_symmetry*2] + label = 'p^' + '{}{} {} {}{}'.format(brackets[0], + *(uvw if uvw else hkl), + brackets[-1],) pole = Orientation(q['data'],lattice=q['meta']['lattice'],a=1,c=c).to_pole(uvw=uvw,hkl=hkl,with_symmetry=with_symmetry) return { 'data': pole, - 'label': 'p^[{} {} {}]'.format(*uvw) if uvw else 'p^({} {} {})'.format(*hkl), + 'label': label, 'meta' : { - 'unit': '1', - 'description': 'lab frame vector along lattice ' \ - + ('direction' if uvw else 'plane') \ - + ('s' if with_symmetry else ''), - 'creator': 'add_pole' + 'unit': '1', + 'description': 'lab frame vector along lattice ' \ + + ('direction' if uvw else 'plane') \ + + ('s' if with_symmetry else ''), + 'creator': 'add_pole' } } def add_pole(self,q='O',*,uvw=None,hkl=None,with_symmetry=False): @@ -1047,7 +1051,7 @@ class Result: q : str Name of the dataset containing the crystallographic orientation as quaternions. Defaults to 'O'. - uvw|hkl : numpy.ndarray of shape (...,3) + uvw|hkl : numpy.ndarray of shape (3) Miller indices of crystallographic direction or plane normal. with_symmetry : bool, optional Calculate all N symmetrically equivalent vectors. diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index 9cc8f5643..559ff514f 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -24,8 +24,7 @@ def default(tmp_path,ref_path): """Small Result file in temp location for modification.""" fname = '12grains6x7x8_tensionY.hdf5' shutil.copy(ref_path/fname,tmp_path) - f = Result(tmp_path/fname) - return f.view(times=20.0) + return Result(tmp_path/fname).view(times=20.0) @pytest.fixture def single_phase(tmp_path,ref_path): @@ -226,15 +225,19 @@ class TestResult: assert np.allclose(in_memory,in_file) @pytest.mark.parametrize('options',[{'uvw':[1,0,0],'with_symmetry':False}, - {'hkl':[0,1,1],'with_symmetry':True}]) + {'uvw':[1,1,0],'with_symmetry':True}, + {'hkl':[0,1,1],'with_symmetry':True}, + {'hkl':[1,1,1],'with_symmetry':False}, + ]) def test_add_pole(self,default,options): default.add_pole(**options) rot = default.place('O') in_memory = Orientation(rot,lattice=rot.dtype.metadata['lattice']).to_pole(**options) - brackets = ['[[]','[]]'] if 'uvw' in options.keys() else ['(',')'] # escape fnmatch - label = '{}{} {} {}{}'.format(brackets[0],*(list(options.values())[0]),brackets[1]) - in_file = default.place(f'p^{label}') - print(in_file - in_memory) + brackets = [['[[]','[]]'],'()','〈〉','{}'][('hkl' in options)*1+(options['with_symmetry'])*2] # escape fnmatch + label = 'p^{}{} {} {}{}'.format(brackets[0], + *(list(options.values())[0]), + brackets[-1]) + in_file = default.place(label) assert np.allclose(in_memory,in_file) def test_add_rotation(self,default): From 75272163cd4e915a9ccc3933347d47509aac9076 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 10 May 2022 15:45:19 -0400 Subject: [PATCH 50/88] slight polish of help messages --- python/damask/_rotation.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index f138fbb8a..4a143585e 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -721,7 +721,7 @@ class Rotation: Parameters ---------- q : numpy.ndarray, shape (...,4) - Unit quaternion (q_0, q_1, q_2, q_3) in positive real hemisphere, i.e. ǀqǀ = 1, q_0 ≥ 0. + Unit quaternion (q_0, q_1, q_2, q_3) in positive real hemisphere, i.e. ǀqǀ = 1 and q_0 ≥ 0. accept_homomorph : bool, optional Allow homomorphic variants, i.e. q_0 < 0 (negative real hemisphere). Defaults to False. @@ -777,11 +777,11 @@ class Rotation: @staticmethod def from_axis_angle(axis_angle: np.ndarray, - degrees:bool = False, + degrees: bool = False, normalize: bool = False, P: Literal[1, -1] = -1) -> 'Rotation': """ - Initialize from Axis angle pair. + Initialize from axis–angle pair. Parameters ---------- @@ -818,12 +818,12 @@ class Rotation: orthonormal: bool = True, reciprocal: bool = False) -> 'Rotation': """ - Initialize from lattice basis vectors. + Initialize from basis vector triplet. Parameters ---------- basis : numpy.ndarray, shape (...,3,3) - Three three-dimensional lattice basis vectors. + Three three-dimensional basis vectors. orthonormal : bool, optional Basis is strictly orthonormal, i.e. is free of stretch components. Defaults to True. reciprocal : bool, optional @@ -857,7 +857,7 @@ class Rotation: Parameters ---------- R : numpy.ndarray, shape (...,3,3) - Rotation matrix with det(R) = 1, R.T ∙ R = I. + Rotation matrix with det(R) = 1 and R.T ∙ R = I. """ return Rotation.from_basis(R) @@ -866,14 +866,14 @@ class Rotation: def from_parallel(a: np.ndarray, b: np.ndarray ) -> 'Rotation': """ - Initialize from pairs of two orthogonal lattice basis vectors. + Initialize from pairs of two orthogonal basis vectors. Parameters ---------- a : numpy.ndarray, shape (...,2,3) - Two three-dimensional lattice vectors of first orthogonal basis. + Two three-dimensional vectors of first orthogonal basis. b : numpy.ndarray, shape (...,2,3) - Corresponding three-dimensional lattice vectors of second basis. + Corresponding three-dimensional vectors of second basis. """ a_ = np.array(a) @@ -896,7 +896,7 @@ class Rotation: normalize: bool = False, P: Literal[1, -1] = -1) -> 'Rotation': """ - Initialize from Rodrigues–Frank vector (angle separated from axis). + Initialize from Rodrigues–Frank vector (with angle separated from axis). Parameters ---------- From 302f020f6346e0ba4aae0304180021a89b180204 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 11 May 2022 07:02:20 +0200 Subject: [PATCH 51/88] looks better at least on Linux --- python/damask/_result.py | 2 +- python/tests/test_Result.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/damask/_result.py b/python/damask/_result.py index 2eb4e585a..253881731 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -1025,7 +1025,7 @@ class Result: @staticmethod def _add_pole(q,uvw,hkl,with_symmetry): c = q['meta']['c/a'] if 'c/a' in q['meta'] else 1 - brackets = ['[]','()','〈〉','{}'][(uvw is None)*1+with_symmetry*2] + brackets = ['[]','()','⟨⟩','{}'][(uvw is None)*1+with_symmetry*2] label = 'p^' + '{}{} {} {}{}'.format(brackets[0], *(uvw if uvw else hkl), brackets[-1],) diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index 559ff514f..7e107494a 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -233,7 +233,7 @@ class TestResult: default.add_pole(**options) rot = default.place('O') in_memory = Orientation(rot,lattice=rot.dtype.metadata['lattice']).to_pole(**options) - brackets = [['[[]','[]]'],'()','〈〉','{}'][('hkl' in options)*1+(options['with_symmetry'])*2] # escape fnmatch + brackets = [['[[]','[]]'],'()','⟨⟩','{}'][('hkl' in options)*1+(options['with_symmetry'])*2] # escape fnmatch label = 'p^{}{} {} {}{}'.format(brackets[0], *(list(options.values())[0]), brackets[-1]) From b080e414ae73cbfadf198fb0e0fca829728bd7e4 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 11 May 2022 08:55:55 -0400 Subject: [PATCH 52/88] normalize to_pole output by default --- python/damask/_orientation.py | 11 +++++++++-- python/tests/test_Orientation.py | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index 534a9548d..0c995110c 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -786,7 +786,8 @@ class Orientation(Rotation,Crystal): def to_pole(self, *, uvw: FloatSequence = None, hkl: FloatSequence = None, - with_symmetry: bool = False) -> np.ndarray: + with_symmetry: bool = False, + normalize: bool = True) -> np.ndarray: """ Calculate lab frame vector along lattice direction [uvw] or plane normal (hkl). @@ -795,9 +796,13 @@ class Orientation(Rotation,Crystal): uvw|hkl : numpy.ndarray, shape (...,3) Miller indices of crystallographic direction or plane normal. Shape of vector blends with shape of own rotation array. - For example, a rotation array, shape (3,2) and a vector array of shape (2,4) result in (3,2,4) outputs. + For example, a rotation array of shape (3,2) and a vector array of shape (2,4) result in (3,2,4) outputs. with_symmetry : bool, optional Calculate all N symmetrically equivalent vectors. + Defaults to False. + normalize : bool, optional + Normalize output vector. + Defaults to True. Returns ------- @@ -807,6 +812,8 @@ class Orientation(Rotation,Crystal): """ v = self.to_frame(uvw=uvw,hkl=hkl) blend = util.shapeblender(self.shape,v.shape[:-1]) + if normalize: + v /= np.linalg.norm(v,axis=-1,keepdims=len(v.shape)>1) if with_symmetry: sym_ops = self.symmetry_operations shape = v.shape[:-1]+sym_ops.shape diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index 729967539..6eedd3b77 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -173,8 +173,8 @@ class TestOrientation: o = Orientation.from_directions(uvw=a,hkl=c,**kwargs) x = o.to_pole(uvw=a) z = o.to_pole(hkl=c) - assert np.isclose(np.dot(x/np.linalg.norm(x),np.array([1,0,0])),1) \ - and np.isclose(np.dot(z/np.linalg.norm(z),np.array([0,0,1])),1) + assert np.isclose(np.dot(x,np.array([1,0,0])),1) \ + and np.isclose(np.dot(z,np.array([0,0,1])),1) @pytest.mark.parametrize('function',[Orientation.from_random, Orientation.from_quaternion, From 35aa8a9bc61148ca77cbc25efcbdd869e6cbaf7a Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 11 May 2022 09:19:48 -0400 Subject: [PATCH 53/88] combine table.add and .set --- python/damask/_table.py | 57 +++++++++++--------------------- python/tests/test_Grid.py | 2 +- python/tests/test_Orientation.py | 2 +- python/tests/test_Table.py | 4 +-- 4 files changed, 24 insertions(+), 41 deletions(-) diff --git a/python/damask/_table.py b/python/damask/_table.py index 841842fc0..f440b7302 100644 --- a/python/damask/_table.py +++ b/python/damask/_table.py @@ -363,14 +363,14 @@ class Table: data: np.ndarray, info: str = None) -> 'Table': """ - Set column data. + Add new or replace existing column data. Parameters ---------- label : str Column label. data : numpy.ndarray - Replacement data. + Column data. info : str, optional Human-readable information about the modified data. @@ -382,49 +382,32 @@ class Table: """ dup = self.copy() dup._add_comment(label, data.shape[1:], info) + if m := re.match(r'(.*)\[((\d+,)*(\d+))\]',label): key = m.group(1) - idx = np.ravel_multi_index(tuple(map(int,m.group(2).split(","))), - self.shapes[key]) - iloc = dup.data.columns.get_loc(key).tolist().index(True) + idx - dup.data.iloc[:,iloc] = data else: - dup.data[label] = data.reshape(dup.data[label].shape) - return dup + key = label + if key in dup.shapes: - def add(self, - label: str, - data: np.ndarray, - info: str = None) -> 'Table': - """ - Add column data. + if m: + idx = np.ravel_multi_index(tuple(map(int,m.group(2).split(","))), + self.shapes[key]) + iloc = dup.data.columns.get_loc(key).tolist().index(True) + idx + dup.data.iloc[:,iloc] = data + else: + dup.data[label] = data.reshape(dup.data[label].shape) - Parameters - ---------- - label : str - Column label. - data : numpy.ndarray - New data. - info : str, optional - Human-readable information about the new data. + else: - Returns - ------- - updated : damask.Table - Updated table. + dup.shapes[label] = data.shape[1:] if len(data.shape) > 1 else (1,) + size = np.prod(data.shape[1:],dtype=int) + new = pd.DataFrame(data=data.reshape(-1,size), + columns=[label]*size, + ) + new.index = dup.data.index + dup.data = pd.concat([dup.data,new],axis=1) - """ - dup = self.copy() - dup._add_comment(label,data.shape[1:],info) - - dup.shapes[label] = data.shape[1:] if len(data.shape) > 1 else (1,) - size = np.prod(data.shape[1:],dtype=int) - new = pd.DataFrame(data=data.reshape(-1,size), - columns=[label]*size, - ) - new.index = dup.data.index - dup.data = pd.concat([dup.data,new],axis=1) return dup diff --git a/python/tests/test_Grid.py b/python/tests/test_Grid.py index 9fb2f310c..05344d28d 100644 --- a/python/tests/test_Grid.py +++ b/python/tests/test_Grid.py @@ -441,7 +441,7 @@ class TestGrid: z = np.ones(cells.prod()) z[cells[:2].prod()*int(cells[2]/2):] = 0 t = Table({'coords':3,'z':1},np.column_stack((coords,z))) - t = t.add('indicator',t.get('coords')[:,0]) + t = t.set('indicator',t.get('coords')[:,0]) g = Grid.from_table(t,'coords',['indicator','z']) assert g.N_materials == g.cells[0]*2 and (g.material[:,:,-1]-g.material[:,:,0] == cells[0]).all() diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index 729967539..61c4948be 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -169,7 +169,7 @@ class TestOrientation: def test_from_directions(self,kwargs): for a,b in np.random.random((10,2,3)): c = np.cross(b,a) - if np.all(np.isclose(c,0)): continue + if np.allclose(c,0): continue o = Orientation.from_directions(uvw=a,hkl=c,**kwargs) x = o.to_pole(uvw=a) z = o.to_pole(hkl=c) diff --git a/python/tests/test_Table.py b/python/tests/test_Table.py index 812f2848f..e530abe58 100644 --- a/python/tests/test_Table.py +++ b/python/tests/test_Table.py @@ -51,7 +51,7 @@ class TestTable: def test_add(self,default): d = np.random.random((5,9)) - assert np.allclose(d,default.add('nine',d,'random data').get('nine')) + assert np.allclose(d,default.set('nine',d,'random data').get('nine')) def test_isclose(self,default): assert default.isclose(default).all() @@ -200,6 +200,6 @@ class TestTable: t = Table({'v':(2,)}, np.array([[0,1,],[2,1,]]), ['test data'])\ - .add('s',np.array(['b','a']))\ + .set('s',np.array(['b','a']))\ .sort_by('s') assert np.all(t.get('v')[:,0] == np.array([2,0])) From becf0eed000887ac22674373c6ea3440dd01be42 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Wed, 11 May 2022 17:51:37 +0200 Subject: [PATCH 54/88] use updated test and reference --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 3561f74a5..ede67b648 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 3561f74a5852c32e2c3da4dc48090b517cfa8e90 +Subproject commit ede67b6488f0a0a116fe5aa8b36980d11e0f29e7 From 6f07145b75c2b1aeb945b539d931e0db2dd7e716 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 11 May 2022 20:31:51 +0200 Subject: [PATCH 55/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-322-g53c345f4f --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9b4527e73..7606cee2c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-312-g6e7372f30 +3.0.0-alpha6-322-g53c345f4f From 648d17d3811295219d3dc9f3d4a00dbbff1e1f3e Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 11 May 2022 18:19:10 -0400 Subject: [PATCH 56/88] renamed .add to .set to be consistent with Table.set --- python/damask/_vtk.py | 25 +++++++++------- python/tests/reference/VTK/polyData.vtp | 11 +++++++ python/tests/test_VTK.py | 40 ++++++++++++------------- 3 files changed, 46 insertions(+), 30 deletions(-) diff --git a/python/damask/_vtk.py b/python/damask/_vtk.py index 4f2658cd7..880b00ede 100644 --- a/python/damask/_vtk.py +++ b/python/damask/_vtk.py @@ -401,13 +401,13 @@ class VTK: # Check https://blog.kitware.com/ghost-and-blanking-visibility-changes/ for missing data - def add(self, + def set(self, label: str = None, data: Union[np.ndarray, np.ma.MaskedArray] = None, *, table: 'Table' = None): """ - Add data to either cells or points. + Add (or replace existing) point or cell data. Data can either be a numpy.array, which requires a corresponding label, or a damask.Table. @@ -417,11 +417,15 @@ class VTK: label : str, optional Label of data array. data : numpy.ndarray or numpy.ma.MaskedArray, optional - Data to add. First dimension needs to match either + Data to add or replace. First array dimension needs to match either number of cells or number of points. table: damask.Table, optional - Data to add. Number of rows needs to match either - number of cells or number of points. + Data to add or replace. Each table label is individually considered. + Number of rows needs to match either number of cells or number of points. + + Notes + ----- + If the number of cells equals the number of points, the data is added to both. """ @@ -429,7 +433,10 @@ class VTK: label: str, data: np.ndarray): - N_data = data.shape[0] + N_p,N_c = vtk_data.GetNumberOfPoints(),vtk_data.GetNumberOfCells() + if (N_data := data.shape[0]) not in [N_p,N_c]: + raise ValueError(f'data count mismatch ({N_data} ≠ {N_p} & {N_c})') + data_ = data.reshape(N_data,-1) \ .astype(np.single if data.dtype in [np.double,np.longdouble] else data.dtype) @@ -442,12 +449,10 @@ class VTK: d.SetName(label) - if N_data == vtk_data.GetNumberOfPoints(): + if N_data == N_p: vtk_data.GetPointData().AddArray(d) - elif N_data == vtk_data.GetNumberOfCells(): + if N_data == N_c: vtk_data.GetCellData().AddArray(d) - else: - raise ValueError(f'data count mismatch ({N_data} ≠ {self.N_points} & {self.N_cells})') if data is None and table is None: raise KeyError('no data given') diff --git a/python/tests/reference/VTK/polyData.vtp b/python/tests/reference/VTK/polyData.vtp index dc4b5f149..5f4606535 100644 --- a/python/tests/reference/VTK/polyData.vtp +++ b/python/tests/reference/VTK/polyData.vtp @@ -16,6 +16,17 @@ + + AQAAAACAAAB4AAAAVgAAAA==eF5jYICBhv2WfY9tLfuS7Ypk3PeDaCDf7okF3/7Vq1bZrV6lZQ+k94HEgHL2QHovUM7+iUUfiG0LlQdhkH77Ipnj9iB5qFp7kBjQDiBmcADRANsaLXM= + + + 0.74535601471 + + + 2.4494897428 + + + diff --git a/python/tests/test_VTK.py b/python/tests/test_VTK.py index b0a7ef4c5..58855c831 100644 --- a/python/tests/test_VTK.py +++ b/python/tests/test_VTK.py @@ -147,24 +147,24 @@ class TestVTK: with pytest.raises(KeyError): default.get('does_not_exist') - def test_invalid_add_shape(self,default): + def test_invalid_set_shape(self,default): with pytest.raises(ValueError): - default.add('valid',np.ones(3)) + default.set('valid',np.ones(3)) - def test_invalid_add_missing_label(self,default): + def test_invalid_set_missing_label(self,default): data = np.random.randint(9,size=np.prod(np.array(default.vtk_data.GetDimensions())-1)) with pytest.raises(ValueError): - default.add(data=data) + default.set(data=data) - def test_invalid_add_type(self,default): + def test_invalid_set_type(self,default): with pytest.raises(TypeError): - default.add(label='valid',data='invalid_type') + default.set(label='valid',data='invalid_type') with pytest.raises(TypeError): - default.add(label='valid',table='invalid_type') + default.set(label='valid',table='invalid_type') - def test_invalid_add_dual(self,default): + def test_invalid_set_dual(self,default): with pytest.raises(KeyError): - default.add(label='valid',data=0,table=0) + default.set(label='valid',data=0,table=0) @pytest.mark.parametrize('data_type,shape',[(float,(3,)), (float,(3,3)), @@ -172,31 +172,31 @@ class TestVTK: (int,(4,)), (str,(1,))]) @pytest.mark.parametrize('N_values',[5*6*7,6*7*8]) - def test_add_get(self,default,data_type,shape,N_values): + def test_set_get(self,default,data_type,shape,N_values): data = np.squeeze(np.random.randint(0,100,(N_values,)+shape)).astype(data_type) - new = default.add('data',data) + new = default.set('data',data) assert (np.squeeze(data.reshape(N_values,-1)) == new.get('data')).all() @pytest.mark.parametrize('shapes',[{'scalar':(1,),'vector':(3,),'tensor':(3,3)}, {'vector':(6,),'tensor':(3,3)}, {'tensor':(3,3),'scalar':(1,)}]) - def test_add_table(self,default,shapes): + def test_set_table(self,default,shapes): N = np.random.choice([default.N_points,default.N_cells]) d = dict() for k,s in shapes.items(): d[k] = dict(shape = s, data = np.random.random(N*np.prod(s)).reshape((N,-1))) - new = default.add(table=Table(shapes,np.column_stack([d[k]['data'] for k in shapes.keys()]))) + new = default.set(table=Table(shapes,np.column_stack([d[k]['data'] for k in shapes.keys()]))) for k,s in shapes.items(): assert np.allclose(np.squeeze(d[k]['data']),new.get(k),rtol=1e-7) - def test_add_masked(self,default): + def test_set_masked(self,default): data = np.random.rand(5*6*7,3) masked = ma.MaskedArray(data,mask=data<.4,fill_value=42.) - mask_auto = default.add('D',masked) - mask_manual = default.add('D',np.where(masked.mask,masked.fill_value,masked)) + mask_auto = default.set('D',masked) + mask_manual = default.set('D',np.where(masked.mask,masked.fill_value,masked)) assert mask_manual == mask_auto @@ -210,7 +210,7 @@ class TestVTK: data = np.squeeze(np.random.randint(0,100,(N_values,)+shape)).astype(data_type) ALPHABET = np.array(list(string.ascii_lowercase + ' ')) label = ''.join(np.random.choice(ALPHABET, size=10)) - new = default.add(label,data) + new = default.set(label,data) if N_values == default.N_points: assert label in new.labels['Point Data'] if N_values == default.N_cells: assert label in new.labels['Cell Data'] @@ -225,7 +225,7 @@ class TestVTK: @pytest.mark.xfail(int(vtk.vtkVersion.GetVTKVersion().split('.')[0])<8, reason='missing METADATA') def test_compare_reference_polyData(self,update,ref_path,tmp_path): points=np.dstack((np.linspace(0.,1.,10),np.linspace(0.,2.,10),np.linspace(-1.,1.,10))).squeeze() - polyData = VTK.from_poly_data(points).add('coordinates',points) + polyData = VTK.from_poly_data(points).set('coordinates',points) if update: polyData.save(ref_path/'polyData') else: @@ -242,8 +242,8 @@ class TestVTK: c = coords[:-1,:-1,:-1,:].reshape(-1,3,order='F') n = coords[:,:,:,:].reshape(-1,3,order='F') rectilinearGrid = VTK.from_rectilinear_grid(grid) \ - .add('cell',np.ascontiguousarray(c)) \ - .add('node',np.ascontiguousarray(n)) + .set('cell',np.ascontiguousarray(c)) \ + .set('node',np.ascontiguousarray(n)) if update: rectilinearGrid.save(ref_path/'rectilinearGrid') else: From fce600f02b8abaa1638c8314c1081145c0b99402 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 12 May 2022 00:39:19 +0200 Subject: [PATCH 57/88] in tree build not supported anymore --- .github/workflows/Python.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Python.yml b/.github/workflows/Python.yml index 15e04fb18..2f2a5d111 100644 --- a/.github/workflows/Python.yml +++ b/.github/workflows/Python.yml @@ -42,13 +42,13 @@ jobs: - name: Install and run unit tests (Unix) if: runner.os != 'Windows' run: | - python -m pip install ./python --no-deps -vv --use-feature=in-tree-build + python -m pip install ./python --no-deps -vv COLUMNS=256 pytest python - name: Install and run unit tests (Windows) if: runner.os == 'Windows' run: | - python -m pip install ./python --no-deps -vv --use-feature=in-tree-build + python -m pip install ./python --no-deps -vv pytest python -k 'not XDMF' apt: From d18e36ecf085efe6e0fc7db447b7df63cdc5c58c Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 11 May 2022 18:54:03 -0400 Subject: [PATCH 58/88] fixed leftover .add --> .set --- python/damask/_grid.py | 6 +++--- python/damask/_result.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/damask/_grid.py b/python/damask/_grid.py index 471ba36bd..f7acfe5aa 100644 --- a/python/damask/_grid.py +++ b/python/damask/_grid.py @@ -694,9 +694,9 @@ class Grid: """ v = VTK.from_image_data(self.cells,self.size,self.origin)\ - .add('material',self.material.flatten(order='F')) + .set('material',self.material.flatten(order='F')) for label,data in self.initial_conditions.items(): - v = v.add(label,data.flatten(order='F')) + v = v.set(label,data.flatten(order='F')) v.comments = self.comments v.save(fname,parallel=False,compress=compress) @@ -745,7 +745,7 @@ class Grid: """ VTK.from_image_data(self.cells,self.size,self.origin) \ - .add('material',self.material.flatten('F'),) \ + .set('material',self.material.flatten('F'),) \ .show('material',colormap) diff --git a/python/damask/_result.py b/python/damask/_result.py index 253881731..b86a5fb3d 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -1627,7 +1627,7 @@ class Result: for inc in util.show_progress(self.visible['increments']): u = _read(f['/'.join([inc,'geometry','u_n' if mode.lower() == 'cell' else 'u_p'])]) - v = v.add('u',u) + v = v.set('u',u) for ty in ['phase','homogenization']: for field in self.visible['fields']: @@ -1654,7 +1654,7 @@ class Result: outs[out][at_cell_ho[label]] = data[in_data_ho[label]] for label,dataset in outs.items(): - v = v.add(' / '.join(['/'.join([ty,field,label]),dataset.dtype.metadata['unit']]),dataset) + v = v.set(' / '.join(['/'.join([ty,field,label]),dataset.dtype.metadata['unit']]),dataset) v.save(f'{self.fname.stem}_inc{inc[10:].zfill(N_digits)}',parallel=parallel) From fd71a900e75d7977d93ba509293d85fc03ed2476 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 12 May 2022 03:27:49 +0200 Subject: [PATCH 59/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-325-g236a009e2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7606cee2c..5a0b819ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-322-g53c345f4f +3.0.0-alpha6-325-g236a009e2 From 0b6ead1a484fb472e36d8ddf351f39d0e5d977f0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 12 May 2022 15:36:12 +0200 Subject: [PATCH 60/88] avoid console-spam during initialization --- src/signals.f90 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/signals.f90 b/src/signals.f90 index bf53912f4..a3eac8025 100644 --- a/src/signals.f90 +++ b/src/signals.f90 @@ -10,9 +10,9 @@ module signals private logical, volatile, public, protected :: & - signals_SIGTERM, & !< termination signal - signals_SIGUSR1, & !< 1. user-defined signal - signals_SIGUSR2 !< 2. user-defined signal + signals_SIGTERM = .false., & !< termination signal + signals_SIGUSR1 = .false., & !< 1. user-defined signal + signals_SIGUSR2 = .false. !< 2. user-defined signal public :: & signals_init, & @@ -31,9 +31,6 @@ subroutine signals_init() call signalterm_c(c_funloc(catchSIGTERM)) call signalusr1_c(c_funloc(catchSIGUSR1)) call signalusr2_c(c_funloc(catchSIGUSR2)) - call signals_setSIGTERM(.false.) - call signals_setSIGUSR1(.false.) - call signals_setSIGUSR2(.false.) end subroutine signals_init From 961e6acf6e3d746d71a646fde746dd2b2dc251cd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 12 May 2022 16:56:12 +0200 Subject: [PATCH 61/88] not needed anymore --- install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch | 1 + install/MarcMentat/2022.1/Marc_tools/include_linux64.patch | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch b/install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch index f0276bb62..5d78b22f8 100644 --- a/install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch +++ b/install/MarcMentat/2021.3.1/Marc_tools/include_linux64.patch @@ -21,6 +21,7 @@ I8DEFINES="-DI64" I8CDEFINES="-U_DOUBLE -D_SINGLE" fi + @@ -556,7 +561,7 @@ then PROFILE=" $PROFILE -pg" fi diff --git a/install/MarcMentat/2022.1/Marc_tools/include_linux64.patch b/install/MarcMentat/2022.1/Marc_tools/include_linux64.patch index d16e21403..8cf6d2113 100644 --- a/install/MarcMentat/2022.1/Marc_tools/include_linux64.patch +++ b/install/MarcMentat/2022.1/Marc_tools/include_linux64.patch @@ -7,7 +7,7 @@ +# DAMASK uses the HDF5 compiler wrapper around the Intel compiler +H5FC="$(h5fc -shlib -show)" +HDF5_LIB=${H5FC//ifort/} -+FCOMP="$H5FC -DDAMASK_HDF5" ++FCOMP="$H5FC" + # AEM if test "$MARCDLLOUTDIR" = ""; then @@ -17,9 +17,8 @@ I8CDEFINES= else - I8FFLAGS="-i8" -- I8DEFINES="-DI64" + I8FFLAGS="-i8 -integer-size 64" -+ I8DEFINES="-DI64 -DINT=8" + I8DEFINES="-DI64" I8CDEFINES="-U_DOUBLE -D_SINGLE" fi From 1135a42b2a1aca6581203c870773e1547305b861 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 12 May 2022 18:25:40 +0200 Subject: [PATCH 62/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-328-g14a7d3fc4 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5a0b819ae..84a698485 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-325-g236a009e2 +3.0.0-alpha6-328-g14a7d3fc4 From 5627c28ea142f61bf1981ebe211fea6d0ef9b057 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 13 May 2022 00:35:47 +0200 Subject: [PATCH 63/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-339-g6f7e8491b --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 84a698485..20916718f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-328-g14a7d3fc4 +3.0.0-alpha6-339-g6f7e8491b From 12cd19554f6599147b756aaceadfdf6cffa8a551 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 13 May 2022 06:02:22 +0200 Subject: [PATCH 64/88] consistent interface and description --- python/damask/_table.py | 4 ++-- python/damask/_vtk.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/python/damask/_table.py b/python/damask/_table.py index f440b7302..2d2c30c00 100644 --- a/python/damask/_table.py +++ b/python/damask/_table.py @@ -370,9 +370,9 @@ class Table: label : str Column label. data : numpy.ndarray - Column data. + Column data. First dimension needs to match number of rows. info : str, optional - Human-readable information about the modified data. + Human-readable information about the data. Returns ------- diff --git a/python/damask/_vtk.py b/python/damask/_vtk.py index 880b00ede..aa0be4dea 100644 --- a/python/damask/_vtk.py +++ b/python/damask/_vtk.py @@ -404,10 +404,11 @@ class VTK: def set(self, label: str = None, data: Union[np.ndarray, np.ma.MaskedArray] = None, + info: str = None, *, table: 'Table' = None): """ - Add (or replace existing) point or cell data. + Add new or replace existing point or cell data. Data can either be a numpy.array, which requires a corresponding label, or a damask.Table. @@ -419,6 +420,8 @@ class VTK: data : numpy.ndarray or numpy.ma.MaskedArray, optional Data to add or replace. First array dimension needs to match either number of cells or number of points. + info : str, optional + Human-readable information about the data. table: damask.Table, optional Data to add or replace. Each table label is individually considered. Number of rows needs to match either number of cells or number of points. @@ -465,14 +468,17 @@ class VTK: _add_array(dup.vtk_data, label, np.where(data.mask,data.fill_value,data) if isinstance(data,np.ma.MaskedArray) else data) + if info is not None: dup.comments = f'{label}: {info}' else: raise ValueError('no label defined for data') elif isinstance(table,Table): for l in table.labels: _add_array(dup.vtk_data,l,table.get(l)) + if info is not None: dup.comments = f'{l}: {info}' else: raise TypeError + return dup From 05d3a929442d96c2f68bc831d4940c70c9af548a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 13 May 2022 08:43:24 +0200 Subject: [PATCH 65/88] using the module is the recommended approach --- src/Marc/DAMASK_Marc.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Marc/DAMASK_Marc.f90 b/src/Marc/DAMASK_Marc.f90 index 4a42120ee..8cff89cc9 100644 --- a/src/Marc/DAMASK_Marc.f90 +++ b/src/Marc/DAMASK_Marc.f90 @@ -208,9 +208,9 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & use discretization_Marc use homogenization use materialpoint_Marc + use OMP_LIB implicit none - include "omp_lib.h" ! the openMP function library integer, intent(in) :: & ! according to MSC.Marc 2012 Manual D ngens, & !< size of stress-strain law nn, & !< integration point number From d48fa460b1c2ff308e6c81086baa7c8f104d9ce0 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 13 May 2022 08:49:30 +0200 Subject: [PATCH 66/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-343-gc8d48d6eb --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 20916718f..2ff635946 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-339-g6f7e8491b +3.0.0-alpha6-343-gc8d48d6eb From 90c3b3170d4300ebd521bb4b623fc647f5d6e577 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 13 May 2022 09:53:44 +0200 Subject: [PATCH 67/88] propagate 'normalize' option --- python/damask/_orientation.py | 6 ++++-- python/damask/_result.py | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index 0c995110c..dcc139b7c 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -796,7 +796,8 @@ class Orientation(Rotation,Crystal): uvw|hkl : numpy.ndarray, shape (...,3) Miller indices of crystallographic direction or plane normal. Shape of vector blends with shape of own rotation array. - For example, a rotation array of shape (3,2) and a vector array of shape (2,4) result in (3,2,4) outputs. + For example, a rotation array of shape (3,2) and a vector + array of shape (2,4) result in (3,2,4) outputs. with_symmetry : bool, optional Calculate all N symmetrically equivalent vectors. Defaults to False. @@ -807,7 +808,8 @@ class Orientation(Rotation,Crystal): Returns ------- vector : numpy.ndarray, shape (...,3) or (...,N,3) - Lab frame vector (or vectors if with_symmetry) along [uvw] direction or (hkl) plane normal. + Lab frame vector (or vectors if with_symmetry) along + [uvw] direction or (hkl) plane normal. """ v = self.to_frame(uvw=uvw,hkl=hkl) diff --git a/python/damask/_result.py b/python/damask/_result.py index 253881731..7a58a1621 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -1023,26 +1023,26 @@ class Result: @staticmethod - def _add_pole(q,uvw,hkl,with_symmetry): + def _add_pole(q,uvw,hkl,with_symmetry,normalize): c = q['meta']['c/a'] if 'c/a' in q['meta'] else 1 brackets = ['[]','()','⟨⟩','{}'][(uvw is None)*1+with_symmetry*2] label = 'p^' + '{}{} {} {}{}'.format(brackets[0], *(uvw if uvw else hkl), brackets[-1],) - pole = Orientation(q['data'],lattice=q['meta']['lattice'],a=1,c=c).to_pole(uvw=uvw,hkl=hkl,with_symmetry=with_symmetry) + ori = Orientation(q['data'],lattice=q['meta']['lattice'],a=1,c=c) return { - 'data': pole, + 'data': ori.to_pole(uvw=uvw,hkl=hkl,with_symmetry=with_symmetry,normalize=normalize), 'label': label, 'meta' : { 'unit': '1', - 'description': 'lab frame vector along lattice ' \ - + ('direction' if uvw else 'plane') \ + 'description': f'{"normalized " if normalize else ""}lab frame vector along lattice ' \ + + ('direction' if uvw is not None else 'plane') \ + ('s' if with_symmetry else ''), 'creator': 'add_pole' } } - def add_pole(self,q='O',*,uvw=None,hkl=None,with_symmetry=False): + def add_pole(self,q='O',*,uvw=None,hkl=None,with_symmetry=False,normalize=True): """ Add lab frame vector along lattice direction [uvw] or plane normal (hkl). @@ -1055,9 +1055,15 @@ class Result: Miller indices of crystallographic direction or plane normal. with_symmetry : bool, optional Calculate all N symmetrically equivalent vectors. + Defaults to True. + normalize : bool, optional + Normalize output vector. + Defaults to True. """ - self._add_generic_pointwise(self._add_pole,{'q':q},{'uvw':uvw,'hkl':hkl,'with_symmetry':with_symmetry}) + self._add_generic_pointwise(self._add_pole, + {'q':q}, + {'uvw':uvw,'hkl':hkl,'with_symmetry':with_symmetry,'normalize':normalize}) @staticmethod From 6b17787be1a0a35c65d1125248266f2a4fa6b078 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 13 May 2022 09:59:09 +0200 Subject: [PATCH 68/88] only relevant for Marc --- src/Marc/DAMASK_Marc.f90 | 2 +- src/{ => Marc}/element.f90 | 149 ------------------------------------- 2 files changed, 1 insertion(+), 150 deletions(-) rename src/{ => Marc}/element.f90 (88%) diff --git a/src/Marc/DAMASK_Marc.f90 b/src/Marc/DAMASK_Marc.f90 index 4a42120ee..c04fc0ee7 100644 --- a/src/Marc/DAMASK_Marc.f90 +++ b/src/Marc/DAMASK_Marc.f90 @@ -152,7 +152,7 @@ end module DAMASK_interface #include "../rotations.f90" #include "../polynomials.f90" #include "../lattice.f90" -#include "../element.f90" +#include "element.f90" #include "../geometry_plastic_nonlocal.f90" #include "../discretization.f90" #include "discretization_Marc.f90" diff --git a/src/element.f90 b/src/Marc/element.f90 similarity index 88% rename from src/element.f90 rename to src/Marc/element.f90 index c8e3b0416..295a41547 100644 --- a/src/element.f90 +++ b/src/Marc/element.f90 @@ -152,22 +152,14 @@ module element reshape([& -2,-3,-1 & ! Note: This fix is for gfortran 9 only. gfortran 8 supports neither, gfortran > 9 both variants -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR1)) -#else ],[NIPNEIGHBOR(CELLTYPE(1)),NIP(1)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(2)),NIP(2)), parameter :: IPNEIGHBOR2 = & reshape([& 2,-3, 3,-1, & -2, 1, 3,-1, & 2,-3,-2, 1 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR2)) -#else ],[NIPNEIGHBOR(CELLTYPE(2)),NIP(2)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(3)),NIP(3)), parameter :: IPNEIGHBOR3 = & reshape([& @@ -175,11 +167,7 @@ module element -2, 1, 4,-1, & 4,-4,-3, 1, & -2, 3,-3, 2 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR3)) -#else ],[NIPNEIGHBOR(CELLTYPE(3)),NIP(3)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(4)),NIP(4)), parameter :: IPNEIGHBOR4 = & reshape([& @@ -192,20 +180,12 @@ module element 8,-4,-3, 4, & 9, 7,-3, 5, & -2, 8,-3, 6 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR4)) -#else ],[NIPNEIGHBOR(CELLTYPE(4)),NIP(4)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(5)),NIP(5)), parameter :: IPNEIGHBOR5 = & reshape([& -1,-2,-3,-4 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR5)) -#else ],[NIPNEIGHBOR(CELLTYPE(5)),NIP(5)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(6)),NIP(6)), parameter :: IPNEIGHBOR6 = & reshape([& @@ -213,11 +193,7 @@ module element -2, 1, 3,-2, 4,-1, & 2,-4,-3, 1, 4,-1, & 2,-4, 3,-2,-3, 1 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR6)) -#else ],[NIPNEIGHBOR(CELLTYPE(6)),NIP(6)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(7)),NIP(7)), parameter :: IPNEIGHBOR7 = & reshape([& @@ -227,20 +203,12 @@ module element 5,-4, 6,-2,-5, 1, & -3, 4, 6,-2,-5, 2, & 5,-4,-3, 4,-5, 3 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR7)) -#else ],[NIPNEIGHBOR(CELLTYPE(7)),NIP(7)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(8)),NIP(8)), parameter :: IPNEIGHBOR8 = & reshape([& -3,-5,-4,-2,-6,-1 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR8)) -#else ],[NIPNEIGHBOR(CELLTYPE(8)),NIP(8)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(9)),NIP(9)), parameter :: IPNEIGHBOR9 = & reshape([& @@ -252,11 +220,7 @@ module element -3, 5, 8,-2,-6, 2, & 8,-5,-4, 5,-6, 3, & -3, 7,-4, 6,-6, 4 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR9)) -#else ],[NIPNEIGHBOR(CELLTYPE(9)),NIP(9)]) -#endif integer, dimension(NIPNEIGHBOR(CELLTYPE(10)),NIP(10)), parameter :: IPNEIGHBOR10 = & reshape([& @@ -287,11 +251,7 @@ module element 26,-5,-4,22,-6,16, & 27,25,-4,23,-6,17, & -3,26,-4,24,-6,18 & -#if !defined(__GFORTRAN__) - ],shape(IPNEIGHBOR10)) -#else ],[NIPNEIGHBOR(CELLTYPE(10)),NIP(10)]) -#endif integer, dimension(NNODE(1),NCELLNODE(GEOMTYPE(1))), parameter :: CELLNODEPARENTNODEWEIGHTS1 = & @@ -299,11 +259,7 @@ module element 1, 0, 0, & 0, 1, 0, & 0, 0, 1 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS1)) !< 2D 3node 1ip -#else ],[NNODE(1),NCELLNODE(GEOMTYPE(1))]) -#endif integer, dimension(NNODE(2),NCELLNODE(GEOMTYPE(2))), parameter :: CELLNODEPARENTNODEWEIGHTS2 = & reshape([& @@ -314,11 +270,7 @@ module element 0, 0, 0, 0, 1, 0, & 0, 0, 0, 0, 0, 1, & 1, 1, 1, 2, 2, 2 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS2)) !< 2D 6node 3ip -#else ],[NNODE(2),NCELLNODE(GEOMTYPE(2))]) -#endif integer, dimension(NNODE(3),NCELLNODE(GEOMTYPE(3))), parameter :: CELLNODEPARENTNODEWEIGHTS3 = & reshape([& @@ -331,11 +283,7 @@ module element 0, 0, 1, 1, & 1, 0, 0, 1, & 1, 1, 1, 1 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS3)) !< 2D 6node 3ip -#else ],[NNODE(3),NCELLNODE(GEOMTYPE(3))]) -#endif integer, dimension(NNODE(4),NCELLNODE(GEOMTYPE(4))), parameter :: CELLNODEPARENTNODEWEIGHTS4 = & reshape([& @@ -355,11 +303,7 @@ module element 1, 4, 1, 1, 8, 8, 2, 2, & 1, 1, 4, 1, 2, 8, 8, 2, & 1, 1, 1, 4, 2, 2, 8, 8 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS4)) !< 2D 8node 9ip -#else ],[NNODE(4),NCELLNODE(GEOMTYPE(4))]) -#endif integer, dimension(NNODE(5),NCELLNODE(GEOMTYPE(5))), parameter :: CELLNODEPARENTNODEWEIGHTS5 = & reshape([& @@ -372,11 +316,7 @@ module element 0, 0, 0, 0, 0, 0, 1, 0, & 0, 0, 0, 0, 0, 0, 0, 1, & 1, 1, 1, 1, 2, 2, 2, 2 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS5)) !< 2D 8node 4ip -#else ],[NNODE(5),NCELLNODE(GEOMTYPE(5))]) -#endif integer, dimension(NNODE(6),NcellNode(GEOMTYPE(6))), parameter :: CELLNODEPARENTNODEWEIGHTS6 = & reshape([& @@ -384,11 +324,7 @@ module element 0, 1, 0, 0, & 0, 0, 1, 0, & 0, 0, 0, 1 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS6)) !< 3D 4node 1ip -#else ],[NNODE(6),NcellNode(GEOMTYPE(6))]) -#endif integer, dimension(NNODE(7),NCELLNODE(GEOMTYPE(7))), parameter :: CELLNODEPARENTNODEWEIGHTS7 = & reshape([& @@ -407,11 +343,7 @@ module element 0, 1, 1, 1, 0, & 1, 0, 1, 1, 0, & 0, 0, 0, 0, 1 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS7)) !< 3D 5node 4ip -#else ],[NNODE(7),NCELLNODE(GEOMTYPE(7))]) -#endif integer, dimension(NNODE(8),NCELLNODE(GEOMTYPE(8))), parameter :: CELLNODEPARENTNODEWEIGHTS8 = & reshape([& @@ -430,11 +362,7 @@ module element 0, 1, 1, 1, 0, 2, 0, 0, 2, 2, & 1, 0, 1, 1, 0, 0, 2, 2, 0, 2, & 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS8)) !< 3D 10node 4ip -#else ],[NNODE(8),NCELLNODE(GEOMTYPE(8))]) -#endif integer, dimension(NNODE(9),NCELLNODE(GEOMTYPE(9))), parameter :: CELLNODEPARENTNODEWEIGHTS9 = & reshape([& @@ -459,11 +387,7 @@ module element 1, 0, 1, 1, 0, 1, & 0, 0, 0, 1, 1, 1, & 1, 1, 1, 1, 1, 1 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS9)) !< 3D 6node 6ip -#else ],[NNODE(9),NCELLNODE(GEOMTYPE(9))]) -#endif integer, dimension(NNODE(10),NCELLNODE(GEOMTYPE(10))), parameter :: CELLNODEPARENTNODEWEIGHTS10 = & reshape([& @@ -475,11 +399,7 @@ module element 0, 0, 0, 0, 0, 1, 0, 0, & 0, 0, 0, 0, 0, 0, 1, 0, & 0, 0, 0, 0, 0, 0, 0, 1 & -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS10)) !< 3D 8node 1ip -#else ],[NNODE(10),NCELLNODE(GEOMTYPE(10))]) -#endif integer, dimension(NNODE(11),NCELLNODE(GEOMTYPE(11))), parameter :: CELLNODEPARENTNODEWEIGHTS11 = & reshape([& @@ -510,11 +430,7 @@ module element 1, 0, 0, 1, 1, 0, 0, 1, & ! 25 0, 0, 0, 0, 1, 1, 1, 1, & ! 1, 1, 1, 1, 1, 1, 1, 1 & ! -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS11)) !< 3D 8node 8ip -#else ],[NNODE(11),NCELLNODE(GEOMTYPE(11))]) -#endif integer, dimension(NNODE(12),NCELLNODE(GEOMTYPE(12))), parameter :: CELLNODEPARENTNODEWEIGHTS12 = & reshape([& @@ -545,11 +461,7 @@ module element 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 2, & ! 25 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, & ! 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 & ! -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS12)) !< 3D 20node 8ip -#else ],[NNODE(12),NCELLNODE(GEOMTYPE(12))]) -#endif integer, dimension(NNODE(13),NCELLNODE(GEOMTYPE(13))), parameter :: CELLNODEPARENTNODEWEIGHTS13 = & reshape([& @@ -617,32 +529,20 @@ module element 4, 8, 4, 3, 8,24, 8, 4, 12,12, 4, 4, 32,32,12,12, 12,32,12, 4, & ! 3, 4, 8, 4, 4, 8,24, 8, 4,12,12, 4, 12,32,32,12, 4,12,32,12, & ! 4, 3, 4, 8, 8, 4, 8,24, 4, 4,12,12, 12,12,32,32, 12, 4,12,32 & ! -#if !defined(__GFORTRAN__) - ],shape(CELLNODEPARENTNODEWEIGHTS13)) !< 3D 20node 27ip -#else ],[NNODE(13),NCELLNODE(GEOMTYPE(13))]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(1)),NIP(1)), parameter :: CELL1 = & reshape([& 1,2,3 & -#if !defined(__GFORTRAN__) - ],shape(CELL1)) -#else ],[NCELLNODEPERCELL(CELLTYPE(1)),NIP(1)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(2)),NIP(2)), parameter :: CELL2 = & reshape([& 1, 4, 7, 6, & 2, 5, 7, 4, & 3, 6, 7, 5 & -#if !defined(__GFORTRAN__) - ],shape(CELL2)) -#else ],[NCELLNODEPERCELL(CELLTYPE(2)),NIP(2)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(3)),NIP(3)), parameter :: CELL3 = & reshape([& @@ -650,11 +550,7 @@ module element 5, 2, 6, 9, & 8, 9, 7, 4, & 9, 6, 3, 7 & -#if !defined(__GFORTRAN__) - ],shape(CELL3)) -#else ],[NCELLNODEPERCELL(CELLTYPE(3)),NIP(3)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(4)),NIP(4)), parameter :: CELL4 = & reshape([& @@ -667,20 +563,12 @@ module element 11,16,10, 4, & 16,15, 9,10, & 15, 8, 3, 9 & -#if !defined(__GFORTRAN__) - ],shape(CELL4)) -#else ],[NCELLNODEPERCELL(CELLTYPE(4)),NIP(4)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(5)),NIP(5)), parameter :: CELL5 = & reshape([& 1, 2, 3, 4 & -#if !defined(__GFORTRAN__) - ],shape(CELL5)) -#else ],[NCELLNODEPERCELL(CELLTYPE(5)),NIP(5)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(6)),NIP(6)), parameter :: CELL6 = & reshape([& @@ -688,11 +576,7 @@ module element 5, 2, 6,11,12, 9,13,15, & 7,11, 6, 3,14,15,13,10, & 8,12,15,14, 4, 9,13,10 & -#if !defined(__GFORTRAN__) - ],shape(CELL6)) -#else ],[NCELLNODEPERCELL(CELLTYPE(6)),NIP(6)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(7)),NIP(7)), parameter :: CELL7 = & reshape([& @@ -702,20 +586,12 @@ module element 10,17,21,19, 4,13,20,15, & 17,11,18,21,13, 5,14,20, & 19,21,18,12,15,20,14, 6 & -#if !defined(__GFORTRAN__) - ],shape(CELL7)) -#else ],[NCELLNODEPERCELL(CELLTYPE(7)),NIP(7)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(8)),NIP(8)), parameter :: CELL8 = & reshape([& 1, 2, 3, 4, 5, 6, 7, 8 & -#if !defined(__GFORTRAN__) - ],shape(CELL8)) -#else ],[NCELLNODEPERCELL(CELLTYPE(8)),NIP(8)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(9)),NIP(9)), parameter :: CELL9 = & reshape([& @@ -727,11 +603,7 @@ module element 22,18,23,27,13, 6,14,26, & 25,27,24,20,16,26,15, 8, & 27,23,19,24,26,14, 7,15 & -#if !defined(__GFORTRAN__) - ],shape(CELL9)) -#else ],[NCELLNODEPERCELL(CELLTYPE(9)),NIP(9)]) -#endif integer, dimension(NCELLNODEPERCELL(CELLTYPE(10)),NIP(10)), parameter :: CELL10 = & reshape([& @@ -762,11 +634,7 @@ module element 51,64,50,24,31,56,30, 8, & 64,63,49,50,56,55,29,30, & 63,48,23,49,55,28, 7,29 & -#if !defined(__GFORTRAN__) - ],shape(CELL10)) -#else ],[NCELLNODEPERCELL(CELLTYPE(10)),NIP(10)]) -#endif integer, dimension(NCELLNODEPERCELLFACE(1),NIPNEIGHBOR(1)), parameter :: CELLFACE1 = & @@ -774,11 +642,7 @@ module element 2,3, & 3,1, & 1,2 & -#if !defined(__GFORTRAN__) - ],shape(CELLFACE1)) !< 2D 3node, VTK_TRIANGLE (5) -#else ],[NCELLNODEPERCELLFACE(1),NIPNEIGHBOR(1)]) -#endif integer, dimension(NCELLNODEPERCELLFACE(2),NIPNEIGHBOR(2)), parameter :: CELLFACE2 = & reshape([& @@ -786,11 +650,7 @@ module element 4,1, & 3,4, & 1,2 & -#if !defined(__GFORTRAN__) - ],shape(CELLFACE2)) !< 2D 4node, VTK_QUAD (9) -#else ],[NCELLNODEPERCELLFACE(2),NIPNEIGHBOR(2)]) -#endif integer, dimension(NCELLNODEPERCELLFACE(3),NIPNEIGHBOR(3)), parameter :: CELLFACE3 = & reshape([& @@ -798,11 +658,7 @@ module element 1,2,4, & 2,3,4, & 1,4,3 & -#if !defined(__GFORTRAN__) - ],shape(CELLFACE3)) !< 3D 4node, VTK_TETRA (10) -#else ],[NCELLNODEPERCELLFACE(3),NIPNEIGHBOR(3)]) -#endif integer, dimension(NCELLNODEPERCELLFACE(4),NIPNEIGHBOR(4)), parameter :: CELLFACE4 = & reshape([& @@ -812,12 +668,7 @@ module element 1,2,6,5, & 5,6,7,8, & 1,4,3,2 & -#if !defined(__GFORTRAN__) - ],shape(CELLFACE4)) !< 3D 8node, VTK_HEXAHEDRON (12) -#else ],[NCELLNODEPERCELLFACE(4),NIPNEIGHBOR(4)]) -#endif - contains From 37eb567451fb81e4f8313da41a1bd8a9ba4323b8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 13 May 2022 11:10:02 +0200 Subject: [PATCH 69/88] dataset for Platinum --- examples/config/phase/Pt.yaml | 5 ++++ .../phase/mechanical/elastic/Hooke_Pt.yaml | 26 +++++++++++++++++++ .../plastic/phenopowerlaw_Pt-5%Cu.yaml | 16 ++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 examples/config/phase/Pt.yaml create mode 100644 examples/config/phase/mechanical/elastic/Hooke_Pt.yaml create mode 100644 examples/config/phase/mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml diff --git a/examples/config/phase/Pt.yaml b/examples/config/phase/Pt.yaml new file mode 100644 index 000000000..90d8ba2f2 --- /dev/null +++ b/examples/config/phase/Pt.yaml @@ -0,0 +1,5 @@ +references: + - https://en.wikipedia.org/wiki/Platinum + +lattice: cF +rho: 21450.0 diff --git a/examples/config/phase/mechanical/elastic/Hooke_Pt.yaml b/examples/config/phase/mechanical/elastic/Hooke_Pt.yaml new file mode 100644 index 000000000..88513b8ac --- /dev/null +++ b/examples/config/phase/mechanical/elastic/Hooke_Pt.yaml @@ -0,0 +1,26 @@ +type: Hooke + +references: + - S.M. Collard and R.B. McLellan, + Acta Metallurgica et Materialia 40:699-702, 1992, + https://doi.org/10.1016/0956-7151(92)90011-3 + +C_11: 373.42e+9 +C_11,T: -8.929e+7 +C_11,T^2: -1.298e+5 +C_11,T^3: 1.2807e+2 +C_11,T^4: -4.6114e-2 + +C_12: 241.74e+9 +C_12,T: 5.705e+7 +C_12,T^2: 0.4511e+5 +C_12,T^3: -0.4860e+2 +C_12,T^4: 1.446e-2 + +C_44: 77.65e+9 +C_44,T: -1.342e+7 +C_44,T^2: -0.1493e+5 +C_44,T^3: 0.1260e+2 +C_44,T^4: -0.6470e-2 + +T_ref: 0 diff --git a/examples/config/phase/mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml b/examples/config/phase/mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml new file mode 100644 index 000000000..41b933935 --- /dev/null +++ b/examples/config/phase/mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml @@ -0,0 +1,16 @@ +type: phenopowerlaw +references: +- K.M. Jackson and C. Lang, + Platinum Metals Review 50:15-19, 2006, + https://doi.org/10.1595/147106705X93359, + fitted from Fig. 5 (Pt-5% Cu recrystallised) + +N_sl: [12] + +n_sl: 1.6 +a_sl: 0.8 +h_0_sl-sl: 300.0e+6 +xi_0_sl: [150.0e+6] +xi_inf_sl: [500.0e+6] +h_sl-sl: [1, 1, 1.4, 1.4, 1.4, 1.4, 1.4] +dot_gamma_0_sl: 0.0001 From cda6e0af358f851088af122c747e2e269502733b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 13 May 2022 11:44:02 +0200 Subject: [PATCH 70/88] some difference to pure Ni --- .../phase/mechanical/elastic/Hooke_IN625.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/config/phase/mechanical/elastic/Hooke_IN625.yaml diff --git a/examples/config/phase/mechanical/elastic/Hooke_IN625.yaml b/examples/config/phase/mechanical/elastic/Hooke_IN625.yaml new file mode 100644 index 000000000..5230994c3 --- /dev/null +++ b/examples/config/phase/mechanical/elastic/Hooke_IN625.yaml @@ -0,0 +1,21 @@ +type: Hooke + +references: + - Wang et al., + Materials Science and Engineering:A 674:406-412, 2016, + https://doi.org/10.1016/j.msea.2016.08.010, + fitted to Tab. 2 (last 3 rows) + +C_11: 243.3e+9 +C_11,T: -6.380e+5 +C_11,T^2: -8.362e+4 + +C_12: 156.7e+9 +C_12,T: 2.091e+7 +C_12,T^2: -4.675e+4 + +C_44: 99.3e+9 +C_44,T: -3.800e+7 +C_44,T^2: 1.587e+4 + +T_ref: 293.15 From 3f85027b9ec1dc07eaaa3778b88c0b3ddc9e2829 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 12 May 2022 16:45:42 +0200 Subject: [PATCH 71/88] better use SIGINT for actions triggered by the user SIGTERM is send by MPI if one process fails, catching it results in deadlocks --- PRIVATE | 2 +- src/C_routines.c | 4 ++-- src/grid/DAMASK_grid.f90 | 2 +- src/signals.f90 | 24 ++++++++++++------------ src/system_routines.f90 | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/PRIVATE b/PRIVATE index 3561f74a5..df33ba9a1 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 3561f74a5852c32e2c3da4dc48090b517cfa8e90 +Subproject commit df33ba9a1360439c5c18a241a1e439dab0cdcafd diff --git a/src/C_routines.c b/src/C_routines.c index a25fde688..37364543d 100644 --- a/src/C_routines.c +++ b/src/C_routines.c @@ -58,8 +58,8 @@ void getusername_c(char username[], int *stat){ } -void signalterm_c(void (*handler)(int)){ - signal(SIGTERM, handler); +void signalint_c(void (*handler)(int)){ + signal(SIGINT, handler); } void signalusr1_c(void (*handler)(int)){ diff --git a/src/grid/DAMASK_grid.f90 b/src/grid/DAMASK_grid.f90 index 835e18b34..824d867c5 100644 --- a/src/grid/DAMASK_grid.f90 +++ b/src/grid/DAMASK_grid.f90 @@ -471,7 +471,7 @@ program DAMASK_grid call materialpoint_restartWrite endif if (signal) call signals_setSIGUSR2(.false.) - call MPI_Allreduce(signals_SIGTERM,signal,1_MPI_INTEGER_KIND,MPI_LOGICAL,MPI_LOR,MPI_COMM_WORLD,err_MPI) + call MPI_Allreduce(signals_SIGINT,signal,1_MPI_INTEGER_KIND,MPI_LOGICAL,MPI_LOR,MPI_COMM_WORLD,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' if (signal) exit loadCaseLooping endif skipping diff --git a/src/signals.f90 b/src/signals.f90 index a3eac8025..7db101f94 100644 --- a/src/signals.f90 +++ b/src/signals.f90 @@ -10,13 +10,13 @@ module signals private logical, volatile, public, protected :: & - signals_SIGTERM = .false., & !< termination signal + signals_SIGINT = .false., & !< interrupt signal signals_SIGUSR1 = .false., & !< 1. user-defined signal signals_SIGUSR2 = .false. !< 2. user-defined signal public :: & signals_init, & - signals_setSIGTERM, & + signals_setSIGINT, & signals_setSIGUSR1, & signals_setSIGUSR2 @@ -28,7 +28,7 @@ contains !-------------------------------------------------------------------------------------------------- subroutine signals_init() - call signalterm_c(c_funloc(catchSIGTERM)) + call signalint_c(c_funloc(catchSIGINT)) call signalusr1_c(c_funloc(catchSIGUSR1)) call signalusr2_c(c_funloc(catchSIGUSR2)) @@ -36,18 +36,18 @@ end subroutine signals_init !-------------------------------------------------------------------------------------------------- -!> @brief Set global variable signals_SIGTERM to .true. +!> @brief Set global variable signals_SIGINT to .true. !> @details This function can be registered to catch signals send to the executable. !-------------------------------------------------------------------------------------------------- -subroutine catchSIGTERM(signal) bind(C) +subroutine catchSIGINT(signal) bind(C) integer(C_INT), value :: signal print'(a,i0)', ' received signal ',signal - call signals_setSIGTERM(.true.) + call signals_setSIGINT(.true.) -end subroutine catchSIGTERM +end subroutine catchSIGINT !-------------------------------------------------------------------------------------------------- @@ -81,17 +81,17 @@ end subroutine catchSIGUSR2 !-------------------------------------------------------------------------------------------------- -!> @brief Set global variable signals_SIGTERM. +!> @brief Set global variable signals_SIGINT. !-------------------------------------------------------------------------------------------------- -subroutine signals_setSIGTERM(state) +subroutine signals_setSIGINT(state) logical, intent(in) :: state - signals_SIGTERM = state - print*, 'set SIGTERM to',state + signals_SIGINT = state + print*, 'set SIGINT to',state -end subroutine signals_setSIGTERM +end subroutine signals_setSIGINT !-------------------------------------------------------------------------------------------------- diff --git a/src/system_routines.f90 b/src/system_routines.f90 index e0adf9dc0..2af1e12a9 100644 --- a/src/system_routines.f90 +++ b/src/system_routines.f90 @@ -15,7 +15,7 @@ module system_routines getCWD, & getHostName, & getUserName, & - signalterm_C, & + signalint_C, & signalusr1_C, & signalusr2_C, & f_c_string, & @@ -55,11 +55,11 @@ module system_routines integer(C_INT), intent(out) :: stat end subroutine getUserName_C - subroutine signalterm_C(handler) bind(C) + subroutine signalint_C(handler) bind(C) use, intrinsic :: ISO_C_Binding, only: C_FUNPTR type(C_FUNPTR), intent(in), value :: handler - end subroutine signalterm_C + end subroutine signalint_C subroutine signalusr1_C(handler) bind(C) use, intrinsic :: ISO_C_Binding, only: C_FUNPTR From 1448719e6badb62222da78280e522656652fd7a7 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 13 May 2022 16:35:24 +0200 Subject: [PATCH 72/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-346-gd83f0acf7 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2ff635946..701a06286 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-343-gc8d48d6eb +3.0.0-alpha6-346-gd83f0acf7 From b9fd6329daa975cdb153e5fcaa8b02b5f03c2eab Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 14 May 2022 21:07:33 +0200 Subject: [PATCH 73/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-351-gc9d7cf405 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 701a06286..f1bc4ad9a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-346-gd83f0acf7 +3.0.0-alpha6-351-gc9d7cf405 From 10e849801662f72e525453362fb0aaa8bdbf2b71 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 16 May 2022 02:43:09 +0200 Subject: [PATCH 74/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-355-g6c7f2344d --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f1bc4ad9a..d918fb5b1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-351-gc9d7cf405 +3.0.0-alpha6-355-g6c7f2344d From b3992e0ff01c26236bab9a32071fb47e03fe29e1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 16 May 2022 23:16:23 +0200 Subject: [PATCH 75/88] test new example files --- PRIVATE | 2 +- .../mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/PRIVATE b/PRIVATE index ede67b648..1766c855e 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit ede67b6488f0a0a116fe5aa8b36980d11e0f29e7 +Subproject commit 1766c855e54668d6225c9b22db536be7052605bc diff --git a/examples/config/phase/mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml b/examples/config/phase/mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml index 41b933935..864237825 100644 --- a/examples/config/phase/mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml +++ b/examples/config/phase/mechanical/plastic/phenopowerlaw_Pt-5%Cu.yaml @@ -1,9 +1,13 @@ type: phenopowerlaw + references: -- K.M. Jackson and C. Lang, - Platinum Metals Review 50:15-19, 2006, - https://doi.org/10.1595/147106705X93359, - fitted from Fig. 5 (Pt-5% Cu recrystallised) + - K.M. Jackson and C. Lang, + Platinum Metals Review 50:15-19, 2006, + https://doi.org/10.1595/147106705X93359, + fitted from Fig. 5 (Pt-5% Cu recrystallised) + - U.F. Kocks, + Metallurgical and Materials Transactions B 1:1121–1143, 1970, + https://doi.org/10.1007/BF02900224 N_sl: [12] From 0f1d0cbd61d3650038d0a825625acbc5ae5a4c59 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 17 May 2022 08:53:32 +0200 Subject: [PATCH 76/88] copy and paste error --- examples/config/phase/mechanical/elastic/Hooke_IN625.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/config/phase/mechanical/elastic/Hooke_IN625.yaml b/examples/config/phase/mechanical/elastic/Hooke_IN625.yaml index 5230994c3..1411de6f4 100644 --- a/examples/config/phase/mechanical/elastic/Hooke_IN625.yaml +++ b/examples/config/phase/mechanical/elastic/Hooke_IN625.yaml @@ -14,7 +14,7 @@ C_12: 156.7e+9 C_12,T: 2.091e+7 C_12,T^2: -4.675e+4 -C_44: 99.3e+9 +C_44: 117.8e+9 C_44,T: -3.800e+7 C_44,T^2: 1.587e+4 From 6a870d72a5a5dd65f049ba97781a680c567fdc66 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 17 May 2022 13:59:25 +0200 Subject: [PATCH 77/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-362-g0ce280cc5 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d918fb5b1..5890b17a3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-355-g6c7f2344d +3.0.0-alpha6-362-g0ce280cc5 From 2a2324266ce9517354ef51db54700200d552eaf2 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 17 May 2022 19:35:47 +0200 Subject: [PATCH 78/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-367-g85fa92ee1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5890b17a3..73aee9b3f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-362-g0ce280cc5 +3.0.0-alpha6-367-g85fa92ee1 From 8442f0cdd3cdeb4ebeac1809a9db6941d9cf9dd6 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 17 May 2022 16:12:00 -0400 Subject: [PATCH 79/88] accumulate comments --- python/damask/_vtk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/damask/_vtk.py b/python/damask/_vtk.py index aa0be4dea..6baa16214 100644 --- a/python/damask/_vtk.py +++ b/python/damask/_vtk.py @@ -468,13 +468,13 @@ class VTK: _add_array(dup.vtk_data, label, np.where(data.mask,data.fill_value,data) if isinstance(data,np.ma.MaskedArray) else data) - if info is not None: dup.comments = f'{label}: {info}' + if info is not None: dup.comments += f'{label}: {info}' else: raise ValueError('no label defined for data') elif isinstance(table,Table): for l in table.labels: _add_array(dup.vtk_data,l,table.get(l)) - if info is not None: dup.comments = f'{l}: {info}' + if info is not None: dup.comments += f'{l}: {info}' else: raise TypeError From 0962d2ebdf292bdef271dc2573099fe2226741c4 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 18 May 2022 03:17:26 +0200 Subject: [PATCH 80/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-371-g18d862cdb --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 73aee9b3f..435d3544f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-367-g85fa92ee1 +3.0.0-alpha6-371-g18d862cdb From 556d9d840e7fbfeb73974249a5da2ac423a56200 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 17 May 2022 23:56:05 +0200 Subject: [PATCH 81/88] specifying V_e is more natural than F_i --- PRIVATE | 2 +- python/damask/_configmaterial.py | 6 +- python/tests/test_ConfigMaterial.py | 6 +- src/IO.f90 | 2 + src/material.f90 | 10 ++-- src/phase_mechanical.f90 | 89 +++++++++++++++-------------- src/rotations.f90 | 9 ++- 7 files changed, 64 insertions(+), 60 deletions(-) diff --git a/PRIVATE b/PRIVATE index 1766c855e..d2c229e6d 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 1766c855e54668d6225c9b22db536be7052605bc +Subproject commit d2c229e6dd81fb399b2c1b0658b750f7d309f175 diff --git a/python/damask/_configmaterial.py b/python/damask/_configmaterial.py index 725567b7f..7a06a2c69 100644 --- a/python/damask/_configmaterial.py +++ b/python/damask/_configmaterial.py @@ -482,7 +482,7 @@ class ConfigMaterial(Config): """ N,n,shaped = 1,1,{} - map_dim = {'O':-1,'F_i':-2} + map_dim = {'O':-1,'V_e':-2} for k,v in kwargs.items(): shaped[k] = np.array(v) s = shaped[k].shape[:map_dim.get(k,None)] @@ -494,12 +494,12 @@ class ConfigMaterial(Config): if 'v' not in kwargs: shaped['v'] = np.broadcast_to(1/n,(N,n)) - map_shape = {'O':(N,n,4),'F_i':(N,n,3,3)} + map_shape = {'O':(N,n,4),'V_e':(N,n,3,3)} for k,v in shaped.items(): target = map_shape.get(k,(N,n)) obj = np.broadcast_to(v.reshape(util.shapeshifter(v.shape, target, mode = 'right')), target) for i in range(N): - if k in ['phase','O','v','F_i']: + if k in ['phase','O','v','V_e']: for j in range(n): mat[i]['constituents'][j][k] = obj[i,j].item() if isinstance(obj[i,j],np.generic) else obj[i,j] else: diff --git a/python/tests/test_ConfigMaterial.py b/python/tests/test_ConfigMaterial.py index d3ea986c5..f003e254e 100644 --- a/python/tests/test_ConfigMaterial.py +++ b/python/tests/test_ConfigMaterial.py @@ -113,15 +113,15 @@ class TestConfigMaterial: @pytest.mark.parametrize('N,n,kw',[ (1,1,{'phase':'Gold', 'O':[1,0,0,0], - 'F_i':np.eye(3), + 'V_e':np.eye(3), 'homogenization':'SX'}), (3,1,{'phase':'Gold', 'O':Rotation.from_random(3), - 'F_i':np.broadcast_to(np.eye(3),(3,3,3)), + 'V_e':np.broadcast_to(np.eye(3),(3,3,3)), 'homogenization':'SX'}), (2,3,{'phase':np.broadcast_to(['a','b','c'],(2,3)), 'O':Rotation.from_random((2,3)), - 'F_i':np.broadcast_to(np.eye(3),(2,3,3,3)), + 'V_e':np.broadcast_to(np.eye(3),(2,3,3,3)), 'homogenization':['SX','PX']}), ]) def test_material_add(self,kw,N,n): diff --git a/src/IO.f90 b/src/IO.f90 index 240c9e992..047d11add 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -428,6 +428,8 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg) msg = 'too many systems requested' case (146) msg = 'number of values does not match' + case (147) + msg = 'V_e needs to be symmetric' case (148) msg = 'Nconstituents mismatch between homogenization and material' diff --git a/src/material.f90 b/src/material.f90 index 2258c40a1..ce4cabea9 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -27,7 +27,7 @@ module material type(tRotationContainer), dimension(:), allocatable, public, protected :: material_O_0 - type(tTensorContainer), dimension(:), allocatable, public, protected :: material_F_i_0 + type(tTensorContainer), dimension(:), allocatable, public, protected :: material_V_e_0 integer, dimension(:), allocatable, public, protected :: & homogenization_Nconstituents !< number of grains in each homogenization @@ -133,7 +133,7 @@ subroutine parse() allocate(material_v(homogenization_maxNconstituents,discretization_Ncells),source=0.0_pReal) allocate(material_O_0(materials%length)) - allocate(material_F_i_0(materials%length)) + allocate(material_V_e_0(materials%length)) allocate(ho_of(materials%length)) allocate(ph_of(materials%length,homogenization_maxNconstituents),source=-1) @@ -154,7 +154,7 @@ subroutine parse() if (constituents%length /= homogenization%get_asInt('N_constituents')) call IO_error(148) allocate(material_O_0(ma)%data(constituents%length)) - allocate(material_F_i_0(ma)%data(1:3,1:3,constituents%length)) + allocate(material_V_e_0(ma)%data(1:3,1:3,constituents%length)) do co = 1, constituents%length constituent => constituents%get(co) @@ -162,7 +162,9 @@ subroutine parse() ph_of(ma,co) = phases%getIndex(constituent%get_asString('phase')) call material_O_0(ma)%data(co)%fromQuaternion(constituent%get_as1dFloat('O',requiredSize=4)) - material_F_i_0(ma)%data(1:3,1:3,co) = constituent%get_as2dFloat('F_i',defaultVal=math_I3,requiredShape=[3,3]) + material_V_e_0(ma)%data(1:3,1:3,co) = constituent%get_as2dFloat('V_e',defaultVal=math_I3,requiredShape=[3,3]) + if (any(dNeq(material_V_e_0(ma)%data(1:3,1:3,co),transpose(material_V_e_0(ma)%data(1:3,1:3,co))))) & + call IO_error(147) end do if (dNeq(sum(v_of(ma,:)),1.0_pReal,1.e-9_pReal)) call IO_error(153,ext_msg='constituent') diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index fc9e40e02..bddd4775e 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -210,7 +210,6 @@ module subroutine mechanical_init(phases) Nmembers class(tNode), pointer :: & num_crystallite, & - phase, & mech @@ -239,11 +238,8 @@ module subroutine mechanical_init(phases) allocate(phase_mechanical_Fe(ph)%data(3,3,Nmembers)) allocate(phase_mechanical_Fi(ph)%data(3,3,Nmembers)) - allocate(phase_mechanical_Fi0(ph)%data(3,3,Nmembers)) allocate(phase_mechanical_Fp(ph)%data(3,3,Nmembers)) - allocate(phase_mechanical_Fp0(ph)%data(3,3,Nmembers)) allocate(phase_mechanical_F(ph)%data(3,3,Nmembers)) - allocate(phase_mechanical_F0(ph)%data(3,3,Nmembers)) allocate(phase_mechanical_Li(ph)%data(3,3,Nmembers),source=0.0_pReal) allocate(phase_mechanical_Li0(ph)%data(3,3,Nmembers),source=0.0_pReal) allocate(phase_mechanical_Lp(ph)%data(3,3,Nmembers),source=0.0_pReal) @@ -265,23 +261,21 @@ module subroutine mechanical_init(phases) ma = discretization_materialAt((ce-1)/discretization_nIPs+1) do co = 1,homogenization_Nconstituents(material_homogenizationID(ce)) ph = material_phaseID(co,ce) - phase_mechanical_Fi0(ph)%data(1:3,1:3,material_phaseEntry(co,ce)) = material_F_i_0(ma)%data(1:3,1:3,co) + en = material_phaseEntry(co,ce) + phase_mechanical_F(ph)%data(1:3,1:3,en) = math_I3 + phase_mechanical_Fp(ph)%data(1:3,1:3,en) = material_O_0(ma)%data(co)%asMatrix() ! Fp reflects initial orientation (see 10.1016/j.actamat.2006.01.005) + phase_mechanical_Fp(ph)%data(1:3,1:3,en) = phase_mechanical_Fp(ph)%data(1:3,1:3,en) & + / math_det33(phase_mechanical_Fp(ph)%data(1:3,1:3,en))**(1.0_pReal/3.0_pReal) + phase_mechanical_Fe(ph)%data(1:3,1:3,en) = matmul(material_V_e_0(ma)%data(1:3,1:3,co), & + transpose(phase_mechanical_Fp(ph)%data(1:3,1:3,en))) + phase_mechanical_Fi(ph)%data(1:3,1:3,en) = material_O_0(ma)%data(co)%rotate(math_inv33(material_V_e_0(ma)%data(1:3,1:3,co))) enddo enddo do ph = 1, phases%length - do en = 1, count(material_phaseID == ph) - - phase_mechanical_Fp0(ph)%data(1:3,1:3,en) = phase_O_0(ph)%data(en)%asMatrix() ! Fp reflects initial orientation (see 10.1016/j.actamat.2006.01.005) - phase_mechanical_Fp0(ph)%data(1:3,1:3,en) = phase_mechanical_Fp0(ph)%data(1:3,1:3,en) & - / math_det33(phase_mechanical_Fp0(ph)%data(1:3,1:3,en))**(1.0_pReal/3.0_pReal) - phase_mechanical_F0(ph)%data(1:3,1:3,en) = math_I3 - phase_mechanical_Fe(ph)%data(1:3,1:3,en) = math_inv33(matmul(phase_mechanical_Fi0(ph)%data(1:3,1:3,en), & - phase_mechanical_Fp0(ph)%data(1:3,1:3,en))) ! assuming that euler angles are given in internal strain free configuration - enddo - phase_mechanical_Fp(ph)%data = phase_mechanical_Fp0(ph)%data - phase_mechanical_Fi(ph)%data = phase_mechanical_Fi0(ph)%data - phase_mechanical_F(ph)%data = phase_mechanical_F0(ph)%data + phase_mechanical_F0(ph)%data = phase_mechanical_F(ph)%data + phase_mechanical_Fp0(ph)%data = phase_mechanical_Fp(ph)%data + phase_mechanical_Fi0(ph)%data = phase_mechanical_Fi(ph)%data enddo @@ -318,7 +312,6 @@ module subroutine mechanical_init(phases) end select - call eigen_init(phases) @@ -1244,6 +1237,9 @@ module function phase_mechanical_dPdF(Delta_t,co,ce) result(dPdF) end function phase_mechanical_dPdF +!-------------------------------------------------------------------------------------------------- +!< @brief Write restart information to file. +!-------------------------------------------------------------------------------------------------- module subroutine mechanical_restartWrite(groupHandle,ph) integer(HID_T), intent(in) :: groupHandle @@ -1251,36 +1247,41 @@ module subroutine mechanical_restartWrite(groupHandle,ph) call HDF5_write(plasticState(ph)%state,groupHandle,'omega_plastic') - call HDF5_write(phase_mechanical_Fi(ph)%data,groupHandle,'F_i') - call HDF5_write(phase_mechanical_Li(ph)%data,groupHandle,'L_i') - call HDF5_write(phase_mechanical_Lp(ph)%data,groupHandle,'L_p') - call HDF5_write(phase_mechanical_Fp(ph)%data,groupHandle,'F_p') call HDF5_write(phase_mechanical_S(ph)%data,groupHandle,'S') call HDF5_write(phase_mechanical_F(ph)%data,groupHandle,'F') + call HDF5_write(phase_mechanical_Fp(ph)%data,groupHandle,'F_p') + call HDF5_write(phase_mechanical_Fi(ph)%data,groupHandle,'F_i') + call HDF5_write(phase_mechanical_Lp(ph)%data,groupHandle,'L_p') + call HDF5_write(phase_mechanical_Li(ph)%data,groupHandle,'L_i') end subroutine mechanical_restartWrite +!-------------------------------------------------------------------------------------------------- +!< @brief Read restart information from file. +!-------------------------------------------------------------------------------------------------- module subroutine mechanical_restartRead(groupHandle,ph) integer(HID_T), intent(in) :: groupHandle integer, intent(in) :: ph + integer :: en + call HDF5_read(plasticState(ph)%state0,groupHandle,'omega_plastic') - call HDF5_read(phase_mechanical_Fi0(ph)%data,groupHandle,'F_i') - call HDF5_read(phase_mechanical_Li0(ph)%data,groupHandle,'L_i') - call HDF5_read(phase_mechanical_Lp0(ph)%data,groupHandle,'L_p') - call HDF5_read(phase_mechanical_Fp0(ph)%data,groupHandle,'F_p') call HDF5_read(phase_mechanical_S0(ph)%data,groupHandle,'S') call HDF5_read(phase_mechanical_F0(ph)%data,groupHandle,'F') + call HDF5_read(phase_mechanical_Fp0(ph)%data,groupHandle,'F_p') + call HDF5_read(phase_mechanical_Fi0(ph)%data,groupHandle,'F_i') + call HDF5_read(phase_mechanical_Lp0(ph)%data,groupHandle,'L_p') + call HDF5_read(phase_mechanical_Li0(ph)%data,groupHandle,'L_i') end subroutine mechanical_restartRead -!---------------------------------------------------------------------------------------------- -!< @brief Get first Piola-Kichhoff stress (for use by non-mech physics) -!---------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------------- +!< @brief Get first Piola-Kichhoff stress (for use by non-mech physics). +!-------------------------------------------------------------------------------------------------- module function mechanical_S(ph,en) result(S) integer, intent(in) :: ph,en @@ -1292,9 +1293,9 @@ module function mechanical_S(ph,en) result(S) end function mechanical_S -!---------------------------------------------------------------------------------------------- -!< @brief Get plastic velocity gradient (for use by non-mech physics) -!---------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------------- +!< @brief Get plastic velocity gradient (for use by non-mech physics). +!-------------------------------------------------------------------------------------------------- module function mechanical_L_p(ph,en) result(L_p) integer, intent(in) :: ph,en @@ -1306,9 +1307,9 @@ module function mechanical_L_p(ph,en) result(L_p) end function mechanical_L_p -!---------------------------------------------------------------------------------------------- -!< @brief Get elastic deformation gradient (for use by non-mech physics) -!---------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------------- +!< @brief Get elastic deformation gradient (for use by non-mech physics). +!-------------------------------------------------------------------------------------------------- module function mechanical_F_e(ph,en) result(F_e) integer, intent(in) :: ph,en @@ -1320,9 +1321,9 @@ module function mechanical_F_e(ph,en) result(F_e) end function mechanical_F_e -!---------------------------------------------------------------------------------------------- -!< @brief Get second Piola-Kichhoff stress (for use by homogenization) -!---------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------------- +!< @brief Get second Piola-Kichhoff stress (for use by homogenization). +!-------------------------------------------------------------------------------------------------- module function phase_P(co,ce) result(P) integer, intent(in) :: co, ce @@ -1334,9 +1335,9 @@ module function phase_P(co,ce) result(P) end function phase_P -!---------------------------------------------------------------------------------------------- -!< @brief Get deformation gradient (for use by homogenization) -!---------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------------- +!< @brief Get deformation gradient (for use by homogenization). +!-------------------------------------------------------------------------------------------------- module function phase_F(co,ce) result(F) integer, intent(in) :: co, ce @@ -1348,9 +1349,9 @@ module function phase_F(co,ce) result(F) end function phase_F -!---------------------------------------------------------------------------------------------- -!< @brief Set deformation gradient (for use by homogenization) -!---------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------------- +!< @brief Set deformation gradient (for use by homogenization). +!-------------------------------------------------------------------------------------------------- module subroutine phase_set_F(F,co,ce) real(pReal), dimension(3,3), intent(in) :: F diff --git a/src/rotations.f90 b/src/rotations.f90 index 7aa81fcab..3340bf2a0 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -323,17 +323,16 @@ pure function rotTensor2(self,T,active) result(tRot) logical :: passive + if (present(active)) then passive = .not. active else passive = .true. endif - if (passive) then - tRot = matmul(matmul(self%asMatrix(),T),transpose(self%asMatrix())) - else - tRot = matmul(matmul(transpose(self%asMatrix()),T),self%asMatrix()) - endif + tRot = merge(matmul(matmul(self%asMatrix(),T),transpose(self%asMatrix())), & + matmul(matmul(transpose(self%asMatrix()),T),self%asMatrix()), & + passive) end function rotTensor2 From 41a732f62df0ab2e3538156801b405f35a8f3244 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 19 May 2022 16:36:50 +0200 Subject: [PATCH 82/88] assumed rank solution gives wrong results #194 --- src/HDF5_utilities.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HDF5_utilities.f90 b/src/HDF5_utilities.f90 index 86807507b..fcd2c189a 100644 --- a/src/HDF5_utilities.f90 +++ b/src/HDF5_utilities.f90 @@ -48,7 +48,7 @@ module HDF5_utilities !> @details for parallel IO, all dimension except for the last need to match !-------------------------------------------------------------------------------------------------- interface HDF5_write -#if defined(__GFORTRAN__) && __GNUC__<11 +#if defined(__GFORTRAN__) module procedure HDF5_write_real1 module procedure HDF5_write_real2 module procedure HDF5_write_real3 @@ -1214,7 +1214,7 @@ subroutine HDF5_read_int7(dataset,loc_id,datasetName,parallel) end subroutine HDF5_read_int7 -#if defined(__GFORTRAN__) && __GNUC__<11 +#if defined(__GFORTRAN__) !-------------------------------------------------------------------------------------------------- !> @brief write dataset of type real with 1 dimension @@ -1631,7 +1631,7 @@ subroutine HDF5_write_str(dataset,loc_id,datasetName) end subroutine HDF5_write_str -#if defined(__GFORTRAN__) && __GNUC__<11 +#if defined(__GFORTRAN__) !-------------------------------------------------------------------------------------------------- !> @brief write dataset of type integer with 1 dimension From d2b493765c671713c28d9175090880d108b47462 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 19 May 2022 22:42:33 +0200 Subject: [PATCH 83/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-373-g41a732f62 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 435d3544f..07abc66a1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-371-g18d862cdb +3.0.0-alpha6-373-g41a732f62 From 491e2ec0b2b963353e09347c38383c78710477fa Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 20 May 2022 06:30:07 +0200 Subject: [PATCH 84/88] avoid negative zero when not needed --- src/material.f90 | 2 +- src/rotations.f90 | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/material.f90 b/src/material.f90 index ce4cabea9..eafc411cd 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -164,7 +164,7 @@ subroutine parse() call material_O_0(ma)%data(co)%fromQuaternion(constituent%get_as1dFloat('O',requiredSize=4)) material_V_e_0(ma)%data(1:3,1:3,co) = constituent%get_as2dFloat('V_e',defaultVal=math_I3,requiredShape=[3,3]) if (any(dNeq(material_V_e_0(ma)%data(1:3,1:3,co),transpose(material_V_e_0(ma)%data(1:3,1:3,co))))) & - call IO_error(147) + call IO_error(147) end do if (dNeq(sum(v_of(ma,:)),1.0_pReal,1.e-9_pReal)) call IO_error(153,ext_msg='constituent') diff --git a/src/rotations.f90 b/src/rotations.f90 index 3340bf2a0..6257fe7e4 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -574,7 +574,7 @@ end function qu2cu !--------------------------------------------------------------------------------------------------- !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH -!> @brief convert rotation matrix to cubochoric +!> @brief convert rotation matrix to unit quaternion !> @details the original formulation (direct conversion) had (numerical?) issues !--------------------------------------------------------------------------------------------------- pure function om2qu(om) result(qu) @@ -601,14 +601,14 @@ pure function om2qu(om) result(qu) endif endif if(sign(1.0_pReal,qu(1))<0.0_pReal) qu =-1.0_pReal * qu - qu = qu*[1.0_pReal,P,P,P] + qu(2:4) = merge(qu(2:4),qu(2:4)*P,dEq0(qu(2:4))) end function om2qu !--------------------------------------------------------------------------------------------------- !> @author Marc De Graef, Carnegie Mellon University -!> @brief orientation matrix to Euler angles +!> @brief convert orientation matrix to Euler angles !> @details Two step check for special cases to avoid invalid operations (not needed for python) !--------------------------------------------------------------------------------------------------- pure function om2eu(om) result(eu) @@ -1333,8 +1333,8 @@ pure function cu2ho(cu) result(ho) ! transform to sphere grid (inverse Lambert) ! [note that there is no need to worry about dividing by zero, since XYZ(3) can not become zero] c = sum(T**2) - s = PI * c/(24.0*XYZ(3)**2) - c = sqrt(PI) * c / sqrt(24.0_pReal) / XYZ(3) + s = c * PI/(24.0*XYZ(3)**2) + c = c * sqrt(PI/24.0_pReal) / XYZ(3) q = sqrt( 1.0 - s ) LamXYZ = [ T(order(2)) * q, T(order(1)) * q, PREF * XYZ(3) - c ] end if special From f42bb5d1755a77ea02a9d34a42fdff68b2746fef Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 20 May 2022 06:43:32 +0200 Subject: [PATCH 85/88] mitigate rounding errors --- src/phase_mechanical.f90 | 2 -- src/rotations.f90 | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index bddd4775e..88b86a8d9 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -264,8 +264,6 @@ module subroutine mechanical_init(phases) en = material_phaseEntry(co,ce) phase_mechanical_F(ph)%data(1:3,1:3,en) = math_I3 phase_mechanical_Fp(ph)%data(1:3,1:3,en) = material_O_0(ma)%data(co)%asMatrix() ! Fp reflects initial orientation (see 10.1016/j.actamat.2006.01.005) - phase_mechanical_Fp(ph)%data(1:3,1:3,en) = phase_mechanical_Fp(ph)%data(1:3,1:3,en) & - / math_det33(phase_mechanical_Fp(ph)%data(1:3,1:3,en))**(1.0_pReal/3.0_pReal) phase_mechanical_Fe(ph)%data(1:3,1:3,en) = matmul(material_V_e_0(ma)%data(1:3,1:3,co), & transpose(phase_mechanical_Fp(ph)%data(1:3,1:3,en))) phase_mechanical_Fi(ph)%data(1:3,1:3,en) = material_O_0(ma)%data(co)%rotate(math_inv33(material_V_e_0(ma)%data(1:3,1:3,co))) diff --git a/src/rotations.f90 b/src/rotations.f90 index 6257fe7e4..5367f2c07 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -449,6 +449,7 @@ pure function qu2om(qu) result(om) om(1,3) = 2.0_pReal*(qu(2)*qu(4)+qu(1)*qu(3)) if (sign(1.0_pReal,P) < 0.0_pReal) om = transpose(om) + om = om/math_det33(om)**(1.0_pReal/3.0_pReal) end function qu2om @@ -602,6 +603,7 @@ pure function om2qu(om) result(qu) endif if(sign(1.0_pReal,qu(1))<0.0_pReal) qu =-1.0_pReal * qu qu(2:4) = merge(qu(2:4),qu(2:4)*P,dEq0(qu(2:4))) + qu = qu/norm2(qu) end function om2qu From ad6cd12a18669caad0d11380fecb71bc50240963 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 20 May 2022 18:36:34 +0200 Subject: [PATCH 86/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-379-g119f8c484 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 07abc66a1..d6c405825 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-373-g41a732f62 +3.0.0-alpha6-379-g119f8c484 From d2c072604a7b948c82ae48af99be3736c0ae5f78 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 21 May 2022 09:23:44 +0200 Subject: [PATCH 87/88] missing update of PRIVATE --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index d2c229e6d..0e82975b2 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit d2c229e6dd81fb399b2c1b0658b750f7d309f175 +Subproject commit 0e82975b23a1bd4310c523388f1cadf1b8e03dd0 From 4d17adb1bfab5563785b7f650df1bb93b813129e Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 21 May 2022 11:19:40 +0200 Subject: [PATCH 88/88] [skip ci] updated version information after successful test of v3.0.0-alpha6-381-gd2c072604 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d6c405825..323a6d77e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-379-g119f8c484 +3.0.0-alpha6-381-gd2c072604