fix compilation issues

This commit is contained in:
Axel Kohlmeyer
2022-05-28 05:57:06 -04:00
parent 97fab45f7e
commit 14a9d34838
3 changed files with 50 additions and 62 deletions

View File

@ -610,7 +610,7 @@ int PairAmoeba::read_section_line(FILE *fp, char *line,
char *ptr,*copy,*copy_next;
char **words,**words_next;
int nwords_next;
int nwords, nwords_next;
copy = copy_next = NULL;
words = words_next = NULL;

View File

@ -61,13 +61,13 @@ void PairAmoeba::multipole()
// owned atoms
int nlocal = atom->nlocal;
const int nlocal = atom->nlocal;
// 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][1] = 0.0;
tq[i][2] = 0.0;
@ -90,7 +90,7 @@ void PairAmoeba::multipole()
term = 2.0 * aewald * aewald;
fterm = -felec * aewald / MY_PIS;
for (i = 0; i < nlocal; i++) {
for (int i = 0; i < nlocal; i++) {
ci = rpole[i][0];
dix = rpole[i][1];
diy = rpole[i][2];

View File

@ -32,47 +32,33 @@ AtomVecAmoeba::AtomVecAmoeba(LAMMPS *lmp) : AtomVec(lmp)
// order of fields in a string does not matter
// except: fields_data_atom & fields_data_vel must match data file
fields_grow = (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 "
"nspecial special nspecial15 special15";
fields_copy = (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 "
"nspecial special nspecial15 special15";
fields_comm = (char *) "";
fields_comm_vel = (char *) "";
fields_reverse = (char *) "";
fields_border = (char *) "q molecule";
fields_border_vel = (char *) "q molecule";
fields_exchange = (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 "
"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";
// clang-format off
fields_grow = {"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", "nspecial", "special",
"nspecial15", "special15"};
fields_copy = {"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", "nspecial", "special",
"nspecial15", "special15"};
fields_border = {"q", "molecule"};
fields_border_vel = {"q", "molecule"};
fields_exchange = {"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",
"nspecial", "special", "nspecial15", "special15"};
fields_restart = {"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 = {"q", "molecule", "num_bond", "num_angle", "num_dihedral", "num_improper",
"nspecial", "nspecial15"};
fields_data_atom = {"id", "molecule", "type", "q", "x"};
fields_data_vel = {"id", "v"};
// clang-format on
setup_fields();
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_type[ilocal][m] = -bond_type[ilocal][m];
any_bond_negative = 1;
} else bond_negative[m] = 0;
} else
bond_negative[m] = 0;
}
any_angle_negative = 0;
@ -154,7 +141,8 @@ void AtomVecAmoeba::pack_restart_pre(int ilocal)
angle_negative[m] = 1;
angle_type[ilocal][m] = -angle_type[ilocal][m];
any_angle_negative = 1;
} else angle_negative[m] = 0;
} else
angle_negative[m] = 0;
}
any_dihedral_negative = 0;
@ -163,7 +151,8 @@ void AtomVecAmoeba::pack_restart_pre(int ilocal)
dihedral_negative[m] = 1;
dihedral_type[ilocal][m] = -dihedral_type[ilocal][m];
any_dihedral_negative = 1;
} else dihedral_negative[m] = 0;
} else
dihedral_negative[m] = 0;
}
any_improper_negative = 0;
@ -172,7 +161,8 @@ void AtomVecAmoeba::pack_restart_pre(int ilocal)
improper_negative[m] = 1;
improper_type[ilocal][m] = -improper_type[ilocal][m];
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) {
for (int m = 0; m < num_dihedral[ilocal]; m++)
if (dihedral_negative[m])
dihedral_type[ilocal][m] = -dihedral_type[ilocal][m];
if (dihedral_negative[m]) dihedral_type[ilocal][m] = -dihedral_type[ilocal][m];
}
if (any_improper_negative) {
for (int m = 0; m < num_improper[ilocal]; m++)
if (improper_negative[m])
improper_type[ilocal][m] = -improper_type[ilocal][m];
if (improper_negative[m]) improper_type[ilocal][m] = -improper_type[ilocal][m];
}
}