petsc macros can be omitted with use of preal

This commit is contained in:
Daniel Otto de Mentock 2022-12-05 10:38:36 +01:00
parent a2f898a94c
commit c2e78158c8
4 changed files with 26 additions and 33 deletions

View File

@ -288,15 +288,13 @@ end subroutine grid_damage_spectral_forward
!--------------------------------------------------------------------------------------------------
!> @brief Construct the residual vector.
!--------------------------------------------------------------------------------------------------
subroutine formResidual(in,x_scal,r,dummy,err_PETSc)
subroutine formResidual(residual_subdomain,x_scal,r,dummy,err_PETSc)
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: &
in
real(pReal), dimension( &
XG_RANGE,YG_RANGE,ZG_RANGE), intent(in) :: &
residual_subdomain
real(pReal), dimension(cells(1),cells(2),cells3), intent(in) :: &
x_scal
real(pReal), dimension( &
X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: &
real(pReal), dimension(cells(1),cells(2),cells3), intent(out) :: &
r !< residual
PetscObject :: dummy
PetscErrorCode, intent(out) :: err_PETSc

View File

@ -496,14 +496,15 @@ end subroutine converged
!--------------------------------------------------------------------------------------------------
!> @brief Construct the residual vector.
!--------------------------------------------------------------------------------------------------
subroutine formResidual(in, F, &
subroutine formResidual(residual_subdomain, F, &
r, dummy, err_PETSc)
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: in !< DMDA info (needs to be named "in" for macros like XRANGE to work)
real(pReal), dimension(3,3,XG_RANGE,YG_RANGE,ZG_RANGE), &
intent(in) :: F !< deformation gradient field
real(pReal), dimension(3,3,X_RANGE,Y_RANGE,Z_RANGE), &
intent(out) :: r !< residuum field
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: &
residual_subdomain !< DMDA info (needs to be named "in" for macros like XRANGE to work)
real(pReal), dimension(3,3,cells(1),cells(2),cells3), intent(in) :: &
F !< deformation gradient field
real(pReal), dimension(3,3,cells(1),cells(2),cells3), intent(out) :: &
r !< residuum field
PetscObject :: dummy
PetscErrorCode :: err_PETSc

View File

@ -558,14 +558,14 @@ end subroutine converged
!--------------------------------------------------------------------------------------------------
!> @brief Construct the residual vector.
!--------------------------------------------------------------------------------------------------
subroutine formResidual(in, FandF_tau, &
subroutine formResidual(residual_subdomain, FandF_tau, &
r, dummy,err_PETSc)
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: in !< DMDA info (needs to be named "in" for macros like XRANGE to work)
real(pReal), dimension(3,3,2,XG_RANGE,YG_RANGE,ZG_RANGE), &
target, intent(in) :: FandF_tau
real(pReal), dimension(3,3,2,X_RANGE,Y_RANGE,Z_RANGE),&
target, intent(out) :: r !< residuum field
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: residual_subdomain !< DMDA info (needs to be named "in" for macros like XRANGE to work)
real(pReal), dimension(3,3,2,cells(1),cells(2),cells3), target, intent(in) :: &
FandF_tau !< deformation gradient field
real(pReal), dimension(3,3,2,cells(1),cells(2),cells3), target, intent(out) :: &
r !< residuum field
PetscObject :: dummy
PetscErrorCode :: err_PETSc
@ -582,14 +582,10 @@ subroutine formResidual(in, FandF_tau, &
i, j, k, e
F => FandF_tau(1:3,1:3,1,&
XG_RANGE,YG_RANGE,ZG_RANGE)
F_tau => FandF_tau(1:3,1:3,2,&
XG_RANGE,YG_RANGE,ZG_RANGE)
r_F => r(1:3,1:3,1,&
X_RANGE, Y_RANGE, Z_RANGE)
r_F_tau => r(1:3,1:3,2,&
X_RANGE, Y_RANGE, Z_RANGE)
F => FandF_tau(1:3,1:3,1,1:cells(1),1:cells(2),1:cells3)
F_tau => FandF_tau(1:3,1:3,2,1:cells(1),1:cells(2),1:cells3)
r_F => r(1:3,1:3,1,1:cells(1),1:cells(2),1:cells3)
r_F_tau => r(1:3,1:3,2,1:cells(1),1:cells(2),1:cells3)
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)

View File

@ -315,16 +315,14 @@ end subroutine grid_thermal_spectral_restartWrite
!--------------------------------------------------------------------------------------------------
!> @brief forms the spectral thermal residual vector
!--------------------------------------------------------------------------------------------------
subroutine formResidual(in,x_scal,r,dummy,err_PETSc)
subroutine formResidual(residual_subdomain,x_scal,r,dummy,err_PETSc)
DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: &
in
real(pReal), dimension( &
XG_RANGE,YG_RANGE,ZG_RANGE), intent(in) :: &
residual_subdomain
real(pReal), dimension(cells(1),cells(2),cells3), intent(in) :: &
x_scal
real(pReal), dimension( &
X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: &
r !< residual
real(pReal), dimension(cells(1),cells(2),cells3), intent(out) :: &
r !< residual
PetscObject :: dummy
PetscErrorCode, intent(out) :: err_PETSc