loads of whitespace fixes
This commit is contained in:
@ -92,7 +92,7 @@ restricted triclinic parallelepiped.
|
|||||||
conform to the LAMMPS definition of a restricted triclinic box.
|
conform to the LAMMPS definition of a restricted triclinic box.
|
||||||
See the discussion in the next sub-section about general triclinic
|
See the discussion in the next sub-section about general triclinic
|
||||||
simulation boxes in LAMMPS.
|
simulation boxes in LAMMPS.
|
||||||
|
|
||||||
Note that the :doc:`thermo_style custom <thermo_style>` command has
|
Note that the :doc:`thermo_style custom <thermo_style>` command has
|
||||||
keywords for outputting the various parameters that define both
|
keywords for outputting the various parameters that define both
|
||||||
restricted and general triclinic simulation boxes. Thus you can check
|
restricted and general triclinic simulation boxes. Thus you can check
|
||||||
|
|||||||
@ -46,11 +46,11 @@ Examples
|
|||||||
create_box 1 NULL 0 5 0 5 -0.5 0.5
|
create_box 1 NULL 0 5 0 5 -0.5 0.5
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
# 3d general triclinic box using primitive cell for 3d fcc lattice
|
# 3d general triclinic box using primitive cell for 3d fcc lattice
|
||||||
lattice custom 1.0 a2 0.0 0.5 0.5 a1 0.5 0.0 0.5 a3 0.5 0.5 0.0 basis 0.0 0.0 0.0
|
lattice custom 1.0 a2 0.0 0.5 0.5 a1 0.5 0.0 0.5 a3 0.5 0.5 0.0 basis 0.0 0.0 0.0
|
||||||
create box 1 NULL -5 5 -10 10 0 20
|
create box 1 NULL -5 5 -10 10 0 20
|
||||||
|
|
||||||
Description
|
Description
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
|
|||||||
@ -719,9 +719,9 @@ Third, the output for any attribute of the *custom* style which
|
|||||||
represents a per-atom vector quantity will be converted (rotated) to
|
represents a per-atom vector quantity will be converted (rotated) to
|
||||||
be oriented consistent with the general tricinic box and its
|
be oriented consistent with the general tricinic box and its
|
||||||
orientation relative to the standard xyz coordinate axes.
|
orientation relative to the standard xyz coordinate axes.
|
||||||
|
|
||||||
This applies to the following *custom* style attributes:
|
This applies to the following *custom* style attributes:
|
||||||
|
|
||||||
* vx,vy,vz = atom velocities
|
* vx,vy,vz = atom velocities
|
||||||
* fx,fy,fz = forces on atoms
|
* fx,fy,fz = forces on atoms
|
||||||
* mux,muy,muz = orientation of dipole moment of atom
|
* mux,muy,muz = orientation of dipole moment of atom
|
||||||
|
|||||||
@ -148,7 +148,7 @@ keyword must be used.
|
|||||||
triclinic box, the avec, bvec, cvec, and "abc origin" keywords must
|
triclinic box, the avec, bvec, cvec, and "abc origin" keywords must
|
||||||
have the same values in subsequent data files. Also the *shift*
|
have the same values in subsequent data files. Also the *shift*
|
||||||
keyword cannot be used in subsequent read_data commands.
|
keyword cannot be used in subsequent read_data commands.
|
||||||
|
|
||||||
The three choices for the *add* argument affect how the atom IDs and
|
The three choices for the *add* argument affect how the atom IDs and
|
||||||
molecule IDs of atoms in the data file are treated. If *append* is
|
molecule IDs of atoms in the data file are treated. If *append* is
|
||||||
specified, atoms in the data file are added to the current system,
|
specified, atoms in the data file are added to the current system,
|
||||||
@ -494,7 +494,7 @@ periodic sense) back inside the box. For triclinic boxes, periodicity
|
|||||||
in x,y,z refers to the faces of the parallelepided defined by the
|
in x,y,z refers to the faces of the parallelepided defined by the
|
||||||
**A**,**B**,**C** edge vectors of the simuation box. See the
|
**A**,**B**,**C** edge vectors of the simuation box. See the
|
||||||
:doc:`boundary <boundary>` command doc page for a fuller discussion.
|
:doc:`boundary <boundary>` command doc page for a fuller discussion.
|
||||||
|
|
||||||
Note that if the *add* option is being used to add atoms to a
|
Note that if the *add* option is being used to add atoms to a
|
||||||
simulation box that already exists, this periodic remapping will be
|
simulation box that already exists, this periodic remapping will be
|
||||||
performed using simulation box bounds that are the union of the
|
performed using simulation box bounds that are the union of the
|
||||||
|
|||||||
@ -107,7 +107,7 @@ screen and log files. The units for each column of output
|
|||||||
corresponding to the list of keywords is determined by the :doc:`units
|
corresponding to the list of keywords is determined by the :doc:`units
|
||||||
<units>` command for the simulation. E.g. energies will be in energy
|
<units>` command for the simulation. E.g. energies will be in energy
|
||||||
units, temperature in temperature units, pressure in pressure units.
|
units, temperature in temperature units, pressure in pressure units.
|
||||||
|
|
||||||
Style *one* prints a single line of thermodynamic info that is the
|
Style *one* prints a single line of thermodynamic info that is the
|
||||||
equivalent of "thermo_style custom step temp epair emol etotal press".
|
equivalent of "thermo_style custom step temp epair emol etotal press".
|
||||||
The line contains only numeric values.
|
The line contains only numeric values.
|
||||||
|
|||||||
@ -235,7 +235,7 @@ void AtomVecDielectric::write_data_restore_restricted()
|
|||||||
AtomVec::write_data_restore_restricted();
|
AtomVec::write_data_restore_restricted();
|
||||||
|
|
||||||
if (!mu_hold) return;
|
if (!mu_hold) return;
|
||||||
|
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
memcpy(&mu[i],&mu_hold[i],3*sizeof(double));
|
memcpy(&mu[i],&mu_hold[i],3*sizeof(double));
|
||||||
|
|||||||
@ -29,7 +29,7 @@ AtomVecDipole::AtomVecDipole(LAMMPS *lmp) : AtomVec(lmp)
|
|||||||
mass_type = PER_TYPE;
|
mass_type = PER_TYPE;
|
||||||
|
|
||||||
atom->q_flag = atom->mu_flag = 1;
|
atom->q_flag = atom->mu_flag = 1;
|
||||||
|
|
||||||
mu_hold = nullptr;
|
mu_hold = nullptr;
|
||||||
|
|
||||||
// strings with peratom variables to include in each AtomVec method
|
// strings with peratom variables to include in each AtomVec method
|
||||||
@ -117,7 +117,7 @@ void AtomVecDipole::write_data_restore_restricted()
|
|||||||
AtomVec::write_data_restore_restricted();
|
AtomVec::write_data_restore_restricted();
|
||||||
|
|
||||||
if (!mu_hold) return;
|
if (!mu_hold) return;
|
||||||
|
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
memcpy(&mu[i],&mu_hold[i],3*sizeof(double));
|
memcpy(&mu[i],&mu_hold[i],3*sizeof(double));
|
||||||
|
|||||||
@ -60,7 +60,7 @@ AtomVecSMD::AtomVecSMD(LAMMPS *lmp) : AtomVec(lmp)
|
|||||||
atom->eff_plastic_strain_rate_flag = 1;
|
atom->eff_plastic_strain_rate_flag = 1;
|
||||||
|
|
||||||
x0_hold = nullptr;
|
x0_hold = nullptr;
|
||||||
|
|
||||||
// strings with peratom variables to include in each AtomVec method
|
// strings with peratom variables to include in each AtomVec method
|
||||||
// strings cannot contain fields in corresponding AtomVec default strings
|
// strings cannot contain fields in corresponding AtomVec default strings
|
||||||
// order of fields in a string does not matter
|
// order of fields in a string does not matter
|
||||||
@ -166,7 +166,7 @@ void AtomVecSMD::data_atom_post(int ilocal)
|
|||||||
// for PBC, shift, etc
|
// for PBC, shift, etc
|
||||||
// this means no need for read_data_general_to_restricted() method
|
// this means no need for read_data_general_to_restricted() method
|
||||||
// to rotate x0 for general triclinic
|
// to rotate x0 for general triclinic
|
||||||
|
|
||||||
x0[ilocal][0] = x[ilocal][0];
|
x0[ilocal][0] = x[ilocal][0];
|
||||||
x0[ilocal][1] = x[ilocal][1];
|
x0[ilocal][1] = x[ilocal][1];
|
||||||
x0[ilocal][2] = x[ilocal][2];
|
x0[ilocal][2] = x[ilocal][2];
|
||||||
|
|||||||
@ -43,7 +43,7 @@ AtomVecSpin::AtomVecSpin(LAMMPS *lmp) : AtomVec(lmp)
|
|||||||
atom->sp_flag = 1;
|
atom->sp_flag = 1;
|
||||||
|
|
||||||
sp_hold = nullptr;
|
sp_hold = nullptr;
|
||||||
|
|
||||||
// strings with peratom variables to include in each AtomVec method
|
// strings with peratom variables to include in each AtomVec method
|
||||||
// strings cannot contain fields in corresponding AtomVec default strings
|
// strings cannot contain fields in corresponding AtomVec default strings
|
||||||
// order of fields in a string does not matter
|
// order of fields in a string does not matter
|
||||||
@ -147,7 +147,7 @@ void AtomVecSpin::write_data_restore_restricted()
|
|||||||
AtomVec::write_data_restore_restricted();
|
AtomVec::write_data_restore_restricted();
|
||||||
|
|
||||||
if (!sp_hold) return;
|
if (!sp_hold) return;
|
||||||
|
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
memcpy(&sp[i],&sp_hold[i],3*sizeof(double));
|
memcpy(&sp[i],&sp_hold[i],3*sizeof(double));
|
||||||
|
|||||||
22
src/atom.cpp
22
src/atom.cpp
@ -1052,7 +1052,7 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
|
|||||||
auto location = "Atoms section of data file";
|
auto location = "Atoms section of data file";
|
||||||
|
|
||||||
// use the first line to detect and validate the number of words/tokens per line
|
// use the first line to detect and validate the number of words/tokens per line
|
||||||
|
|
||||||
next = strchr(buf,'\n');
|
next = strchr(buf,'\n');
|
||||||
if (!next) error->all(FLERR, "Missing data in {}", location);
|
if (!next) error->all(FLERR, "Missing data in {}", location);
|
||||||
*next = '\0';
|
*next = '\0';
|
||||||
@ -1069,7 +1069,7 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
|
|||||||
error->all(FLERR,"Incorrect format in {}: {}", location, utils::trim(buf));
|
error->all(FLERR,"Incorrect format in {}: {}", location, utils::trim(buf));
|
||||||
|
|
||||||
*next = '\n';
|
*next = '\n';
|
||||||
|
|
||||||
// set bounds for my proc
|
// set bounds for my proc
|
||||||
// if periodic and I am lo/hi proc, adjust bounds by EPSILON
|
// if periodic and I am lo/hi proc, adjust bounds by EPSILON
|
||||||
// ensures all data atoms will be owned even with round-off
|
// ensures all data atoms will be owned even with round-off
|
||||||
@ -1147,17 +1147,17 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
|
|||||||
int nvalues = values.size();
|
int nvalues = values.size();
|
||||||
|
|
||||||
// skip comment lines
|
// skip comment lines
|
||||||
|
|
||||||
if ((nvalues == 0) || (utils::strmatch(values[0],"^#.*"))) {
|
if ((nvalues == 0) || (utils::strmatch(values[0],"^#.*"))) {
|
||||||
|
|
||||||
// check that line has correct # of words
|
// check that line has correct # of words
|
||||||
|
|
||||||
} else if ((nvalues < nwords) ||
|
} else if ((nvalues < nwords) ||
|
||||||
((nvalues > nwords) && (!utils::strmatch(values[nwords],"^#")))) {
|
((nvalues > nwords) && (!utils::strmatch(values[nwords],"^#")))) {
|
||||||
error->all(FLERR, "Incorrect format in {}: {}", location, utils::trim(buf));
|
error->all(FLERR, "Incorrect format in {}: {}", location, utils::trim(buf));
|
||||||
|
|
||||||
// extract the atom coords and image flags (if they exist)
|
// extract the atom coords and image flags (if they exist)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int imx = 0, imy = 0, imz = 0;
|
int imx = 0, imy = 0, imz = 0;
|
||||||
if (imageflag) {
|
if (imageflag) {
|
||||||
@ -1186,14 +1186,14 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
|
|||||||
error->all(FLERR,"Read_data atom z coord is non-zero for 2d simulation");
|
error->all(FLERR,"Read_data atom z coord is non-zero for 2d simulation");
|
||||||
xdata[2] = 0.0;
|
xdata[2] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert atom coords from general to restricted triclinic
|
// convert atom coords from general to restricted triclinic
|
||||||
// so can decide which proc owns the atom
|
// so can decide which proc owns the atom
|
||||||
|
|
||||||
if (triclinic_general) domain->general_to_restricted_coords(xdata);
|
if (triclinic_general) domain->general_to_restricted_coords(xdata);
|
||||||
|
|
||||||
// apply shift if requested by read_data command
|
// apply shift if requested by read_data command
|
||||||
|
|
||||||
if (shiftflag) {
|
if (shiftflag) {
|
||||||
xdata[0] += shift[0];
|
xdata[0] += shift[0];
|
||||||
xdata[1] += shift[1];
|
xdata[1] += shift[1];
|
||||||
@ -1201,11 +1201,11 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// map atom into simulation box for periodic dimensions
|
// map atom into simulation box for periodic dimensions
|
||||||
|
|
||||||
domain->remap(xdata,imagedata);
|
domain->remap(xdata,imagedata);
|
||||||
|
|
||||||
// determine if this proc owns the atom
|
// determine if this proc owns the atom
|
||||||
|
|
||||||
if (triclinic) {
|
if (triclinic) {
|
||||||
domain->x2lamda(xdata,lamda);
|
domain->x2lamda(xdata,lamda);
|
||||||
coord = lamda;
|
coord = lamda;
|
||||||
@ -1216,7 +1216,7 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
|
|||||||
coord[2] >= sublo[2] && coord[2] < subhi[2]) {
|
coord[2] >= sublo[2] && coord[2] < subhi[2]) {
|
||||||
|
|
||||||
// atom-style specific method parses single line
|
// atom-style specific method parses single line
|
||||||
|
|
||||||
avec->data_atom(xdata,imagedata,values,typestr);
|
avec->data_atom(xdata,imagedata,values,typestr);
|
||||||
typestr = utils::utf8_subst(typestr);
|
typestr = utils::utf8_subst(typestr);
|
||||||
if (id_offset) tag[nlocal-1] += id_offset;
|
if (id_offset) tag[nlocal-1] += id_offset;
|
||||||
|
|||||||
@ -70,7 +70,7 @@ AtomVec::AtomVec(LAMMPS *lmp) : Pointers(lmp)
|
|||||||
|
|
||||||
x_hold = nullptr;
|
x_hold = nullptr;
|
||||||
v_hold = omega_hold = angmom_hold = nullptr;
|
v_hold = omega_hold = angmom_hold = nullptr;
|
||||||
|
|
||||||
threads = nullptr;
|
threads = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2243,7 +2243,7 @@ void AtomVec::read_data_general_to_restricted(int nlocal_previous, int nlocal)
|
|||||||
|
|
||||||
// operate on v, omega, angmom
|
// operate on v, omega, angmom
|
||||||
// no other read_data Velocities fields are Nx3 double arrays
|
// no other read_data Velocities fields are Nx3 double arrays
|
||||||
|
|
||||||
if (datatype == Atom::DOUBLE) {
|
if (datatype == Atom::DOUBLE) {
|
||||||
if (cols == 3) {
|
if (cols == 3) {
|
||||||
double **array = *((double ***) pdata);
|
double **array = *((double ***) pdata);
|
||||||
@ -2283,7 +2283,7 @@ void AtomVec::write_data_restricted_to_general()
|
|||||||
|
|
||||||
// operate on v, omega, angmom
|
// operate on v, omega, angmom
|
||||||
// no other write_data Velocities fields are Nx3 double arrays
|
// no other write_data Velocities fields are Nx3 double arrays
|
||||||
|
|
||||||
if (datatype == Atom::DOUBLE) {
|
if (datatype == Atom::DOUBLE) {
|
||||||
if (cols == 3) {
|
if (cols == 3) {
|
||||||
double **array = *((double ***) pdata);
|
double **array = *((double ***) pdata);
|
||||||
@ -2325,10 +2325,10 @@ void AtomVec::write_data_restore_restricted()
|
|||||||
memory->destroy(x_hold);
|
memory->destroy(x_hold);
|
||||||
x_hold = nullptr;
|
x_hold = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// operate on v, omega, angmom
|
// operate on v, omega, angmom
|
||||||
// no other write_data Velocities fields are Nx3 double arrays
|
// no other write_data Velocities fields are Nx3 double arrays
|
||||||
|
|
||||||
if (v_hold) {
|
if (v_hold) {
|
||||||
memcpy(&v[0][0],&v_hold[0][0],3*nlocal*sizeof(double));
|
memcpy(&v[0][0],&v_hold[0][0],3*nlocal*sizeof(double));
|
||||||
memory->destroy(v_hold);
|
memory->destroy(v_hold);
|
||||||
@ -2340,7 +2340,7 @@ void AtomVec::write_data_restore_restricted()
|
|||||||
memory->destroy(omega_hold);
|
memory->destroy(omega_hold);
|
||||||
omega_hold = nullptr;
|
omega_hold = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (angmom_hold) {
|
if (angmom_hold) {
|
||||||
memcpy(&atom->angmom[0][0],&angmom_hold[0][0],3*nlocal*sizeof(double));
|
memcpy(&atom->angmom[0][0],&angmom_hold[0][0],3*nlocal*sizeof(double));
|
||||||
memory->destroy(angmom_hold);
|
memory->destroy(angmom_hold);
|
||||||
|
|||||||
@ -174,8 +174,8 @@ class AtomVec : protected Pointers {
|
|||||||
double **x, **v, **f;
|
double **x, **v, **f;
|
||||||
|
|
||||||
// copies of original unrotated fields for write_data for general triclinic
|
// copies of original unrotated fields for write_data for general triclinic
|
||||||
|
|
||||||
double **x_hold;
|
double **x_hold;
|
||||||
double **v_hold, **omega_hold, **angmom_hold;
|
double **v_hold, **omega_hold, **angmom_hold;
|
||||||
|
|
||||||
// standard list of peratom fields always operated on by different methods
|
// standard list of peratom fields always operated on by different methods
|
||||||
|
|||||||
@ -648,15 +648,15 @@ void AtomVecBody::write_data_bonus(FILE *fp, int n, double *buf, int /*flag*/)
|
|||||||
void AtomVecBody::read_data_general_to_restricted(int nlocal_previous, int nlocal)
|
void AtomVecBody::read_data_general_to_restricted(int nlocal_previous, int nlocal)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
AtomVec::read_data_general_to_restricted(nlocal_previous, nlocal);
|
AtomVec::read_data_general_to_restricted(nlocal_previous, nlocal);
|
||||||
|
|
||||||
// quat_g2r = quat that rotates from general to restricted triclinic
|
// quat_g2r = quat that rotates from general to restricted triclinic
|
||||||
// quat_new = body quat converted to restricted triclinic
|
// quat_new = body quat converted to restricted triclinic
|
||||||
|
|
||||||
double quat_g2r[4],quat_new[4];
|
double quat_g2r[4],quat_new[4];
|
||||||
MathExtra::mat_to_quat(domain->rotate_g2r,quat_g2r);
|
MathExtra::mat_to_quat(domain->rotate_g2r,quat_g2r);
|
||||||
|
|
||||||
for (int i = nlocal_previous; i < nlocal; i++) {
|
for (int i = nlocal_previous; i < nlocal; i++) {
|
||||||
if (body[i] < 0) continue;
|
if (body[i] < 0) continue;
|
||||||
j = body[i];
|
j = body[i];
|
||||||
@ -685,7 +685,7 @@ void AtomVecBody::write_data_restricted_to_general()
|
|||||||
|
|
||||||
// quat_r2g = quat that rotates from restricted to general triclinic
|
// quat_r2g = quat that rotates from restricted to general triclinic
|
||||||
// quat_new = ellipsoid quat converted to general triclinic
|
// quat_new = ellipsoid quat converted to general triclinic
|
||||||
|
|
||||||
double quat_r2g[4],quat_new[4];
|
double quat_r2g[4],quat_new[4];
|
||||||
MathExtra::mat_to_quat(domain->rotate_r2g,quat_r2g);
|
MathExtra::mat_to_quat(domain->rotate_r2g,quat_r2g);
|
||||||
|
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class AtomVecBody : public AtomVec {
|
|||||||
void read_data_general_to_restricted(int, int);
|
void read_data_general_to_restricted(int, int);
|
||||||
void write_data_restricted_to_general();
|
void write_data_restricted_to_general();
|
||||||
void write_data_restore_restricted();
|
void write_data_restore_restricted();
|
||||||
|
|
||||||
// methods used by other classes to query/set body info
|
// methods used by other classes to query/set body info
|
||||||
|
|
||||||
double radius_body(int, int, int *, double *);
|
double radius_body(int, int, int *, double *);
|
||||||
|
|||||||
@ -545,15 +545,15 @@ void AtomVecEllipsoid::write_data_bonus(FILE *fp, int n, double *buf, int /*flag
|
|||||||
void AtomVecEllipsoid::read_data_general_to_restricted(int nlocal_previous, int nlocal)
|
void AtomVecEllipsoid::read_data_general_to_restricted(int nlocal_previous, int nlocal)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
AtomVec::read_data_general_to_restricted(nlocal_previous, nlocal);
|
AtomVec::read_data_general_to_restricted(nlocal_previous, nlocal);
|
||||||
|
|
||||||
// quat_g2r = quat that rotates from general to restricted triclinic
|
// quat_g2r = quat that rotates from general to restricted triclinic
|
||||||
// quat_new = ellipsoid quat converted to restricted triclinic
|
// quat_new = ellipsoid quat converted to restricted triclinic
|
||||||
|
|
||||||
double quat_g2r[4],quat_new[4];
|
double quat_g2r[4],quat_new[4];
|
||||||
MathExtra::mat_to_quat(domain->rotate_g2r,quat_g2r);
|
MathExtra::mat_to_quat(domain->rotate_g2r,quat_g2r);
|
||||||
|
|
||||||
for (int i = nlocal_previous; i < nlocal; i++) {
|
for (int i = nlocal_previous; i < nlocal; i++) {
|
||||||
if (ellipsoid[i] < 0) continue;
|
if (ellipsoid[i] < 0) continue;
|
||||||
j = ellipsoid[i];
|
j = ellipsoid[i];
|
||||||
@ -582,7 +582,7 @@ void AtomVecEllipsoid::write_data_restricted_to_general()
|
|||||||
|
|
||||||
// quat_r2g = quat that rotates from restricted to general triclinic
|
// quat_r2g = quat that rotates from restricted to general triclinic
|
||||||
// quat_new = ellipsoid quat converted to general triclinic
|
// quat_new = ellipsoid quat converted to general triclinic
|
||||||
|
|
||||||
double quat_r2g[4],quat_new[4];
|
double quat_r2g[4],quat_new[4];
|
||||||
MathExtra::mat_to_quat(domain->rotate_r2g,quat_r2g);
|
MathExtra::mat_to_quat(domain->rotate_r2g,quat_r2g);
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class AtomVecEllipsoid : public AtomVec {
|
|||||||
double *rmass;
|
double *rmass;
|
||||||
double **angmom;
|
double **angmom;
|
||||||
double **quat_hold;
|
double **quat_hold;
|
||||||
|
|
||||||
int nghost_bonus, nmax_bonus;
|
int nghost_bonus, nmax_bonus;
|
||||||
int ellipsoid_flag;
|
int ellipsoid_flag;
|
||||||
double rmass_one;
|
double rmass_one;
|
||||||
|
|||||||
@ -526,7 +526,7 @@ int AtomVecLine::pack_data_bonus(double *buf, int /*flag*/)
|
|||||||
j = line[i];
|
j = line[i];
|
||||||
length = bonus[j].length;
|
length = bonus[j].length;
|
||||||
theta = bonus[j].theta;
|
theta = bonus[j].theta;
|
||||||
|
|
||||||
xc = x_bonus[i][0];
|
xc = x_bonus[i][0];
|
||||||
yc = x_bonus[i][1];
|
yc = x_bonus[i][1];
|
||||||
x1 = xc - 0.5 * cos(theta) * length;
|
x1 = xc - 0.5 * cos(theta) * length;
|
||||||
@ -541,7 +541,7 @@ int AtomVecLine::pack_data_bonus(double *buf, int /*flag*/)
|
|||||||
// if triclinic_general:
|
// if triclinic_general:
|
||||||
// rotate 4 buf values from restricted to general triclinic
|
// rotate 4 buf values from restricted to general triclinic
|
||||||
// output by write_data_bonus() as x1/y1 and x2/y2
|
// output by write_data_bonus() as x1/y1 and x2/y2
|
||||||
|
|
||||||
if (triclinic_general) {
|
if (triclinic_general) {
|
||||||
coords[0] = buf[m-4]; coords[1] = buf[m-3]; coords[2] = 0.0;
|
coords[0] = buf[m-4]; coords[1] = buf[m-3]; coords[2] = 0.0;
|
||||||
domain->restricted_to_general_coords(coords);
|
domain->restricted_to_general_coords(coords);
|
||||||
|
|||||||
@ -510,7 +510,7 @@ void AtomVecTri::data_atom_bonus(int m, const std::vector<std::string> &values)
|
|||||||
|
|
||||||
// convert c1,c2,c3 from general to restricted triclniic
|
// convert c1,c2,c3 from general to restricted triclniic
|
||||||
// x is already restricted triclinic
|
// x is already restricted triclinic
|
||||||
|
|
||||||
if (domain->triclinic_general) {
|
if (domain->triclinic_general) {
|
||||||
domain->general_to_restricted_coords(c1);
|
domain->general_to_restricted_coords(c1);
|
||||||
domain->general_to_restricted_coords(c2);
|
domain->general_to_restricted_coords(c2);
|
||||||
@ -523,11 +523,11 @@ void AtomVecTri::data_atom_bonus(int m, const std::vector<std::string> &values)
|
|||||||
domain->remap_near(c1,x[m]);
|
domain->remap_near(c1,x[m]);
|
||||||
domain->remap_near(c2,x[m]);
|
domain->remap_near(c2,x[m]);
|
||||||
domain->remap_near(c3,x[m]);
|
domain->remap_near(c3,x[m]);
|
||||||
|
|
||||||
// centroid = 1/3 of sum of vertices
|
// centroid = 1/3 of sum of vertices
|
||||||
// error if centroid is not within EPSILON of atom x
|
// error if centroid is not within EPSILON of atom x
|
||||||
// reset atom x to centroid
|
// reset atom x to centroid
|
||||||
|
|
||||||
double centroid[3];
|
double centroid[3];
|
||||||
centroid[0] = (c1[0] + c2[0] + c3[0]) / 3.0;
|
centroid[0] = (c1[0] + c2[0] + c3[0]) / 3.0;
|
||||||
centroid[1] = (c1[1] + c2[1] + c3[1]) / 3.0;
|
centroid[1] = (c1[1] + c2[1] + c3[1]) / 3.0;
|
||||||
@ -729,7 +729,7 @@ int AtomVecTri::pack_data_bonus(double *buf, int /*flag*/)
|
|||||||
double **x_bonus;
|
double **x_bonus;
|
||||||
if (triclinic_general) x_bonus = x_hold;
|
if (triclinic_general) x_bonus = x_hold;
|
||||||
else x_bonus = x;
|
else x_bonus = x;
|
||||||
|
|
||||||
tagint *tag = atom->tag;
|
tagint *tag = atom->tag;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
@ -760,7 +760,7 @@ int AtomVecTri::pack_data_bonus(double *buf, int /*flag*/)
|
|||||||
// if triclinic_general:
|
// if triclinic_general:
|
||||||
// rotate 9 buf values from restricted to general triclinic
|
// rotate 9 buf values from restricted to general triclinic
|
||||||
// output by write_data_bonus() as c1,c2,c3
|
// output by write_data_bonus() as c1,c2,c3
|
||||||
|
|
||||||
if (triclinic_general) {
|
if (triclinic_general) {
|
||||||
domain->restricted_to_general_coords(&buf[m-9]);
|
domain->restricted_to_general_coords(&buf[m-9]);
|
||||||
domain->restricted_to_general_coords(&buf[m-6]);
|
domain->restricted_to_general_coords(&buf[m-6]);
|
||||||
|
|||||||
@ -358,11 +358,11 @@ void CreateAtoms::command(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// require non-none lattice be defined for BOX or REGION styles
|
// require non-none lattice be defined for BOX or REGION styles
|
||||||
|
|
||||||
if ((style == BOX) || (style == REGION)) {
|
if ((style == BOX) || (style == REGION)) {
|
||||||
if (nbasis == 0) error->all(FLERR, "Cannot create atoms with undefined lattice");
|
if (nbasis == 0) error->all(FLERR, "Cannot create atoms with undefined lattice");
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply scaling factor for styles that use distance-dependent factors
|
// apply scaling factor for styles that use distance-dependent factors
|
||||||
|
|
||||||
if (scaleflag) {
|
if (scaleflag) {
|
||||||
@ -465,7 +465,7 @@ void CreateAtoms::command(int narg, char **arg)
|
|||||||
atom->avec->clear_bonus();
|
atom->avec->clear_bonus();
|
||||||
|
|
||||||
// add atoms/molecules with appropriate add() method
|
// add atoms/molecules with appropriate add() method
|
||||||
|
|
||||||
bigint natoms_previous = atom->natoms;
|
bigint natoms_previous = atom->natoms;
|
||||||
int nlocal_previous = atom->nlocal;
|
int nlocal_previous = atom->nlocal;
|
||||||
|
|
||||||
@ -1178,7 +1178,7 @@ void CreateAtoms::add_lattice()
|
|||||||
{
|
{
|
||||||
// add atoms on general triclinic lattice if Domain has setting for it
|
// add atoms on general triclinic lattice if Domain has setting for it
|
||||||
// verify lattice was defined with triclinic/general option
|
// verify lattice was defined with triclinic/general option
|
||||||
|
|
||||||
if (!domain->triclinic_general && domain->lattice->is_general_triclinic())
|
if (!domain->triclinic_general && domain->lattice->is_general_triclinic())
|
||||||
error->all(FLERR,"Create_atoms for non general triclinic box cannot use triclinic/general lattice");
|
error->all(FLERR,"Create_atoms for non general triclinic box cannot use triclinic/general lattice");
|
||||||
if (domain->triclinic_general && !domain->lattice->is_general_triclinic())
|
if (domain->triclinic_general && !domain->lattice->is_general_triclinic())
|
||||||
@ -1228,7 +1228,7 @@ void CreateAtoms::add_lattice()
|
|||||||
// convert 8 corner points of bounding box to lattice coordinates
|
// convert 8 corner points of bounding box to lattice coordinates
|
||||||
// compute new bounding box (xyz min/max) in lattice coords
|
// compute new bounding box (xyz min/max) in lattice coords
|
||||||
// for orthogonal or restricted triclinic, use 8 corner points of bbox lo/hi
|
// for orthogonal or restricted triclinic, use 8 corner points of bbox lo/hi
|
||||||
|
|
||||||
if (!domain->triclinic_general) {
|
if (!domain->triclinic_general) {
|
||||||
domain->lattice->bbox(1, bboxlo[0], bboxlo[1], bboxlo[2], xmin, ymin, zmin, xmax, ymax, zmax);
|
domain->lattice->bbox(1, bboxlo[0], bboxlo[1], bboxlo[2], xmin, ymin, zmin, xmax, ymax, zmax);
|
||||||
domain->lattice->bbox(1, bboxhi[0], bboxlo[1], bboxlo[2], xmin, ymin, zmin, xmax, ymax, zmax);
|
domain->lattice->bbox(1, bboxhi[0], bboxlo[1], bboxlo[2], xmin, ymin, zmin, xmax, ymax, zmax);
|
||||||
@ -1274,7 +1274,7 @@ void CreateAtoms::add_lattice()
|
|||||||
domain->restricted_to_general_coords(point);
|
domain->restricted_to_general_coords(point);
|
||||||
domain->lattice->bbox(1, point[0], point[1], point[2], xmin, ymin, zmin, xmax, ymax, zmax);
|
domain->lattice->bbox(1, point[0], point[1], point[2], xmin, ymin, zmin, xmax, ymax, zmax);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ilo:ihi,jlo:jhi,klo:khi = loop bounds for lattice overlap of my subbox
|
// ilo:ihi,jlo:jhi,klo:khi = loop bounds for lattice overlap of my subbox
|
||||||
// overlap = any part of a unit cell (face,edge,pt) in common with my subbox
|
// overlap = any part of a unit cell (face,edge,pt) in common with my subbox
|
||||||
// in lattice space, subbox is a tilted box
|
// in lattice space, subbox is a tilted box
|
||||||
@ -1284,7 +1284,7 @@ void CreateAtoms::add_lattice()
|
|||||||
// which can lead to missing atoms in rare cases
|
// which can lead to missing atoms in rare cases
|
||||||
// extra decrement of lo if min < 0, since static_cast(-1.5) = -1
|
// extra decrement of lo if min < 0, since static_cast(-1.5) = -1
|
||||||
// for 2d simulation, klo = khi = 0 so just one plane of atoms
|
// for 2d simulation, klo = khi = 0 so just one plane of atoms
|
||||||
|
|
||||||
ilo = static_cast<int>(xmin) - 1;
|
ilo = static_cast<int>(xmin) - 1;
|
||||||
jlo = static_cast<int>(ymin) - 1;
|
jlo = static_cast<int>(ymin) - 1;
|
||||||
klo = static_cast<int>(zmin) - 1;
|
klo = static_cast<int>(zmin) - 1;
|
||||||
@ -1297,7 +1297,7 @@ void CreateAtoms::add_lattice()
|
|||||||
if (zmin < 0.0) klo--;
|
if (zmin < 0.0) klo--;
|
||||||
|
|
||||||
if (domain->dimension == 2) klo = khi = 0;
|
if (domain->dimension == 2) klo = khi = 0;
|
||||||
|
|
||||||
// count lattice sites on each proc
|
// count lattice sites on each proc
|
||||||
|
|
||||||
nlatt_overflow = 0;
|
nlatt_overflow = 0;
|
||||||
@ -1395,7 +1395,7 @@ void CreateAtoms::loop_lattice(int action)
|
|||||||
error->all(FLERR,"Create_atoms atom z coord is non-zero for 2d simulation");
|
error->all(FLERR,"Create_atoms atom z coord is non-zero for 2d simulation");
|
||||||
x[2] = 0.0;
|
x[2] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if a region was specified, test if atom is in it
|
// if a region was specified, test if atom is in it
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void CreateBox::command(int narg, char **arg)
|
|||||||
|
|
||||||
Region *region = nullptr;
|
Region *region = nullptr;
|
||||||
int triclinic_general = 0;
|
int triclinic_general = 0;
|
||||||
|
|
||||||
if (strcmp(arg[1],"NULL") == 0) triclinic_general = 1;
|
if (strcmp(arg[1],"NULL") == 0) triclinic_general = 1;
|
||||||
else {
|
else {
|
||||||
region = domain->get_region_by_id(arg[1]);
|
region = domain->get_region_by_id(arg[1]);
|
||||||
@ -61,13 +61,13 @@ void CreateBox::command(int narg, char **arg)
|
|||||||
// 3 options: orthogonal, restricted triclinic, general triclinic
|
// 3 options: orthogonal, restricted triclinic, general triclinic
|
||||||
|
|
||||||
int iarg = 2;
|
int iarg = 2;
|
||||||
|
|
||||||
if (region) {
|
if (region) {
|
||||||
|
|
||||||
// region is not prism
|
// region is not prism
|
||||||
// setup orthogonal box
|
// setup orthogonal box
|
||||||
// set simulation domain from region extent
|
// set simulation domain from region extent
|
||||||
|
|
||||||
if (strcmp(region->style, "prism") != 0) {
|
if (strcmp(region->style, "prism") != 0) {
|
||||||
domain->triclinic = 0;
|
domain->triclinic = 0;
|
||||||
domain->boxlo[0] = region->extent_xlo;
|
domain->boxlo[0] = region->extent_xlo;
|
||||||
@ -108,7 +108,7 @@ void CreateBox::command(int narg, char **arg)
|
|||||||
} else if (triclinic_general) {
|
} else if (triclinic_general) {
|
||||||
if (!domain->lattice->is_general_triclinic())
|
if (!domain->lattice->is_general_triclinic())
|
||||||
error->all(FLERR,"Create_box for general triclinic requires triclnic/general lattice");
|
error->all(FLERR,"Create_box for general triclinic requires triclnic/general lattice");
|
||||||
|
|
||||||
if (iarg + 6 > narg) utils::missing_cmd_args(FLERR, "create_box general triclinic", error);
|
if (iarg + 6 > narg) utils::missing_cmd_args(FLERR, "create_box general triclinic", error);
|
||||||
|
|
||||||
double alo = utils::numeric(FLERR, arg[iarg + 0], false, lmp);
|
double alo = utils::numeric(FLERR, arg[iarg + 0], false, lmp);
|
||||||
@ -118,14 +118,14 @@ void CreateBox::command(int narg, char **arg)
|
|||||||
double clo = utils::numeric(FLERR, arg[iarg + 4], false, lmp);
|
double clo = utils::numeric(FLERR, arg[iarg + 4], false, lmp);
|
||||||
double chi = utils::numeric(FLERR, arg[iarg + 5], false, lmp);
|
double chi = utils::numeric(FLERR, arg[iarg + 5], false, lmp);
|
||||||
iarg += 6;
|
iarg += 6;
|
||||||
|
|
||||||
// use lattice2box() to generate origin and ABC vectors
|
// use lattice2box() to generate origin and ABC vectors
|
||||||
// origin = abc lo
|
// origin = abc lo
|
||||||
// ABC vectors = hi in one dim - origin
|
// ABC vectors = hi in one dim - origin
|
||||||
|
|
||||||
double avec[3],bvec[3],cvec[3],origin[3];
|
double avec[3],bvec[3],cvec[3],origin[3];
|
||||||
double px,py,pz;
|
double px,py,pz;
|
||||||
|
|
||||||
px = alo; py = blo; pz = clo;
|
px = alo; py = blo; pz = clo;
|
||||||
domain->lattice->lattice2box(px,py,pz);
|
domain->lattice->lattice2box(px,py,pz);
|
||||||
origin[0] = px;
|
origin[0] = px;
|
||||||
@ -157,7 +157,7 @@ void CreateBox::command(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// define general triclinic box within Domain class
|
// define general triclinic box within Domain class
|
||||||
|
|
||||||
domain->define_general_triclinic(avec,bvec,cvec,origin);
|
domain->define_general_triclinic(avec,bvec,cvec,origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -293,12 +293,12 @@ void Domain::set_global_box()
|
|||||||
|
|
||||||
// update general triclinic box if defined
|
// update general triclinic box if defined
|
||||||
// reset general tri ABC edge vectors from restricted tri box
|
// reset general tri ABC edge vectors from restricted tri box
|
||||||
|
|
||||||
if (triclinic_general) {
|
if (triclinic_general) {
|
||||||
double aprime[3],bprime[3],cprime[3];
|
double aprime[3],bprime[3],cprime[3];
|
||||||
|
|
||||||
// A'B'C' = edge vectors of restricted triclinic box
|
// A'B'C' = edge vectors of restricted triclinic box
|
||||||
|
|
||||||
aprime[0] = boxhi[0] - boxlo[0];
|
aprime[0] = boxhi[0] - boxlo[0];
|
||||||
aprime[1] = aprime[2] = 0.0;
|
aprime[1] = aprime[2] = 0.0;
|
||||||
bprime[0] = xy;
|
bprime[0] = xy;
|
||||||
@ -309,7 +309,7 @@ void Domain::set_global_box()
|
|||||||
cprime[2] = boxhi[2] - boxlo[2];
|
cprime[2] = boxhi[2] - boxlo[2];
|
||||||
|
|
||||||
// transform restricted A'B'C' to general triclinic ABC
|
// transform restricted A'B'C' to general triclinic ABC
|
||||||
|
|
||||||
MathExtra::matvec(rotate_r2g,aprime,avec);
|
MathExtra::matvec(rotate_r2g,aprime,avec);
|
||||||
MathExtra::matvec(rotate_r2g,bprime,bvec);
|
MathExtra::matvec(rotate_r2g,bprime,bvec);
|
||||||
MathExtra::matvec(rotate_r2g,cprime,cvec);
|
MathExtra::matvec(rotate_r2g,cprime,cvec);
|
||||||
@ -556,7 +556,7 @@ void Domain::define_general_triclinic(double *avec_caller, double *bvec_caller,
|
|||||||
{
|
{
|
||||||
if (triclinic || triclinic_general)
|
if (triclinic || triclinic_general)
|
||||||
error->all(FLERR,"General triclinic box edge vectors are already set");
|
error->all(FLERR,"General triclinic box edge vectors are already set");
|
||||||
|
|
||||||
triclinic = triclinic_general = 1;
|
triclinic = triclinic_general = 1;
|
||||||
|
|
||||||
avec[0] = avec_caller[0];
|
avec[0] = avec_caller[0];
|
||||||
@ -596,7 +596,7 @@ void Domain::define_general_triclinic(double *avec_caller, double *bvec_caller,
|
|||||||
xy = bprime[0];
|
xy = bprime[0];
|
||||||
xz = cprime[0];
|
xz = cprime[0];
|
||||||
yz = cprime[1];
|
yz = cprime[1];
|
||||||
|
|
||||||
// debug
|
// debug
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -656,7 +656,7 @@ void Domain::general_to_restricted_rotation(double *a, double *b, double *c,
|
|||||||
MathExtra::norm3(rot1);
|
MathExtra::norm3(rot1);
|
||||||
double theta1 = acos(a[0]/alen);
|
double theta1 = acos(a[0]/alen);
|
||||||
MathExtra::axisangle_to_quat(rot1,theta1,quat1);
|
MathExtra::axisangle_to_quat(rot1,theta1,quat1);
|
||||||
|
|
||||||
// rotmat1 = rotation matrix associated with quat1
|
// rotmat1 = rotation matrix associated with quat1
|
||||||
|
|
||||||
double rotmat1[3][3];
|
double rotmat1[3][3];
|
||||||
@ -674,7 +674,7 @@ void Domain::general_to_restricted_rotation(double *a, double *b, double *c,
|
|||||||
// Byz1 dot yunit = B1y = |Byz1| cos(theta2)
|
// Byz1 dot yunit = B1y = |Byz1| cos(theta2)
|
||||||
// theta2 via acos() is positive (0 to PI)
|
// theta2 via acos() is positive (0 to PI)
|
||||||
// positive is valid if B1z < 0.0 else flip sign of theta2
|
// positive is valid if B1z < 0.0 else flip sign of theta2
|
||||||
|
|
||||||
double byzvec1[3],quat2[4];
|
double byzvec1[3],quat2[4];
|
||||||
MathExtra::copy3(b1,byzvec1);
|
MathExtra::copy3(b1,byzvec1);
|
||||||
byzvec1[0] = 0.0;
|
byzvec1[0] = 0.0;
|
||||||
@ -705,7 +705,7 @@ void Domain::general_to_restricted_rotation(double *a, double *b, double *c,
|
|||||||
void Domain::general_to_restricted_coords(double *x)
|
void Domain::general_to_restricted_coords(double *x)
|
||||||
{
|
{
|
||||||
double xshift[3],xnew[3];
|
double xshift[3],xnew[3];
|
||||||
|
|
||||||
xshift[0] = x[0] - boxlo[0];
|
xshift[0] = x[0] - boxlo[0];
|
||||||
xshift[1] = x[1] - boxlo[1];
|
xshift[1] = x[1] - boxlo[1];
|
||||||
xshift[2] = x[2] - boxlo[2];
|
xshift[2] = x[2] - boxlo[2];
|
||||||
@ -722,7 +722,7 @@ void Domain::general_to_restricted_coords(double *x)
|
|||||||
void Domain::restricted_to_general_coords(double *x)
|
void Domain::restricted_to_general_coords(double *x)
|
||||||
{
|
{
|
||||||
double xshift[3],xnew[3];
|
double xshift[3],xnew[3];
|
||||||
|
|
||||||
xshift[0] = x[0] - boxlo[0];
|
xshift[0] = x[0] - boxlo[0];
|
||||||
xshift[1] = x[1] - boxlo[1];
|
xshift[1] = x[1] - boxlo[1];
|
||||||
xshift[2] = x[2] - boxlo[2];
|
xshift[2] = x[2] - boxlo[2];
|
||||||
@ -735,7 +735,7 @@ void Domain::restricted_to_general_coords(double *x)
|
|||||||
void Domain::restricted_to_general_coords(double *x, double *xnew)
|
void Domain::restricted_to_general_coords(double *x, double *xnew)
|
||||||
{
|
{
|
||||||
double xshift[3];
|
double xshift[3];
|
||||||
|
|
||||||
xshift[0] = x[0] - boxlo[0];
|
xshift[0] = x[0] - boxlo[0];
|
||||||
xshift[1] = x[1] - boxlo[1];
|
xshift[1] = x[1] - boxlo[1];
|
||||||
xshift[2] = x[2] - boxlo[2];
|
xshift[2] = x[2] - boxlo[2];
|
||||||
@ -752,7 +752,7 @@ void Domain::restricted_to_general_coords(double *x, double *xnew)
|
|||||||
void Domain::general_to_restricted_vector(double *v)
|
void Domain::general_to_restricted_vector(double *v)
|
||||||
{
|
{
|
||||||
double vnew[3];
|
double vnew[3];
|
||||||
|
|
||||||
MathExtra::matvec(rotate_g2r,v,vnew);
|
MathExtra::matvec(rotate_g2r,v,vnew);
|
||||||
v[0] = vnew[0];
|
v[0] = vnew[0];
|
||||||
v[1] = vnew[1];
|
v[1] = vnew[1];
|
||||||
@ -766,7 +766,7 @@ void Domain::general_to_restricted_vector(double *v)
|
|||||||
void Domain::restricted_to_general_vector(double *v)
|
void Domain::restricted_to_general_vector(double *v)
|
||||||
{
|
{
|
||||||
double vnew[3];
|
double vnew[3];
|
||||||
|
|
||||||
MathExtra::matvec(rotate_r2g,v,vnew);
|
MathExtra::matvec(rotate_r2g,v,vnew);
|
||||||
v[0] = vnew[0];
|
v[0] = vnew[0];
|
||||||
v[1] = vnew[1];
|
v[1] = vnew[1];
|
||||||
|
|||||||
12
src/domain.h
12
src/domain.h
@ -41,7 +41,7 @@ class Domain : protected Pointers {
|
|||||||
|
|
||||||
int triclinic; // 0 = orthog box, 1 = triclinic (restricted or general)
|
int triclinic; // 0 = orthog box, 1 = triclinic (restricted or general)
|
||||||
int triclinic_general; // 1 if general <-> restricted tri mapping is stored, 0 if not
|
int triclinic_general; // 1 if general <-> restricted tri mapping is stored, 0 if not
|
||||||
|
|
||||||
// orthogonal box
|
// orthogonal box
|
||||||
|
|
||||||
double xprd, yprd, zprd; // global box dimensions
|
double xprd, yprd, zprd; // global box dimensions
|
||||||
@ -96,7 +96,7 @@ class Domain : protected Pointers {
|
|||||||
double rotate_r2g[3][3]; // rotation matrix from restricted --> general tri
|
double rotate_r2g[3][3]; // rotation matrix from restricted --> general tri
|
||||||
|
|
||||||
// box flags
|
// box flags
|
||||||
|
|
||||||
int box_change; // 1 if any of next 3 flags are set, else 0
|
int box_change; // 1 if any of next 3 flags are set, else 0
|
||||||
int box_change_size; // 1 if box size changes, 0 if not
|
int box_change_size; // 1 if box size changes, 0 if not
|
||||||
int box_change_shape; // 1 if box shape changes, 0 if not
|
int box_change_shape; // 1 if box shape changes, 0 if not
|
||||||
@ -145,13 +145,13 @@ class Domain : protected Pointers {
|
|||||||
void general_to_restricted_rotation(double *, double *, double *,
|
void general_to_restricted_rotation(double *, double *, double *,
|
||||||
double [3][3],
|
double [3][3],
|
||||||
double *, double *, double *);
|
double *, double *, double *);
|
||||||
void general_to_restricted_coords(double *);
|
void general_to_restricted_coords(double *);
|
||||||
void restricted_to_general_coords(double *);
|
void restricted_to_general_coords(double *);
|
||||||
void restricted_to_general_coords(double *, double *);
|
void restricted_to_general_coords(double *, double *);
|
||||||
void general_to_restricted_vector(double *);
|
void general_to_restricted_vector(double *);
|
||||||
void restricted_to_general_vector(double *);
|
void restricted_to_general_vector(double *);
|
||||||
void restricted_to_general_vector(double *, double *x);
|
void restricted_to_general_vector(double *, double *x);
|
||||||
|
|
||||||
void set_lattice(int, char **);
|
void set_lattice(int, char **);
|
||||||
void add_region(int, char **);
|
void add_region(int, char **);
|
||||||
void delete_region(Region *);
|
void delete_region(Region *);
|
||||||
|
|||||||
@ -133,7 +133,7 @@ void DumpAtom::init_style()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image_flag == 0) convert_choice = &DumpAtom::convert_noimage;
|
if (image_flag == 0) convert_choice = &DumpAtom::convert_noimage;
|
||||||
else convert_choice = &DumpAtom::convert_image;
|
else convert_choice = &DumpAtom::convert_image;
|
||||||
|
|
||||||
@ -157,14 +157,14 @@ int DumpAtom::modify_param(int narg, char **arg)
|
|||||||
for (auto &item : keyword_user) item.clear();
|
for (auto &item : keyword_user) item.clear();
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(arg[0],"image") == 0) {
|
if (strcmp(arg[0],"image") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
||||||
image_flag = utils::logical(FLERR,arg[1],false,lmp);
|
image_flag = utils::logical(FLERR,arg[1],false,lmp);
|
||||||
for (auto &item : keyword_user) item.clear();
|
for (auto &item : keyword_user) item.clear();
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(arg[0],"triclinic/general") == 0) {
|
if (strcmp(arg[0],"triclinic/general") == 0) {
|
||||||
triclinic_general = 1;
|
triclinic_general = 1;
|
||||||
if (triclinic_general && !domain->triclinic_general)
|
if (triclinic_general && !domain->triclinic_general)
|
||||||
@ -172,7 +172,7 @@ int DumpAtom::modify_param(int narg, char **arg)
|
|||||||
"if simulation box is not general triclinic");
|
"if simulation box is not general triclinic");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1347,7 +1347,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
|||||||
if (triclinic_general) pack_choice[iarg] = &DumpCustom::pack_y_triclinic_general;
|
if (triclinic_general) pack_choice[iarg] = &DumpCustom::pack_y_triclinic_general;
|
||||||
else pack_choice[iarg] = &DumpCustom::pack_y;
|
else pack_choice[iarg] = &DumpCustom::pack_y;
|
||||||
vtype[iarg] = Dump::DOUBLE;
|
vtype[iarg] = Dump::DOUBLE;
|
||||||
} else if (strcmp(arg[iarg],"z") == 0) {
|
} else if (strcmp(arg[iarg],"z") == 0) {
|
||||||
if (triclinic_general) pack_choice[iarg] = &DumpCustom::pack_z_triclinic_general;
|
if (triclinic_general) pack_choice[iarg] = &DumpCustom::pack_z_triclinic_general;
|
||||||
else pack_choice[iarg] = &DumpCustom::pack_z;
|
else pack_choice[iarg] = &DumpCustom::pack_z;
|
||||||
vtype[iarg] = Dump::DOUBLE;
|
vtype[iarg] = Dump::DOUBLE;
|
||||||
@ -1390,7 +1390,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
|||||||
if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_zsu_triclinic;
|
if (domain->triclinic) pack_choice[iarg] = &DumpCustom::pack_zsu_triclinic;
|
||||||
else pack_choice[iarg] = &DumpCustom::pack_zsu;
|
else pack_choice[iarg] = &DumpCustom::pack_zsu;
|
||||||
vtype[iarg] = Dump::DOUBLE;
|
vtype[iarg] = Dump::DOUBLE;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg],"ix") == 0) {
|
} else if (strcmp(arg[iarg],"ix") == 0) {
|
||||||
pack_choice[iarg] = &DumpCustom::pack_ix;
|
pack_choice[iarg] = &DumpCustom::pack_ix;
|
||||||
vtype[iarg] = Dump::INT;
|
vtype[iarg] = Dump::INT;
|
||||||
@ -1431,7 +1431,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
|||||||
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
||||||
pack_choice[iarg] = &DumpCustom::pack_q;
|
pack_choice[iarg] = &DumpCustom::pack_q;
|
||||||
vtype[iarg] = Dump::DOUBLE;
|
vtype[iarg] = Dump::DOUBLE;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg],"mux") == 0) {
|
} else if (strcmp(arg[iarg],"mux") == 0) {
|
||||||
if (!atom->mu_flag)
|
if (!atom->mu_flag)
|
||||||
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
||||||
@ -1466,7 +1466,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
|||||||
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
||||||
pack_choice[iarg] = &DumpCustom::pack_diameter;
|
pack_choice[iarg] = &DumpCustom::pack_diameter;
|
||||||
vtype[iarg] = Dump::DOUBLE;
|
vtype[iarg] = Dump::DOUBLE;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg],"heatflow") == 0) {
|
} else if (strcmp(arg[iarg],"heatflow") == 0) {
|
||||||
if (!atom->heatflow_flag)
|
if (!atom->heatflow_flag)
|
||||||
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
||||||
@ -1477,7 +1477,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
|||||||
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
||||||
pack_choice[iarg] = &DumpCustom::pack_temperature;
|
pack_choice[iarg] = &DumpCustom::pack_temperature;
|
||||||
vtype[iarg] = Dump::DOUBLE;
|
vtype[iarg] = Dump::DOUBLE;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg],"omegax") == 0) {
|
} else if (strcmp(arg[iarg],"omegax") == 0) {
|
||||||
if (!atom->omega_flag)
|
if (!atom->omega_flag)
|
||||||
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
||||||
@ -1496,7 +1496,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
|||||||
if (triclinic_general) pack_choice[iarg] = &DumpCustom::pack_omegaz_triclinic_general;
|
if (triclinic_general) pack_choice[iarg] = &DumpCustom::pack_omegaz_triclinic_general;
|
||||||
else pack_choice[iarg] = &DumpCustom::pack_omegaz;
|
else pack_choice[iarg] = &DumpCustom::pack_omegaz;
|
||||||
vtype[iarg] = Dump::DOUBLE;
|
vtype[iarg] = Dump::DOUBLE;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg],"angmomx") == 0) {
|
} else if (strcmp(arg[iarg],"angmomx") == 0) {
|
||||||
if (!atom->angmom_flag)
|
if (!atom->angmom_flag)
|
||||||
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
||||||
@ -1515,7 +1515,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
|||||||
if (triclinic_general) pack_choice[iarg] = &DumpCustom::pack_angmomz_triclinic_general;
|
if (triclinic_general) pack_choice[iarg] = &DumpCustom::pack_angmomz_triclinic_general;
|
||||||
else pack_choice[iarg] = &DumpCustom::pack_angmomz;
|
else pack_choice[iarg] = &DumpCustom::pack_angmomz;
|
||||||
vtype[iarg] = Dump::DOUBLE;
|
vtype[iarg] = Dump::DOUBLE;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg],"tqx") == 0) {
|
} else if (strcmp(arg[iarg],"tqx") == 0) {
|
||||||
if (!atom->torque_flag)
|
if (!atom->torque_flag)
|
||||||
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
error->all(FLERR,"Dumping an atom property that isn't allocated");
|
||||||
@ -1793,7 +1793,7 @@ int DumpCustom::modify_param(int narg, char **arg)
|
|||||||
"if simulation box is not general triclinic");
|
"if simulation box is not general triclinic");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(arg[0],"triclinic/general") == 0) {
|
if (strcmp(arg[0],"triclinic/general") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
||||||
triclinic_general = utils::logical(FLERR,arg[1],false,lmp);
|
triclinic_general = utils::logical(FLERR,arg[1],false,lmp);
|
||||||
@ -2387,7 +2387,7 @@ void DumpCustom::pack_x_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double xtri[3];
|
double xtri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_coords(x[clist[i]],xtri);
|
domain->restricted_to_general_coords(x[clist[i]],xtri);
|
||||||
buf[n] = xtri[0];
|
buf[n] = xtri[0];
|
||||||
@ -2973,7 +2973,7 @@ void DumpCustom::pack_fx_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
double ftri[3];
|
double ftri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(f[clist[i]],ftri);
|
domain->restricted_to_general_vector(f[clist[i]],ftri);
|
||||||
buf[n] = ftri[0];
|
buf[n] = ftri[0];
|
||||||
@ -3075,7 +3075,7 @@ void DumpCustom::pack_mux_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **mu = atom->mu;
|
double **mu = atom->mu;
|
||||||
double mutri[3];
|
double mutri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(mu[clist[i]],mutri);
|
domain->restricted_to_general_vector(mu[clist[i]],mutri);
|
||||||
buf[n] = mutri[0];
|
buf[n] = mutri[0];
|
||||||
@ -3089,7 +3089,7 @@ void DumpCustom::pack_muy_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **mu = atom->mu;
|
double **mu = atom->mu;
|
||||||
double mutri[3];
|
double mutri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(mu[clist[i]],mutri);
|
domain->restricted_to_general_vector(mu[clist[i]],mutri);
|
||||||
buf[n] = mutri[1];
|
buf[n] = mutri[1];
|
||||||
@ -3103,7 +3103,7 @@ void DumpCustom::pack_muz_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **mu = atom->mu;
|
double **mu = atom->mu;
|
||||||
double mutri[3];
|
double mutri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(mu[clist[i]],mutri);
|
domain->restricted_to_general_vector(mu[clist[i]],mutri);
|
||||||
buf[n] = mutri[2];
|
buf[n] = mutri[2];
|
||||||
@ -3201,7 +3201,7 @@ void DumpCustom::pack_omegax_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **omega = atom->omega;
|
double **omega = atom->omega;
|
||||||
double omegatri[3];
|
double omegatri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(omega[clist[i]],omegatri);
|
domain->restricted_to_general_vector(omega[clist[i]],omegatri);
|
||||||
buf[n] = omegatri[0];
|
buf[n] = omegatri[0];
|
||||||
@ -3215,7 +3215,7 @@ void DumpCustom::pack_omegay_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **omega = atom->omega;
|
double **omega = atom->omega;
|
||||||
double omegatri[3];
|
double omegatri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(omega[clist[i]],omegatri);
|
domain->restricted_to_general_vector(omega[clist[i]],omegatri);
|
||||||
buf[n] = omegatri[1];
|
buf[n] = omegatri[1];
|
||||||
@ -3229,7 +3229,7 @@ void DumpCustom::pack_omegaz_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **omega = atom->omega;
|
double **omega = atom->omega;
|
||||||
double omegatri[3];
|
double omegatri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(omega[clist[i]],omegatri);
|
domain->restricted_to_general_vector(omega[clist[i]],omegatri);
|
||||||
buf[n] = omegatri[2];
|
buf[n] = omegatri[2];
|
||||||
@ -3279,7 +3279,7 @@ void DumpCustom::pack_angmomx_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **angmom = atom->angmom;
|
double **angmom = atom->angmom;
|
||||||
double angmomtri[3];
|
double angmomtri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(angmom[clist[i]],angmomtri);
|
domain->restricted_to_general_vector(angmom[clist[i]],angmomtri);
|
||||||
buf[n] = angmomtri[0];
|
buf[n] = angmomtri[0];
|
||||||
@ -3293,7 +3293,7 @@ void DumpCustom::pack_angmomy_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **angmom = atom->angmom;
|
double **angmom = atom->angmom;
|
||||||
double angmomtri[3];
|
double angmomtri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(angmom[clist[i]],angmomtri);
|
domain->restricted_to_general_vector(angmom[clist[i]],angmomtri);
|
||||||
buf[n] = angmomtri[1];
|
buf[n] = angmomtri[1];
|
||||||
@ -3307,7 +3307,7 @@ void DumpCustom::pack_angmomz_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **angmom = atom->angmom;
|
double **angmom = atom->angmom;
|
||||||
double angmomtri[3];
|
double angmomtri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(angmom[clist[i]],angmomtri);
|
domain->restricted_to_general_vector(angmom[clist[i]],angmomtri);
|
||||||
buf[n] = angmomtri[2];
|
buf[n] = angmomtri[2];
|
||||||
@ -3357,7 +3357,7 @@ void DumpCustom::pack_tqx_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **torque = atom->torque;
|
double **torque = atom->torque;
|
||||||
double tqtri[3];
|
double tqtri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(torque[clist[i]],tqtri);
|
domain->restricted_to_general_vector(torque[clist[i]],tqtri);
|
||||||
buf[n] = tqtri[0];
|
buf[n] = tqtri[0];
|
||||||
@ -3371,7 +3371,7 @@ void DumpCustom::pack_tqy_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **torque = atom->torque;
|
double **torque = atom->torque;
|
||||||
double tqtri[3];
|
double tqtri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(torque[clist[i]],tqtri);
|
domain->restricted_to_general_vector(torque[clist[i]],tqtri);
|
||||||
buf[n] = tqtri[1];
|
buf[n] = tqtri[1];
|
||||||
@ -3385,7 +3385,7 @@ void DumpCustom::pack_tqz_triclinic_general(int n)
|
|||||||
{
|
{
|
||||||
double **torque = atom->torque;
|
double **torque = atom->torque;
|
||||||
double tqtri[3];
|
double tqtri[3];
|
||||||
|
|
||||||
for (int i = 0; i < nchoose; i++) {
|
for (int i = 0; i < nchoose; i++) {
|
||||||
domain->restricted_to_general_vector(torque[clist[i]],tqtri);
|
domain->restricted_to_general_vector(torque[clist[i]],tqtri);
|
||||||
buf[n] = tqtri[2];
|
buf[n] = tqtri[2];
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class DumpCustom : public Dump {
|
|||||||
int nevery; // dump frequency for output
|
int nevery; // dump frequency for output
|
||||||
char *idregion; // region ID, nullptr if no region
|
char *idregion; // region ID, nullptr if no region
|
||||||
int triclinic_general; // 1 if output box & per-atom info for general triclinic
|
int triclinic_general; // 1 if output box & per-atom info for general triclinic
|
||||||
|
|
||||||
int nthresh; // # of defined thresholds
|
int nthresh; // # of defined thresholds
|
||||||
int nthreshlast; // # of defined thresholds with value = LAST
|
int nthreshlast; // # of defined thresholds with value = LAST
|
||||||
//
|
//
|
||||||
@ -159,7 +159,7 @@ class DumpCustom : public Dump {
|
|||||||
void pack_x_triclinic_general(int);
|
void pack_x_triclinic_general(int);
|
||||||
void pack_y_triclinic_general(int);
|
void pack_y_triclinic_general(int);
|
||||||
void pack_z_triclinic_general(int);
|
void pack_z_triclinic_general(int);
|
||||||
|
|
||||||
void pack_xs(int);
|
void pack_xs(int);
|
||||||
void pack_ys(int);
|
void pack_ys(int);
|
||||||
void pack_zs(int);
|
void pack_zs(int);
|
||||||
@ -190,11 +190,11 @@ class DumpCustom : public Dump {
|
|||||||
|
|
||||||
void pack_vx(int);
|
void pack_vx(int);
|
||||||
void pack_vy(int);
|
void pack_vy(int);
|
||||||
void pack_vz(int);
|
void pack_vz(int);
|
||||||
void pack_vx_triclinic_general(int);
|
void pack_vx_triclinic_general(int);
|
||||||
void pack_vy_triclinic_general(int);
|
void pack_vy_triclinic_general(int);
|
||||||
void pack_vz_triclinic_general(int);
|
void pack_vz_triclinic_general(int);
|
||||||
|
|
||||||
void pack_fx(int);
|
void pack_fx(int);
|
||||||
void pack_fy(int);
|
void pack_fy(int);
|
||||||
void pack_fz(int);
|
void pack_fz(int);
|
||||||
@ -214,7 +214,7 @@ class DumpCustom : public Dump {
|
|||||||
|
|
||||||
void pack_radius(int);
|
void pack_radius(int);
|
||||||
void pack_diameter(int);
|
void pack_diameter(int);
|
||||||
|
|
||||||
void pack_heatflow(int);
|
void pack_heatflow(int);
|
||||||
void pack_temperature(int);
|
void pack_temperature(int);
|
||||||
|
|
||||||
@ -224,14 +224,14 @@ class DumpCustom : public Dump {
|
|||||||
void pack_omegax_triclinic_general(int);
|
void pack_omegax_triclinic_general(int);
|
||||||
void pack_omegay_triclinic_general(int);
|
void pack_omegay_triclinic_general(int);
|
||||||
void pack_omegaz_triclinic_general(int);
|
void pack_omegaz_triclinic_general(int);
|
||||||
|
|
||||||
void pack_angmomx(int);
|
void pack_angmomx(int);
|
||||||
void pack_angmomy(int);
|
void pack_angmomy(int);
|
||||||
void pack_angmomz(int);
|
void pack_angmomz(int);
|
||||||
void pack_angmomx_triclinic_general(int);
|
void pack_angmomx_triclinic_general(int);
|
||||||
void pack_angmomy_triclinic_general(int);
|
void pack_angmomy_triclinic_general(int);
|
||||||
void pack_angmomz_triclinic_general(int);
|
void pack_angmomz_triclinic_general(int);
|
||||||
|
|
||||||
void pack_tqx(int);
|
void pack_tqx(int);
|
||||||
void pack_tqy(int);
|
void pack_tqy(int);
|
||||||
void pack_tqz(int);
|
void pack_tqz(int);
|
||||||
|
|||||||
@ -141,7 +141,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||||||
// process optional args
|
// process optional args
|
||||||
|
|
||||||
int triclinic_general = 0;
|
int triclinic_general = 0;
|
||||||
|
|
||||||
int iarg = 2;
|
int iarg = 2;
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"origin") == 0) {
|
if (strcmp(arg[iarg],"origin") == 0) {
|
||||||
@ -230,7 +230,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||||||
} else if (strcmp(arg[iarg],"triclinic/general") == 0) {
|
} else if (strcmp(arg[iarg],"triclinic/general") == 0) {
|
||||||
triclinic_general = 1;
|
triclinic_general = 1;
|
||||||
iarg++;
|
iarg++;
|
||||||
|
|
||||||
} else error->all(FLERR,"Unknown lattice keyword: {}", arg[iarg]);
|
} else error->all(FLERR,"Unknown lattice keyword: {}", arg[iarg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||||||
|
|
||||||
// additional requirements for a general triclinic lattice
|
// additional requirements for a general triclinic lattice
|
||||||
// a123 prime are used to compute lattice spacings
|
// a123 prime are used to compute lattice spacings
|
||||||
|
|
||||||
if (triclinic_general) {
|
if (triclinic_general) {
|
||||||
if (style != CUSTOM)
|
if (style != CUSTOM)
|
||||||
error->all(FLERR,"Lattice triclnic/general must be style = CUSTOM");
|
error->all(FLERR,"Lattice triclnic/general must be style = CUSTOM");
|
||||||
@ -285,11 +285,11 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||||||
double rotmat[3][3];
|
double rotmat[3][3];
|
||||||
domain->general_to_restricted_rotation(a1,a2,a3,rotmat,a1_prime,a2_prime,a3_prime);
|
domain->general_to_restricted_rotation(a1,a2,a3,rotmat,a1_prime,a2_prime,a3_prime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset scale for LJ units (input scale is rho*)
|
// reset scale for LJ units (input scale is rho*)
|
||||||
// scale = (Nbasis/(Vprimitive * rho*)) ^ (1/dim)
|
// scale = (Nbasis/(Vprimitive * rho*)) ^ (1/dim)
|
||||||
// use fabs() in case a1,a2,a3 are not right-handed for general triclinic
|
// use fabs() in case a1,a2,a3 are not right-handed for general triclinic
|
||||||
|
|
||||||
if (strcmp(update->unit_style,"lj") == 0) {
|
if (strcmp(update->unit_style,"lj") == 0) {
|
||||||
double vec[3];
|
double vec[3];
|
||||||
MathExtra::cross3(a2,a3,vec);
|
MathExtra::cross3(a2,a3,vec);
|
||||||
@ -321,7 +321,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||||||
// reset transform used by bbox() to be based on rotated a123 prime vectors
|
// reset transform used by bbox() to be based on rotated a123 prime vectors
|
||||||
|
|
||||||
if (triclinic_general) setup_transform(a1_prime,a2_prime,a3_prime);
|
if (triclinic_general) setup_transform(a1_prime,a2_prime,a3_prime);
|
||||||
|
|
||||||
bbox(0,0.0,0.0,0.0,xmin,ymin,zmin,xmax,ymax,zmax);
|
bbox(0,0.0,0.0,0.0,xmin,ymin,zmin,xmax,ymax,zmax);
|
||||||
bbox(0,1.0,0.0,0.0,xmin,ymin,zmin,xmax,ymax,zmax);
|
bbox(0,1.0,0.0,0.0,xmin,ymin,zmin,xmax,ymax,zmax);
|
||||||
bbox(0,0.0,1.0,0.0,xmin,ymin,zmin,xmax,ymax,zmax);
|
bbox(0,0.0,1.0,0.0,xmin,ymin,zmin,xmax,ymax,zmax);
|
||||||
@ -334,13 +334,13 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||||||
// restore original general triclinic a123 transform
|
// restore original general triclinic a123 transform
|
||||||
|
|
||||||
if (triclinic_general) setup_transform(a2,a2,a3);
|
if (triclinic_general) setup_transform(a2,a2,a3);
|
||||||
|
|
||||||
xlattice = xmax - xmin;
|
xlattice = xmax - xmin;
|
||||||
ylattice = ymax - ymin;
|
ylattice = ymax - ymin;
|
||||||
zlattice = zmax - zmin;
|
zlattice = zmax - zmin;
|
||||||
|
|
||||||
// user-defined lattice spacings
|
// user-defined lattice spacings
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
xlattice *= scale;
|
xlattice *= scale;
|
||||||
ylattice *= scale;
|
ylattice *= scale;
|
||||||
@ -542,7 +542,7 @@ void Lattice::setup_transform(double *a, double *b, double *c)
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Lattice::lattice2box(double &x, double &y, double &z)
|
void Lattice::lattice2box(double &x, double &y, double &z)
|
||||||
{
|
{
|
||||||
double x1 = primitive[0][0]*x + primitive[0][1]*y + primitive[0][2]*z;
|
double x1 = primitive[0][0]*x + primitive[0][1]*y + primitive[0][2]*z;
|
||||||
double y1 = primitive[1][0]*x + primitive[1][1]*y + primitive[1][2]*z;
|
double y1 = primitive[1][0]*x + primitive[1][1]*y + primitive[1][2]*z;
|
||||||
double z1 = primitive[2][0]*x + primitive[2][1]*y + primitive[2][2]*z;
|
double z1 = primitive[2][0]*x + primitive[2][1]*y + primitive[2][2]*z;
|
||||||
@ -615,7 +615,7 @@ void Lattice::add_basis(double x, double y, double z)
|
|||||||
void Lattice::bbox(int flag, double x, double y, double z,
|
void Lattice::bbox(int flag, double x, double y, double z,
|
||||||
double &xmin, double &ymin, double &zmin,
|
double &xmin, double &ymin, double &zmin,
|
||||||
double &xmax, double &ymax, double &zmax)
|
double &xmax, double &ymax, double &zmax)
|
||||||
{
|
{
|
||||||
if (flag == 0) lattice2box(x,y,z);
|
if (flag == 0) lattice2box(x,y,z);
|
||||||
else box2lattice(x,y,z);
|
else box2lattice(x,y,z);
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class Lattice : protected Pointers {
|
|||||||
int nbasis; // # of basis atoms in unit cell
|
int nbasis; // # of basis atoms in unit cell
|
||||||
double **basis; // fractional coords of each basis atom
|
double **basis; // fractional coords of each basis atom
|
||||||
// within unit cell (0 <= coord < 1)
|
// within unit cell (0 <= coord < 1)
|
||||||
|
|
||||||
Lattice(class LAMMPS *, int, char **);
|
Lattice(class LAMMPS *, int, char **);
|
||||||
~Lattice() override;
|
~Lattice() override;
|
||||||
void lattice2box(double &, double &, double &);
|
void lattice2box(double &, double &, double &);
|
||||||
@ -36,7 +36,7 @@ class Lattice : protected Pointers {
|
|||||||
void bbox(int, double, double, double,
|
void bbox(int, double, double, double,
|
||||||
double &, double &, double &, double &, double &, double &);
|
double &, double &, double &, double &, double &, double &);
|
||||||
int is_general_triclinic();
|
int is_general_triclinic();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int triclinic_general; // 1 if general triclinic, else 0
|
int triclinic_general; // 1 if general triclinic, else 0
|
||||||
int oriented; // 1 if non-default orient xyz, else 0
|
int oriented; // 1 if non-default orient xyz, else 0
|
||||||
@ -51,10 +51,10 @@ class Lattice : protected Pointers {
|
|||||||
double rotaterow[3][3];
|
double rotaterow[3][3];
|
||||||
double rotatecol[3][3];
|
double rotatecol[3][3];
|
||||||
|
|
||||||
double a1_prime[3]; // a123 rotated to restricted triclinic orientation
|
double a1_prime[3]; // a123 rotated to restricted triclinic orientation
|
||||||
double a2_prime[3];
|
double a2_prime[3];
|
||||||
double a3_prime[3];
|
double a3_prime[3];
|
||||||
|
|
||||||
int orthogonal();
|
int orthogonal();
|
||||||
int right_handed_orientation();
|
int right_handed_orientation();
|
||||||
int right_handed_primitive();
|
int right_handed_primitive();
|
||||||
|
|||||||
@ -381,7 +381,7 @@ void mat_to_quat(double mat[3][3], double *q)
|
|||||||
ez[0] = mat[0][2];
|
ez[0] = mat[0][2];
|
||||||
ez[1] = mat[1][2];
|
ez[1] = mat[1][2];
|
||||||
ez[2] = mat[2][2];
|
ez[2] = mat[2][2];
|
||||||
|
|
||||||
MathExtra::exyz_to_q(ex,ey,ez,q);
|
MathExtra::exyz_to_q(ex,ey,ez,q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -474,7 +474,7 @@ void ReadData::command(int narg, char **arg)
|
|||||||
int atomflag, topoflag;
|
int atomflag, topoflag;
|
||||||
int bondflag, angleflag, dihedralflag, improperflag;
|
int bondflag, angleflag, dihedralflag, improperflag;
|
||||||
int ellipsoidflag, lineflag, triflag, bodyflag;
|
int ellipsoidflag, lineflag, triflag, bodyflag;
|
||||||
|
|
||||||
atomflag = topoflag = 0;
|
atomflag = topoflag = 0;
|
||||||
bondflag = angleflag = dihedralflag = improperflag = 0;
|
bondflag = angleflag = dihedralflag = improperflag = 0;
|
||||||
ellipsoidflag = lineflag = triflag = bodyflag = 0;
|
ellipsoidflag = lineflag = triflag = bodyflag = 0;
|
||||||
@ -492,14 +492,14 @@ void ReadData::command(int narg, char **arg)
|
|||||||
boxlo[0] = boxlo[1] = boxlo[2] = -0.5;
|
boxlo[0] = boxlo[1] = boxlo[2] = -0.5;
|
||||||
boxhi[0] = boxhi[1] = boxhi[2] = 0.5;
|
boxhi[0] = boxhi[1] = boxhi[2] = 0.5;
|
||||||
xy = xz = yz = 0.0;
|
xy = xz = yz = 0.0;
|
||||||
|
|
||||||
avec[0] = bvec[1] = cvec[2] = 1.0;
|
avec[0] = bvec[1] = cvec[2] = 1.0;
|
||||||
avec[1] = avec[2] = 0.0;
|
avec[1] = avec[2] = 0.0;
|
||||||
bvec[0] = bvec[2] = 0.0;
|
bvec[0] = bvec[2] = 0.0;
|
||||||
cvec[0] = cvec[1] = 0.0;
|
cvec[0] = cvec[1] = 0.0;
|
||||||
abc_origin[0] = abc_origin[1] = abc_origin[2] = 0.0;
|
abc_origin[0] = abc_origin[1] = abc_origin[2] = 0.0;
|
||||||
if (domain->dimension == 2) abc_origin[2] = -0.5;
|
if (domain->dimension == 2) abc_origin[2] = -0.5;
|
||||||
|
|
||||||
keyword[0] = '\0';
|
keyword[0] = '\0';
|
||||||
|
|
||||||
nlocal_previous = atom->nlocal;
|
nlocal_previous = atom->nlocal;
|
||||||
@ -542,7 +542,7 @@ void ReadData::command(int narg, char **arg)
|
|||||||
"2d simulation with general triclinic box");
|
"2d simulation with general triclinic box");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// problem setup using info from header
|
// problem setup using info from header
|
||||||
// only done once, if firstpass and first data file
|
// only done once, if firstpass and first data file
|
||||||
// apply extra settings before grow(), even if no topology in file
|
// apply extra settings before grow(), even if no topology in file
|
||||||
@ -577,7 +577,7 @@ void ReadData::command(int narg, char **arg)
|
|||||||
if (!triclinic_general) {
|
if (!triclinic_general) {
|
||||||
|
|
||||||
// orthogonal or restricted triclinic box
|
// orthogonal or restricted triclinic box
|
||||||
|
|
||||||
domain->boxlo[0] = boxlo[0];
|
domain->boxlo[0] = boxlo[0];
|
||||||
domain->boxhi[0] = boxhi[0];
|
domain->boxhi[0] = boxhi[0];
|
||||||
domain->boxlo[1] = boxlo[1];
|
domain->boxlo[1] = boxlo[1];
|
||||||
@ -586,7 +586,7 @@ void ReadData::command(int narg, char **arg)
|
|||||||
domain->boxhi[2] = boxhi[2];
|
domain->boxhi[2] = boxhi[2];
|
||||||
|
|
||||||
// restricted triclinic box
|
// restricted triclinic box
|
||||||
|
|
||||||
if (triclinic) {
|
if (triclinic) {
|
||||||
domain->triclinic = 1;
|
domain->triclinic = 1;
|
||||||
domain->xy = xy;
|
domain->xy = xy;
|
||||||
@ -597,7 +597,7 @@ void ReadData::command(int narg, char **arg)
|
|||||||
// general triclinic box
|
// general triclinic box
|
||||||
// define_general_triclinic() converts
|
// define_general_triclinic() converts
|
||||||
// ABC edge vectors + abc_origin to restricted triclinic
|
// ABC edge vectors + abc_origin to restricted triclinic
|
||||||
|
|
||||||
} else if (triclinic_general) {
|
} else if (triclinic_general) {
|
||||||
domain->define_general_triclinic(avec,bvec,cvec,abc_origin);
|
domain->define_general_triclinic(avec,bvec,cvec,abc_origin);
|
||||||
}
|
}
|
||||||
@ -612,7 +612,7 @@ void ReadData::command(int narg, char **arg)
|
|||||||
// first data file must also be general triclinic
|
// first data file must also be general triclinic
|
||||||
// avec,bvec,vec and origin must match first data file
|
// avec,bvec,vec and origin must match first data file
|
||||||
// shift not allowed
|
// shift not allowed
|
||||||
|
|
||||||
if (triclinic_general) {
|
if (triclinic_general) {
|
||||||
if (!domain->triclinic_general)
|
if (!domain->triclinic_general)
|
||||||
error->all(FLERR,"Read_data subsequent file cannot switch to general triclinic");
|
error->all(FLERR,"Read_data subsequent file cannot switch to general triclinic");
|
||||||
@ -633,14 +633,14 @@ void ReadData::command(int narg, char **arg)
|
|||||||
|
|
||||||
// restricted triclinic
|
// restricted triclinic
|
||||||
// tilt factors must match first data file
|
// tilt factors must match first data file
|
||||||
|
|
||||||
} else if (triclinic) {
|
} else if (triclinic) {
|
||||||
if (!domain->triclinic || domain->triclinic_general)
|
if (!domain->triclinic || domain->triclinic_general)
|
||||||
error->all(FLERR,"Read_data subsequent file cannot switch to restricted triclinic");
|
error->all(FLERR,"Read_data subsequent file cannot switch to restricted triclinic");
|
||||||
if (xy != domain->xy || xz != domain->xz || yz != domain->yz)
|
if (xy != domain->xy || xz != domain->xz || yz != domain->yz)
|
||||||
error->all(FLERR,"Read_data subsequent file tilt factors must be same as first file");
|
error->all(FLERR,"Read_data subsequent file tilt factors must be same as first file");
|
||||||
}
|
}
|
||||||
|
|
||||||
double oldboxlo[3] = {domain->boxlo[0], domain->boxlo[1], domain->boxlo[2]};
|
double oldboxlo[3] = {domain->boxlo[0], domain->boxlo[1], domain->boxlo[2]};
|
||||||
double oldboxhi[3] = {domain->boxhi[0], domain->boxhi[1], domain->boxhi[2]};
|
double oldboxhi[3] = {domain->boxhi[0], domain->boxhi[1], domain->boxhi[2]};
|
||||||
domain->boxlo[0] = MIN(domain->boxlo[0], boxlo[0] + shift[0]);
|
domain->boxlo[0] = MIN(domain->boxlo[0], boxlo[0] + shift[0]);
|
||||||
@ -652,7 +652,7 @@ void ReadData::command(int narg, char **arg)
|
|||||||
|
|
||||||
// check if box has changed
|
// check if box has changed
|
||||||
// if yes, warn about non-zero image flags
|
// if yes, warn about non-zero image flags
|
||||||
|
|
||||||
if ((oldboxlo[0] != domain->boxlo[0]) || (oldboxlo[1] != domain->boxlo[1]) ||
|
if ((oldboxlo[0] != domain->boxlo[0]) || (oldboxlo[1] != domain->boxlo[1]) ||
|
||||||
(oldboxlo[2] != domain->boxlo[2]) || (oldboxhi[0] != domain->boxhi[0]) ||
|
(oldboxlo[2] != domain->boxlo[2]) || (oldboxhi[0] != domain->boxhi[0]) ||
|
||||||
(oldboxhi[1] != domain->boxhi[1]) || (oldboxhi[2] != domain->boxhi[2])) {
|
(oldboxhi[1] != domain->boxhi[1]) || (oldboxhi[2] != domain->boxhi[2])) {
|
||||||
@ -673,7 +673,7 @@ void ReadData::command(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// setup simulation box and paritioning in Domain and Comm classes
|
// setup simulation box and paritioning in Domain and Comm classes
|
||||||
|
|
||||||
domain->print_box(" ");
|
domain->print_box(" ");
|
||||||
domain->set_initial_box();
|
domain->set_initial_box();
|
||||||
domain->set_global_box();
|
domain->set_global_box();
|
||||||
@ -1228,7 +1228,7 @@ void ReadData::header(int firstpass)
|
|||||||
// initialize type counts by the "extra" numbers so they get counted
|
// initialize type counts by the "extra" numbers so they get counted
|
||||||
// in case the corresponding "types" line is missing and thus the extra
|
// in case the corresponding "types" line is missing and thus the extra
|
||||||
// value will not be processed
|
// value will not be processed
|
||||||
|
|
||||||
if (addflag == NONE) {
|
if (addflag == NONE) {
|
||||||
atom->ntypes = extra_atom_types;
|
atom->ntypes = extra_atom_types;
|
||||||
atom->nbondtypes = extra_bond_types;
|
atom->nbondtypes = extra_bond_types;
|
||||||
@ -1244,7 +1244,7 @@ void ReadData::header(int firstpass)
|
|||||||
if (eof == nullptr) error->one(FLERR, "Unexpected end of data file");
|
if (eof == nullptr) error->one(FLERR, "Unexpected end of data file");
|
||||||
|
|
||||||
// check for units keyword in first line and print warning on mismatch
|
// check for units keyword in first line and print warning on mismatch
|
||||||
|
|
||||||
auto units = Tokenizer(utils::strfind(line, "units = \\w+")).as_vector();
|
auto units = Tokenizer(utils::strfind(line, "units = \\w+")).as_vector();
|
||||||
if (units.size() > 2) {
|
if (units.size() > 2) {
|
||||||
if (units[2] != update->unit_style)
|
if (units[2] != update->unit_style)
|
||||||
@ -1433,7 +1433,7 @@ void ReadData::header(int firstpass)
|
|||||||
xy = utils::numeric(FLERR, words[0], false, lmp);
|
xy = utils::numeric(FLERR, words[0], false, lmp);
|
||||||
xz = utils::numeric(FLERR, words[1], false, lmp);
|
xz = utils::numeric(FLERR, words[1], false, lmp);
|
||||||
yz = utils::numeric(FLERR, words[2], false, lmp);
|
yz = utils::numeric(FLERR, words[2], false, lmp);
|
||||||
|
|
||||||
} else if (utils::strmatch(line, "^\\s*\\f+\\s+\\f+\\s+\\f+\\s+\\avec\\s")) {
|
} else if (utils::strmatch(line, "^\\s*\\f+\\s+\\f+\\s+\\f+\\s+\\avec\\s")) {
|
||||||
avec_flag = 1;
|
avec_flag = 1;
|
||||||
avec[0] = utils::numeric(FLERR, words[0], false, lmp);
|
avec[0] = utils::numeric(FLERR, words[0], false, lmp);
|
||||||
@ -1522,7 +1522,7 @@ void ReadData::atoms()
|
|||||||
if (eof) error->all(FLERR, "Unexpected end of data file");
|
if (eof) error->all(FLERR, "Unexpected end of data file");
|
||||||
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
|
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
|
||||||
error->all(FLERR, "Label map is incomplete: all types must be assigned a unique type label");
|
error->all(FLERR, "Label map is incomplete: all types must be assigned a unique type label");
|
||||||
atom->data_atoms(nchunk, buffer, id_offset, mol_offset, toffset,
|
atom->data_atoms(nchunk, buffer, id_offset, mol_offset, toffset,
|
||||||
shiftflag, shift, tlabelflag, lmap->lmap2lmap.atom, triclinic_general);
|
shiftflag, shift, tlabelflag, lmap->lmap2lmap.atom, triclinic_general);
|
||||||
nread += nchunk;
|
nread += nchunk;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,12 +64,12 @@ class ReadData : public Command {
|
|||||||
int triclinic, triclinic_general;
|
int triclinic, triclinic_general;
|
||||||
int xloxhi_flag, yloyhi_flag, zlozhi_flag, tilt_flag;
|
int xloxhi_flag, yloyhi_flag, zlozhi_flag, tilt_flag;
|
||||||
int avec_flag, bvec_flag, cvec_flag, abc_origin_flag;
|
int avec_flag, bvec_flag, cvec_flag, abc_origin_flag;
|
||||||
|
|
||||||
double boxlo[3], boxhi[3];
|
double boxlo[3], boxhi[3];
|
||||||
double xy, xz, yz;
|
double xy, xz, yz;
|
||||||
double avec[3], bvec[3], cvec[3];
|
double avec[3], bvec[3], cvec[3];
|
||||||
double abc_origin[3];
|
double abc_origin[3];
|
||||||
|
|
||||||
// optional args
|
// optional args
|
||||||
|
|
||||||
int addflag, offsetflag, shiftflag, coeffflag, settypeflag;
|
int addflag, offsetflag, shiftflag, coeffflag, settypeflag;
|
||||||
|
|||||||
@ -980,7 +980,7 @@ void Thermo::parse_fields(const std::string &str)
|
|||||||
addfield("Pxy", &Thermo::compute_pxy_triclinic_general, FLOAT);
|
addfield("Pxy", &Thermo::compute_pxy_triclinic_general, FLOAT);
|
||||||
else addfield("Pxy", &Thermo::compute_pxy, FLOAT);
|
else addfield("Pxy", &Thermo::compute_pxy, FLOAT);
|
||||||
index_press_vector = add_compute(id_press, VECTOR);
|
index_press_vector = add_compute(id_press, VECTOR);
|
||||||
} else if (word == "pxz") {
|
} else if (word == "pxz") {
|
||||||
if (triclinic_general)
|
if (triclinic_general)
|
||||||
addfield("Pxz", &Thermo::compute_pxz_triclinic_general, FLOAT);
|
addfield("Pxz", &Thermo::compute_pxz_triclinic_general, FLOAT);
|
||||||
else addfield("Pxz", &Thermo::compute_pxz, FLOAT);
|
else addfield("Pxz", &Thermo::compute_pxz, FLOAT);
|
||||||
@ -1223,7 +1223,7 @@ void Thermo::check_press_vector(const std::string &keyword)
|
|||||||
pressure->invoked_flag |= Compute::INVOKED_VECTOR;
|
pressure->invoked_flag |= Compute::INVOKED_VECTOR;
|
||||||
|
|
||||||
// store 3x3 matrix form of symmetric pressure tensor for use in triclinic_general()
|
// store 3x3 matrix form of symmetric pressure tensor for use in triclinic_general()
|
||||||
|
|
||||||
if (triclinic_general) {
|
if (triclinic_general) {
|
||||||
press_tensor[0][0] = pressure->vector[0];
|
press_tensor[0][0] = pressure->vector[0];
|
||||||
press_tensor[1][1] = pressure->vector[1];
|
press_tensor[1][1] = pressure->vector[1];
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class Thermo : protected Pointers {
|
|||||||
std::string image_fname;
|
std::string image_fname;
|
||||||
|
|
||||||
// data used by routines that compute single values
|
// data used by routines that compute single values
|
||||||
|
|
||||||
int ivalue; // integer value to print
|
int ivalue; // integer value to print
|
||||||
double dvalue; // double value to print
|
double dvalue; // double value to print
|
||||||
bigint bivalue; // big integer value to print
|
bigint bivalue; // big integer value to print
|
||||||
@ -96,7 +96,7 @@ class Thermo : protected Pointers {
|
|||||||
// index = where they are in computes list
|
// index = where they are in computes list
|
||||||
// id = ID of Compute objects
|
// id = ID of Compute objects
|
||||||
// Compute * = ptrs to the Compute objects
|
// Compute * = ptrs to the Compute objects
|
||||||
|
|
||||||
int index_temp, index_press_scalar, index_press_vector, index_pe;
|
int index_temp, index_press_scalar, index_press_vector, index_pe;
|
||||||
class Compute *temperature, *pressure, *pe;
|
class Compute *temperature, *pressure, *pe;
|
||||||
double press_tensor[3][3];
|
double press_tensor[3][3];
|
||||||
|
|||||||
@ -74,7 +74,7 @@ void WriteData::command(int narg, char **arg)
|
|||||||
fixflag = 1;
|
fixflag = 1;
|
||||||
triclinic_general = 0;
|
triclinic_general = 0;
|
||||||
lmapflag = 1;
|
lmapflag = 1;
|
||||||
|
|
||||||
// store current (default) setting since we may change it
|
// store current (default) setting since we may change it
|
||||||
|
|
||||||
int domain_triclinic_general = domain->triclinic_general;
|
int domain_triclinic_general = domain->triclinic_general;
|
||||||
@ -227,9 +227,9 @@ void WriteData::write(const std::string &file)
|
|||||||
// reset internal per-atom data that needs rotation
|
// reset internal per-atom data that needs rotation
|
||||||
|
|
||||||
if (domain->triclinic_general) atom->avec->write_data_restricted_to_general();
|
if (domain->triclinic_general) atom->avec->write_data_restricted_to_general();
|
||||||
|
|
||||||
// per atom info in Atoms and Velocities sections
|
// per atom info in Atoms and Velocities sections
|
||||||
|
|
||||||
if (natoms) atoms();
|
if (natoms) atoms();
|
||||||
if (natoms) velocities();
|
if (natoms) velocities();
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ void WriteData::write(const std::string &file)
|
|||||||
// restore internal per-atom data that was rotated
|
// restore internal per-atom data that was rotated
|
||||||
|
|
||||||
if (domain->triclinic_general) atom->avec->write_data_restore_restricted();
|
if (domain->triclinic_general) atom->avec->write_data_restore_restricted();
|
||||||
|
|
||||||
// close data file
|
// close data file
|
||||||
|
|
||||||
if (me == 0) fclose(fp);
|
if (me == 0) fclose(fp);
|
||||||
@ -326,7 +326,7 @@ void WriteData::header()
|
|||||||
domain->boxlo[2],domain->boxhi[2]);
|
domain->boxlo[2],domain->boxhi[2]);
|
||||||
if (domain->triclinic)
|
if (domain->triclinic)
|
||||||
fmt::print(fp,"{} {} {} xy xz yz\n",domain->xy,domain->xz,domain->yz);
|
fmt::print(fp,"{} {} {} xy xz yz\n",domain->xy,domain->xz,domain->yz);
|
||||||
|
|
||||||
} else if (domain->triclinic_general) {
|
} else if (domain->triclinic_general) {
|
||||||
fmt::print(fp,"\n{} {} {} avec\n{} {} {} bvec\n{} {} {} cvec\n",
|
fmt::print(fp,"\n{} {} {} avec\n{} {} {} bvec\n{} {} {} cvec\n",
|
||||||
domain->avec[0],domain->avec[1],domain->avec[2],
|
domain->avec[0],domain->avec[1],domain->avec[2],
|
||||||
|
|||||||
@ -451,7 +451,7 @@ void WriteRestart::header()
|
|||||||
write_int(TRICLINIC_GENERAL,domain->triclinic_general);
|
write_int(TRICLINIC_GENERAL,domain->triclinic_general);
|
||||||
if (domain->triclinic_general)
|
if (domain->triclinic_general)
|
||||||
write_double_vec(ROTATE_G2R,9,&domain->rotate_g2r[0][0]);
|
write_double_vec(ROTATE_G2R,9,&domain->rotate_g2r[0][0]);
|
||||||
|
|
||||||
write_double_vec(SPECIAL_LJ,3,&force->special_lj[1]);
|
write_double_vec(SPECIAL_LJ,3,&force->special_lj[1]);
|
||||||
write_double_vec(SPECIAL_COUL,3,&force->special_coul[1]);
|
write_double_vec(SPECIAL_COUL,3,&force->special_coul[1]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user