add check to require atom attribute molecule to avoid segfaults, when it is missing

This commit is contained in:
Axel Kohlmeyer
2018-04-19 18:24:19 -04:00
parent 48e42a4e1e
commit f1ee46cc64
3 changed files with 8 additions and 2 deletions

View File

@ -231,6 +231,8 @@ void PairCoulShield::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style coul/shield requires atom attribute q");
if (!atom->molecule_flag)
error->all(FLERR,"Pair style coul/shield requires atom attribute molecule");
neighbor->request(this,instance_me);
}

View File

@ -636,7 +636,9 @@ void PairILPGrapheneHBN::calc_normal()
void PairILPGrapheneHBN::init_style()
{
if (force->newton_pair == 0)
error->all(FLERR,"Pair style ILP requires newton pair on");
error->all(FLERR,"Pair style ilp/graphene/hbn requires newton pair on");
if (!atom->molecule_flag)
error->all(FLERR,"Pair style ilp/graphene/hbn requires atom attribute molecule");
// need a full neighbor list, including neighbors of ghosts

View File

@ -640,7 +640,9 @@ void PairKolmogorovCrespiFull::calc_normal()
void PairKolmogorovCrespiFull::init_style()
{
if (force->newton_pair == 0)
error->all(FLERR,"Pair style KC requires newton pair on");
error->all(FLERR,"Pair style kolmolgorov/crespi/full requires newton pair on");
if (!atom->molecule_flag)
error->all(FLERR,"Pair style kolmolgorov/crespi/full requires atom attribute molecule");
// need a full neighbor list, including neighbors of ghosts