fix compilation issues
This commit is contained in:
@ -610,7 +610,7 @@ int PairAmoeba::read_section_line(FILE *fp, char *line,
|
|||||||
|
|
||||||
char *ptr,*copy,*copy_next;
|
char *ptr,*copy,*copy_next;
|
||||||
char **words,**words_next;
|
char **words,**words_next;
|
||||||
int nwords_next;
|
int nwords, nwords_next;
|
||||||
|
|
||||||
copy = copy_next = NULL;
|
copy = copy_next = NULL;
|
||||||
words = words_next = NULL;
|
words = words_next = NULL;
|
||||||
|
|||||||
@ -61,13 +61,13 @@ void PairAmoeba::multipole()
|
|||||||
|
|
||||||
// owned atoms
|
// owned atoms
|
||||||
|
|
||||||
int nlocal = atom->nlocal;
|
const int nlocal = atom->nlocal;
|
||||||
|
|
||||||
// zero repulsion torque on owned + ghost atoms
|
// zero repulsion torque on owned + ghost atoms
|
||||||
|
|
||||||
int nall = nlocal + atom->nghost;
|
const int nall = nlocal + atom->nghost;
|
||||||
|
|
||||||
for (i = 0; i < nall; i++) {
|
for (int i = 0; i < nall; i++) {
|
||||||
tq[i][0] = 0.0;
|
tq[i][0] = 0.0;
|
||||||
tq[i][1] = 0.0;
|
tq[i][1] = 0.0;
|
||||||
tq[i][2] = 0.0;
|
tq[i][2] = 0.0;
|
||||||
@ -90,7 +90,7 @@ void PairAmoeba::multipole()
|
|||||||
term = 2.0 * aewald * aewald;
|
term = 2.0 * aewald * aewald;
|
||||||
fterm = -felec * aewald / MY_PIS;
|
fterm = -felec * aewald / MY_PIS;
|
||||||
|
|
||||||
for (i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
ci = rpole[i][0];
|
ci = rpole[i][0];
|
||||||
dix = rpole[i][1];
|
dix = rpole[i][1];
|
||||||
diy = rpole[i][2];
|
diy = rpole[i][2];
|
||||||
|
|||||||
@ -32,47 +32,33 @@ AtomVecAmoeba::AtomVecAmoeba(LAMMPS *lmp) : AtomVec(lmp)
|
|||||||
// order of fields in a string does not matter
|
// order of fields in a string does not matter
|
||||||
// except: fields_data_atom & fields_data_vel must match data file
|
// except: fields_data_atom & fields_data_vel must match data file
|
||||||
|
|
||||||
fields_grow = (char *)
|
// clang-format off
|
||||||
"q molecule num_bond bond_type bond_atom "
|
fields_grow = {"q", "molecule", "num_bond", "bond_type", "bond_atom", "num_angle", "angle_type",
|
||||||
"num_angle angle_type angle_atom1 angle_atom2 angle_atom3 "
|
"angle_atom1", "angle_atom2", "angle_atom3", "num_dihedral", "dihedral_type", "dihedral_atom1",
|
||||||
"num_dihedral dihedral_type dihedral_atom1 dihedral_atom2 "
|
"dihedral_atom2", "dihedral_atom3", "dihedral_atom4", "num_improper", "improper_type",
|
||||||
"dihedral_atom3 dihedral_atom4 "
|
"improper_atom1", "improper_atom2", "improper_atom3", "improper_atom4", "nspecial", "special",
|
||||||
"num_improper improper_type improper_atom1 improper_atom2 "
|
"nspecial15", "special15"};
|
||||||
"improper_atom3 improper_atom4 "
|
fields_copy = {"q", "molecule", "num_bond", "bond_type", "bond_atom", "num_angle", "angle_type",
|
||||||
"nspecial special nspecial15 special15";
|
"angle_atom1", "angle_atom2", "angle_atom3", "num_dihedral", "dihedral_type", "dihedral_atom1",
|
||||||
fields_copy = (char *)
|
"dihedral_atom2", "dihedral_atom3", "dihedral_atom4", "num_improper", "improper_type",
|
||||||
"q molecule num_bond bond_type bond_atom "
|
"improper_atom1", "improper_atom2", "improper_atom3", "improper_atom4", "nspecial", "special",
|
||||||
"num_angle angle_type angle_atom1 angle_atom2 angle_atom3 "
|
"nspecial15", "special15"};
|
||||||
"num_dihedral dihedral_type dihedral_atom1 dihedral_atom2 "
|
fields_border = {"q", "molecule"};
|
||||||
"dihedral_atom3 dihedral_atom4 "
|
fields_border_vel = {"q", "molecule"};
|
||||||
"num_improper improper_type improper_atom1 improper_atom2 "
|
fields_exchange = {"q", "molecule", "num_bond", "bond_type", "bond_atom", "num_angle",
|
||||||
"improper_atom3 improper_atom4 "
|
"angle_type", "angle_atom1", "angle_atom2", "angle_atom3", "num_dihedral", "dihedral_type",
|
||||||
"nspecial special nspecial15 special15";
|
"dihedral_atom1", "dihedral_atom2", "dihedral_atom3", "dihedral_atom4", "num_improper",
|
||||||
fields_comm = (char *) "";
|
"improper_type", "improper_atom1", "improper_atom2", "improper_atom3", "improper_atom4",
|
||||||
fields_comm_vel = (char *) "";
|
"nspecial", "special", "nspecial15", "special15"};
|
||||||
fields_reverse = (char *) "";
|
fields_restart = {"q", "molecule", "num_bond", "bond_type", "bond_atom", "num_angle",
|
||||||
fields_border = (char *) "q molecule";
|
"angle_type", "angle_atom1", "angle_atom2", "angle_atom3", "num_dihedral", "dihedral_type",
|
||||||
fields_border_vel = (char *) "q molecule";
|
"dihedral_atom1", "dihedral_atom2", "dihedral_atom3", "dihedral_atom4", "num_improper",
|
||||||
fields_exchange = (char *)
|
"improper_type", "improper_atom1", "improper_atom2", "improper_atom3", "improper_atom4"};
|
||||||
"q molecule num_bond bond_type bond_atom "
|
fields_create = {"q", "molecule", "num_bond", "num_angle", "num_dihedral", "num_improper",
|
||||||
"num_angle angle_type angle_atom1 angle_atom2 angle_atom3 "
|
"nspecial", "nspecial15"};
|
||||||
"num_dihedral dihedral_type dihedral_atom1 dihedral_atom2 "
|
fields_data_atom = {"id", "molecule", "type", "q", "x"};
|
||||||
"dihedral_atom3 dihedral_atom4 "
|
fields_data_vel = {"id", "v"};
|
||||||
"num_improper improper_type improper_atom1 improper_atom2 "
|
// clang-format on
|
||||||
"improper_atom3 improper_atom4 "
|
|
||||||
"nspecial special nspecial15 special15";
|
|
||||||
fields_restart = (char *)
|
|
||||||
"q molecule num_bond bond_type bond_atom "
|
|
||||||
"num_angle angle_type angle_atom1 angle_atom2 angle_atom3 "
|
|
||||||
"num_dihedral dihedral_type dihedral_atom1 dihedral_atom2 "
|
|
||||||
"dihedral_atom3 dihedral_atom4 "
|
|
||||||
"num_improper improper_type improper_atom1 improper_atom2 "
|
|
||||||
"improper_atom3 improper_atom4";
|
|
||||||
fields_create = (char *)
|
|
||||||
"q molecule num_bond num_angle num_dihedral num_improper nspecial nspecial15";
|
|
||||||
fields_data_atom = (char *) "id molecule type q x";
|
|
||||||
fields_data_vel = (char *) "id v";
|
|
||||||
|
|
||||||
setup_fields();
|
setup_fields();
|
||||||
|
|
||||||
bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
|
bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
|
||||||
@ -145,7 +131,8 @@ void AtomVecAmoeba::pack_restart_pre(int ilocal)
|
|||||||
bond_negative[m] = 1;
|
bond_negative[m] = 1;
|
||||||
bond_type[ilocal][m] = -bond_type[ilocal][m];
|
bond_type[ilocal][m] = -bond_type[ilocal][m];
|
||||||
any_bond_negative = 1;
|
any_bond_negative = 1;
|
||||||
} else bond_negative[m] = 0;
|
} else
|
||||||
|
bond_negative[m] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
any_angle_negative = 0;
|
any_angle_negative = 0;
|
||||||
@ -154,7 +141,8 @@ void AtomVecAmoeba::pack_restart_pre(int ilocal)
|
|||||||
angle_negative[m] = 1;
|
angle_negative[m] = 1;
|
||||||
angle_type[ilocal][m] = -angle_type[ilocal][m];
|
angle_type[ilocal][m] = -angle_type[ilocal][m];
|
||||||
any_angle_negative = 1;
|
any_angle_negative = 1;
|
||||||
} else angle_negative[m] = 0;
|
} else
|
||||||
|
angle_negative[m] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
any_dihedral_negative = 0;
|
any_dihedral_negative = 0;
|
||||||
@ -163,7 +151,8 @@ void AtomVecAmoeba::pack_restart_pre(int ilocal)
|
|||||||
dihedral_negative[m] = 1;
|
dihedral_negative[m] = 1;
|
||||||
dihedral_type[ilocal][m] = -dihedral_type[ilocal][m];
|
dihedral_type[ilocal][m] = -dihedral_type[ilocal][m];
|
||||||
any_dihedral_negative = 1;
|
any_dihedral_negative = 1;
|
||||||
} else dihedral_negative[m] = 0;
|
} else
|
||||||
|
dihedral_negative[m] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
any_improper_negative = 0;
|
any_improper_negative = 0;
|
||||||
@ -172,7 +161,8 @@ void AtomVecAmoeba::pack_restart_pre(int ilocal)
|
|||||||
improper_negative[m] = 1;
|
improper_negative[m] = 1;
|
||||||
improper_type[ilocal][m] = -improper_type[ilocal][m];
|
improper_type[ilocal][m] = -improper_type[ilocal][m];
|
||||||
any_improper_negative = 1;
|
any_improper_negative = 1;
|
||||||
} else improper_negative[m] = 0;
|
} else
|
||||||
|
improper_negative[m] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,14 +186,12 @@ void AtomVecAmoeba::pack_restart_post(int ilocal)
|
|||||||
|
|
||||||
if (any_dihedral_negative) {
|
if (any_dihedral_negative) {
|
||||||
for (int m = 0; m < num_dihedral[ilocal]; m++)
|
for (int m = 0; m < num_dihedral[ilocal]; m++)
|
||||||
if (dihedral_negative[m])
|
if (dihedral_negative[m]) dihedral_type[ilocal][m] = -dihedral_type[ilocal][m];
|
||||||
dihedral_type[ilocal][m] = -dihedral_type[ilocal][m];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (any_improper_negative) {
|
if (any_improper_negative) {
|
||||||
for (int m = 0; m < num_improper[ilocal]; m++)
|
for (int m = 0; m < num_improper[ilocal]; m++)
|
||||||
if (improper_negative[m])
|
if (improper_negative[m]) improper_type[ilocal][m] = -improper_type[ilocal][m];
|
||||||
improper_type[ilocal][m] = -improper_type[ilocal][m];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user