LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] about to update the dipole in "fix nve asphere"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] about to update the dipole in "fix nve asphere"


From: "htc" <619771202@...1204...>
Date: Mon, 20 Nov 2017 23:07:32 +0800

i read the command 'fix nve shpere' and found that dipole can be updated relate to omega,so i think it may be the same for the command"fix nve asphere"to update dipole  if i use the code come from "fix nve asphere".
this:
if (mu[i][3] > 0.0) 
 {
 g[0] = mu[i][0] + dtv * (omega[i][1] * mu[i][2] - omega[i][2] * mu[i][1]);
 g[1] = mu[i][1] + dtv * (omega[i][2] * mu[i][0] - omega[i][0] * mu[i][2]);
 g[2] = mu[i][2] + dtv * (omega[i][0] * mu[i][1] - omega[i][1] * mu[i][0]);
 msq = g[0] * g[0] + g[1] * g[1] + g[2] * g[2];
 scale = mu[i][3] / sqrt(msq);
 mu[i][0] = g[0] * scale;
 mu[i][1] = g[1] * scale;
 mu[i][2] = g[2] * scale;
 }
i wonder if my judgement is right or not.And i hope you are not angry because i thought this question may be a little foolish.I am not too familliar with c++,so can you provide some suggestion?