Hiding compile bugs in temporary files
This commit is contained in:
@ -60,8 +60,8 @@ PairRHEOReact::PairRHEOReact(LAMMPS *lmp) : Pair(lmp),
|
||||
int tmp1, tmp2;
|
||||
int index = atom->find_custom("react_nbond", tmp1, tmp2);
|
||||
if (index == -1) {
|
||||
id_fix_pa = utils::strdup("pair_rheo_react_fix_property_atom");
|
||||
modify->add_fix(fmt::format("{} all property/atom i_react_nbond", id_fix_pa));
|
||||
id_fix = utils::strdup("pair_rheo_react_fix_property_atom");
|
||||
modify->add_fix(fmt::format("{} all property/atom i_react_nbond", id_fix));
|
||||
index = atom->find_custom("nbond", tmp1, tmp2);
|
||||
}
|
||||
nbond = atom->ivector[index];
|
||||
@ -125,11 +125,9 @@ void PairRHEOReact::compute(int eflag, int vflag)
|
||||
double **v = atom->v;
|
||||
double **f = atom->f;
|
||||
int *type = atom->type;
|
||||
int *phase = atom->phase;
|
||||
int *status = atom->status;
|
||||
int *mask = atom->mask;
|
||||
int *nbond = atom->ivector[index_nb];
|
||||
int *surface = atom->surface;
|
||||
double *rsurf = atom->dvector[index_rsurf];
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
@ -151,7 +149,7 @@ void PairRHEOReact::compute(int eflag, int vflag)
|
||||
for(i = 0; i < nmax; i++) {
|
||||
dbond[i] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
// loop over neighbors of my atoms
|
||||
for (ii = 0; ii < inum; ii++) {
|
||||
i = ilist[ii];
|
||||
@ -167,23 +165,25 @@ void PairRHEOReact::compute(int eflag, int vflag)
|
||||
jlist = firstneigh[i];
|
||||
jnum = numneigh[i];
|
||||
|
||||
|
||||
for (jj = 0; jj < jnum; jj++) {
|
||||
j = jlist[jj];
|
||||
j &= NEIGHMASK;
|
||||
jtype = type[j];
|
||||
data = &alldata[2*jj];
|
||||
|
||||
|
||||
// If not bonded and there's an internal fluid particle, unsave any data and skip
|
||||
if (!(saved[jj] == 1 && data[0] > 0)) {
|
||||
if ((phase[i] <= FixRHEO::FLUID_MAX && rsurf[i] > rlimit[itype][jtype]) || (phase[j] <= FixRHEO::FLUID_MAX && rsurf[j] > rlimit[itype][jtype])) {
|
||||
if ((status[i] <= FixRHEO::FLUID_MAX && rsurf[i] > rlimit[itype][jtype]) || (status[j] <= FixRHEO::FLUID_MAX && rsurf[j] > rlimit[itype][jtype])) {
|
||||
saved[jj] = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// If both are solid, unbond and skip
|
||||
if ((phase[i] == FixRHEO::SOLID || phase[i] == FixRHEO::FREEZING) &&
|
||||
(phase[j] == FixRHEO::SOLID || phase[j] == FixRHEO::FREEZING)) {
|
||||
if ((status[i] == FixRHEO::SOLID || status[i] == FixRHEO::FREEZING) &&
|
||||
(status[j] == FixRHEO::SOLID || status[j] == FixRHEO::FREEZING)) {
|
||||
//If bonded, deincrement
|
||||
if (saved[jj] == 1 && data[0] > 0) {
|
||||
dbond[i] --;
|
||||
@ -245,7 +245,7 @@ void PairRHEOReact::compute(int eflag, int vflag)
|
||||
|
||||
if (data[0] <= 0) {
|
||||
// Skip if either is fluid (only include r+s or r+r since already skipped s+s)
|
||||
if (phase[i] <= FixRHEO::FLUID_MAX || phase[j] <= FixRHEO::FLUID_MAX) continue;
|
||||
if (status[i] <= FixRHEO::FLUID_MAX || status[j] <= FixRHEO::FLUID_MAX) continue;
|
||||
|
||||
// Skip if out of contact
|
||||
if (rsq > sigma[itype][jtype]*sigma[itype][jtype]) continue;
|
||||
@ -315,10 +315,11 @@ void PairRHEOReact::compute(int eflag, int vflag)
|
||||
// If it has bonds it is reactive (no shifting)
|
||||
// If a reactive particle breaks all bonds, return to fluid
|
||||
// Keep it non-shifting for this timestep to be safe
|
||||
if (nbond[i] != 0 && phase[i] <= FixRHEO::FLUID_MAX) phase[i] = FixRHEO::FLUID_NO_SHIFT;
|
||||
if (nbond[i] != 0 && status[i] <= FixRHEO::FLUID_MAX) status[i] = FixRHEO::FLUID_NO_SHIFT;
|
||||
}
|
||||
|
||||
if (vflag_fdotr) virial_fdotr_compute();
|
||||
*/
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -410,7 +411,7 @@ void PairRHEOReact::coeff(int narg, char **arg)
|
||||
void PairRHEOReact::init_style()
|
||||
{
|
||||
int irequest = neighbor->request(this,instance_me);
|
||||
neighbor->requests[irequest]->history = 1;
|
||||
//neighbor->requests[irequest]->history = 1;
|
||||
|
||||
if (fix_history == nullptr) {
|
||||
|
||||
@ -432,10 +433,10 @@ void PairRHEOReact::init_style()
|
||||
fix_dummy = nullptr;
|
||||
}
|
||||
|
||||
int temp_flag;
|
||||
index_rsurf = atom->find_custom("rsurf", temp_flag);
|
||||
if ((index_rsurf < 0) || (temp_flag != 1))
|
||||
error->all(FLERR, "Pair rheo/react can't find fix property/atom rsurf");
|
||||
//int temp_flag;
|
||||
//index_rsurf = atom->find_custom("rsurf", temp_flag);
|
||||
//if ((index_rsurf < 0) || (temp_flag != 1))
|
||||
// error->all(FLERR, "Pair rheo/react can't find fix property/atom rsurf");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -443,6 +444,7 @@ void PairRHEOReact::init_style()
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairRHEOReact::setup() {
|
||||
/*
|
||||
int ifix = modify->find_fix_by_style("rheo");
|
||||
if (ifix == -1) error->all(FLERR, "Using pair rheo/react without fix rheo");
|
||||
fix_rheo = ((FixRHEO *) modify->fix[ifix]);
|
||||
@ -452,6 +454,7 @@ void PairRHEOReact::setup() {
|
||||
|
||||
if (force->newton_pair == 0) error->all(FLERR,
|
||||
"Pair rheo/react needs newton pair on for bond changes to be consistent");
|
||||
*/
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -27,8 +27,8 @@ namespace LAMMPS_NS {
|
||||
class PairRHEOReact : public Pair {
|
||||
public:
|
||||
PairRHEOReact(class LAMMPS *);
|
||||
virtual ~PairRHEOReact() override;
|
||||
virtual void compute(int, int) override;
|
||||
~PairRHEOReact() override;
|
||||
void compute(int, int) override;
|
||||
void settings(int, char **) override;
|
||||
void coeff(int, char **) override;
|
||||
void init_style() override;
|
||||
@ -49,6 +49,9 @@ class PairRHEOReact : public Pair {
|
||||
int *dbond, *nbond;
|
||||
double dt;
|
||||
|
||||
int index_nb, nmax;
|
||||
char *id_fix;
|
||||
|
||||
class FixDummy *fix_dummy;
|
||||
class FixNeighHistory *fix_history;
|
||||
class FixRHEO *fix_rheo;
|
||||
|
||||
@ -106,7 +106,7 @@ void PairRHEOTension::compute(int eflag, int vflag)
|
||||
ilist = list->ilist;
|
||||
numneigh = list->numneigh;
|
||||
firstneigh = list->firstneigh;
|
||||
|
||||
/*
|
||||
int nmax = atom->nmax;
|
||||
if (nmax_store <= nmax) {
|
||||
memory->grow(ct, nmax, "atom:rheo_c_tension");
|
||||
@ -173,6 +173,7 @@ void PairRHEOTension::compute(int eflag, int vflag)
|
||||
|
||||
comm->reverse_comm(this);
|
||||
comm->forward_comm(this);
|
||||
*/
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -193,6 +194,14 @@ void PairRHEOTension::allocate()
|
||||
memory->create(cutsq, n + 1, n + 1, "pair:cutsq");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
global settings
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairRHEOTension::settings(int narg, char **arg)
|
||||
{
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set coeffs for one or more type pairs
|
||||
------------------------------------------------------------------------- */
|
||||
@ -208,7 +217,7 @@ void PairRHEOTension::coeff(int narg, char **arg)
|
||||
utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi,error);
|
||||
utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi,error);
|
||||
|
||||
alpha_one = utils::numeric(FLERR, arg[2], false, lmp);
|
||||
double alpha_one = utils::numeric(FLERR, arg[2], false, lmp);
|
||||
|
||||
int count = 0;
|
||||
for (int i = ilo; i <= ihi; i++) {
|
||||
@ -232,7 +241,7 @@ void PairRHEOTension::setup()
|
||||
auto fixes = modify->get_fix_by_style("rheo");
|
||||
if (fixes.size() == 0) error->all(FLERR, "Need to define fix rheo to use pair rheo");
|
||||
fix_rheo = dynamic_cast<FixRHEO *>(fixes[0]);
|
||||
|
||||
/*
|
||||
compute_kernel = fix_rheo->compute_kernel;
|
||||
compute_grad = fix_rheo->compute_grad;
|
||||
compute_interface = fix_rheo->compute_interface;
|
||||
@ -243,6 +252,7 @@ void PairRHEOTension::setup()
|
||||
hsq = h * h;
|
||||
hinv = 1.0 / h;
|
||||
hinv3 = hinv * 3.0;
|
||||
*/
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -291,6 +301,7 @@ double PairRHEOTension::init_one(int i, int j)
|
||||
|
||||
int PairRHEOTension::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/)
|
||||
{
|
||||
/*
|
||||
int i,j,k,m;
|
||||
m = 0;
|
||||
double *rho = atom->rho;
|
||||
@ -307,12 +318,14 @@ int PairRHEOTension::pack_forward_comm(int n, int *list, double *buf, int /*pbc_
|
||||
}
|
||||
}
|
||||
return m;
|
||||
*/
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairRHEOTension::unpack_forward_comm(int n, int first, double *buf)
|
||||
{
|
||||
/*
|
||||
int i, k, m, last;
|
||||
double *rho = atom->rho;
|
||||
m = 0;
|
||||
@ -327,6 +340,7 @@ void PairRHEOTension::unpack_forward_comm(int n, int first, double *buf)
|
||||
rho[i] = buf[m++];
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@ -334,6 +348,7 @@ void PairRHEOTension::unpack_forward_comm(int n, int first, double *buf)
|
||||
|
||||
int PairRHEOTension::pack_reverse_comm(int n, int first, double *buf)
|
||||
{
|
||||
/*
|
||||
int i, k, m, last;
|
||||
double **fp_store = compute_interface->fp_store;
|
||||
|
||||
@ -346,12 +361,14 @@ int PairRHEOTension::pack_reverse_comm(int n, int first, double *buf)
|
||||
}
|
||||
|
||||
return m;
|
||||
*/
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairRHEOTension::unpack_reverse_comm(int n, int *list, double *buf)
|
||||
{
|
||||
/*
|
||||
int i, j, k, m;
|
||||
double **fp_store = compute_interface->fp_store;
|
||||
|
||||
@ -362,4 +379,5 @@ void PairRHEOTension::unpack_reverse_comm(int n, int *list, double *buf)
|
||||
fp_store[j][1] += buf[m++];
|
||||
fp_store[j][2] += buf[m++];
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ class PairRHEOTension : public Pair {
|
||||
PairRHEOTension(class LAMMPS *);
|
||||
~PairRHEOTension() override;
|
||||
void compute(int, int) override;
|
||||
void settings(int, char **) override;
|
||||
void coeff(int, char **) override;
|
||||
void setup() override;
|
||||
void init_style() override;
|
||||
@ -41,8 +42,8 @@ class PairRHEOTension : public Pair {
|
||||
protected:
|
||||
int nmax_store;
|
||||
double **nt, *ct;
|
||||
double *alpha;
|
||||
double hsq, hinv, hinv3;
|
||||
double **alpha;
|
||||
double h, hsq, hinv, hinv3;
|
||||
|
||||
void allocate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user