From 26ab0365be98cff7444ae81baebfb3dea8f96d15 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Apr 2022 17:30:37 +0200 Subject: [PATCH 01/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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 730cda2020b5b4d7bff3fb1da8d41ff5a54a9070 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 29 Apr 2022 14:50:27 +0200 Subject: [PATCH 08/16] 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 09/16] 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 be39865ff7adad51805f9cbda70ac521241d04a9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 May 2022 09:51:10 +0200 Subject: [PATCH 10/16] 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 11/16] 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 12/16] 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 13/16] 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 14/16] 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 c58bbaa9add158bcad6bbb641d00964500c1d0f4 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 5 May 2022 03:50:41 +0200 Subject: [PATCH 15/16] [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 16/16] [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