diff --git a/doc/src/set.rst b/doc/src/set.rst index c6c44ceb45..3d970d7044 100644 --- a/doc/src/set.rst +++ b/doc/src/set.rst @@ -16,9 +16,10 @@ Syntax * keyword = *type* or *type/fraction* or *type/ratio* or *type/subset* or *mol* or *x* or *y* or *z* or *vx* or *vy* or *vz* or *charge* or *dipole* or *dipole/random* or *quat* or *spin/atom* or *spin/atom/random* or - *quat* or *quat/random* or *diameter* or *shape* or - *length* or *tri* or *theta* or *theta/random* or *angmom* or - *omega* or *mass* or *density* or *density/disc* or + *spin/electron* or *radius/electron* or + *quat* or *quat/random* or *diameter* or *shape* or *length* or *tri* or + *theta* or *theta/random* or *angmom* or *omega* or + *mass* or *density* or *density/disc* or *volume* or *image* or *bond* or *angle* or *dihedral* or *improper* or *sph/e* or *sph/cv* or *sph/rho* or *smd/contact/radius* or *smd/mass/density* or *dpd/theta* or @@ -62,6 +63,10 @@ Syntax *spin/atom/random* value = seed Dlen seed = random # seed (positive integer) for magnetic spin orientations Dlen = magnitude of magnetic spin vector (in Bohr magneton's unit) + *radius/electron* values = eradius + eradius = electron radius (or fixed-core radius) (distance units) + *spin/electron* value = espin + espin = electron spin (+1/-1), 0 = nuclei, 2 = fixed-core, 3 = pseudo-cores (i.e. ECP) *quat* values = a b c theta a,b,c = unit vector to rotate particle around via right-hand rule theta = rotation angle (degrees) @@ -290,6 +295,16 @@ Keyword *spin/atom/random* randomizes the orientation of the magnetic spin vectors for the selected atoms and sets the magnitude of each to the specified *Dlen* value. This keyword was previously called *spin/random*. +.. versionadded:: TBD + +Keyword *radius/electron* uses the specified value to set the radius of +electrons or fixed cores. + +.. versionadded:: TBD + +Keyword *spin/electron* sets the spin of an electron (+/- 1) or indicates +nuclei (=0), fixed-cores (=2), or pseudo-cores (= 3). + Keyword *quat* uses the specified values to create a quaternion (4-vector) that represents the orientation of the selected atoms. The particles must define a quaternion for their orientation diff --git a/src/set.cpp b/src/set.cpp index 601bdd9e56..80c524f8a4 100644 --- a/src/set.cpp +++ b/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