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?
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?
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.
axel.
Also, the aspherical styles (e.g. ellipsoids) do not
store an omega. They store a fully general angmom
vector and derive an omega from it. So fix nve/asphere
would have to work with angmom.
Steve
I replace “int omega[3]” with"double **omega=atom->omega",and use “omega[i][j]” derived from"mq_to_omega" to update “mu[i][j]”.And then i donnot know how to use this update.I mean i try to run the
procedure and dump the “mux muy muz” of each atom,and i found that the value did not change which means it still did not update the dipole althought i had add the code.So i am curious about what to do next to apply the update.