stop with error or print a warning when the system or atom ids get to large for reax/c pair styles

This commit is contained in:
Axel Kohlmeyer 2019-04-05 06:29:38 -04:00
parent 4f026b9b38
commit 42e8a7613e
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
3 changed files with 20 additions and 6 deletions

View File

@ -343,6 +343,15 @@ void PairReaxCOMP::init_style( )
if (force->newton_pair == 0)
error->all(FLERR,"Pair style reax/c/omp requires newton pair on");
if ((atom->map_max_tag > 99999999) && (comm->me == 0))
error->warning(FLERR,"Some Atom-IDs are too large. Pair style reax/c/omp "
"native output files may get misformatted or corrupted");
// because system->bigN is an int, we cannot have more atoms than MAXSMALLINT
if (atom->natoms > MAXSMALLINT)
error->all(FLERR,"Too many atoms for pair style reax/c/omp");
// need a half neighbor list w/ Newton off and ghost neighbors
// built whenever re-neighboring occurs

View File

@ -90,8 +90,7 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp)
mpi_data = (mpi_datatypes *)
memory->smalloc(sizeof(mpi_datatypes),"reax:mpi");
MPI_Comm_rank(world,&system->my_rank);
control->me = system->my_rank;
control->me = system->my_rank = comm->me;
system->my_coords[0] = 0;
system->my_coords[1] = 0;
@ -383,6 +382,14 @@ void PairReaxC::init_style( )
error->all(FLERR,"Pair style reax/c requires atom IDs");
if (force->newton_pair == 0)
error->all(FLERR,"Pair style reax/c requires newton pair on");
if ((atom->map_max_tag > 99999999) && (comm->me == 0))
error->warning(FLERR,"Some Atom-IDs are too large. Pair style reax/c "
"native output files may get misformatted or corrupted");
// because system->bigN is an int, we cannot have more atoms than MAXSMALLINT
if (atom->natoms > MAXSMALLINT)
error->all(FLERR,"Too many atoms for pair style reax/c");
// need a half neighbor list w/ Newton off and ghost neighbors
// built whenever re-neighboring occurs

View File

@ -55,8 +55,7 @@ int Init_Output_Files( reax_system *system, control_params *control,
sprintf( temp, "%s.pot", control->sim_name );
if ((out_control->pot = fopen( temp, "w" )) != NULL) {
fflush( out_control->pot );
}
else {
} else {
strcpy( msg, "init_out_controls: .pot file could not be opened\n" );
return FAILURE;
}
@ -74,8 +73,7 @@ int Init_Output_Files( reax_system *system, control_params *control,
"step", "Pint/norm[x]", "Pint/norm[y]", "Pint/norm[z]",
"Pext/Ptot[x]", "Pext/Ptot[y]", "Pext/Ptot[z]", "Pkin/V" );
fflush( out_control->prs );
}
else {
} else {
strcpy(msg,"init_out_controls: .prs file couldn't be opened\n");
return FAILURE;
}