better and consistent variable name
This commit is contained in:
parent
1f86111f57
commit
7b1080fdb7
|
@ -253,7 +253,7 @@ end subroutine grid_damage_spectral_forward
|
|||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief forms the spectral damage residual vector
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
subroutine formResidual(in,x_scal,f_scal,dummy,dummy_err)
|
||||
subroutine formResidual(in,x_scal,r,dummy,dummy_err)
|
||||
|
||||
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: &
|
||||
in
|
||||
|
@ -262,7 +262,7 @@ subroutine formResidual(in,x_scal,f_scal,dummy,dummy_err)
|
|||
x_scal
|
||||
PetscScalar, dimension( &
|
||||
X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: &
|
||||
f_scal
|
||||
r
|
||||
PetscObject :: dummy
|
||||
PetscErrorCode :: dummy_err
|
||||
integer :: i, j, k, ce
|
||||
|
@ -305,7 +305,7 @@ subroutine formResidual(in,x_scal,f_scal,dummy,dummy_err)
|
|||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! constructing residual
|
||||
f_scal = scalarField_real(1:grid(1),1:grid(2),1:grid3) - phi_current
|
||||
r = scalarField_real(1:grid(1),1:grid(2),1:grid3) - phi_current
|
||||
|
||||
end subroutine formResidual
|
||||
|
||||
|
|
|
@ -521,7 +521,7 @@ subroutine formResidual(da_local,x_local, &
|
|||
|
||||
DM :: da_local
|
||||
Vec :: x_local, f_local
|
||||
PetscScalar, pointer,dimension(:,:,:,:) :: x_scal, f_scal
|
||||
PetscScalar, pointer,dimension(:,:,:,:) :: x_scal, r
|
||||
PetscScalar, dimension(8,3) :: x_elem, f_elem
|
||||
PetscInt :: i, ii, j, jj, k, kk, ctr, ele
|
||||
PetscInt :: &
|
||||
|
@ -580,7 +580,7 @@ subroutine formResidual(da_local,x_local, &
|
|||
!--------------------------------------------------------------------------------------------------
|
||||
! constructing residual
|
||||
call VecSet(f_local,0.0_pReal,err_PETSc);CHKERRQ(err_PETSc)
|
||||
call DMDAVecGetArrayF90(da_local,f_local,f_scal,err_PETSc);CHKERRQ(err_PETSc)
|
||||
call DMDAVecGetArrayF90(da_local,f_local,r,err_PETSc);CHKERRQ(err_PETSc)
|
||||
call DMDAVecGetArrayF90(da_local,x_local,x_scal,err_PETSc);CHKERRQ(err_PETSc)
|
||||
ele = 0
|
||||
do k = grid3offset+1, grid3offset+grid3; do j = 1, grid(2); do i = 1, grid(1)
|
||||
|
@ -597,28 +597,28 @@ subroutine formResidual(da_local,x_local, &
|
|||
ctr = 0
|
||||
do kk = -1, 0; do jj = -1, 0; do ii = -1, 0
|
||||
ctr = ctr + 1
|
||||
f_scal(0:2,i+ii,j+jj,k+kk) = f_scal(0:2,i+ii,j+jj,k+kk) + f_elem(ctr,1:3)
|
||||
r(0:2,i+ii,j+jj,k+kk) = r(0:2,i+ii,j+jj,k+kk) + f_elem(ctr,1:3)
|
||||
enddo; enddo; enddo
|
||||
enddo; enddo; enddo
|
||||
call DMDAVecRestoreArrayF90(da_local,x_local,x_scal,err_PETSc);CHKERRQ(err_PETSc)
|
||||
call DMDAVecRestoreArrayF90(da_local,f_local,f_scal,err_PETSc);CHKERRQ(err_PETSc)
|
||||
call DMDAVecRestoreArrayF90(da_local,f_local,r,err_PETSc);CHKERRQ(err_PETSc)
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! applying boundary conditions
|
||||
call DMDAVecGetArrayF90(da_local,f_local,f_scal,err_PETSc);CHKERRQ(err_PETSc)
|
||||
call DMDAVecGetArrayF90(da_local,f_local,r,err_PETSc);CHKERRQ(err_PETSc)
|
||||
if (grid3offset == 0) then
|
||||
f_scal(0:2,0, 0, 0) = 0.0_pReal
|
||||
f_scal(0:2,grid(1),0, 0) = 0.0_pReal
|
||||
f_scal(0:2,0, grid(2),0) = 0.0_pReal
|
||||
f_scal(0:2,grid(1),grid(2),0) = 0.0_pReal
|
||||
r(0:2,0, 0, 0) = 0.0_pReal
|
||||
r(0:2,grid(1),0, 0) = 0.0_pReal
|
||||
r(0:2,0, grid(2),0) = 0.0_pReal
|
||||
r(0:2,grid(1),grid(2),0) = 0.0_pReal
|
||||
end if
|
||||
if (grid3+grid3offset == grid(3)) then
|
||||
f_scal(0:2,0, 0, grid(3)) = 0.0_pReal
|
||||
f_scal(0:2,grid(1),0, grid(3)) = 0.0_pReal
|
||||
f_scal(0:2,0, grid(2),grid(3)) = 0.0_pReal
|
||||
f_scal(0:2,grid(1),grid(2),grid(3)) = 0.0_pReal
|
||||
r(0:2,0, 0, grid(3)) = 0.0_pReal
|
||||
r(0:2,grid(1),0, grid(3)) = 0.0_pReal
|
||||
r(0:2,0, grid(2),grid(3)) = 0.0_pReal
|
||||
r(0:2,grid(1),grid(2),grid(3)) = 0.0_pReal
|
||||
end if
|
||||
call DMDAVecRestoreArrayF90(da_local,f_local,f_scal,err_PETSc);CHKERRQ(err_PETSc)
|
||||
call DMDAVecRestoreArrayF90(da_local,f_local,r,err_PETSc);CHKERRQ(err_PETSc)
|
||||
|
||||
end subroutine formResidual
|
||||
|
||||
|
|
|
@ -465,13 +465,13 @@ end subroutine converged
|
|||
!> @brief forms the residual vector
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
subroutine formResidual(in, F, &
|
||||
residuum, dummy, err_PETSc)
|
||||
r, dummy, err_PETSc)
|
||||
|
||||
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: in !< DMDA info (needs to be named "in" for macros like XRANGE to work)
|
||||
PetscScalar, dimension(3,3,XG_RANGE,YG_RANGE,ZG_RANGE), &
|
||||
intent(in) :: F !< deformation gradient field
|
||||
PetscScalar, dimension(3,3,X_RANGE,Y_RANGE,Z_RANGE), &
|
||||
intent(out) :: residuum !< residuum field
|
||||
intent(out) :: r !< residuum field
|
||||
real(pReal), dimension(3,3) :: &
|
||||
deltaF_aim
|
||||
PetscInt :: &
|
||||
|
@ -500,7 +500,7 @@ subroutine formResidual(in, F, &
|
|||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! evaluate constitutive response
|
||||
call utilities_constitutiveResponse(residuum, & ! "residuum" gets field of first PK stress (to save memory)
|
||||
call utilities_constitutiveResponse(r, & ! residuum gets field of first PK stress (to save memory)
|
||||
P_av,C_volAvg,C_minMaxAvg, &
|
||||
F,params%Delta_t,params%rotation_BC)
|
||||
call MPI_Allreduce(MPI_IN_PLACE,terminallyIll,1_MPI_INTEGER_KIND,MPI_LOGICAL,MPI_LOR,MPI_COMM_WORLD,err_MPI)
|
||||
|
@ -515,7 +515,7 @@ subroutine formResidual(in, F, &
|
|||
!--------------------------------------------------------------------------------------------------
|
||||
! updated deformation gradient using fix point algorithm of basic scheme
|
||||
tensorField_real = 0.0_pReal
|
||||
tensorField_real(1:3,1:3,1:grid(1),1:grid(2),1:grid3) = residuum ! store fPK field for subsequent FFT forward transform
|
||||
tensorField_real(1:3,1:3,1:grid(1),1:grid(2),1:grid3) = r ! store fPK field for subsequent FFT forward transform
|
||||
call utilities_FFTtensorForward ! FFT forward of global "tensorField_real"
|
||||
err_div = utilities_divergenceRMS() ! divRMS of tensorField_fourier for later use
|
||||
call utilities_fourierGammaConvolution(params%rotation_BC%rotate(deltaF_aim,active=.true.)) ! convolution of Gamma and tensorField_fourier
|
||||
|
@ -523,7 +523,7 @@ subroutine formResidual(in, F, &
|
|||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! constructing residual
|
||||
residuum = tensorField_real(1:3,1:3,1:grid(1),1:grid(2),1:grid3) ! Gamma*P gives correction towards div(P) = 0, so needs to be zero, too
|
||||
r = tensorField_real(1:3,1:3,1:grid(1),1:grid(2),1:grid3) ! Gamma*P gives correction towards div(P) = 0, so needs to be zero, too
|
||||
|
||||
end subroutine formResidual
|
||||
|
||||
|
|
|
@ -531,13 +531,13 @@ end subroutine converged
|
|||
!> @brief forms the residual vector
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
subroutine formResidual(in, FandF_tau, &
|
||||
residuum, dummy,err_PETSc)
|
||||
r, dummy,err_PETSc)
|
||||
|
||||
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: in !< DMDA info (needs to be named "in" for macros like XRANGE to work)
|
||||
PetscScalar, dimension(3,3,2,XG_RANGE,YG_RANGE,ZG_RANGE), &
|
||||
target, intent(in) :: FandF_tau
|
||||
PetscScalar, dimension(3,3,2,X_RANGE,Y_RANGE,Z_RANGE),&
|
||||
target, intent(out) :: residuum !< residuum field
|
||||
target, intent(out) :: r !< residuum field
|
||||
PetscScalar, pointer, dimension(:,:,:,:,:) :: &
|
||||
F, &
|
||||
F_tau, &
|
||||
|
@ -558,10 +558,10 @@ subroutine formResidual(in, FandF_tau, &
|
|||
XG_RANGE,YG_RANGE,ZG_RANGE)
|
||||
F_tau => FandF_tau(1:3,1:3,2,&
|
||||
XG_RANGE,YG_RANGE,ZG_RANGE)
|
||||
residual_F => residuum(1:3,1:3,1,&
|
||||
X_RANGE, Y_RANGE, Z_RANGE)
|
||||
residual_F_tau => residuum(1:3,1:3,2,&
|
||||
X_RANGE, Y_RANGE, Z_RANGE)
|
||||
residual_F => r(1:3,1:3,1,&
|
||||
X_RANGE, Y_RANGE, Z_RANGE)
|
||||
residual_F_tau => r(1:3,1:3,2,&
|
||||
X_RANGE, Y_RANGE, Z_RANGE)
|
||||
|
||||
F_av = sum(sum(sum(F,dim=5),dim=4),dim=3) * wgt
|
||||
call MPI_Allreduce(MPI_IN_PLACE,F_av,9_MPI_INTEGER_KIND,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD,err_MPI)
|
||||
|
|
|
@ -250,7 +250,7 @@ end subroutine grid_thermal_spectral_forward
|
|||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief forms the spectral thermal residual vector
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
subroutine formResidual(in,x_scal,f_scal,dummy,dummy_err)
|
||||
subroutine formResidual(in,x_scal,r,dummy,dummy_err)
|
||||
|
||||
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: &
|
||||
in
|
||||
|
@ -259,7 +259,7 @@ subroutine formResidual(in,x_scal,f_scal,dummy,dummy_err)
|
|||
x_scal
|
||||
PetscScalar, dimension( &
|
||||
X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: &
|
||||
f_scal
|
||||
r
|
||||
PetscObject :: dummy
|
||||
PetscErrorCode :: dummy_err
|
||||
integer :: i, j, k, ce
|
||||
|
@ -296,7 +296,7 @@ subroutine formResidual(in,x_scal,f_scal,dummy,dummy_err)
|
|||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! constructing residual
|
||||
f_scal = T_current - scalarField_real(1:grid(1),1:grid(2),1:grid3)
|
||||
r = T_current - scalarField_real(1:grid(1),1:grid(2),1:grid3)
|
||||
|
||||
end subroutine formResidual
|
||||
|
||||
|
|
Loading…
Reference in New Issue