From b5a11f9d3148f68fbc6a35f348ed50240568b734 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 30 Jul 2013 21:04:41 +0000 Subject: [PATCH] fixed bug in AL, weakened correction slightly --- code/DAMASK_spectral_solverAL.f90 | 5 +++-- code/DAMASK_spectral_solverPolarisation.f90 | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/DAMASK_spectral_solverAL.f90 b/code/DAMASK_spectral_solverAL.f90 index ec8261f15..ca3dc772f 100755 --- a/code/DAMASK_spectral_solverAL.f90 +++ b/code/DAMASK_spectral_solverAL.f90 @@ -571,6 +571,7 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) !-------------------------------------------------------------------------------------------------- ! evaluate constitutive response + P_avLastEval = P_av call Utilities_constitutiveResponse(F_lastInc,F - residual_F_lambda/polarBeta,params%temperature,params%timeinc, & residual_F,C_volAvg,C_minMaxAvg,P_av,ForwardData,params%rotation_BC) ForwardData = .False. @@ -578,9 +579,9 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) !-------------------------------------------------------------------------------------------------- ! stress BC handling write(6,'(/,a)') ' ... correcting F to fullfill stress BC ....................................' - correctionFactor = (cos((1.0-500.0_pReal**(-sum((P_av-P_avLastEval)**2.0_pReal)/& ! only correct when averages stress of last two calls is close + correctionFactor = (cos((1.0-10000.0_pReal**(-sum((P_av-P_avLastEval)**2.0_pReal)/& ! only correct when averages stress of last two calls doesn't strongly deviate sum(P_av**2.0_pReal)))*PI)+1.0)/2.0_pReal - write(6,'(/,a,f8.2)') ' stress BC correction factor = ', correctionFactor + write(6,'(/,a,f10.4)') ' stress BC correction factor = ', correctionFactor F_aim = F_aim - correctionFactor *math_mul3333xx33(S, ((P_av - params%P_BC))) ! S = 0.0 for no bc err_stress = maxval(abs(mask_stress * (P_av - params%P_BC))) ! mask = 0.0 for no bc diff --git a/code/DAMASK_spectral_solverPolarisation.f90 b/code/DAMASK_spectral_solverPolarisation.f90 index 2f8d11251..c9860576c 100644 --- a/code/DAMASK_spectral_solverPolarisation.f90 +++ b/code/DAMASK_spectral_solverPolarisation.f90 @@ -580,9 +580,9 @@ subroutine Polarisation_formResidual(in,x_scal,f_scal,dummy,ierr) !-------------------------------------------------------------------------------------------------- ! stress BC handling write(6,'(/,a)') ' ... correcting F to fullfill stress BC ....................................' - correctionFactor = (cos((1.0-500.0_pReal**(-sum((P_av-P_avLastEval)**2.0_pReal)/& ! only correct when averages stress of last two calls is close + correctionFactor = (cos((1.0-10000.0_pReal**(-sum((P_av-P_avLastEval)**2.0_pReal)/& ! only correct when averages stress of last two calls doesn't strongly deviate sum(P_av**2.0_pReal)))*PI)+1.0)/2.0_pReal - write(6,'(/,a,f8.2)') ' stress BC correction factor = ', correctionFactor + write(6,'(/,a,f10.4)') ' stress BC correction factor = ', correctionFactor F_aim = F_aim - correctionFactor *math_mul3333xx33(S, ((P_av - params%P_BC))) ! S = 0.0 for no bc err_stress = maxval(abs(mask_stress * (P_av - params%P_BC))) ! mask = 0.0 for no bc