support setting electron spin and radius with the set command
This commit is contained in:
19
src/set.cpp
19
src/set.cpp
@ -976,6 +976,8 @@ void Set::set(int keyword)
|
||||
// set magnetic moments
|
||||
|
||||
else if (keyword == SPIN_ATOM) {
|
||||
if (dvalue < 0.0)
|
||||
error->one(FLERR,"Incorrect value for atomic spin magnitude: {}", dvalue);
|
||||
double **sp = atom->sp;
|
||||
double inorm = 1.0/sqrt(xvalue*xvalue+yvalue*yvalue+zvalue*zvalue);
|
||||
sp[i][0] = inorm*xvalue;
|
||||
@ -984,6 +986,23 @@ void Set::set(int keyword)
|
||||
sp[i][3] = dvalue;
|
||||
}
|
||||
|
||||
// set electron radius
|
||||
|
||||
else if (keyword == RADIUS_ELECTRON) {
|
||||
atom->eradius[i] = dvalue;
|
||||
if (dvalue < 0.0)
|
||||
error->one(FLERR,"Incorrect value for electron radius: {}", dvalue);
|
||||
}
|
||||
|
||||
// set electron spin
|
||||
|
||||
else if (keyword == SPIN_ELECTRON) {
|
||||
if ((dvalue == -1) || (dvalue == 1) || (dvalue == 0) || (dvalue == 2) || (dvalue == 3))
|
||||
atom->spin[i] = (int)dvalue;
|
||||
else
|
||||
error->one(FLERR,"Incorrect value for electron spin: {}", dvalue);
|
||||
}
|
||||
|
||||
// set quaternion orientation of ellipsoid or tri or body particle or sphere/bpm
|
||||
// enforce quat rotation vector in z dir for 2d systems
|
||||
|
||||
|
||||
Reference in New Issue
Block a user