Merge branch 'master' into openmp-step6
Resolved Conflicts: src/GPU/pppm_gpu.cpp src/KSPACE/ewald.h src/MANYBODY/pair_airebo.cpp src/MANYBODY/pair_comb.cpp src/MANYBODY/pair_comb.h src/MANYBODY/pair_tersoff.h src/MOLECULE/pair_hbond_dreiding_lj.cpp src/MOLECULE/pair_hbond_dreiding_morse.cpp src/USER-CUDA/pppm_cuda.cpp src/USER-OMP/Install.sh src/USER-OMP/Package.sh src/USER-OMP/dihedral_charmm_omp.cpp src/USER-OMP/dihedral_charmm_omp.h src/USER-OMP/dihedral_class2_omp.cpp src/USER-OMP/dihedral_class2_omp.h src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp src/USER-OMP/dihedral_cosine_shift_exp_omp.h src/USER-OMP/dihedral_harmonic_omp.cpp src/USER-OMP/dihedral_harmonic_omp.h src/USER-OMP/dihedral_helix_omp.cpp src/USER-OMP/dihedral_helix_omp.h src/USER-OMP/dihedral_multi_harmonic_omp.cpp src/USER-OMP/dihedral_multi_harmonic_omp.h src/USER-OMP/dihedral_opls_omp.cpp src/USER-OMP/dihedral_opls_omp.h src/USER-OMP/fix_nve_sphere_omp.cpp src/USER-OMP/pair_adp_omp.cpp src/USER-OMP/pair_adp_omp.h src/USER-OMP/pair_born_coul_long_omp.cpp src/USER-OMP/pair_born_coul_long_omp.h src/USER-OMP/pair_born_omp.cpp src/USER-OMP/pair_born_omp.h src/USER-OMP/pair_buck_coul_cut_omp.cpp src/USER-OMP/pair_buck_coul_cut_omp.h src/USER-OMP/pair_buck_coul_long_omp.cpp src/USER-OMP/pair_buck_coul_long_omp.h src/USER-OMP/pair_buck_coul_omp.cpp src/USER-OMP/pair_buck_coul_omp.h src/USER-OMP/pair_buck_omp.cpp src/USER-OMP/pair_buck_omp.h src/USER-OMP/pair_cdeam_omp.cpp src/USER-OMP/pair_cdeam_omp.h src/USER-OMP/pair_colloid_omp.cpp src/USER-OMP/pair_colloid_omp.h src/USER-OMP/pair_coul_cut_omp.cpp src/USER-OMP/pair_coul_cut_omp.h src/USER-OMP/pair_coul_debye_omp.cpp src/USER-OMP/pair_coul_debye_omp.h src/USER-OMP/pair_coul_long_omp.cpp src/USER-OMP/pair_coul_long_omp.h src/USER-OMP/pair_dipole_cut_omp.cpp src/USER-OMP/pair_dipole_cut_omp.h src/USER-OMP/pair_dipole_sf_omp.cpp src/USER-OMP/pair_dipole_sf_omp.h src/USER-OMP/pair_dpd_omp.cpp src/USER-OMP/pair_dpd_omp.h src/USER-OMP/pair_dpd_tstat_omp.cpp src/USER-OMP/pair_dpd_tstat_omp.h src/USER-OMP/pair_eam_omp.cpp src/USER-OMP/pair_eam_omp.h src/USER-OMP/pair_edip_omp.cpp src/USER-OMP/pair_edip_omp.h src/USER-OMP/pair_eim_omp.cpp src/USER-OMP/pair_eim_omp.h src/USER-OMP/pair_gauss_omp.cpp src/USER-OMP/pair_gauss_omp.h src/USER-OMP/pair_gayberne_omp.cpp src/USER-OMP/pair_gayberne_omp.h src/USER-OMP/pair_gran_hertz_history_omp.cpp src/USER-OMP/pair_gran_hertz_history_omp.h src/USER-OMP/pair_gran_hooke_history_omp.cpp src/USER-OMP/pair_gran_hooke_history_omp.h src/USER-OMP/pair_gran_hooke_omp.cpp src/USER-OMP/pair_gran_hooke_omp.h src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp src/USER-OMP/pair_hbond_dreiding_lj_omp.h src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp src/USER-OMP/pair_hbond_dreiding_morse_omp.h src/USER-OMP/pair_lj96_cut_omp.cpp src/USER-OMP/pair_lj96_cut_omp.h src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp src/USER-OMP/pair_lj_charmm_coul_long_omp.h src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp src/USER-OMP/pair_lj_class2_coul_cut_omp.h src/USER-OMP/pair_lj_class2_coul_long_omp.cpp src/USER-OMP/pair_lj_class2_coul_long_omp.h src/USER-OMP/pair_lj_class2_omp.cpp src/USER-OMP/pair_lj_class2_omp.h src/USER-OMP/pair_lj_coul_omp.cpp src/USER-OMP/pair_lj_coul_omp.h src/USER-OMP/pair_lj_cubic_omp.cpp src/USER-OMP/pair_lj_cubic_omp.h src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp src/USER-OMP/pair_lj_cut_coul_cut_omp.h src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp src/USER-OMP/pair_lj_cut_coul_debye_omp.h src/USER-OMP/pair_lj_cut_coul_long_omp.cpp src/USER-OMP/pair_lj_cut_coul_long_omp.h src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.cpp src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.h src/USER-OMP/pair_lj_cut_omp.cpp src/USER-OMP/pair_lj_expand_omp.cpp src/USER-OMP/pair_lj_expand_omp.h src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h src/USER-OMP/pair_lj_gromacs_omp.cpp src/USER-OMP/pair_lj_gromacs_omp.h src/USER-OMP/pair_lj_sf_omp.cpp src/USER-OMP/pair_lj_sf_omp.h src/USER-OMP/pair_lj_smooth_omp.cpp src/USER-OMP/pair_lj_smooth_omp.h src/USER-OMP/pair_lubricate_omp.cpp src/USER-OMP/pair_lubricate_omp.h src/USER-OMP/pair_morse_omp.cpp src/USER-OMP/pair_morse_omp.h src/USER-OMP/pair_peri_lps_omp.cpp src/USER-OMP/pair_peri_lps_omp.h src/USER-OMP/pair_peri_pmb_omp.cpp src/USER-OMP/pair_peri_pmb_omp.h src/USER-OMP/pair_resquared_omp.cpp src/USER-OMP/pair_resquared_omp.h src/USER-OMP/pair_soft_omp.cpp src/USER-OMP/pair_soft_omp.h src/USER-OMP/pair_sw_omp.cpp src/USER-OMP/pair_sw_omp.h src/USER-OMP/pair_table_omp.cpp src/USER-OMP/pair_table_omp.h src/USER-OMP/pair_tersoff_omp.cpp src/USER-OMP/pair_tersoff_omp.h src/USER-OMP/pair_yukawa_colloid_omp.cpp src/USER-OMP/pair_yukawa_colloid_omp.h src/USER-OMP/pair_yukawa_omp.cpp src/USER-OMP/pair_yukawa_omp.h src/USER-OMP/thr_omp.cpp src/USER-OMP/thr_omp.h src/read_data.cpp
This commit is contained in:
@ -21,6 +21,8 @@
|
||||
#include "atom.h"
|
||||
#include "atom_vec.h"
|
||||
#include "atom_vec_ellipsoid.h"
|
||||
#include "atom_vec_line.h"
|
||||
#include "atom_vec_tri.h"
|
||||
#include "comm.h"
|
||||
#include "update.h"
|
||||
#include "force.h"
|
||||
@ -42,7 +44,10 @@ using namespace LAMMPS_NS;
|
||||
#define DELTA 4 // must be 2 or larger
|
||||
|
||||
// customize for new sections
|
||||
#define NSECTIONS 21 // change when add to header::section_keywords
|
||||
#define NSECTIONS 23 // change when add to header::section_keywords
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -60,6 +65,10 @@ ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp)
|
||||
|
||||
nellipsoids = 0;
|
||||
avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
|
||||
nlines = 0;
|
||||
avec_line = (AtomVecLine *) atom->style_match("line");
|
||||
ntris = 0;
|
||||
avec_tri = (AtomVecTri *) atom->style_match("tri");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -150,8 +159,18 @@ void ReadData::command(int narg, char **arg)
|
||||
} else if (strcmp(keyword,"Ellipsoids") == 0) {
|
||||
if (!avec_ellipsoid)
|
||||
error->one(FLERR,"Invalid data file section: Ellipsoids");
|
||||
if (atomflag == 0) error->one(FLERR,"Must read Atoms before Ellipsoids");
|
||||
ellipsoids();
|
||||
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Ellipsoids");
|
||||
bonus(nellipsoids,(AtomVec *) avec_ellipsoid,"ellipsoids");
|
||||
} else if (strcmp(keyword,"Lines") == 0) {
|
||||
if (!avec_line)
|
||||
error->one(FLERR,"Invalid data file section: Lines");
|
||||
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Lines");
|
||||
bonus(nlines,(AtomVec *) avec_line,"lines");
|
||||
} else if (strcmp(keyword,"Triangles") == 0) {
|
||||
if (!avec_tri)
|
||||
error->one(FLERR,"Invalid data file section: Triangles");
|
||||
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Triangles");
|
||||
bonus(ntris,(AtomVec *) avec_tri,"triangles");
|
||||
|
||||
} else if (strcmp(keyword,"Bonds") == 0) {
|
||||
if (atom->avec->bonds_allow == 0)
|
||||
@ -222,25 +241,31 @@ void ReadData::command(int narg, char **arg)
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
error->one(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
|
||||
if (force->dihedral == NULL)
|
||||
error->one(FLERR,"Must define dihedral_style before MiddleBondTorsion Coeffs");
|
||||
error->one(FLERR,
|
||||
"Must define dihedral_style before "
|
||||
"MiddleBondTorsion Coeffs");
|
||||
dihedralcoeffs(1);
|
||||
} else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
error->one(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
|
||||
if (force->dihedral == NULL)
|
||||
error->one(FLERR,"Must define dihedral_style before EndBondTorsion Coeffs");
|
||||
error->one(FLERR,
|
||||
"Must define dihedral_style before EndBondTorsion Coeffs");
|
||||
dihedralcoeffs(2);
|
||||
} else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
error->one(FLERR,"Invalid data file section: AngleTorsion Coeffs");
|
||||
if (force->dihedral == NULL)
|
||||
error->one(FLERR,"Must define dihedral_style before AngleTorsion Coeffs");
|
||||
error->one(FLERR,
|
||||
"Must define dihedral_style before AngleTorsion Coeffs");
|
||||
dihedralcoeffs(3);
|
||||
} else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
error->one(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
|
||||
if (force->dihedral == NULL)
|
||||
error->one(FLERR,"Must define dihedral_style before AngleAngleTorsion Coeffs");
|
||||
error->one(FLERR,
|
||||
"Must define dihedral_style before "
|
||||
"AngleAngleTorsion Coeffs");
|
||||
dihedralcoeffs(4);
|
||||
} else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
@ -274,7 +299,8 @@ void ReadData::command(int narg, char **arg)
|
||||
|
||||
// error if natoms > 0 yet no atoms were read
|
||||
|
||||
if (atom->natoms > 0 && atomflag == 0) error->one(FLERR,"No atoms in data file");
|
||||
if (atom->natoms > 0 && atomflag == 0)
|
||||
error->one(FLERR,"No atoms in data file");
|
||||
|
||||
// create bond topology now that system is defined
|
||||
|
||||
@ -303,7 +329,7 @@ void ReadData::header(int flag)
|
||||
// customize for new sections
|
||||
|
||||
char *section_keywords[NSECTIONS] =
|
||||
{"Atoms","Velocities","Ellipsoids",
|
||||
{"Atoms","Velocities","Ellipsoids","Lines","Triangles",
|
||||
"Bonds","Angles","Dihedrals","Impropers",
|
||||
"Masses","Pair Coeffs","Bond Coeffs","Angle Coeffs",
|
||||
"Dihedral Coeffs","Improper Coeffs",
|
||||
@ -373,6 +399,14 @@ void ReadData::header(int flag)
|
||||
if (!avec_ellipsoid)
|
||||
error->one(FLERR,"No ellipsoids allowed with this atom style");
|
||||
sscanf(line,BIGINT_FORMAT,&nellipsoids);
|
||||
} else if (strstr(line,"lines")) {
|
||||
if (!avec_line)
|
||||
error->one(FLERR,"No lines allowed with this atom style");
|
||||
sscanf(line,BIGINT_FORMAT,&nlines);
|
||||
} else if (strstr(line,"triangles")) {
|
||||
if (!avec_tri)
|
||||
error->one(FLERR,"No triangles allowed with this atom style");
|
||||
sscanf(line,BIGINT_FORMAT,&ntris);
|
||||
}
|
||||
|
||||
else if (strstr(line,"xlo xhi"))
|
||||
@ -475,7 +509,8 @@ void ReadData::atoms()
|
||||
if (logfile) fprintf(logfile," " BIGINT_FORMAT " atoms\n",natoms);
|
||||
}
|
||||
|
||||
if (natoms != atom->natoms) error->all(FLERR,"Did not assign all atoms correctly");
|
||||
if (natoms != atom->natoms)
|
||||
error->all(FLERR,"Did not assign all atoms correctly");
|
||||
|
||||
// if any atom ID < 0, error
|
||||
// if all atom IDs = 0, tag_enable = 0
|
||||
@ -568,11 +603,11 @@ void ReadData::velocities()
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
read all ellipsoids
|
||||
read all bonus data
|
||||
to find atoms, must build atom map if not a molecular system
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ReadData::ellipsoids()
|
||||
void ReadData::bonus(bigint nbonus, AtomVec *ptr, char *type)
|
||||
{
|
||||
int i,m,nchunk;
|
||||
|
||||
@ -585,7 +620,7 @@ void ReadData::ellipsoids()
|
||||
}
|
||||
|
||||
bigint nread = 0;
|
||||
bigint natoms = nellipsoids;
|
||||
bigint natoms = nbonus;
|
||||
|
||||
while (nread < natoms) {
|
||||
if (natoms-nread > CHUNK) nchunk = CHUNK;
|
||||
@ -603,7 +638,7 @@ void ReadData::ellipsoids()
|
||||
MPI_Bcast(&m,1,MPI_INT,0,world);
|
||||
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
|
||||
|
||||
atom->data_bonus(nchunk,buffer,avec_ellipsoid);
|
||||
atom->data_bonus(nchunk,buffer,ptr);
|
||||
nread += nchunk;
|
||||
}
|
||||
|
||||
@ -613,8 +648,8 @@ void ReadData::ellipsoids()
|
||||
}
|
||||
|
||||
if (me == 0) {
|
||||
if (screen) fprintf(screen," " BIGINT_FORMAT " ellipsoids\n",natoms);
|
||||
if (logfile) fprintf(logfile," " BIGINT_FORMAT " ellipsoids\n",natoms);
|
||||
if (screen) fprintf(screen," " BIGINT_FORMAT " %s\n",natoms,type);
|
||||
if (logfile) fprintf(logfile," " BIGINT_FORMAT " %s\n",natoms,type);
|
||||
}
|
||||
}
|
||||
|
||||
@ -660,7 +695,8 @@ void ReadData::bonds()
|
||||
if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",sum/factor);
|
||||
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",sum/factor);
|
||||
}
|
||||
if (sum != factor*atom->nbonds) error->all(FLERR,"Bonds assigned incorrectly");
|
||||
if (sum != factor*atom->nbonds)
|
||||
error->all(FLERR,"Bonds assigned incorrectly");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -705,7 +741,8 @@ void ReadData::angles()
|
||||
if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",sum/factor);
|
||||
if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",sum/factor);
|
||||
}
|
||||
if (sum != factor*atom->nangles) error->all(FLERR,"Angles assigned incorrectly");
|
||||
if (sum != factor*atom->nangles)
|
||||
error->all(FLERR,"Angles assigned incorrectly");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -1010,6 +1047,8 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
|
||||
int natoms = static_cast<int> (atom->natoms);
|
||||
bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
|
||||
int ellipsoid_flag = 0;
|
||||
int line_flag = 0;
|
||||
int tri_flag = 0;
|
||||
|
||||
// customize for new sections
|
||||
// allocate topology counting vector
|
||||
@ -1031,6 +1070,14 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
|
||||
error->one(FLERR,"Invalid data file section: Ellipsoids");
|
||||
ellipsoid_flag = 1;
|
||||
skip_lines(nellipsoids);
|
||||
} else if (strcmp(keyword,"Lines") == 0) {
|
||||
if (!avec_line) error->one(FLERR,"Invalid data file section: Lines");
|
||||
line_flag = 1;
|
||||
skip_lines(nlines);
|
||||
} else if (strcmp(keyword,"Triangles") == 0) {
|
||||
if (!avec_tri) error->one(FLERR,"Invalid data file section: Triangles");
|
||||
tri_flag = 1;
|
||||
skip_lines(ntris);
|
||||
|
||||
} else if (strcmp(keyword,"Pair Coeffs") == 0) {
|
||||
if (force->pair == NULL)
|
||||
@ -1077,25 +1124,31 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
error->one(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
|
||||
if (force->dihedral == NULL)
|
||||
error->one(FLERR,"Must define dihedral_style before MiddleBondTorsion Coeffs");
|
||||
error->one(FLERR,
|
||||
"Must define dihedral_style before "
|
||||
"MiddleBondTorsion Coeffs");
|
||||
skip_lines(atom->ndihedraltypes);
|
||||
} else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
error->one(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
|
||||
if (force->dihedral == NULL)
|
||||
error->one(FLERR,"Must define dihedral_style before EndBondTorsion Coeffs");
|
||||
error->one(FLERR,
|
||||
"Must define dihedral_style before EndBondTorsion Coeffs");
|
||||
skip_lines(atom->ndihedraltypes);
|
||||
} else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
error->one(FLERR,"Invalid data file section: AngleTorsion Coeffs");
|
||||
if (force->dihedral == NULL)
|
||||
error->one(FLERR,"Must define dihedral_style before AngleTorsion Coeffs");
|
||||
error->one(FLERR,
|
||||
"Must define dihedral_style before AngleTorsion Coeffs");
|
||||
skip_lines(atom->ndihedraltypes);
|
||||
} else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
error->one(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
|
||||
if (force->dihedral == NULL)
|
||||
error->one(FLERR,"Must define dihedral_style before AngleAngleTorsion Coeffs");
|
||||
error->one(FLERR,
|
||||
"Must define dihedral_style before "
|
||||
"AngleAngleTorsion Coeffs");
|
||||
skip_lines(atom->ndihedraltypes);
|
||||
} else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
|
||||
if (atom->avec->dihedrals_allow == 0)
|
||||
@ -1252,6 +1305,10 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
|
||||
|
||||
if (nellipsoids && !ellipsoid_flag)
|
||||
error->one(FLERR,"Needed bonus data not in data file");
|
||||
if (nlines && !line_flag)
|
||||
error->one(FLERR,"Needed bonus data not in data file");
|
||||
if (ntris && !tri_flag)
|
||||
error->one(FLERR,"Needed bonus data not in data file");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user