mirror of
https://github.com/ParticulateFlow/LIGGGHTS-PFM.git
synced 2025-12-08 06:47:43 +00:00
move deletion of particles to pre_exchange method
deletion of particles requires a neighbor list rebuild and should always be done in pre_exchange force_reneighbor: 1 indicates that this fix might require neighbor list rebuilds and adds the fix to a list that gets checked for that event next_reneighbor: used in deciding whether or not to trigger rebuild in the current time step
This commit is contained in:
@ -148,6 +148,8 @@ FixCfdCouplingDeform::FixCfdCouplingDeform(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
vector_flag = 1;
|
||||
size_vector = 3;
|
||||
force_reneighbor = 1;
|
||||
next_reneighbor = -1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -202,6 +204,7 @@ int FixCfdCouplingDeform::setmask()
|
||||
{
|
||||
int mask = 0;
|
||||
mask |= INITIAL_INTEGRATE;
|
||||
mask |= PRE_EXCHANGE;
|
||||
mask |= POST_FORCE;
|
||||
return mask;
|
||||
}
|
||||
@ -266,6 +269,15 @@ void FixCfdCouplingDeform::initial_integrate(int)
|
||||
// only delete group immediately after pull/push so that no latent heat is neglected
|
||||
if (prev_time != fix_coupling_->latestpull("partDeformations")) return;
|
||||
|
||||
next_reneighbor = update->ntimestep;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixCfdCouplingDeform::pre_exchange()
|
||||
{
|
||||
if(next_reneighbor != update->ntimestep) return;
|
||||
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
int *type = atom->type;
|
||||
|
||||
@ -41,6 +41,7 @@ class FixCfdCouplingDeform : public Fix {
|
||||
int setmask();
|
||||
void init();
|
||||
void initial_integrate(int);
|
||||
void pre_exchange();
|
||||
void post_force(int);
|
||||
|
||||
double compute_vector(int n);
|
||||
|
||||
Reference in New Issue
Block a user