From f20cecd4219a83805741a08e3437b8ff36166a69 Mon Sep 17 00:00:00 2001 From: Krishna Komerla Date: Tue, 10 Apr 2012 15:15:46 +0000 Subject: [PATCH] integrated subroutine for regridding into mesh.f90 and made it available for python --- code/DAMASK_python_interface.f90 | 4 ++-- code/damask.core.pyf | 25 ++++++++++++++++++------- code/mesh.f90 | 28 +++++++++++++++++++++++++++- processing/setup/setup_processing.py | 2 ++ 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/code/DAMASK_python_interface.f90 b/code/DAMASK_python_interface.f90 index d6596a856..62b5430d4 100644 --- a/code/DAMASK_python_interface.f90 +++ b/code/DAMASK_python_interface.f90 @@ -60,8 +60,8 @@ subroutine DAMASK_interface_init(loadcaseParameterIn,geometryParameterIn) character(len=1024), intent(in) :: geometryParameterIn integer, dimension(8) :: dateAndTime ! type default integer - geometryParameter = loadcaseParameterIn - loadcaseParameter = geometryParameterIn + geometryParameter = geometryParameterIn + loadcaseParameter = loadcaseParameterIn call date_and_time(values = dateAndTime) diff --git a/code/damask.core.pyf b/code/damask.core.pyf index e2a4f646a..d2c48d0ba 100644 --- a/code/damask.core.pyf +++ b/code/damask.core.pyf @@ -14,19 +14,17 @@ python module core ! in interface ! in :core - module damask_interface ! in :damask_interface:DAMASK_python_interface.f90 - - function getSolverWorkingDirectoryName() - character(len=1024) :: getSolverWorkingDirectoryName() - end function getSolverWorkingDirectoryName - + + module damask_interface ! in :damask_interface:DAMASK_python_interface.f90 + subroutine damask_interface_init(loadcaseParameterIn,geometryParameterIn) ! in :damask_interface:DAMASK_python_interface.f90 character(len=1024), intent(in) :: loadcaseParameterIn character(len=1024), intent(in) :: geometryParameterIn end subroutine damask_interface_init end module damask_interface - + + module math ! in :math:math.f90 subroutine volume_compare(res,geomdim,defgrad,nodes,volume_mismatch) ! in :math:math.f90 @@ -174,6 +172,19 @@ python module core ! in integer, dimension(res_new[0]*res_new[1]*res_new[2]), intent(out),depend(res_new[0],res_new[1],res_new[2]) :: result_indices end subroutine math_nearestNeighborSearch end module math + + + module mesh ! in :mesh:mesh.f90 + + subroutine mesh_regrid(res,resNew) ! in :mesh:mesh.f90 + integer, dimension(3), intent(in) :: res + integer, dimension(3), intent(in,out) :: resNew + real*8, dimension(res[0],res[1],res[2],3,3), depend(res[0],res[1],res[2]) :: F + + end subroutine mesh_regrid + + end module mesh + end interface end python module core diff --git a/code/mesh.f90 b/code/mesh.f90 index bb0d329b5..e2ce39e53 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -260,7 +260,8 @@ mesh_FEasCP, & mesh_build_subNodeCoords, & mesh_build_ipVolumes, & - mesh_build_ipCoordinates + mesh_build_ipCoordinates, & + mesh_regrid private :: FE_mapElemtype, & mesh_faceMatch, & mesh_build_FEdata, & @@ -3627,4 +3628,29 @@ deallocate(mesh_HomogMicro) end subroutine mesh_tell_statistics +subroutine mesh_regrid(res,resNew) !use new_res=0.0 for automatic determination of new grid + use prec, only pInt, pReal + use DAMASK_interface, only : getSolverJobName + use IO, only : IO_read_jobBinaryFile + + integer(pInt), dimension(3), intent(in) :: res + integer(pInt), dimension(3), intent(inout) :: resNew + real(pReal), dimension(res(1),res(2),res(3),3,3) :: F + + real(pReal), dimension(:,:,:,:,:), allocatable :: crystallite_F0, & + CPFEM_dcsdE, & + crystallite_Fp0, & + crystallite_Lp0 + real(pReal), dimension (:,:,:,:,:,:,:), allocatable :: crystallite_dPdF0 + real(pReal), dimension (:,:,:,:), allocatable :: crystallite_Tstar0_v, & + convergedStateConst + integer(pInt), dimension (:,:), allocatable :: convergedSizeConst + + call IO_read_jobBinaryFile(777,'convergedSpectralDefgrad',trim(getSolverJobName()),size(F)) + read (777,rec=1) F + close (777) + +end subroutine mesh_regrid + + end module mesh diff --git a/processing/setup/setup_processing.py b/processing/setup/setup_processing.py index 8e2a6e91c..133f2cf48 100755 --- a/processing/setup/setup_processing.py +++ b/processing/setup/setup_processing.py @@ -139,6 +139,8 @@ execute = { \ ' %s'%(os.path.join(codeDir,'numerics.f90'))+\ ' %s'%(os.path.join(codeDir,'debug.f90'))+\ ' %s'%(os.path.join(codeDir,'math.f90'))+\ + ' %s'%(os.path.join(codeDir,'FEsolving.f90'))+\ + ' %s'%(os.path.join(codeDir,'mesh.f90'))+\ ' %s'%(os.path.join(codeDir,'DAMASK_quit.f90'))+\ ' -L%s/lib -lfftw3'%(damaskEnv.pathInfo['fftw'])+\ ' %s'%lib_lapack,