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]);
}
}

View File

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