avoid segfaults in USER-MESO by checking for required atom style flags
This commit is contained in:
@ -61,6 +61,9 @@ int FixMvvDPD::setmask()
|
||||
|
||||
void FixMvvDPD::init()
|
||||
{
|
||||
if (!atom->vest_flag)
|
||||
error->all(FLERR,"Fix mvv/dpd requires atom attribute vest");
|
||||
|
||||
dtv = update->dt;
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
}
|
||||
|
||||
@ -282,6 +282,9 @@ void PairMDPD::init_style()
|
||||
if (comm->ghost_velocity == 0)
|
||||
error->all(FLERR,"Pair mdpd requires ghost atoms store velocity");
|
||||
|
||||
if (!atom->rho_flag)
|
||||
error->all(FLERR,"Pair style mdpd requires atom attribute rho");
|
||||
|
||||
// if newton off, forces between atoms ij will be double computed
|
||||
// using different random numbers
|
||||
|
||||
|
||||
@ -62,7 +62,11 @@ PairMDPDRhoSum::~PairMDPDRhoSum() {
|
||||
init specific to this pair style
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairMDPDRhoSum::init_style() {
|
||||
void PairMDPDRhoSum::init_style()
|
||||
{
|
||||
if (!atom->rho_flag)
|
||||
error->all(FLERR,"Pair style mdpd/rhosum requires atom attribute rho");
|
||||
|
||||
// need a full neighbor list
|
||||
int irequest = neighbor->request(this,instance_me);
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
|
||||
@ -315,13 +315,17 @@ void PairTDPD::coeff(int narg, char **arg)
|
||||
void PairTDPD::init_style()
|
||||
{
|
||||
if (comm->ghost_velocity == 0)
|
||||
error->all(FLERR,"Pair tdpd requires ghost atoms store velocity");
|
||||
error->all(FLERR,"Pair style tdpd requires ghost atoms store velocity");
|
||||
|
||||
if (!atom->tdpd_flag)
|
||||
error->all(FLERR,"Pair style tdpd requires atom properties cc/cc_flux");
|
||||
|
||||
// if newton off, forces between atoms ij will be double computed
|
||||
// using different random numbers
|
||||
|
||||
if (force->newton_pair == 0 && comm->me == 0) error->warning(FLERR,
|
||||
"Pair tdpd needs newton pair on for momentum conservation");
|
||||
if (force->newton_pair == 0 && comm->me == 0)
|
||||
error->warning(FLERR,"Pair tdpd needs newton pair on "
|
||||
"for momentum conservation");
|
||||
|
||||
neighbor->request(this,instance_me);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user