mirror of https://github.com/lammps/lammps.git
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:
parent
4f026b9b38
commit
42e8a7613e
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue