forked from lijiext/lammps
fix a couple more bugs like in 5246cedda6
This commit is contained in:
parent
c1945b4ec9
commit
97ba95f30e
|
@ -58,6 +58,7 @@ PairDRIP::PairDRIP(LAMMPS *lmp) : Pair(lmp)
|
|||
{
|
||||
single_enable = 0;
|
||||
restartinfo = 0;
|
||||
one_coeff = 1;
|
||||
manybody_flag = 1;
|
||||
centroidstressflag = CENTROID_NOTAVAIL;
|
||||
unit_convert_flag = utils::get_supported_conversions(utils::ENERGY);
|
||||
|
@ -258,7 +259,7 @@ void PairDRIP::read_file(char *filename)
|
|||
int n = -1;
|
||||
for (int m = 0; m < nparams; m++) {
|
||||
if (i == params[m].ielement && j == params[m].jelement) {
|
||||
if (n >= 0) error->all(FLERR, "Potential file has duplicate entry");
|
||||
if (n >= 0) error->all(FLERR, "DRIP potential file has duplicate entry");
|
||||
n = m;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,8 +142,8 @@ void PairILPGrapheneHBN::allocate()
|
|||
void PairILPGrapheneHBN::settings(int narg, char **arg)
|
||||
{
|
||||
if (narg < 1 || narg > 2) error->all(FLERR, "Illegal pair_style command");
|
||||
if (strcmp(force->pair_style, "hybrid/overlay") != 0)
|
||||
error->all(FLERR, "ERROR: requires hybrid/overlay pair_style");
|
||||
if (!utils::strmatch(force->pair_style, "^hybrid/overlay"))
|
||||
error->all(FLERR, "Pair style ilp/graphene/hbn must be used as sub-style with hybrid/overlay");
|
||||
|
||||
cut_global = utils::numeric(FLERR, arg[0], false, lmp);
|
||||
if (narg == 2) tap_flag = utils::numeric(FLERR, arg[1], false, lmp);
|
||||
|
@ -273,16 +273,17 @@ void PairILPGrapheneHBN::read_file(char *filename)
|
|||
|
||||
nparams++;
|
||||
}
|
||||
|
||||
MPI_Bcast(&nparams, 1, MPI_INT, 0, world);
|
||||
MPI_Bcast(&maxparam, 1, MPI_INT, 0, world);
|
||||
|
||||
if (comm->me != 0) {
|
||||
params = (Param *) memory->srealloc(params, maxparam * sizeof(Param), "pair:params");
|
||||
}
|
||||
|
||||
MPI_Bcast(params, maxparam * sizeof(Param), MPI_BYTE, 0, world);
|
||||
}
|
||||
|
||||
MPI_Bcast(&nparams, 1, MPI_INT, 0, world);
|
||||
MPI_Bcast(&maxparam, 1, MPI_INT, 0, world);
|
||||
|
||||
if (comm->me != 0) {
|
||||
params = (Param *) memory->srealloc(params, maxparam * sizeof(Param), "pair:params");
|
||||
}
|
||||
|
||||
MPI_Bcast(params, maxparam * sizeof(Param), MPI_BYTE, 0, world);
|
||||
|
||||
memory->destroy(elem2param);
|
||||
memory->destroy(cutILPsq);
|
||||
memory->create(elem2param, nelements, nelements, "pair:elem2param");
|
||||
|
@ -292,7 +293,7 @@ void PairILPGrapheneHBN::read_file(char *filename)
|
|||
int n = -1;
|
||||
for (int m = 0; m < nparams; m++) {
|
||||
if (i == params[m].ielement && j == params[m].jelement) {
|
||||
if (n >= 0) error->all(FLERR, "ILP Potential file has duplicate entry");
|
||||
if (n >= 0) error->all(FLERR, "ILP potential file has duplicate entry");
|
||||
n = m;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "neigh_request.h"
|
||||
#include "neighbor.h"
|
||||
#include "potential_file_reader.h"
|
||||
#include "tokenizer.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
@ -142,8 +141,8 @@ void PairKolmogorovCrespiFull::allocate()
|
|||
void PairKolmogorovCrespiFull::settings(int narg, char **arg)
|
||||
{
|
||||
if (narg < 1 || narg > 2) error->all(FLERR, "Illegal pair_style command");
|
||||
if (strcmp(force->pair_style, "hybrid/overlay") != 0)
|
||||
error->all(FLERR, "ERROR: requires hybrid/overlay pair_style");
|
||||
if (!utils::strmatch(force->pair_style, "^hybrid/overlay"))
|
||||
error->all(FLERR, "Pair style kolmogorov/crespi/full must be used as sub-style with hybrid/overlay");
|
||||
|
||||
cut_global = utils::numeric(FLERR, arg[0], false, lmp);
|
||||
if (narg == 2) tap_flag = utils::numeric(FLERR, arg[1], false, lmp);
|
||||
|
@ -270,17 +269,17 @@ void PairKolmogorovCrespiFull::read_file(char *filename)
|
|||
|
||||
nparams++;
|
||||
}
|
||||
|
||||
MPI_Bcast(&nparams, 1, MPI_INT, 0, world);
|
||||
MPI_Bcast(&maxparam, 1, MPI_INT, 0, world);
|
||||
|
||||
if (comm->me != 0) {
|
||||
params = (Param *) memory->srealloc(params, maxparam * sizeof(Param), "pair:params");
|
||||
}
|
||||
|
||||
MPI_Bcast(params, maxparam * sizeof(Param), MPI_BYTE, 0, world);
|
||||
}
|
||||
|
||||
MPI_Bcast(&nparams, 1, MPI_INT, 0, world);
|
||||
MPI_Bcast(&maxparam, 1, MPI_INT, 0, world);
|
||||
|
||||
if (comm->me != 0) {
|
||||
params = (Param *) memory->srealloc(params, maxparam * sizeof(Param), "pair:params");
|
||||
}
|
||||
|
||||
MPI_Bcast(params, maxparam * sizeof(Param), MPI_BYTE, 0, world);
|
||||
|
||||
memory->destroy(elem2param);
|
||||
memory->destroy(cutKCsq);
|
||||
memory->create(elem2param, nelements, nelements, "pair:elem2param");
|
||||
|
@ -290,7 +289,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename)
|
|||
int n = -1;
|
||||
for (int m = 0; m < nparams; m++) {
|
||||
if (i == params[m].ielement && j == params[m].jelement) {
|
||||
if (n >= 0) error->all(FLERR, "KC Potential file has duplicate entry");
|
||||
if (n >= 0) error->all(FLERR, "KC potential file has duplicate entry");
|
||||
n = m;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue