add check for required atom properties to USER-SDPD
This commit is contained in:
@ -23,7 +23,9 @@
|
|||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
|
#include "neighbor.h"
|
||||||
#include "neigh_list.h"
|
#include "neigh_list.h"
|
||||||
|
#include "neigh_request.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
@ -238,7 +240,7 @@ void PairSDPDTaitwaterIsothermal::allocate () {
|
|||||||
void PairSDPDTaitwaterIsothermal::settings (int narg, char **arg) {
|
void PairSDPDTaitwaterIsothermal::settings (int narg, char **arg) {
|
||||||
if (narg != 2 && narg != 3)
|
if (narg != 2 && narg != 3)
|
||||||
error->all (FLERR, "Illegal number of arguments for "
|
error->all (FLERR, "Illegal number of arguments for "
|
||||||
"pair_style sdpd/taitwater/morris/isothermal");
|
"pair_style sdpd/taitwater/isothermal");
|
||||||
|
|
||||||
temperature = force->numeric (FLERR, arg[0]);
|
temperature = force->numeric (FLERR, arg[0]);
|
||||||
viscosity = force->numeric (FLERR, arg[1]);
|
viscosity = force->numeric (FLERR, arg[1]);
|
||||||
@ -297,13 +299,26 @@ void PairSDPDTaitwaterIsothermal::coeff (int narg, char **arg) {
|
|||||||
error->all(FLERR,"Incorrect args for pair coefficients");
|
error->all(FLERR,"Incorrect args for pair coefficients");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
init specific to this pair style
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void PairSDPDTaitwaterIsothermal::init_style()
|
||||||
|
{
|
||||||
|
if ((!atom->rho_flag) || (atom->drho == NULL))
|
||||||
|
error->all(FLERR,"Pair style dpd/taitwater/isothermal requires atom "
|
||||||
|
"attributes rho and drho");
|
||||||
|
|
||||||
|
neighbor->request(this,instance_me);
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
init for one type pair i,j and corresponding j,i
|
init for one type pair i,j and corresponding j,i
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double PairSDPDTaitwaterIsothermal::init_one (int i, int j) {
|
double PairSDPDTaitwaterIsothermal::init_one (int i, int j) {
|
||||||
if (setflag[i][j] == 0)
|
if (setflag[i][j] == 0)
|
||||||
error->all(FLERR,"Not all pair sph/taitwater/morris coeffs are set");
|
error->all(FLERR,"Not all pair sdpd/taitwater/isothermal coeffs are set");
|
||||||
|
|
||||||
cut[j][i] = cut[i][j];
|
cut[j][i] = cut[i][j];
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class PairSDPDTaitwaterIsothermal : public Pair {
|
|||||||
void settings (int, char **);
|
void settings (int, char **);
|
||||||
void coeff (int, char **);
|
void coeff (int, char **);
|
||||||
virtual double init_one (int, int);
|
virtual double init_one (int, int);
|
||||||
|
virtual void init_style();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double viscosity, temperature;
|
double viscosity, temperature;
|
||||||
|
|||||||
@ -175,6 +175,8 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
|
|||||||
spin_flag = eradius_flag = ervel_flag = erforce_flag = ervelforce_flag = 0;
|
spin_flag = eradius_flag = ervel_flag = erforce_flag = ervelforce_flag = 0;
|
||||||
cs_flag = csforce_flag = vforce_flag = etag_flag = 0;
|
cs_flag = csforce_flag = vforce_flag = etag_flag = 0;
|
||||||
|
|
||||||
|
// USER-SPH, USER-MESO, and USER-DPD flags
|
||||||
|
|
||||||
rho_flag = e_flag = cv_flag = vest_flag = 0;
|
rho_flag = e_flag = cv_flag = vest_flag = 0;
|
||||||
dpd_flag = edpd_flag = tdpd_flag = 0;
|
dpd_flag = edpd_flag = tdpd_flag = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user