TABLE OF CONTENTS
ABINIT/fcart2fred [ Functions ]
NAME
fcart2fred
FUNCTION
Convert cartesian forces into reduced forces
COPYRIGHT
Copyright (C) 1998-2017 ABINIT group (DCA, XG, GMR, FJ, MT) This file is distributed under the terms of the GNU General Public License, see ~abinit/COPYING or http://www.gnu.org/copyleft/gpl.txt . For the initials of contributors, see ~abinit/doc/developers/contributors.txt.
INPUTS
fcart(3,natom)=forces in cartesian coordinates (Ha/Bohr) natom=Number of atoms in the unitary cell rprimd(3,3)=dimensional primitive
OUTPUT
fred(3,natom)=symmetrized grtn = d(etotal)/d(xred)
SIDE EFFECTS
NOTES
Unlike fred, fcart has been corrected by enforcing the translational symmetry, namely that the sum of force on all atoms is zero.
PARENTS
gstateimg,m_abihist,m_effective_potential,m_mep,mover,prec_simple pred_bfgs,pred_delocint,pred_lbfgs,pred_verlet,prtxfase
CHILDREN
SOURCE
40 #if defined HAVE_CONFIG_H 41 #include "config.h" 42 #endif 43 44 #include "abi_common.h" 45 46 47 subroutine fcart2fred(fcart,fred,rprimd,natom) 48 49 use defs_basis 50 use m_profiling_abi 51 52 !This section has been created automatically by the script Abilint (TD). 53 !Do not modify the following lines by hand. 54 #undef ABI_FUNC 55 #define ABI_FUNC 'fcart2fred' 56 !End of the abilint section 57 58 implicit none 59 60 !Arguments ------------------------------------ 61 !scalars 62 integer,intent(in) :: natom 63 !arrays 64 real(dp),intent(in) :: fcart(3,natom) 65 real(dp),intent(out) :: fred(3,natom) 66 real(dp),intent(in) :: rprimd(3,3) 67 68 !Local variables------------------------------- 69 !scalars 70 integer :: iatom,mu 71 72 ! ************************************************************************* 73 74 !MT, april 2012: the coding was not consistent with fred2fcart 75 do iatom=1,natom 76 do mu=1,3 77 fred(mu,iatom)= - (rprimd(1,mu)*fcart(1,iatom)+& 78 & rprimd(2,mu)*fcart(2,iatom)+& 79 & rprimd(3,mu)*fcart(3,iatom)) 80 end do 81 end do 82 83 !Previous version 84 !do iatom=1,natom 85 !do mu=1,3 86 !fred(mu,iatom)= - (rprimd(mu,1)*fcart(1,iatom)+& 87 !& rprimd(mu,2)*fcart(2,iatom)+& 88 !& rprimd(mu,3)*fcart(3,iatom)) 89 !end do 90 !end do 91 92 end subroutine fcart2fred