move pointer initialization to initializer list. modernize error messages.
This commit is contained in:
@ -54,8 +54,8 @@ FixReaxFFSpeciesKokkos::FixReaxFFSpeciesKokkos(LAMMPS *lmp, int narg, char **arg
|
|||||||
void FixReaxFFSpeciesKokkos::init()
|
void FixReaxFFSpeciesKokkos::init()
|
||||||
{
|
{
|
||||||
Pair* pair_kk = force->pair_match("^reax../kk",0);
|
Pair* pair_kk = force->pair_match("^reax../kk",0);
|
||||||
if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reaxff/species/kk without "
|
if (pair_kk == nullptr)
|
||||||
"pair_style reaxff/kk");
|
error->all(FLERR,"Cannot use fix reaxff/species/kk without pair_style reaxff/kk");
|
||||||
|
|
||||||
FixReaxFFSpecies::init();
|
FixReaxFFSpecies::init();
|
||||||
}
|
}
|
||||||
@ -135,7 +135,7 @@ void FixReaxFFSpeciesKokkos::FindMolecule()
|
|||||||
if (!anychange) break;
|
if (!anychange) break;
|
||||||
|
|
||||||
MPI_Allreduce(&loop,&looptot,1,MPI_INT,MPI_SUM,world);
|
MPI_Allreduce(&loop,&looptot,1,MPI_INT,MPI_SUM,world);
|
||||||
if (looptot >= 400*nprocs) break;
|
if (looptot >= 400*comm->nprocs) break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,9 +44,13 @@ using namespace FixConst;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
|
FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) :
|
||||||
|
Fix(lmp, narg, arg), Name(nullptr), MolName(nullptr), NMol(nullptr), nd(nullptr),
|
||||||
|
MolType(nullptr), molmap(nullptr), mark(nullptr), Mol2Spec(nullptr), clusterID(nullptr),
|
||||||
|
x0(nullptr), BOCut(nullptr), fp(nullptr), pos(nullptr), fdel(nullptr), ele(nullptr),
|
||||||
|
eletype(nullptr), filepos(nullptr), filedel(nullptr)
|
||||||
{
|
{
|
||||||
if (narg < 7) error->all(FLERR, "Illegal fix reaxff/species command");
|
if (narg < 7) utils::missing_cmd_args(FLERR, "fix reaxff/species", error);
|
||||||
|
|
||||||
force_reneighbor = 1;
|
force_reneighbor = 1;
|
||||||
next_reneighbor = -1;
|
next_reneighbor = -1;
|
||||||
@ -62,8 +66,6 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp,
|
|||||||
compressed = 0;
|
compressed = 0;
|
||||||
nvalid = -1;
|
nvalid = -1;
|
||||||
|
|
||||||
MPI_Comm_rank(world, &me);
|
|
||||||
MPI_Comm_size(world, &nprocs);
|
|
||||||
ntypes = atom->ntypes;
|
ntypes = atom->ntypes;
|
||||||
|
|
||||||
nevery = utils::inumeric(FLERR, arg[3], false, lmp);
|
nevery = utils::inumeric(FLERR, arg[3], false, lmp);
|
||||||
@ -73,10 +75,11 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp,
|
|||||||
|
|
||||||
comm_forward = 4;
|
comm_forward = 4;
|
||||||
|
|
||||||
if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0)
|
if (nevery <= 0) error->all(FLERR, "Invalid fix reaxff/species nevery value {}", nevery);
|
||||||
error->all(FLERR, "Illegal fix reaxff/species command");
|
if (nrepeat <= 0) error->all(FLERR, "Invalid fix reaxff/species nrepeat value {}", nrepeat);
|
||||||
if (nfreq % nevery || nrepeat * nevery > nfreq)
|
if (nfreq <= 0) error->all(FLERR, "Invalid fix reaxff/species nfreq value {}", nfreq);
|
||||||
error->all(FLERR, "Illegal fix reaxff/species command");
|
if ((nfreq % nevery) || (nrepeat * nevery > nfreq))
|
||||||
|
error->all(FLERR, "Incompatible fix reaxff/species nevery/nrepeat/nfreq settings");
|
||||||
|
|
||||||
// Neighbor lists must stay unchanged during averaging of bonds,
|
// Neighbor lists must stay unchanged during averaging of bonds,
|
||||||
// but may be updated when no averaging is performed.
|
// but may be updated when no averaging is performed.
|
||||||
@ -99,13 +102,13 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp,
|
|||||||
rene_flag = 1;
|
rene_flag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me == 0 && rene_flag)
|
if (comm->me == 0 && rene_flag)
|
||||||
error->warning(FLERR,
|
error->warning(FLERR,
|
||||||
"Resetting reneighboring criteria to 'delay {} every {} check no' "
|
"Resetting reneighboring criteria to 'delay {} every {} check no' "
|
||||||
"due to fix reaxff/species",
|
"due to fix reaxff/species averaging of bond data",
|
||||||
neighbor->delay, neighbor->every);
|
neighbor->delay, neighbor->every);
|
||||||
|
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
if (platform::has_compress_extension(arg[6])) {
|
if (platform::has_compress_extension(arg[6])) {
|
||||||
fp = platform::compressed_write(arg[6]);
|
fp = platform::compressed_write(arg[6]);
|
||||||
compressed = 1;
|
compressed = 1;
|
||||||
@ -125,17 +128,6 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp,
|
|||||||
memory->create(clusterID, ntmp, "reaxff/species:clusterID");
|
memory->create(clusterID, ntmp, "reaxff/species:clusterID");
|
||||||
vector_atom = clusterID;
|
vector_atom = clusterID;
|
||||||
|
|
||||||
BOCut = nullptr;
|
|
||||||
Name = nullptr;
|
|
||||||
MolName = nullptr;
|
|
||||||
MolType = nullptr;
|
|
||||||
NMol = nullptr;
|
|
||||||
Mol2Spec = nullptr;
|
|
||||||
nd = nullptr;
|
|
||||||
molmap = nullptr;
|
|
||||||
mark = nullptr;
|
|
||||||
fdel = nullptr;
|
|
||||||
|
|
||||||
nmax = 0;
|
nmax = 0;
|
||||||
setupflag = 0;
|
setupflag = 0;
|
||||||
|
|
||||||
@ -160,16 +152,16 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp,
|
|||||||
|
|
||||||
int iarg = 7;
|
int iarg = 7;
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
|
|
||||||
// set BO cutoff
|
// set BO cutoff
|
||||||
if (strcmp(arg[iarg], "cutoff") == 0) {
|
if (strcmp(arg[iarg], "cutoff") == 0) {
|
||||||
if (iarg + 4 > narg) error->all(FLERR, "Illegal fix reaxff/species command");
|
if (iarg + 4 > narg) utils::missing_cmd_args(FLERR, "fix reaxff/species cutoff", error);
|
||||||
itype = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
itype = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
jtype = utils::inumeric(FLERR, arg[iarg + 2], false, lmp);
|
jtype = utils::inumeric(FLERR, arg[iarg + 2], false, lmp);
|
||||||
bo_cut = utils::numeric(FLERR, arg[iarg + 3], false, lmp);
|
bo_cut = utils::numeric(FLERR, arg[iarg + 3], false, lmp);
|
||||||
if (itype > ntypes || jtype > ntypes) error->all(FLERR, "Illegal fix reaxff/species command");
|
if ((itype <= 0) || (jtype <= 0) || (itype > ntypes) || (jtype > ntypes))
|
||||||
if (itype <= 0 || jtype <= 0) error->all(FLERR, "Illegal fix reaxff/species command");
|
error->all(FLERR, "Fix reaxff/species cutoff atom type(s) out of range");
|
||||||
if (bo_cut > 1.0 || bo_cut < 0.0) error->all(FLERR, "Illegal fix reaxff/species command");
|
if ((bo_cut > 1.0) || (bo_cut < 0.0))
|
||||||
|
error->all(FLERR, "Fix reaxff/species invalid cutoff value: {}", bo_cut);
|
||||||
|
|
||||||
BOCut[itype][jtype] = bo_cut;
|
BOCut[itype][jtype] = bo_cut;
|
||||||
BOCut[jtype][itype] = bo_cut;
|
BOCut[jtype][itype] = bo_cut;
|
||||||
@ -177,7 +169,8 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp,
|
|||||||
|
|
||||||
// modify element type names
|
// modify element type names
|
||||||
} else if (strcmp(arg[iarg], "element") == 0) {
|
} else if (strcmp(arg[iarg], "element") == 0) {
|
||||||
if (iarg + ntypes + 1 > narg) error->all(FLERR, "Illegal fix reaxff/species command");
|
if (iarg + ntypes + 1 > narg)
|
||||||
|
utils::missing_cmd_args(FLERR, "fix reaxff/species element", error);
|
||||||
|
|
||||||
eletype = (char **) malloc(ntypes * sizeof(char *));
|
eletype = (char **) malloc(ntypes * sizeof(char *));
|
||||||
int len;
|
int len;
|
||||||
@ -194,63 +187,66 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp,
|
|||||||
delflag = 1;
|
delflag = 1;
|
||||||
delete[] filedel;
|
delete[] filedel;
|
||||||
filedel = utils::strdup(arg[iarg + 1]);
|
filedel = utils::strdup(arg[iarg + 1]);
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
fdel = fopen(filedel, "w");
|
fdel = fopen(filedel, "w");
|
||||||
if (!fdel)
|
if (!fdel)
|
||||||
error->one(FLERR, "Cannot open fix reaxff/species delete file {}: {}", filedel,
|
error->one(FLERR, "Cannot open fix reaxff/species delete file {}: {}", filedel,
|
||||||
utils::getsyserror());
|
utils::getsyserror());
|
||||||
}
|
}
|
||||||
|
|
||||||
del_opened = 1;
|
del_opened = 1;
|
||||||
|
|
||||||
if (strcmp(arg[iarg + 2], "masslimit") == 0) {
|
if (strcmp(arg[iarg + 2], "masslimit") == 0) {
|
||||||
if (iarg + 5 > narg) error->all(FLERR, "Illegal fix reaxff/species command");
|
if (iarg + 5 > narg) utils::missing_cmd_args(FLERR, "fix reaxff/species masslimit", error);
|
||||||
masslimitflag = 1;
|
masslimitflag = 1;
|
||||||
massmin = atof(arg[iarg + 3]);
|
massmin = utils::numeric(FLERR, arg[iarg + 3], false, lmp);
|
||||||
massmax = atof(arg[iarg + 4]);
|
massmax = utils::numeric(FLERR, arg[iarg + 4], false, lmp);
|
||||||
iarg += 5;
|
iarg += 5;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg + 2], "specieslist") == 0) {
|
} else if (strcmp(arg[iarg + 2], "specieslist") == 0) {
|
||||||
specieslistflag = 1;
|
specieslistflag = 1;
|
||||||
ndelspec = atoi(arg[iarg + 3]);
|
ndelspec = utils::inumeric(FLERR, arg[iarg + 3], false, lmp);
|
||||||
if (iarg + ndelspec + 4 > narg) error->all(FLERR, "Illegal fix reaxff/species command");
|
if (iarg + ndelspec + 4 > narg)
|
||||||
|
utils::missing_cmd_args(FLERR, "fix reaxff/species delete specieslist", error);
|
||||||
|
|
||||||
del_species.resize(ndelspec);
|
del_species.resize(ndelspec);
|
||||||
for (int i = 0; i < ndelspec; i++) del_species[i] = arg[iarg + 4 + i];
|
for (int i = 0; i < ndelspec; i++) del_species[i] = arg[iarg + 4 + i];
|
||||||
|
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
fprintf(fdel, "Timestep");
|
fprintf(fdel, "Timestep");
|
||||||
for (i = 0; i < ndelspec; i++) fprintf(fdel, "\t%s", del_species[i].c_str());
|
for (i = 0; i < ndelspec; i++) fprintf(fdel, "\t%s", del_species[i].c_str());
|
||||||
fprintf(fdel, "\n");
|
fprintf(fdel, "\n");
|
||||||
fflush(fdel);
|
fflush(fdel);
|
||||||
}
|
}
|
||||||
|
|
||||||
iarg += ndelspec + 4;
|
iarg += ndelspec + 4;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
error->all(FLERR, "Illegal fix reaxff/species command");
|
error->all(FLERR, "Unknown fix reaxff/species delete option: {}", arg[iarg]);
|
||||||
|
|
||||||
// position of molecules
|
// position of molecules
|
||||||
} else if (strcmp(arg[iarg], "position") == 0) {
|
} else if (strcmp(arg[iarg], "position") == 0) {
|
||||||
if (iarg + 3 > narg) error->all(FLERR, "Illegal fix reaxff/species command");
|
if (iarg + 3 > narg) utils::missing_cmd_args(FLERR, "fix reaxff/species position", error);
|
||||||
posflag = 1;
|
posflag = 1;
|
||||||
posfreq = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
posfreq = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
if (posfreq < nfreq || (posfreq % nfreq != 0))
|
if (posfreq < nfreq || (posfreq % nfreq != 0))
|
||||||
error->all(FLERR, "Illegal fix reaxff/species command");
|
error->all(FLERR, "Incompatible fix reaxff/species postion frequency {}", posfreq);
|
||||||
|
|
||||||
filepos = new char[255];
|
filepos = new char[255];
|
||||||
strcpy(filepos, arg[iarg + 2]);
|
strcpy(filepos, arg[iarg + 2]);
|
||||||
if (strchr(filepos, '*')) {
|
if (strchr(filepos, '*')) {
|
||||||
multipos = 1;
|
multipos = 1;
|
||||||
} else {
|
} else {
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
pos = fopen(filepos, "w");
|
pos = fopen(filepos, "w");
|
||||||
if (pos == nullptr) error->one(FLERR, "Cannot open fix reaxff/species position file");
|
if (pos == nullptr)
|
||||||
|
error->one(FLERR, "Cannot open fix reaxff/species position file: {}",
|
||||||
|
utils::getsyserror());
|
||||||
}
|
}
|
||||||
singlepos_opened = 1;
|
singlepos_opened = 1;
|
||||||
multipos = 0;
|
multipos = 0;
|
||||||
}
|
}
|
||||||
iarg += 3;
|
iarg += 3;
|
||||||
} else
|
} else
|
||||||
error->all(FLERR, "Illegal fix reaxff/species command");
|
error->all(FLERR, "Unknown fix reaxff/species keyword: {}", arg[iarg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!eleflag) {
|
if (!eleflag) {
|
||||||
@ -262,7 +258,7 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (delflag && specieslistflag && masslimitflag)
|
if (delflag && specieslistflag && masslimitflag)
|
||||||
error->all(FLERR, "Illegal fix reaxff/species command");
|
error->all(FLERR, "Incompatible combination fix reaxff/species command options");
|
||||||
|
|
||||||
vector_nmole = 0;
|
vector_nmole = 0;
|
||||||
vector_nspec = 0;
|
vector_nspec = 0;
|
||||||
@ -287,7 +283,7 @@ FixReaxFFSpecies::~FixReaxFFSpecies()
|
|||||||
delete[] filepos;
|
delete[] filepos;
|
||||||
delete[] filedel;
|
delete[] filedel;
|
||||||
|
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
if (compressed)
|
if (compressed)
|
||||||
platform::pclose(fp);
|
platform::pclose(fp);
|
||||||
else
|
else
|
||||||
@ -366,7 +362,7 @@ void FixReaxFFSpecies::init_list(int /*id*/, NeighList *ptr)
|
|||||||
void FixReaxFFSpecies::post_integrate()
|
void FixReaxFFSpecies::post_integrate()
|
||||||
{
|
{
|
||||||
Output_ReaxFF_Bonds(update->ntimestep, fp);
|
Output_ReaxFF_Bonds(update->ntimestep, fp);
|
||||||
if (me == 0) fflush(fp);
|
if (comm->me == 0) fflush(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -403,11 +399,11 @@ void FixReaxFFSpecies::Output_ReaxFF_Bonds(bigint ntimestep, FILE * /*fp*/)
|
|||||||
vector_nmole = Nmole;
|
vector_nmole = Nmole;
|
||||||
vector_nspec = Nspec;
|
vector_nspec = Nspec;
|
||||||
|
|
||||||
if (me == 0 && ntimestep >= 0) WriteFormulas(Nmole, Nspec);
|
if (comm->me == 0 && ntimestep >= 0) WriteFormulas(Nmole, Nspec);
|
||||||
|
|
||||||
if (posflag && ((ntimestep) % posfreq == 0)) {
|
if (posflag && ((ntimestep) % posfreq == 0)) {
|
||||||
WritePos(Nmole, Nspec);
|
WritePos(Nmole, Nspec);
|
||||||
if (me == 0) fflush(pos);
|
if (comm->me == 0) fflush(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delflag) DeleteSpecies(Nmole, Nspec);
|
if (delflag) DeleteSpecies(Nmole, Nspec);
|
||||||
@ -499,7 +495,7 @@ void FixReaxFFSpecies::FindMolecule()
|
|||||||
if (!anychange) break;
|
if (!anychange) break;
|
||||||
|
|
||||||
MPI_Allreduce(&loop, &looptot, 1, MPI_INT, MPI_SUM, world);
|
MPI_Allreduce(&loop, &looptot, 1, MPI_INT, MPI_SUM, world);
|
||||||
if (looptot >= 400 * nprocs) break;
|
if (looptot >= 400 * comm->nprocs) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,12 +526,12 @@ void FixReaxFFSpecies::SortMolecule(int &Nmole)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (idlo == ntotal)
|
if (idlo == ntotal)
|
||||||
if (me == 0)
|
if (comm->me == 0)
|
||||||
error->warning(FLERR, "Atom with cluster ID = maxmol included in fix reaxff/species group {}",
|
error->warning(FLERR, "Atom with cluster ID = maxmol included in fix reaxff/species group {}",
|
||||||
group->names[igroup]);
|
group->names[igroup]);
|
||||||
|
|
||||||
MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world);
|
MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world);
|
||||||
if (flagall && me == 0)
|
if (flagall && comm->me == 0)
|
||||||
error->warning(FLERR, "Atom with cluster ID = 0 included in fix reaxff/species group {}",
|
error->warning(FLERR, "Atom with cluster ID = 0 included in fix reaxff/species group {}",
|
||||||
group->names[igroup]);
|
group->names[igroup]);
|
||||||
|
|
||||||
@ -712,7 +708,7 @@ void FixReaxFFSpecies::WriteFormulas(int Nmole, int Nspec)
|
|||||||
|
|
||||||
void FixReaxFFSpecies::OpenPos()
|
void FixReaxFFSpecies::OpenPos()
|
||||||
{
|
{
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
auto filecurrent = utils::star_subst(filepos, update->ntimestep, padflag);
|
auto filecurrent = utils::star_subst(filepos, update->ntimestep, padflag);
|
||||||
pos = fopen(filecurrent.c_str(), "w");
|
pos = fopen(filecurrent.c_str(), "w");
|
||||||
if (pos == nullptr)
|
if (pos == nullptr)
|
||||||
@ -742,7 +738,7 @@ void FixReaxFFSpecies::WritePos(int Nmole, int Nspec)
|
|||||||
|
|
||||||
for (int j = 0; j < 3; j++) halfbox[j] = box[j] / 2;
|
for (int j = 0; j < 3; j++) halfbox[j] = box[j] / 2;
|
||||||
|
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
fmt::print(pos,
|
fmt::print(pos,
|
||||||
"Timestep {} NMole {} NSpec {} xlo {:f} "
|
"Timestep {} NMole {} NSpec {} xlo {:f} "
|
||||||
"xhi {:f} ylo {:f} yhi {:f} zlo {:f} zhi {:f}\n",
|
"xhi {:f} ylo {:f} yhi {:f} zlo {:f} zhi {:f}\n",
|
||||||
@ -796,7 +792,7 @@ void FixReaxFFSpecies::WritePos(int Nmole, int Nspec)
|
|||||||
MPI_Reduce(Name, Nameall, ntypes, MPI_INT, MPI_SUM, 0, world);
|
MPI_Reduce(Name, Nameall, ntypes, MPI_INT, MPI_SUM, 0, world);
|
||||||
for (n = 0; n < ntypes; n++) Name[n] = Nameall[n];
|
for (n = 0; n < ntypes; n++) Name[n] = Nameall[n];
|
||||||
|
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
fprintf(pos, "%d\t%d\t", m, count);
|
fprintf(pos, "%d\t%d\t", m, count);
|
||||||
for (n = 0; n < ntypes; n++) {
|
for (n = 0; n < ntypes; n++) {
|
||||||
if (Name[n] != 0) {
|
if (Name[n] != 0) {
|
||||||
@ -822,7 +818,7 @@ void FixReaxFFSpecies::WritePos(int Nmole, int Nspec)
|
|||||||
fprintf(pos, "\n");
|
fprintf(pos, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (me == 0 && !multipos) fprintf(pos, "#\n");
|
if (comm->me == 0 && !multipos) fprintf(pos, "#\n");
|
||||||
memory->destroy(Nameall);
|
memory->destroy(Nameall);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -935,12 +931,12 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec)
|
|||||||
|
|
||||||
atom->natoms -= ndel;
|
atom->natoms -= ndel;
|
||||||
|
|
||||||
if (me == 0)
|
if (comm->me == 0)
|
||||||
MPI_Reduce(MPI_IN_PLACE, deletecount, ndelcomm, MPI_DOUBLE, MPI_SUM, 0, world);
|
MPI_Reduce(MPI_IN_PLACE, deletecount, ndelcomm, MPI_DOUBLE, MPI_SUM, 0, world);
|
||||||
else
|
else
|
||||||
MPI_Reduce(deletecount, deletecount, ndelcomm, MPI_DOUBLE, MPI_SUM, 0, world);
|
MPI_Reduce(deletecount, deletecount, ndelcomm, MPI_DOUBLE, MPI_SUM, 0, world);
|
||||||
|
|
||||||
if (me == 0) {
|
if (comm->me == 0) {
|
||||||
if (masslimitflag) {
|
if (masslimitflag) {
|
||||||
int printflag = 0;
|
int printflag = 0;
|
||||||
for (int m = 0; m < Nspec; m++) {
|
for (int m = 0; m < Nspec; m++) {
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class FixReaxFFSpecies : public Fix {
|
|||||||
double compute_vector(int) override;
|
double compute_vector(int) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int me, nprocs, nmax, nlocal, ntypes, ntotal;
|
int nmax, nlocal, ntypes, ntotal;
|
||||||
int nrepeat, nfreq, posfreq, compressed, ndelspec;
|
int nrepeat, nfreq, posfreq, compressed, ndelspec;
|
||||||
int Nmoltype, vector_nmole, vector_nspec;
|
int Nmoltype, vector_nmole, vector_nspec;
|
||||||
int *Name, *MolName, *NMol, *nd, *MolType, *molmap, *mark;
|
int *Name, *MolName, *NMol, *nd, *MolType, *molmap, *mark;
|
||||||
|
|||||||
Reference in New Issue
Block a user