regridding is now working, changed the subroutine into a function
changed order of arrays in nearest neighbor search to make it fortran fast constitutive.f90 and homogenization.f90 write state size out during initialization setup/setup_processing.py is using byterecl to be compatible with binary files written out by solver
This commit is contained in:
parent
a9a72cee97
commit
c752dd5474
|
@ -183,12 +183,12 @@ subroutine DAMASK_interface_init(loadcaseParameterIn,geometryParameterIn)
|
||||||
call GET_ENVIRONMENT_VARIABLE('HOST',hostName)
|
call GET_ENVIRONMENT_VARIABLE('HOST',hostName)
|
||||||
call GET_ENVIRONMENT_VARIABLE('USER',userName)
|
call GET_ENVIRONMENT_VARIABLE('USER',userName)
|
||||||
|
|
||||||
write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',&
|
write(6,'(a,2(i2.2,a),i4.4)') 'Date: ',dateAndTime(3),'/',&
|
||||||
dateAndTime(2),'/',&
|
dateAndTime(2),'/',&
|
||||||
dateAndTime(1)
|
dateAndTime(1)
|
||||||
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':',&
|
write(6,'(a,2(i2.2,a),i2.2)') 'Time: ',dateAndTime(5),':',&
|
||||||
dateAndTime(6),':',&
|
dateAndTime(6),':',&
|
||||||
dateAndTime(7)
|
dateAndTime(7)
|
||||||
write(6,'(a,a)') 'Host Name: ', trim(hostName)
|
write(6,'(a,a)') 'Host Name: ', trim(hostName)
|
||||||
write(6,'(a,a)') 'User Name: ', trim(userName)
|
write(6,'(a,a)') 'User Name: ', trim(userName)
|
||||||
write(6,'(a,a)') 'Path Separator: ', getPathSep()
|
write(6,'(a,a)') 'Path Separator: ', getPathSep()
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
MODULE constitutive
|
MODULE constitutive
|
||||||
|
|
||||||
use prec, only: pInt, p_vec
|
use prec, only: pInt, p_vec
|
||||||
|
use IO, only: IO_write_jobBinaryFile
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
type(p_vec), dimension(:,:,:), allocatable :: &
|
type(p_vec), dimension(:,:,:), allocatable :: &
|
||||||
|
@ -356,6 +357,13 @@ endif
|
||||||
enddo
|
enddo
|
||||||
!$OMP END PARALLEL DO
|
!$OMP END PARALLEL DO
|
||||||
|
|
||||||
|
!----- write out state size file----------------
|
||||||
|
open(777)
|
||||||
|
call IO_write_jobBinaryFile(777,'sizeStateConst', size(constitutive_sizeState))
|
||||||
|
write (777,rec=1) constitutive_sizeState
|
||||||
|
close(777)
|
||||||
|
!-----------------------------------------------
|
||||||
|
|
||||||
constitutive_maxSizeState = maxval(constitutive_sizeState)
|
constitutive_maxSizeState = maxval(constitutive_sizeState)
|
||||||
constitutive_maxSizeDotState = maxval(constitutive_sizeDotState)
|
constitutive_maxSizeDotState = maxval(constitutive_sizeDotState)
|
||||||
constitutive_maxSizePostResults = maxval(constitutive_sizePostResults)
|
constitutive_maxSizePostResults = maxval(constitutive_sizePostResults)
|
||||||
|
|
|
@ -167,8 +167,8 @@ python module core ! in
|
||||||
real*8, dimension(3), intent(in) :: geomdim
|
real*8, dimension(3), intent(in) :: geomdim
|
||||||
integer, intent(in) :: queryPoints
|
integer, intent(in) :: queryPoints
|
||||||
integer, intent(in) :: domainPoints
|
integer, intent(in) :: domainPoints
|
||||||
real*8, dimension(queryPoints,spatialDim), intent(in), depend(queryPoints,spatialDim) :: querySet
|
real*8, dimension(spatialDim,queryPoints), intent(in), depend(queryPoints,spatialDim) :: querySet
|
||||||
real*8, dimension(domainPoints,spatialDim), intent(in), depend(domainPoints,spatialDim) :: domainSet
|
real*8, dimension(spatialDim,domainPoints), intent(in), depend(domainPoints,spatialDim) :: domainSet
|
||||||
! output variable
|
! output variable
|
||||||
integer, dimension(queryPoints), intent(out), depend(queryPoints) :: indices
|
integer, dimension(queryPoints), intent(out), depend(queryPoints) :: indices
|
||||||
! depending on input
|
! depending on input
|
||||||
|
@ -178,9 +178,10 @@ python module core ! in
|
||||||
|
|
||||||
module mesh ! in :mesh:mesh.f90
|
module mesh ! in :mesh:mesh.f90
|
||||||
|
|
||||||
subroutine mesh_regrid(resNew) ! in :mesh:mesh.f90
|
function mesh_regrid(resNewInput) ! in :mesh:mesh.f90
|
||||||
integer, dimension(3), intent(in,out), optional :: resNew
|
integer, dimension(3) :: mesh_regrid
|
||||||
end subroutine mesh_regrid
|
integer, dimension(3), intent(in), optional :: resNewInput
|
||||||
|
end function mesh_regrid
|
||||||
|
|
||||||
end module mesh
|
end module mesh
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ MODULE homogenization
|
||||||
|
|
||||||
!*** Include other modules ***
|
!*** Include other modules ***
|
||||||
use prec, only: pInt,pReal,p_vec
|
use prec, only: pInt,pReal,p_vec
|
||||||
|
use IO, only: IO_write_jobBinaryFile
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
! ****************************************************************
|
! ****************************************************************
|
||||||
|
@ -161,7 +162,7 @@ forall (i = 1:mesh_maxNips,e = 1:mesh_NcpElems)
|
||||||
end forall
|
end forall
|
||||||
|
|
||||||
|
|
||||||
! --- ALLOCATE AND INITIALIZE GLOBAL STATE AND POSTRESULTS VARIABLES ---
|
! --- ALLOCATE AND INITIALIZE GLOBAL STATE AND POSTRESULTS VARIABLES ----------
|
||||||
|
|
||||||
!$OMP PARALLEL DO PRIVATE(myInstance)
|
!$OMP PARALLEL DO PRIVATE(myInstance)
|
||||||
do e = 1,mesh_NcpElems ! loop over elements
|
do e = 1,mesh_NcpElems ! loop over elements
|
||||||
|
@ -192,6 +193,14 @@ end forall
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
!$OMP END PARALLEL DO
|
!$OMP END PARALLEL DO
|
||||||
|
|
||||||
|
!---write state size file out---------------------------------------
|
||||||
|
open(777)
|
||||||
|
call IO_write_jobBinaryFile(777,'sizeStateHomog',size(homogenization_sizeState))
|
||||||
|
write (777,rec=1) homogenization_sizeState
|
||||||
|
close(777)
|
||||||
|
!--------------------------------------------------------------
|
||||||
|
|
||||||
homogenization_maxSizeState = maxval(homogenization_sizeState)
|
homogenization_maxSizeState = maxval(homogenization_sizeState)
|
||||||
homogenization_maxSizePostResults = maxval(homogenization_sizePostResults)
|
homogenization_maxSizePostResults = maxval(homogenization_sizePostResults)
|
||||||
materialpoint_sizeResults = 1 & ! grain count
|
materialpoint_sizeResults = 1 & ! grain count
|
||||||
|
|
|
@ -3832,19 +3832,19 @@ subroutine math_nearestNeighborSearch(spatialDim, Favg, geomdim, queryPoints, do
|
||||||
real(pReal), dimension(3), intent(in) :: geomdim
|
real(pReal), dimension(3), intent(in) :: geomdim
|
||||||
integer(pInt), intent(in) :: domainPoints
|
integer(pInt), intent(in) :: domainPoints
|
||||||
integer(pInt), intent(in) :: queryPoints
|
integer(pInt), intent(in) :: queryPoints
|
||||||
real(pReal), dimension(queryPoints,spatialDim), intent(in) :: querySet
|
real(pReal), dimension(spatialDim,queryPoints), intent(in) :: querySet
|
||||||
real(pReal), dimension(domainPoints,spatialDim), intent(in) :: domainSet
|
real(pReal), dimension(spatialDim,domainPoints), intent(in) :: domainSet
|
||||||
! output variable
|
! output variable
|
||||||
integer(pInt), dimension(queryPoints), intent(out) :: indices
|
integer(pInt), dimension(queryPoints), intent(out) :: indices
|
||||||
! other variables depending on input
|
! other variables depending on input
|
||||||
real(pReal), dimension(3,(3_pInt**spatialDim)*domainPoints) :: domainSetLarge
|
real(pReal), dimension(spatialDim,(3_pInt**spatialDim)*domainPoints) :: domainSetLarge
|
||||||
! other variables
|
! other variables
|
||||||
integer(pInt) :: i,j, l,m,n
|
integer(pInt) :: i,j, l,m,n
|
||||||
type(kdtree2), pointer :: tree
|
type(kdtree2), pointer :: tree
|
||||||
type(kdtree2_result), dimension(1) :: Results
|
type(kdtree2_result), dimension(1) :: Results
|
||||||
|
|
||||||
if (size(querySet(1,:)) /= spatialDim) call IO_error(407_pInt,ext_msg='query set')
|
if (size(querySet(:,1)) /= spatialDim) call IO_error(407_pInt,ext_msg='query set')
|
||||||
if (size(domainSet(1,:)) /= spatialDim) call IO_error(407_pInt,ext_msg='domain set')
|
if (size(domainSet(:,1)) /= spatialDim) call IO_error(407_pInt,ext_msg='domain set')
|
||||||
|
|
||||||
|
|
||||||
i = 0_pInt
|
i = 0_pInt
|
||||||
|
@ -3852,14 +3852,14 @@ subroutine math_nearestNeighborSearch(spatialDim, Favg, geomdim, queryPoints, do
|
||||||
do j = 1_pInt, domainPoints
|
do j = 1_pInt, domainPoints
|
||||||
do l = -1_pInt, 1_pInt; do m = -1_pInt, 1_pInt
|
do l = -1_pInt, 1_pInt; do m = -1_pInt, 1_pInt
|
||||||
i = i + 1_pInt
|
i = i + 1_pInt
|
||||||
domainSetLarge(1:3,i) = domainSet(j,1:3) + math_mul33x3(Favg,real([l,m,0_pInt],pReal)*geomdim)
|
domainSetLarge(1:2,i) = domainSet(1:2,j) +matmul(Favg(1:2,1:2),real([l,m],pReal)*geomdim(1:2))
|
||||||
enddo; enddo
|
enddo; enddo
|
||||||
enddo
|
enddo
|
||||||
else
|
else
|
||||||
do j = 1_pInt, domainPoints
|
do j = 1_pInt, domainPoints
|
||||||
do l = -1_pInt, 1_pInt; do m = -1_pInt, 1_pInt; do n = -1_pInt, 1_pInt
|
do l = -1_pInt, 1_pInt; do m = -1_pInt, 1_pInt; do n = -1_pInt, 1_pInt
|
||||||
i = i + 1_pInt
|
i = i + 1_pInt
|
||||||
domainSetLarge(1:3,i) = domainSet(j,1:3) + math_mul33x3(Favg,real([l,m,n],pReal)*geomdim)
|
domainSetLarge(1:3,i) = domainSet(1:3,j) + math_mul33x3(Favg,real([l,m,n],pReal)*geomdim)
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
|
@ -3867,7 +3867,7 @@ subroutine math_nearestNeighborSearch(spatialDim, Favg, geomdim, queryPoints, do
|
||||||
tree => kdtree2_create(domainSetLarge,sort=.true.,rearrange=.true.)
|
tree => kdtree2_create(domainSetLarge,sort=.true.,rearrange=.true.)
|
||||||
|
|
||||||
do j = 1_pInt, queryPoints
|
do j = 1_pInt, queryPoints
|
||||||
call kdtree2_n_nearest(tp=tree, qv=querySet(j,1:spatialDim),nn=1_pInt, results = Results)
|
call kdtree2_n_nearest(tp=tree, qv=querySet(1:spatialDim,j),nn=1_pInt, results = Results)
|
||||||
indices(j) = Results(1)%idx
|
indices(j) = Results(1)%idx
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
|
258
code/mesh.f90
258
code/mesh.f90
|
@ -3528,7 +3528,7 @@ end subroutine mesh_tell_statistics
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
subroutine mesh_regrid(resNew) !use new_res=[0.0,0.0,0.0] for automatic determination of new grid
|
function mesh_regrid(resNewInput) !use new_res=[0.0,0.0,0.0] for automatic determination of new grid
|
||||||
use prec, only: &
|
use prec, only: &
|
||||||
pInt, &
|
pInt, &
|
||||||
pReal
|
pReal
|
||||||
|
@ -3542,86 +3542,122 @@ subroutine mesh_regrid(resNew) !use new_res=[0.0,0.0,0.0] for automati
|
||||||
deformed_FFT, &
|
deformed_FFT, &
|
||||||
math_mul33x3
|
math_mul33x3
|
||||||
|
|
||||||
integer(pInt), dimension(3), optional, intent(inout) :: resNew
|
integer(pInt), dimension(3) :: mesh_regrid
|
||||||
integer(pInt):: maxsize, i, j, k, ielem, Npoints, NpointsNew
|
integer(pInt), dimension(3), optional, intent(in) :: resNewInput
|
||||||
integer(pInt), dimension(3) :: res
|
integer(pInt):: maxsize, i, j, k, ielem, Npoints, NpointsNew, spatialDim
|
||||||
integer(pInt), dimension(:), allocatable :: indices, outputSize
|
integer(pInt), dimension(3) :: res, resNew
|
||||||
real(pReal), dimension(3) :: geomdim = 0.0_pReal
|
integer(pInt), dimension(:), allocatable :: indices
|
||||||
|
real(pReal), dimension(3) :: geomdim
|
||||||
real(pReal), dimension(3,3) :: Favg
|
real(pReal), dimension(3,3) :: Favg
|
||||||
real(pReal), dimension(:,:), allocatable :: &
|
real(pReal), dimension(:,:), allocatable :: &
|
||||||
coordinatesNew
|
coordinatesNew, &
|
||||||
|
coordinatesLinear
|
||||||
|
|
||||||
|
real(pReal), dimension(:,:,:), allocatable :: &
|
||||||
|
material_phase, material_phaseNew
|
||||||
|
|
||||||
real(pReal), dimension(:,:,:,:,:), allocatable :: &
|
real(pReal), dimension(:,:,:,:,:), allocatable :: &
|
||||||
F, FNew, &
|
F, FNew, &
|
||||||
Fp, FpNew, &
|
Fp, FpNew, &
|
||||||
Lp, LpNew, &
|
Lp, LpNew, &
|
||||||
dcsdE, dcsdENew
|
dcsdE, dcsdENew
|
||||||
|
|
||||||
real(pReal), dimension (:,:,:,:,:,:,:), allocatable :: &
|
real(pReal), dimension (:,:,:,:,:,:,:), allocatable :: &
|
||||||
dPdF, dPdFNew
|
dPdF, dPdFNew
|
||||||
real(pReal), dimension (:,:,:,:), allocatable :: &
|
real(pReal), dimension (:,:,:,:), allocatable :: &
|
||||||
coordinates, &
|
coordinates, &
|
||||||
Tstar, TstarNew, &
|
Tstar, TstarNew, &
|
||||||
stateConst, stateConstNew, &
|
stateHomog, &
|
||||||
stateHomog, stateHomogNew
|
stateConst
|
||||||
integer(pInt), dimension (:,:), allocatable :: SizeConst
|
integer(pInt), dimension(:,:), allocatable :: &
|
||||||
|
sizeStateConst, sizeStateHomog
|
||||||
|
|
||||||
res = mesh_spectral_getResolution()
|
res = mesh_spectral_getResolution()
|
||||||
geomdim = mesh_spectral_getDimension()
|
geomdim = mesh_spectral_getDimension()
|
||||||
|
|
||||||
|
|
||||||
if (.not. present(resNew)) then
|
|
||||||
resNew=res
|
|
||||||
endif
|
|
||||||
|
|
||||||
Npoints = res(1)*res(2)*res(3)
|
Npoints = res(1)*res(2)*res(3)
|
||||||
NpointsNew = resNew(1)*resNew(2)*resNew(3)
|
|
||||||
|
|
||||||
print*, 'resolution ', res
|
|
||||||
print*, 'new resolution', resNew
|
|
||||||
|
|
||||||
allocate(coordinates(res(1),res(2),res(3),3))
|
|
||||||
allocate(coordinatesNew(resNew(1)*resNew(2)*resNew(3),3))
|
|
||||||
allocate(indices(Npoints))
|
|
||||||
allocate(F(res(1),res(2),res(3),3,3))
|
allocate(F(res(1),res(2),res(3),3,3))
|
||||||
|
|
||||||
|
|
||||||
call IO_read_jobBinaryFile(777,'convergedSpectralDefgrad',trim(getSolverJobName()),size(F))
|
call IO_read_jobBinaryFile(777,'convergedSpectralDefgrad',trim(getSolverJobName()),size(F))
|
||||||
read (777,rec=1) F
|
read (777,rec=1) F
|
||||||
close (777)
|
close (777)
|
||||||
|
|
||||||
! ----Calculate average deformation for remesh--------
|
! ----Calculate deformed configuration and average--------
|
||||||
do i= 1_pInt,3_pInt; do j = 1_pInt,3_pInt
|
do i= 1_pInt,3_pInt; do j = 1_pInt,3_pInt
|
||||||
Favg(i,j) = sum(F(1:res(1),1:res(2),1:res(3),i,j)) / Npoints
|
Favg(i,j) = sum(F(1:res(1),1:res(2),1:res(3),i,j)) / Npoints
|
||||||
enddo; enddo
|
enddo; enddo
|
||||||
|
allocate(coordinates(res(1),res(2),res(3),3))
|
||||||
call deformed_fft(res,geomdim,Favg,1.0_pReal,F,coordinates)
|
call deformed_fft(res,geomdim,Favg,1.0_pReal,F,coordinates)
|
||||||
|
deallocate(F)
|
||||||
|
|
||||||
|
! ----Store coordinates into a linear list--------
|
||||||
|
allocate(coordinatesLinear(3,Npoints))
|
||||||
|
ielem = 0_pInt
|
||||||
|
do k=1_pInt,res(3); do j=1_pInt, res(2); do i=1_pInt, res(1)
|
||||||
|
ielem = ielem + 1_pInt
|
||||||
|
coordinatesLinear(1:3,ielem) = coordinates(i,j,k,1:3)
|
||||||
|
enddo; enddo; enddo
|
||||||
|
deallocate(coordinates)
|
||||||
|
|
||||||
|
! ----For 2D /3D case----------------------------------
|
||||||
|
if (res(3)== 1_pInt) then
|
||||||
|
spatialDim = 2_pInt
|
||||||
|
else
|
||||||
|
spatialDim = 3_pInt
|
||||||
|
endif
|
||||||
|
|
||||||
|
! ----determine/calculate new resolution--------------
|
||||||
|
if (.not. present(resNewInput)) then
|
||||||
|
resNew=res
|
||||||
|
elseif(all(resNewInput==0.0_pReal)) then
|
||||||
|
!do automatic determination
|
||||||
|
else
|
||||||
|
resNew=resNewInput
|
||||||
|
endif
|
||||||
|
NpointsNew = resNew(1)*resNew(2)*resNew(3)
|
||||||
|
|
||||||
|
! ----Calculate regular new coordinates------------
|
||||||
|
allocate(coordinatesNew(3,NpointsNew))
|
||||||
ielem = 0_pInt
|
ielem = 0_pInt
|
||||||
do k=1_pInt,resNew(3); do j=1_pInt, resNew(2); do i=1_pInt, resNew(1)
|
do k=1_pInt,resNew(3); do j=1_pInt, resNew(2); do i=1_pInt, resNew(1)
|
||||||
ielem = ielem + 1_pInt
|
ielem = ielem + 1_pInt
|
||||||
coordinatesNew(ielem,1:3) = math_mul33x3(Favg, geomdim/real(resNew,pReal)*real([i,j,k],pReal) &
|
coordinatesNew(1:3,ielem) = math_mul33x3(Favg, geomdim/real(resNew,pReal)*real([i,j,k],pReal) &
|
||||||
- geomdim/real(2_pInt*resNew,pReal))
|
- geomdim/real(2_pInt*resNew,pReal))
|
||||||
enddo; enddo; enddo
|
enddo; enddo; enddo
|
||||||
|
|
||||||
!----- Nearest neighbour search -----------------------
|
!----- Nearest neighbour search -----------------------
|
||||||
call math_nearestNeighborSearch(res, Favg, geomdim, NpointsNew, &
|
allocate(indices(Npoints))
|
||||||
coordinates, coordinatesNew, indices)
|
call math_nearestNeighborSearch(spatialDim, Favg, geomdim, NpointsNew, Npoints, &
|
||||||
indices = indices /3_pInt**3_pInt +1_pInt ! adjust it for 2D case
|
coordinatesNew, coordinatesLinear, indices)
|
||||||
|
deallocate(coordinatesNew)
|
||||||
|
indices = indices / 3_pInt**spatialDim +1_pInt
|
||||||
|
|
||||||
deallocate(F)
|
!---------------------------------------------------------------------------
|
||||||
deallocate(coordinates)
|
allocate(material_phase (1,1, Npoints))
|
||||||
deallocate(coordinatesNew)
|
allocate(material_phaseNew (1,1, NpointsNew))
|
||||||
|
call IO_read_jobBinaryFile(777,'recordedPhase',trim(getSolverJobName()),size(material_phase))
|
||||||
|
read (777,rec=1) material_phase
|
||||||
|
close (777)
|
||||||
|
do i = 1, NpointsNew
|
||||||
|
material_phaseNew(1,1,i) = material_phase(1,1,indices(i))
|
||||||
|
enddo
|
||||||
|
|
||||||
! ---------------------------------------------------------------------------
|
call IO_write_jobBinaryFile(777,'recordedPhase',size(material_phaseNew))
|
||||||
allocate(F (3,3,1,1, Npoints))
|
write (777,rec=1) material_phaseNew
|
||||||
allocate(FNew(3,3,1,1, NpointsNew))
|
close (777)
|
||||||
|
deallocate(material_phase)
|
||||||
|
deallocate(material_phaseNew)
|
||||||
|
|
||||||
|
!---------------------------------------------------------------------------
|
||||||
|
allocate(F (3,3,1,1, Npoints))
|
||||||
|
allocate(FNew (3,3,1,1, NpointsNew))
|
||||||
call IO_read_jobBinaryFile(777,'convergedF',trim(getSolverJobName()),size(F))
|
call IO_read_jobBinaryFile(777,'convergedF',trim(getSolverJobName()),size(F))
|
||||||
read (777,rec=1) F
|
read (777,rec=1) F
|
||||||
close (777)
|
close (777)
|
||||||
call flush(6)
|
|
||||||
|
|
||||||
do i = 1, NpointsNew
|
do i = 1, NpointsNew
|
||||||
FNew(1:3,1:3,1,1,i) = F(1:3,1:3,1,1,indices(i))
|
FNew(1:3,1:3,1,1,i) = F(1:3,1:3,1,1,indices(i))
|
||||||
enddo
|
enddo
|
||||||
call flush(6)
|
|
||||||
|
|
||||||
call IO_write_jobBinaryFile(777,'convergedF',size(FNew))
|
call IO_write_jobBinaryFile(777,'convergedF',size(FNew))
|
||||||
write (777,rec=1) FNew
|
write (777,rec=1) FNew
|
||||||
|
@ -3630,15 +3666,14 @@ subroutine mesh_regrid(resNew) !use new_res=[0.0,0.0,0.0] for automati
|
||||||
deallocate(FNew)
|
deallocate(FNew)
|
||||||
|
|
||||||
!---------------------------------------------------------------------
|
!---------------------------------------------------------------------
|
||||||
allocate(Fp (3,3,1,1,Npoints))
|
allocate(Fp (3,3,1,1,Npoints))
|
||||||
allocate(FpNew(3,3,1,1,NpointsNew))
|
allocate(FpNew (3,3,1,1,NpointsNew))
|
||||||
call IO_read_jobBinaryFile(777,'convergedFp',trim(getSolverJobName()),size(Fp))
|
call IO_read_jobBinaryFile(777,'convergedFp',trim(getSolverJobName()),size(Fp))
|
||||||
read (777,rec=1) Fp
|
read (777,rec=1) Fp
|
||||||
close (777)
|
close (777)
|
||||||
|
|
||||||
do i = 1, NpointsNew
|
do i = 1, NpointsNew
|
||||||
FpNew(1:3,1:3,1,1,i) = Fp(1:3,1:3,1,1,indices(i))
|
FpNew(1:3,1:3,1,1,i) = Fp(1:3,1:3,1,1,indices(i))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call IO_write_jobBinaryFile(777,'convergedFp',size(FpNew))
|
call IO_write_jobBinaryFile(777,'convergedFp',size(FpNew))
|
||||||
write (777,rec=1) FpNew
|
write (777,rec=1) FpNew
|
||||||
|
@ -3647,50 +3682,44 @@ subroutine mesh_regrid(resNew) !use new_res=[0.0,0.0,0.0] for automati
|
||||||
deallocate(FpNew)
|
deallocate(FpNew)
|
||||||
|
|
||||||
!------------------------------------------------------------------------
|
!------------------------------------------------------------------------
|
||||||
allocate(Lp (3,3,1,1,Npoints))
|
allocate(Lp (3,3,1,1,Npoints))
|
||||||
allocate(LpNew(3,3,1,1,NpointsNew))
|
allocate(LpNew (3,3,1,1,NpointsNew))
|
||||||
call IO_read_jobBinaryFile(777,'convergedLp',trim(getSolverJobName()),size(Lp))
|
call IO_read_jobBinaryFile(777,'convergedLp',trim(getSolverJobName()),size(Lp))
|
||||||
read (777,rec=1) Lp
|
read (777,rec=1) Lp
|
||||||
close (777)
|
close (777)
|
||||||
|
|
||||||
do i = 1, NpointsNew
|
do i = 1, NpointsNew
|
||||||
LpNew(1:3,1:3,1,1,i) = Lp(1:3,1:3,1,1,indices(i))
|
LpNew(1:3,1:3,1,1,i) = Lp(1:3,1:3,1,1,indices(i))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call IO_write_jobBinaryFile(777,'convergedLp',size(LpNew))
|
call IO_write_jobBinaryFile(777,'convergedLp',size(LpNew))
|
||||||
write (777,rec=1) LpNew
|
write (777,rec=1) LpNew
|
||||||
close (777)
|
close (777)
|
||||||
deallocate(Lp)
|
deallocate(Lp)
|
||||||
deallocate(LpNew)
|
deallocate(LpNew)
|
||||||
|
|
||||||
!----------------------------------------------------------------------------
|
!----------------------------------------------------------------------------
|
||||||
allocate(dcsdE (6,6,1,1,Npoints))
|
allocate(dcsdE (6,6,1,1,Npoints))
|
||||||
allocate(dcsdENew(6,6,1,1,NpointsNew))
|
allocate(dcsdENew (6,6,1,1,NpointsNew))
|
||||||
call IO_read_jobBinaryFile(777,'convergeddcsdE',trim(getSolverJobName()),size(dcsdE))
|
call IO_read_jobBinaryFile(777,'convergeddcsdE',trim(getSolverJobName()),size(dcsdE))
|
||||||
read (777,rec=1) dcsdE
|
read (777,rec=1) dcsdE
|
||||||
close (777)
|
close (777)
|
||||||
|
|
||||||
do i = 1, NpointsNew
|
do i = 1, NpointsNew
|
||||||
dcsdENew(1:6,1:6,1,1,i) = dcsdE(1:6,1:6,1,1,indices(i))
|
dcsdENew(1:6,1:6,1,1,i) = dcsdE(1:6,1:6,1,1,indices(i))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call IO_write_jobBinaryFile(777,'convergeddcsdE',size(dcsdENew))
|
call IO_write_jobBinaryFile(777,'convergeddcsdE',size(dcsdENew))
|
||||||
write (777,rec=1) dcsdENew
|
write (777,rec=1) dcsdENew
|
||||||
close (777)
|
close (777)
|
||||||
deallocate(dcsdE)
|
deallocate(dcsdE)
|
||||||
deallocate(dcsdENew)
|
deallocate(dcsdENew)
|
||||||
|
|
||||||
! ---------------------------------------------------------------------------
|
!---------------------------------------------------------------------------
|
||||||
allocate(dPdF (3,3,3,3,1,1,Npoints))
|
allocate(dPdF (3,3,3,3,1,1,Npoints))
|
||||||
allocate(dPdFNew(3,3,3,3,1,1,NpointsNew))
|
allocate(dPdFNew (3,3,3,3,1,1,NpointsNew))
|
||||||
call IO_read_jobBinaryFile(777,'convergeddPdF',trim(getSolverJobName()),size(dPdF))
|
call IO_read_jobBinaryFile(777,'convergeddPdF',trim(getSolverJobName()),size(dPdF))
|
||||||
read (777,rec=1) dPdF
|
read (777,rec=1) dPdF
|
||||||
close (777)
|
close (777)
|
||||||
|
|
||||||
do i = 1, NpointsNew
|
do i = 1, NpointsNew
|
||||||
dPdFNew(1:3,1:3,1:3,1:3,1,1,i) = dPdF(1:3,1:3,1:3,1:3,1,1,indices(i))
|
dPdFNew(1:3,1:3,1:3,1:3,1,1,i) = dPdF(1:3,1:3,1:3,1:3,1,1,indices(i))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call IO_write_jobBinaryFile(777,'convergeddPdF',size(dPdFNew))
|
call IO_write_jobBinaryFile(777,'convergeddPdF',size(dPdFNew))
|
||||||
write (777,rec=1) dPdFNew
|
write (777,rec=1) dPdFNew
|
||||||
close (777)
|
close (777)
|
||||||
|
@ -3698,66 +3727,85 @@ subroutine mesh_regrid(resNew) !use new_res=[0.0,0.0,0.0] for automati
|
||||||
deallocate(dPdFNew)
|
deallocate(dPdFNew)
|
||||||
|
|
||||||
!---------------------------------------------------------------------------
|
!---------------------------------------------------------------------------
|
||||||
allocate(Tstar (6,1,1,Npoints))
|
allocate(Tstar (6,1,1,Npoints))
|
||||||
allocate(TstarNew(6,1,1,NpointsNew))
|
allocate(TstarNew (6,1,1,NpointsNew))
|
||||||
call IO_read_jobBinaryFile(777,'convergedTstar',trim(getSolverJobName()),size(Tstar))
|
call IO_read_jobBinaryFile(777,'convergedTstar',trim(getSolverJobName()),size(Tstar))
|
||||||
read (777,rec=1) Tstar
|
read (777,rec=1) Tstar
|
||||||
close (777)
|
close (777)
|
||||||
|
|
||||||
do i = 1, NpointsNew
|
do i = 1, NpointsNew
|
||||||
TstarNew(1:6,1,1,i) = Tstar(1:6,1,1,indices(i))
|
TstarNew(1:6,1,1,i) = Tstar(1:6,1,1,indices(i))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call IO_write_jobBinaryFile(777,'convergedTstar',size(TstarNew))
|
call IO_write_jobBinaryFile(777,'convergedTstar',size(TstarNew))
|
||||||
write (777,rec=1) TstarNew
|
write (777,rec=1) TstarNew
|
||||||
close (777)
|
close (777)
|
||||||
deallocate(Tstar)
|
deallocate(Tstar)
|
||||||
deallocate(TstarNew)
|
deallocate(TstarNew)
|
||||||
|
|
||||||
!----------------------------------------------------------------------------
|
!----------------------------------------------------------------------------
|
||||||
!for homog and state const
|
allocate(sizeStateConst(1,Npoints))
|
||||||
! allocate(SizeConst (1,Npoints))
|
call IO_read_jobBinaryFile(777,'sizeStateConst',trim(getSolverJobName()),size(sizeStateConst))
|
||||||
! allocate(StateConst (1,Npoints))
|
read (777,rec=1) sizeStateConst
|
||||||
! allocate(StateConstNew (1,Npoints))
|
close (777)
|
||||||
! call IO_read_jobBinaryFile(777,'SizeConst',trim(getSolverJobName()))
|
maxsize = maxval(sizeStateConst)
|
||||||
! read (777,rec=1) SizeConst
|
allocate(StateConst (1,1,Npoints,maxsize))
|
||||||
! close(777)
|
|
||||||
! maxsize = maxval(SizeConst)
|
call IO_read_jobBinaryFile(777,'convergedStateConst',trim(getSolverJobName()))
|
||||||
! call IO_read_jobBinaryFile(777,'convergedStateConst',trim(getSolverJobName()))
|
k = 0_pInt
|
||||||
! do i =1, Npoints
|
do i =1, Npoints
|
||||||
! do l = 1,SizeConst(1,i)
|
do j = 1,sizeStateConst(1,i)
|
||||||
! read(777,rec=i) StateConst(1,1,i,l)
|
k = k+1_pInt
|
||||||
! enddo
|
read(777,rec=k) StateConst(1,1,i,j)
|
||||||
! enddo
|
enddo
|
||||||
! close(777)
|
enddo
|
||||||
|
close(777)
|
||||||
|
|
||||||
|
call IO_write_jobBinaryFile(777,'convergedStateConst')
|
||||||
|
k = 0_pInt
|
||||||
|
do i = 1,NpointsNew
|
||||||
|
do j = 1,sizeStateConst(1,i)
|
||||||
|
k=k+1_pInt
|
||||||
|
write(777,rec=k) StateConst(1,1,indices(i),j)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
close (777)
|
||||||
|
deallocate(sizeStateConst)
|
||||||
|
deallocate(StateConst)
|
||||||
|
|
||||||
|
!----------------------------------------------------------------------------
|
||||||
|
allocate(sizeStateHomog(1,Npoints))
|
||||||
|
call IO_read_jobBinaryFile(777,'sizeStateHomog',trim(getSolverJobName()),size(sizeStateHomog))
|
||||||
|
read (777,rec=1) sizeStateHomog
|
||||||
|
close (777)
|
||||||
|
maxsize = maxval(sizeStateHomog)
|
||||||
|
allocate(stateHomog (1,1,Npoints,maxsize))
|
||||||
|
|
||||||
|
call IO_read_jobBinaryFile(777,'convergedStateHomog',trim(getSolverJobName()))
|
||||||
|
k = 0_pInt
|
||||||
|
do i =1, Npoints
|
||||||
|
do j = 1,sizeStateHomog(1,i)
|
||||||
|
k = k+1_pInt
|
||||||
|
read(777,rec=k) stateHomog(1,1,i,j)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
close(777)
|
||||||
|
|
||||||
|
call IO_write_jobBinaryFile(777,'convergedStateHomog')
|
||||||
|
k = 0_pInt
|
||||||
|
do i = 1,NpointsNew
|
||||||
|
do j = 1,sizeStateHomog(1,i)
|
||||||
|
k=k+1_pInt
|
||||||
|
write(777,rec=k) stateHomog(1,1,indices(i),j)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
close (777)
|
||||||
|
deallocate(sizeStateHomog)
|
||||||
|
deallocate(stateHomog)
|
||||||
|
|
||||||
! do i = 1, NpointsNew
|
deallocate(indices)
|
||||||
! do l = 1,SizeConst(1,i)
|
|
||||||
! StateConstNew(1,1,i,l) = StateConst(1,1,indices(i),l)
|
|
||||||
! enddo
|
|
||||||
! enddo
|
|
||||||
|
|
||||||
! call IO_write_jobBinaryFile(777,'convergedStateConst',trim(getSolverJobName()))
|
mesh_regrid = resNew
|
||||||
! m = 0_pInt
|
end function mesh_regrid
|
||||||
! do i = 1,NpointsNew
|
|
||||||
! do l = 1,SizeConst(1,i)
|
|
||||||
! write(777,rec=m) StateConstNew(1,1,i,l)
|
|
||||||
! enddo
|
|
||||||
! enddo
|
|
||||||
! close (777)
|
|
||||||
!----------------------------------------------------------------------------
|
|
||||||
! State homog
|
|
||||||
! call IO_read_jobBinaryFile(777,'convergedStateHomog',FEmodelGeometry)
|
|
||||||
! m = 0_pInt
|
|
||||||
! do k = 1,Npoints;
|
|
||||||
! do l = 1,homogenization_sizeState(j,k)
|
|
||||||
! m = m+1_pInt
|
|
||||||
! read(777,rec=m) stateHomog(1,k)%p(l)
|
|
||||||
! enddo
|
|
||||||
! enddo; enddo
|
|
||||||
! close (777)
|
|
||||||
|
|
||||||
|
|
||||||
end subroutine mesh_regrid
|
|
||||||
|
|
||||||
function mesh_spectral_getDimension(fileUnit)
|
function mesh_spectral_getDimension(fileUnit)
|
||||||
use IO, only: &
|
use IO, only: &
|
||||||
|
|
|
@ -50,9 +50,9 @@ if options.compiler not in compilers:
|
||||||
f2py_compiler = {
|
f2py_compiler = {
|
||||||
'gfortran': 'gnu95 --f90flags="-fno-range-check -xf95-cpp-input -std=f2008 -fall-intrinsics"',
|
'gfortran': 'gnu95 --f90flags="-fno-range-check -xf95-cpp-input -std=f2008 -fall-intrinsics"',
|
||||||
'gnu95': 'gnu95 --f90flags="-fno-range-check -xf95-cpp-input -std=f2008 -fall-intrinsics"',
|
'gnu95': 'gnu95 --f90flags="-fno-range-check -xf95-cpp-input -std=f2008 -fall-intrinsics"',
|
||||||
'intel32': 'intel --f90flags="-fpp -stand f03 -diag-disable 5268"',
|
'intel32': 'intel --f90flags="-fpp -stand f03 -diag-disable 5268 -assume byterecl"',
|
||||||
'intel': 'intelem --f90flags="-fpp -stand f03 -diag-disable 5268"',
|
'intel': 'intelem --f90flags="-fpp -stand f03 -diag-disable 5268 -assume byterecl"',
|
||||||
'ifort': 'intelem --f90flags="-fpp -stand f03 -diag-disable 5268"',
|
'ifort': 'intelem --f90flags="-fpp -stand f03 -diag-disable 5268 -assume byterecl"',
|
||||||
}[options.compiler]
|
}[options.compiler]
|
||||||
compiler = {
|
compiler = {
|
||||||
'gfortran': 'gfortran',
|
'gfortran': 'gfortran',
|
||||||
|
|
Loading…
Reference in New Issue