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

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

From: Axel Kohlmeyer <akohlmey@...24...>
Date: Mon, 20 Nov 2017 12:17:44 -0500

On Mon, Nov 20, 2017 at 10:07 AM, htc <619771202@...1204...> wrote:
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".
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?

​my suggestion is that you either improve your C++ knowledge or find a collaborator that does possess sufficient knowledge and will help you to port the feature from fix nve/sphere to fix nve/asphere.
it won't work by just copying some random bits of code without adapting the style specific data structures and adding the necessary interfaces.



Check out the vibrant tech community on one of the world's most
engaging tech sites,!
lammps-users mailing list

Dr. Axel Kohlmeyer  akohlmey@...12...24...
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.