@@ -312,10 +312,9 @@ function grid_mechanical_FEM_solution(incInfoIn) result(solution)
312
312
PetscErrorCode :: err_PETSc
313
313
SNESConvergedReason :: reason
314
314
315
+
315
316
incInfo = incInfoIn
316
317
317
- !- -------------------------------------------------------------------------------------------------
318
- ! update stiffness (and gamma operator)
319
318
S = utilities_maskedCompliance(params% rotation_BC,params% stress_mask,C_volAvg)
320
319
321
320
call SNESsolve(SNES_mech,PETSC_NULL_VEC,u_PETSc,err_PETSc)
@@ -411,7 +410,7 @@ end subroutine grid_mechanical_FEM_forward
411
410
412
411
413
412
!- -------------------------------------------------------------------------------------------------
414
- ! > @brief Update coordinates
413
+ ! > @brief Update coordinates.
415
414
!- -------------------------------------------------------------------------------------------------
416
415
subroutine grid_mechanical_FEM_updateCoords ()
417
416
@@ -421,7 +420,7 @@ end subroutine grid_mechanical_FEM_updateCoords
421
420
422
421
423
422
!- -------------------------------------------------------------------------------------------------
424
- ! > @brief Write current solver and constitutive data for restart to file
423
+ ! > @brief Write current solver and constitutive data for restart to file.
425
424
!- -------------------------------------------------------------------------------------------------
426
425
subroutine grid_mechanical_FEM_restartWrite ()
427
426
@@ -486,6 +485,7 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,fnorm,reason,dummy,e
486
485
divTol, &
487
486
BCTol
488
487
488
+
489
489
err_div = fnorm* sqrt (wgt)* geomSize(1 )/ scaledGeomSize(1 )/ detJ
490
490
divTol = max (maxval (abs (P_av))* num% eps_div_rtol, num% eps_div_atol)
491
491
BCTol = max (maxval (abs (P_av))* num% eps_stress_rtol, num% eps_stress_atol)
@@ -512,7 +512,7 @@ end subroutine converged
512
512
513
513
514
514
!- -------------------------------------------------------------------------------------------------
515
- ! > @brief forms the residual vector
515
+ ! > @brief Form the residual vector.
516
516
!- -------------------------------------------------------------------------------------------------
517
517
subroutine formResidual (da_local ,x_local , &
518
518
f_local ,dummy ,err_PETSc )
@@ -524,26 +524,25 @@ subroutine formResidual(da_local,x_local, &
524
524
525
525
real (pREAL), pointer ,dimension (:,:,:,:) :: x_scal, r
526
526
real (pREAL), dimension (8 ,3 ) :: x_elem, f_elem
527
- PetscInt :: i, ii, j, jj, k, kk, ctr, ce
528
- PetscInt :: &
529
- PETScIter, &
530
- nfuncs
527
+ PetscInt :: i, ii, j, jj, k, kk, ctr, ce, &
528
+ PETScIter, nfuncs
531
529
integer (MPI_INTEGER_KIND) :: err_MPI
532
530
real (pREAL), dimension (3 ,3 ,3 ,3 ) :: devNull
533
531
532
+
534
533
call SNESGetNumberFunctionEvals(SNES_mech,nfuncs,err_PETSc)
535
534
CHKERRQ(err_PETSc)
536
535
call SNESGetIterationNumber(SNES_mech,PETScIter,err_PETSc)
537
536
CHKERRQ(err_PETSc)
538
537
539
538
540
- if (nfuncs == 0 .and. PETScIter == 0 ) totalIter = - 1 ! new increment
539
+ if (nfuncs == 0 .and. PETScIter == 0 ) totalIter = 0 ! new increment
541
540
542
541
!- -------------------------------------------------------------------------------------------------
543
542
! begin of new iteration
544
543
newIteration: if (totalIter <= PETScIter) then
545
544
totalIter = totalIter + 1
546
- print ' (1x,a,3(a,i0))' , trim (incInfo), ' @ Iteration ' , num% itmin, ' ≤' ,totalIter+1 , ' ≤' , num% itmax
545
+ print ' (1x,a,3(a,i0))' , trim (incInfo), ' @ Iteration ' , num% itmin, ' ≤' ,totalIter, ' ≤' , num% itmax
547
546
if (any (dNeq(params% rotation_BC% asQuaternion(), real ([1.0 , 0.0 , 0.0 , 0.0 ],pREAL)))) &
548
547
print ' (/,1x,a,/,2(3(f12.7,1x)/),3(f12.7,1x))' , &
549
548
' deformation gradient aim (lab) =' , transpose (params% rotation_BC% rotate(F_aim,active= .true. ))
0 commit comments