git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11507 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2014-02-07 21:17:22 +00:00
parent e62361cbf7
commit 784d229527
4 changed files with 46 additions and 28 deletions

View File

@ -139,10 +139,9 @@ void ReadData::command(int narg, char **arg)
} else error->all(FLERR,"Illegal read_data command");
}
// perform 1-pass read if no molecular topoogy in file
// perform 2-pass read if molecular topology
// 1st pass calculates max topology/atom
// perform 2-pass read if molecular topology,
// first pass calculates max topology/atom
int atomflag,topoflag;
int bondflag,angleflag,dihedralflag,improperflag;
@ -180,7 +179,6 @@ void ReadData::command(int narg, char **arg)
atom->allocate_type_arrays();
atom->avec->grow(n);
n = atom->nmax;
domain->print_box(" ");
domain->set_initial_box();
@ -428,16 +426,19 @@ void ReadData::command(int narg, char **arg)
if (!topoflag) break;
firstpass = 0;
// reallocate bond,angle,diehdral,improper arrays via grow(),
// using new bond,angle,dihedral,improper per-atom values from 1st pass
// reallocate bond,angle,diehdral,improper arrays via grow()
// use new bond,angle,dihedral,improper per-atom values from 1st pass
// should leave other atom arrays unchanged, since already nmax in length
// if bonds/etc not in data file, initialize per-atom size
// with extra settings before grow() of these topology arrays
if (bondflag) {
memory->destroy(atom->bond_type);
memory->destroy(atom->bond_atom);
atom->bond_type = NULL;
atom->bond_atom = NULL;
}
} else atom->bond_per_atom = atom->extra_bond_per_atom;
if (angleflag) {
memory->destroy(atom->angle_type);
memory->destroy(atom->angle_atom1);
@ -445,7 +446,8 @@ void ReadData::command(int narg, char **arg)
memory->destroy(atom->angle_atom3);
atom->angle_type = NULL;
atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = NULL;
}
} else atom->angle_per_atom = atom->extra_angle_per_atom;
if (dihedralflag) {
memory->destroy(atom->dihedral_type);
memory->destroy(atom->dihedral_atom1);
@ -455,7 +457,8 @@ void ReadData::command(int narg, char **arg)
atom->dihedral_type = NULL;
atom->dihedral_atom1 = atom->dihedral_atom2 =
atom->dihedral_atom3 = atom->dihedral_atom4 = NULL;
}
} else atom->dihedral_per_atom = atom->extra_dihedral_per_atom;
if (improperflag) {
memory->destroy(atom->improper_type);
memory->destroy(atom->improper_atom1);
@ -465,7 +468,7 @@ void ReadData::command(int narg, char **arg)
atom->improper_type = NULL;
atom->improper_atom1 = atom->improper_atom2 =
atom->improper_atom3 = atom->improper_atom4 = NULL;
}
} else atom->improper_per_atom = atom->extra_improper_per_atom;
atom->avec->grow(atom->nmax);
}