Fixed a bug with rigid/*/small when starting with an empty group of rigid bodies such as when using fix deposit

This commit is contained in:
Trung Nguyen
2021-04-05 23:51:11 -05:00
parent 9da49d9c6f
commit 2fc9734fab
2 changed files with 4 additions and 17 deletions

View File

@ -754,6 +754,8 @@ void FixRigidNHSmall::final_integrate()
void FixRigidNHSmall::nhc_temp_integrate()
{
if (g_f == 0) return;
int i,j,k;
double kt,gfkt_t,gfkt_r,tmp,ms,s,s2;
@ -1148,6 +1150,8 @@ void FixRigidNHSmall::compute_press_target()
void FixRigidNHSmall::nh_epsilon_dot()
{
if (g_f == 0) return;
int i;
double volume,scale,f_epsilon;
@ -1204,8 +1208,6 @@ void FixRigidNHSmall::compute_dof()
nf_r = nfall[1];
g_f = nf_t + nf_r;
onednft = 1.0 + (double)(dimension) / (double)g_f;
onednfr = (double) (dimension) / (double)g_f;
}
/* ----------------------------------------------------------------------
@ -1367,19 +1369,6 @@ int FixRigidNHSmall::modify_param(int narg, char **arg)
return FixRigidSmall::modify_param(narg,arg);
}
/* ----------------------------------------------------------------------
disallow using fix rigid/n??/small fixes with fix deposit
we would need custom functionality to update data structures
used by all fixes derived from this class but not fix rigid/small
------------------------------------------------------------------------- */
void FixRigidNHSmall::set_molecule(int, tagint, int,
double *, double *, double *)
{
error->all(FLERR,fmt::format("Molecule update not (yet) implemented for "
"fix {}", style));
}
/* ---------------------------------------------------------------------- */
void FixRigidNHSmall::allocate_chain()

View File

@ -38,7 +38,6 @@ class FixRigidNHSmall : public FixRigidSmall {
int dimension; // # of dimensions
int nf_t,nf_r; // trans/rot degrees of freedom
double onednft,onednfr; // factors 1 + dimension/trans(rot) degrees of freedom
double *w,*wdti1,*wdti2,*wdti4; // Yoshida-Suzuki coefficients
double *q_t,*q_r; // trans/rot thermostat masses
double *eta_t,*eta_r; // trans/rot thermostat positions
@ -80,7 +79,6 @@ class FixRigidNHSmall : public FixRigidSmall {
void nh_epsilon_dot();
void compute_dof();
void set_molecule(int, tagint, int, double *, double *, double *);
void allocate_chain();
void allocate_order();
void deallocate_chain();