Used existing helper functions to make codes more consise

This commit is contained in:
Trung Nguyen
2020-09-16 15:40:04 -05:00
parent ae68becf4a
commit dfcdb61d87
2 changed files with 4 additions and 24 deletions

View File

@ -994,12 +994,7 @@ void FixRigid::apply_langevin_thermostat()
// convert omega from space frame to body frame
wbody[0] = omega[i][0]*ex_space[i][0] + omega[i][1]*ex_space[i][1] +
omega[i][2]*ex_space[i][2];
wbody[1] = omega[i][0]*ey_space[i][0] + omega[i][1]*ey_space[i][1] +
omega[i][2]*ey_space[i][2];
wbody[2] = omega[i][0]*ez_space[i][0] + omega[i][1]*ez_space[i][1] +
omega[i][2]*ez_space[i][2];
MathExtra::transpose_matvec(ex_space[i],ey_space[i],ez_space[i],omega[i],wbody);
// compute langevin torques in the body frame
@ -1012,12 +1007,7 @@ void FixRigid::apply_langevin_thermostat()
// convert langevin torques from body frame back to space frame
langextra[i][3] = tbody[0]*ex_space[i][0] + tbody[1]*ey_space[i][0] +
tbody[2]*ez_space[i][0];
langextra[i][4] = tbody[0]*ex_space[i][1] + tbody[1]*ey_space[i][1] +
tbody[2]*ez_space[i][1];
langextra[i][5] = tbody[0]*ex_space[i][2] + tbody[1]*ey_space[i][2] +
tbody[2]*ez_space[i][2];
MathExtra::matvec(ex_space[i],ey_space[i],ez_space[i],tbody,&langextra[i][3]);
}
}