Manually resolve two rebase conflicts.
This commit is contained in:
102
src/modify.cpp
102
src/modify.cpp
@ -54,34 +54,34 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp)
|
||||
n_min_post_force = n_min_energy = 0;
|
||||
n_timeflag = -1;
|
||||
|
||||
fix = NULL;
|
||||
fmask = NULL;
|
||||
list_initial_integrate = list_post_integrate = NULL;
|
||||
list_pre_exchange = list_pre_neighbor = list_post_neighbor = NULL;
|
||||
list_pre_force = list_pre_reverse = list_post_force = NULL;
|
||||
list_final_integrate = list_end_of_step = NULL;
|
||||
list_thermo_energy = list_thermo_energy_atom = NULL;
|
||||
list_initial_integrate_respa = list_post_integrate_respa = NULL;
|
||||
list_pre_force_respa = list_post_force_respa = NULL;
|
||||
list_final_integrate_respa = NULL;
|
||||
list_min_pre_exchange = list_min_pre_neighbor = list_min_post_neighbor = NULL;
|
||||
list_min_pre_force = list_min_pre_reverse = list_min_post_force = NULL;
|
||||
list_min_energy = NULL;
|
||||
fix = nullptr;
|
||||
fmask = nullptr;
|
||||
list_initial_integrate = list_post_integrate = nullptr;
|
||||
list_pre_exchange = list_pre_neighbor = list_post_neighbor = nullptr;
|
||||
list_pre_force = list_pre_reverse = list_post_force = nullptr;
|
||||
list_final_integrate = list_end_of_step = nullptr;
|
||||
list_thermo_energy = list_thermo_energy_atom = nullptr;
|
||||
list_initial_integrate_respa = list_post_integrate_respa = nullptr;
|
||||
list_pre_force_respa = list_post_force_respa = nullptr;
|
||||
list_final_integrate_respa = nullptr;
|
||||
list_min_pre_exchange = list_min_pre_neighbor = list_min_post_neighbor = nullptr;
|
||||
list_min_pre_force = list_min_pre_reverse = list_min_post_force = nullptr;
|
||||
list_min_energy = nullptr;
|
||||
|
||||
end_of_step_every = NULL;
|
||||
end_of_step_every = nullptr;
|
||||
|
||||
list_timeflag = NULL;
|
||||
list_timeflag = nullptr;
|
||||
|
||||
nfix_restart_global = 0;
|
||||
id_restart_global = style_restart_global = NULL;
|
||||
state_restart_global = NULL;
|
||||
used_restart_global = NULL;
|
||||
id_restart_global = style_restart_global = nullptr;
|
||||
state_restart_global = nullptr;
|
||||
used_restart_global = nullptr;
|
||||
nfix_restart_peratom = 0;
|
||||
id_restart_peratom = style_restart_peratom = NULL;
|
||||
index_restart_peratom = used_restart_peratom = NULL;
|
||||
id_restart_peratom = style_restart_peratom = nullptr;
|
||||
index_restart_peratom = used_restart_peratom = nullptr;
|
||||
|
||||
ncompute = maxcompute = 0;
|
||||
compute = NULL;
|
||||
compute = nullptr;
|
||||
|
||||
create_factories();
|
||||
}
|
||||
@ -795,17 +795,17 @@ void Modify::add_fix(int narg, char **arg, int trysuffix)
|
||||
// but can't think of better way
|
||||
// too late if instantiate fix, then check flag set in fix constructor,
|
||||
// since some fixes access domain settings in their constructor
|
||||
// NULL must be last entry in this list
|
||||
// nullptr must be last entry in this list
|
||||
|
||||
const char *exceptions[] =
|
||||
{"GPU", "OMP", "INTEL", "property/atom", "cmap", "cmap3", "rx",
|
||||
"deprecated", "STORE/KIM", NULL};
|
||||
"deprecated", "STORE/KIM", nullptr};
|
||||
|
||||
if (domain->box_exist == 0) {
|
||||
int m;
|
||||
for (m = 0; exceptions[m] != NULL; m++)
|
||||
for (m = 0; exceptions[m] != nullptr; m++)
|
||||
if (strcmp(arg[2],exceptions[m]) == 0) break;
|
||||
if (exceptions[m] == NULL)
|
||||
if (exceptions[m] == nullptr)
|
||||
error->all(FLERR,"Fix command before simulation box is defined");
|
||||
}
|
||||
|
||||
@ -821,7 +821,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix)
|
||||
// warn if new group != old group
|
||||
// delete old fix, but do not call update_callback(),
|
||||
// since will replace this fix and thus other fix locs will not change
|
||||
// set ptr to NULL in case new fix scans list of fixes,
|
||||
// set ptr to nullptr in case new fix scans list of fixes,
|
||||
// e.g. scan will occur in add_callback() if called by new fix
|
||||
// if fix ID does not exist:
|
||||
// set newflag = 1 so create new fix
|
||||
@ -852,7 +852,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix)
|
||||
if (fix[ifix]->igroup != igroup && comm->me == 0)
|
||||
error->warning(FLERR,"Replacing a fix, but new group != old group");
|
||||
delete fix[ifix];
|
||||
fix[ifix] = NULL;
|
||||
fix[ifix] = nullptr;
|
||||
|
||||
} else {
|
||||
newflag = 1;
|
||||
@ -866,7 +866,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix)
|
||||
// create the Fix
|
||||
// try first with suffix appended
|
||||
|
||||
fix[ifix] = NULL;
|
||||
fix[ifix] = nullptr;
|
||||
|
||||
if (trysuffix && lmp->suffix_enable) {
|
||||
if (lmp->suffix) {
|
||||
@ -879,7 +879,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix)
|
||||
strcpy(fix[ifix]->style,estyle.c_str());
|
||||
}
|
||||
}
|
||||
if (fix[ifix] == NULL && lmp->suffix2) {
|
||||
if (fix[ifix] == nullptr && lmp->suffix2) {
|
||||
std::string estyle = arg[2] + std::string("/") + lmp->suffix2;
|
||||
if (fix_map->find(estyle) != fix_map->end()) {
|
||||
FixCreator &fix_creator = (*fix_map)[estyle];
|
||||
@ -891,12 +891,12 @@ void Modify::add_fix(int narg, char **arg, int trysuffix)
|
||||
}
|
||||
}
|
||||
|
||||
if (fix[ifix] == NULL && fix_map->find(arg[2]) != fix_map->end()) {
|
||||
if (fix[ifix] == nullptr && fix_map->find(arg[2]) != fix_map->end()) {
|
||||
FixCreator &fix_creator = (*fix_map)[arg[2]];
|
||||
fix[ifix] = fix_creator(lmp,narg,arg);
|
||||
}
|
||||
|
||||
if (fix[ifix] == NULL)
|
||||
if (fix[ifix] == nullptr)
|
||||
error->all(FLERR,utils::check_packages_for_style("fix",arg[2],lmp));
|
||||
|
||||
// check if Fix is in restart_global list
|
||||
@ -1105,7 +1105,7 @@ int Modify::check_rigid_group_overlap(int groupbit)
|
||||
for (int ifix = 0; ifix < nfix; ifix++) {
|
||||
if (utils::strmatch(fix[ifix]->style,"^rigid")) {
|
||||
const int * const body = (const int *)fix[ifix]->extract("body",dim);
|
||||
if ((body == NULL) || (dim != 1)) break;
|
||||
if ((body == nullptr) || (dim != 1)) break;
|
||||
|
||||
for (int i=0; (i < nlocal) && (n == 0); ++i)
|
||||
if ((mask[i] & groupbit) && (body[i] >= 0)) ++n;
|
||||
@ -1137,7 +1137,7 @@ int Modify::check_rigid_region_overlap(int groupbit, Region *reg)
|
||||
for (int ifix = 0; ifix < nfix; ifix++) {
|
||||
if (strncmp("rigid",fix[ifix]->style,5) == 0) {
|
||||
const int * const body = (const int *)fix[ifix]->extract("body",dim);
|
||||
if ((body == NULL) || (dim != 1)) break;
|
||||
if ((body == nullptr) || (dim != 1)) break;
|
||||
|
||||
for (int i=0; (i < nlocal) && (n == 0); ++i)
|
||||
if ((mask[i] & groupbit) && (body[i] >= 0)
|
||||
@ -1167,7 +1167,7 @@ int Modify::check_rigid_list_overlap(int *select)
|
||||
for (int ifix = 0; ifix < nfix; ifix++) {
|
||||
if (utils::strmatch(fix[ifix]->style,"^rigid")) {
|
||||
const int * const body = (const int *)fix[ifix]->extract("body",dim);
|
||||
if ((body == NULL) || (dim != 1)) break;
|
||||
if ((body == nullptr) || (dim != 1)) break;
|
||||
|
||||
for (int i=0; (i < nlocal) && (n == 0); ++i)
|
||||
if ((body[i] >= 0) && select[i]) ++n;
|
||||
@ -1206,7 +1206,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix)
|
||||
// create the Compute
|
||||
// try first with suffix appended
|
||||
|
||||
compute[ncompute] = NULL;
|
||||
compute[ncompute] = nullptr;
|
||||
|
||||
if (trysuffix && lmp->suffix_enable) {
|
||||
if (lmp->suffix) {
|
||||
@ -1219,7 +1219,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix)
|
||||
strcpy(compute[ncompute]->style,estyle.c_str());
|
||||
}
|
||||
}
|
||||
if (compute[ncompute] == NULL && lmp->suffix2) {
|
||||
if (compute[ncompute] == nullptr && lmp->suffix2) {
|
||||
std::string estyle = arg[2] + std::string("/") + lmp->suffix2;
|
||||
if (compute_map->find(estyle) != compute_map->end()) {
|
||||
ComputeCreator &compute_creator = (*compute_map)[estyle];
|
||||
@ -1231,13 +1231,13 @@ void Modify::add_compute(int narg, char **arg, int trysuffix)
|
||||
}
|
||||
}
|
||||
|
||||
if (compute[ncompute] == NULL &&
|
||||
if (compute[ncompute] == nullptr &&
|
||||
compute_map->find(arg[2]) != compute_map->end()) {
|
||||
ComputeCreator &compute_creator = (*compute_map)[arg[2]];
|
||||
compute[ncompute] = compute_creator(lmp,narg,arg);
|
||||
}
|
||||
|
||||
if (compute[ncompute] == NULL)
|
||||
if (compute[ncompute] == nullptr)
|
||||
error->all(FLERR,utils::check_packages_for_style("compute",arg[2],lmp));
|
||||
|
||||
ncompute++;
|
||||
@ -1428,7 +1428,7 @@ int Modify::read_restart(FILE *fp)
|
||||
// nfix_restart_global = # of restart entries with global state info
|
||||
|
||||
int me = comm->me;
|
||||
if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,nullptr,error);
|
||||
MPI_Bcast(&nfix_restart_global,1,MPI_INT,0,world);
|
||||
|
||||
// allocate space for each entry
|
||||
@ -1445,22 +1445,22 @@ int Modify::read_restart(FILE *fp)
|
||||
|
||||
int n;
|
||||
for (int i = 0; i < nfix_restart_global; i++) {
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
id_restart_global[i] = new char[n];
|
||||
if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,nullptr,error);
|
||||
MPI_Bcast(id_restart_global[i],n,MPI_CHAR,0,world);
|
||||
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
style_restart_global[i] = new char[n];
|
||||
if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,nullptr,error);
|
||||
MPI_Bcast(style_restart_global[i],n,MPI_CHAR,0,world);
|
||||
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
state_restart_global[i] = new char[n];
|
||||
if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,nullptr,error);
|
||||
MPI_Bcast(state_restart_global[i],n,MPI_CHAR,0,world);
|
||||
|
||||
used_restart_global[i] = 0;
|
||||
@ -1470,7 +1470,7 @@ int Modify::read_restart(FILE *fp)
|
||||
|
||||
int maxsize = 0;
|
||||
|
||||
if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,nullptr,error);
|
||||
MPI_Bcast(&nfix_restart_peratom,1,MPI_INT,0,world);
|
||||
|
||||
// allocate space for each entry
|
||||
@ -1487,19 +1487,19 @@ int Modify::read_restart(FILE *fp)
|
||||
// set index = which set of extra data this fix represents
|
||||
|
||||
for (int i = 0; i < nfix_restart_peratom; i++) {
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
id_restart_peratom[i] = new char[n];
|
||||
if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,nullptr,error);
|
||||
MPI_Bcast(id_restart_peratom[i],n,MPI_CHAR,0,world);
|
||||
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
style_restart_peratom[i] = new char[n];
|
||||
if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,nullptr,error);
|
||||
MPI_Bcast(style_restart_peratom[i],n,MPI_CHAR,0,world);
|
||||
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
maxsize += n;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user