Fix stress calculation

development
Alex Selimov 3 years ago
parent 586c1f002c
commit 8eac9be895

@ -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

@ -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

Loading…
Cancel
Save