diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index 6d8dec2690..6932620cfe 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -385,15 +385,15 @@ void PairLubricate::init_style() int irequest = neighbor->request(this); - // require that atom radii are identical within each type require - // monodisperse system with same radii for all types + // require that atom radii are identical within each type + // require monodisperse system with same radii for all types double rad,radtype; for (int i = 1; i <= atom->ntypes; i++) { if (!atom->radius_consistency(i,radtype)) - error->all("Pair colloid requires atoms with same type have same radius"); + error->all("Pair lubricate requires monodisperse particles"); if (i > 1 && radtype != rad) - error->all("Pair colloid requires mono-disperse particles"); + error->all("Pair lubricate requires monodisperse particles"); rad = radtype; } } diff --git a/src/COLLOID/pair_yukawa_colloid.cpp b/src/COLLOID/pair_yukawa_colloid.cpp index 46f66624ee..734be8608e 100644 --- a/src/COLLOID/pair_yukawa_colloid.cpp +++ b/src/COLLOID/pair_yukawa_colloid.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Randy Schunk (SNL) + Contributing authors: Randy Schunk (Sandia) ------------------------------------------------------------------------- */ #include "math.h" diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index b8e711f142..675a1b15b6 100755 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -767,7 +767,7 @@ void AtomVecEllipsoid::unpack_border(int n, int first, double *buf) type[i] = static_cast (buf[m++]); mask[i] = static_cast (buf[m++]); ellipsoid[i] = static_cast (buf[m++]); - if (ellipsoid[i] < 0) ellipsoid[i] = 0; + if (ellipsoid[i] == 0) ellipsoid[i] = -1; else { j = nlocal_bonus + nghost_bonus; if (j == nmax_bonus) grow_bonus(); @@ -805,9 +805,8 @@ void AtomVecEllipsoid::unpack_border_vel(int n, int first, double *buf) type[i] = static_cast (buf[m++]); mask[i] = static_cast (buf[m++]); ellipsoid[i] = static_cast (buf[m++]); - if (ellipsoid[i] < 0) ellipsoid[i] = 0; + if (ellipsoid[i] == 0) ellipsoid[i] = -1; else { - j = nlocal_bonus + nghost_bonus; if (j == nmax_bonus) grow_bonus(); shape = bonus[j].shape; quat = bonus[j].quat; @@ -842,7 +841,7 @@ int AtomVecEllipsoid::unpack_border_hybrid(int n, int first, double *buf) last = first + n; for (i = first; i < last; i++) { ellipsoid[i] = static_cast (buf[m++]); - if (ellipsoid[i] < 0) ellipsoid[i] = 0; + if (ellipsoid[i] == 0) ellipsoid[i] = -1; else { j = nlocal_bonus + nghost_bonus; if (j == nmax_bonus) grow_bonus(); @@ -933,7 +932,8 @@ int AtomVecEllipsoid::unpack_exchange(double *buf) angmom[nlocal][2] = buf[m++]; ellipsoid[nlocal] = static_cast (buf[m++]); - if (ellipsoid[nlocal]) { + if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1; + else { if (nlocal_bonus == nmax_bonus) grow_bonus(); double *shape = bonus[nlocal_bonus].shape; double *quat = bonus[nlocal_bonus].quat; @@ -1057,7 +1057,8 @@ int AtomVecEllipsoid::unpack_restart(double *buf) angmom[nlocal][2] = buf[m++]; ellipsoid[nlocal] = static_cast (buf[m++]); - if (ellipsoid[nlocal]) { + if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1; + else { if (nlocal_bonus == nmax_bonus) grow_bonus(); double *shape = bonus[nlocal_bonus].shape; double *quat = bonus[nlocal_bonus].quat; diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 9f5d84b4c8..cf4d5535fb 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -19,6 +19,7 @@ #include "stdlib.h" #include "math.h" #include "fix_nh.h" +#include "math_extra.h" #include "atom.h" #include "force.h" #include "comm.h" @@ -31,7 +32,6 @@ #include "domain.h" #include "memory.h" #include "error.h" -#include "math_extra.h" using namespace LAMMPS_NS; diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index bbae452f96..54c94ad050 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -468,7 +468,7 @@ double FixStoreState::memory_usage() void FixStoreState::grow_arrays(int nmax) { - memory->grow(values,nmax,nvalues,"fix_store:values"); + memory->grow(values,nmax,nvalues,"store/state:values"); if (nvalues == 1) { if (nmax) vector_atom = &values[0][0]; else vector_atom = NULL; diff --git a/src/math_extra.cpp b/src/math_extra.cpp index 535a1e576b..c4318e8bbe 100644 --- a/src/math_extra.cpp +++ b/src/math_extra.cpp @@ -428,8 +428,8 @@ void quat_to_mat_trans(const double *quat, double mat[3][3]) /* ---------------------------------------------------------------------- compute space-frame inertia tensor of an ellipsoid - quat = orientiation quaternion of ellipsoid radii = 3 radii of ellipsoid + quat = orientiation quaternion of ellipsoid return symmetric inertia tensor as 6-vector in Voigt notation ------------------------------------------------------------------------- */ @@ -454,6 +454,36 @@ void inertia_ellipsoid(double *radii, double *quat, double mass, inertia[5] = tensor[0][1]; } +/* ---------------------------------------------------------------------- + compute space-frame inertia tensor of a line segment in 2d + length = length of line + theta = orientiation of line + return symmetric inertia tensor as 6-vector in Voigt notation +------------------------------------------------------------------------- */ + +void inertia_line(double length, double theta, double mass, double *inertia) +{ + double p[3][3],ptrans[3][3],itemp[3][3],tensor[3][3]; + double q[4],idiag[3]; + + q[0] = cos(0.5*theta); + q[1] = q[2] = 0.0; + q[3] = sin(0.5*theta); + MathExtra::quat_to_mat(q,p); + MathExtra::quat_to_mat_trans(q,ptrans); + idiag[0] = 0.0; + idiag[1] = 1.0/12.0 * mass * length*length; + idiag[2] = 1.0/12.0 * mass * length*length; + MathExtra::diag_times3(idiag,ptrans,itemp); + MathExtra::times3(p,itemp,tensor); + inertia[0] = tensor[0][0]; + inertia[1] = tensor[1][1]; + inertia[2] = tensor[2][2]; + inertia[3] = tensor[1][2]; + inertia[4] = tensor[0][2]; + inertia[5] = tensor[0][1]; +} + /* ---------------------------------------------------------------------- compute space-frame inertia tensor of a triangle v0,v1,v2 = 3 vertices of triangle diff --git a/src/math_extra.h b/src/math_extra.h index c9a117fe03..3ca98f8f12 100755 --- a/src/math_extra.h +++ b/src/math_extra.h @@ -114,6 +114,8 @@ namespace MathExtra { void inertia_ellipsoid(double *shape, double *quat, double mass, double *inertia); + void inertia_line(double length, double theta, double mass, + double *inertia); void inertia_triangle(double *v0, double *v1, double *v2, double mass, double *inertia); } diff --git a/src/read_data.cpp b/src/read_data.cpp index 7eef7dc4b4..dd3099ab87 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -41,7 +41,7 @@ using namespace LAMMPS_NS; #define DELTA 4 // must be 2 or larger // customize for new sections -#define NSECTIONS 23 // change when add to header::section_keywords +#define NSECTIONS 21 // change when add to header::section_keywords #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b))