From 8eac9be895b8d51a097fbd8ef9481ec58e492449 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Fri, 23 Jul 2021 10:53:47 -0400 Subject: [PATCH] Fix stress calculation --- src/io.f90 | 2 +- src/mode_calc.f90 | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/io.f90 b/src/io.f90 index 62a2687..193e10b 100644 --- a/src/io.f90 +++ b/src/io.f90 @@ -678,7 +678,7 @@ module io ! stop 3 ! end if select case(trim(adjustl(mode))) - case('--calc', '--convert','--metric') + case('--calc', '--convert','--metric', '--da') infilenum = infilenum+1 infiles(infilenum) = temp_infile case default diff --git a/src/mode_calc.f90 b/src/mode_calc.f90 index 497c90b..25086a3 100644 --- a/src/mode_calc.f90 +++ b/src/mode_calc.f90 @@ -67,23 +67,19 @@ module mode_calc calculated = 0 do i = 1, atom_num do j = 1, 6 - calculated(j) = calculated(j) + virial_atom(j, i) + calculated(j) = calculated(j) - virial_atom(j, i) end do end do !Sum the nodal virials do i = 1, ele_num - avg_virial(:) = 0 do inod = 1, ng_node(lat_ele(i)) do ibasis = 1, basisnum(lat_ele(i)) do j = 1,6 - avg_virial(j) = avg_virial(j) + virial_node(j,ibasis,inod,i)/(basisnum(lat_ele(i))*ng_node(lat_ele(i))) + calculated(j) = calculated(j) - virial_node(j,ibasis,inod,i)*(size_ele(i)**3)/ng_node(lat_ele(i)) end do - end do + end do end do - - !Now add the total virial from the element - calculated = calculated + avg_virial*(esize**3.0_dp) end do !Now calculate the total box virial and convert to GPa