From 20da5663c0b233d839c31b34f30a325faeadb955 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 19 Nov 2022 08:14:38 +0100 Subject: [PATCH] simplified, avoid intermediate writes --- src/grid/grid_damage_spectral.f90 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/grid/grid_damage_spectral.f90 b/src/grid/grid_damage_spectral.f90 index 51804d52b..fc1defac3 100644 --- a/src/grid/grid_damage_spectral.f90 +++ b/src/grid/grid_damage_spectral.f90 @@ -330,14 +330,10 @@ subroutine formResidual(in,x_scal,r,dummy,err_PETSc) call utilities_fourierGreenConvolution(K_ref, mu_ref, params%Delta_t) call utilities_FFTscalarBackward - where(scalarField_real(1:cells(1),1:cells(2),1:cells3) > phi_lastInc) & - scalarField_real(1:cells(1),1:cells(2),1:cells3) = phi_lastInc - where(scalarField_real(1:cells(1),1:cells(2),1:cells3) < num%residualStiffness) & - scalarField_real(1:cells(1),1:cells(2),1:cells3) = num%residualStiffness - !-------------------------------------------------------------------------------------------------- ! constructing residual - r = scalarField_real(1:cells(1),1:cells(2),1:cells3) - phi_current + r = max(min(scalarField_real(1:cells(1),1:cells(2),1:cells3),phi_lastInc),num%residualStiffness) & + - phi_current err_PETSc = 0 end subroutine formResidual