remove dead code and address warnings from static code analysis
This commit is contained in:
@ -25,9 +25,6 @@ AtomVecApip::AtomVecApip(LAMMPS *lmp) : AtomVec(lmp)
|
|||||||
mass_type = PER_TYPE;
|
mass_type = PER_TYPE;
|
||||||
forceclearflag = 1;
|
forceclearflag = 1;
|
||||||
|
|
||||||
double *apip_lambda, *apip_lambda_input, *apip_lambda_input_ta, *apip_lambda_const, *apip_e_fast,
|
|
||||||
*apip_e_precise, **apip_f_const_lambda, **apip_f_dyn_lambda;
|
|
||||||
int *apip_lambda_required;
|
|
||||||
atom->apip_lambda_flag = 1;
|
atom->apip_lambda_flag = 1;
|
||||||
atom->apip_lambda_input_flag = 1;
|
atom->apip_lambda_input_flag = 1;
|
||||||
atom->apip_lambda_input_ta_flag = 1;
|
atom->apip_lambda_input_ta_flag = 1;
|
||||||
|
|||||||
@ -32,10 +32,9 @@ using namespace LAMMPS_NS;
|
|||||||
using namespace FixConst;
|
using namespace FixConst;
|
||||||
|
|
||||||
FixAtomWeightAPIP::FixAtomWeightAPIP(LAMMPS *lmp, int narg, char **arg) :
|
FixAtomWeightAPIP::FixAtomWeightAPIP(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg), fixstore(nullptr), time_simple_extract_name(nullptr),
|
Fix(lmp, narg, arg), time_simple_extract_name(nullptr), time_complex_extract_name(nullptr),
|
||||||
time_complex_extract_name(nullptr), time_lambda_extract_name(nullptr),
|
time_group_extract_name(nullptr), time_lambda_extract_name(nullptr), time_group_name(nullptr),
|
||||||
time_group_extract_name(nullptr), time_group_name(nullptr), fix_lambda(nullptr),
|
fixstore(nullptr), ap_timer(nullptr), fix_lambda(nullptr)
|
||||||
ap_timer(nullptr)
|
|
||||||
{
|
{
|
||||||
if (narg < 9) error->all(FLERR, "Illegal fix balance command");
|
if (narg < 9) error->all(FLERR, "Illegal fix balance command");
|
||||||
|
|
||||||
@ -119,8 +118,6 @@ FixAtomWeightAPIP::FixAtomWeightAPIP(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
int useless_dim = -1;
|
int useless_dim = -1;
|
||||||
void *extracted_ptr = nullptr;
|
|
||||||
|
|
||||||
if (time_simple_extract_name) {
|
if (time_simple_extract_name) {
|
||||||
if (force->pair->extract(time_simple_extract_name, useless_dim) == nullptr)
|
if (force->pair->extract(time_simple_extract_name, useless_dim) == nullptr)
|
||||||
error->all(FLERR, "atom_weight/apip: simple time cannot be extracted with {} from {}",
|
error->all(FLERR, "atom_weight/apip: simple time cannot be extracted with {} from {}",
|
||||||
|
|||||||
@ -46,9 +46,9 @@ static const char cite_fix_lambda_c[] =
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixLambdaAPIP::FixLambdaAPIP(LAMMPS *lmp, int narg, char **arg) :
|
FixLambdaAPIP::FixLambdaAPIP(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg), peratom_stats(nullptr), group_name_simple(nullptr),
|
Fix(lmp, narg, arg), pair_lambda_input(nullptr), pair_lambda_zone(nullptr), fixstore(nullptr),
|
||||||
group_name_complex(nullptr), group_name_ignore_lambda_input(nullptr), fixstore(nullptr),
|
fixstore2(nullptr), group_name_simple(nullptr), group_name_complex(nullptr),
|
||||||
fixstore2(nullptr), pair_lambda_input(nullptr), pair_lambda_zone(nullptr)
|
group_name_ignore_lambda_input(nullptr), peratom_stats(nullptr)
|
||||||
{
|
{
|
||||||
if (lmp->citeme) lmp->citeme->add(cite_fix_lambda_c);
|
if (lmp->citeme) lmp->citeme->add(cite_fix_lambda_c);
|
||||||
|
|
||||||
@ -190,12 +190,14 @@ FixLambdaAPIP::FixLambdaAPIP(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
int FixLambdaAPIP::modify_param(int narg, char **arg)
|
int FixLambdaAPIP::modify_param(int narg, char **arg)
|
||||||
{
|
{
|
||||||
|
if (narg < 2) utils::missing_cmd_args(FLERR, "fix_modify lambda/apip", error);
|
||||||
|
|
||||||
cut_lo = utils::numeric(FLERR, arg[0], false, lmp);
|
cut_lo = utils::numeric(FLERR, arg[0], false, lmp);
|
||||||
cut_hi = utils::numeric(FLERR, arg[1], false, lmp);
|
cut_hi = utils::numeric(FLERR, arg[1], false, lmp);
|
||||||
cut_hi_sq = cut_hi * cut_hi;
|
cut_hi_sq = cut_hi * cut_hi;
|
||||||
cut_width = cut_hi - cut_lo;
|
cut_width = cut_hi - cut_lo;
|
||||||
|
|
||||||
if (cut_lo < 0 || cut_hi < cut_lo) error->all(FLERR, "fix lambda: Illegal cutoff values");
|
if (cut_lo < 0 || cut_hi < cut_lo) error->all(FLERR, "fix lambda/apip: Illegal cutoff values");
|
||||||
|
|
||||||
if (force->pair->cutforce < cut_hi)
|
if (force->pair->cutforce < cut_hi)
|
||||||
error->all(FLERR, "fix lambda: cutoff of potential smaller than cutoff of switching region");
|
error->all(FLERR, "fix lambda: cutoff of potential smaller than cutoff of switching region");
|
||||||
@ -538,21 +540,20 @@ void FixLambdaAPIP::update_lambda_history()
|
|||||||
if (invoked_history2_update == update->ntimestep) return;
|
if (invoked_history2_update == update->ntimestep) return;
|
||||||
invoked_history2_update = update->ntimestep;
|
invoked_history2_update = update->ntimestep;
|
||||||
|
|
||||||
double *lambda_input_ta, **lambda_history, **lambda_input_history;
|
double *lambda_input_ta, **lambda_history;
|
||||||
int *mask;
|
int *mask;
|
||||||
int nlocal;
|
int nlocal;
|
||||||
|
|
||||||
lambda_input_ta = atom->apip_lambda_input_ta;
|
lambda_input_ta = atom->apip_lambda_input_ta;
|
||||||
mask = atom->mask;
|
mask = atom->mask;
|
||||||
lambda_history = fixstore2->astore;
|
lambda_history = fixstore2->astore;
|
||||||
lambda_input_history = fixstore->astore;
|
|
||||||
nlocal = atom->nlocal;
|
nlocal = atom->nlocal;
|
||||||
|
|
||||||
// update stats about written values
|
// update stats about written values
|
||||||
|
|
||||||
history2_last = (history2_last + 1) % history2_length;
|
history2_last = (history2_last + 1) % history2_length;
|
||||||
history2_used = std::min(history2_used + 1, history2_length);
|
history2_used = std::min(history2_used + 1, history2_length);
|
||||||
|
|
||||||
int tmp = 0;
|
|
||||||
for (int i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
if (!(mask[i] & groupbit)) continue;
|
if (!(mask[i] & groupbit)) continue;
|
||||||
|
|
||||||
@ -617,15 +618,13 @@ void FixLambdaAPIP::get_lambda_average()
|
|||||||
void FixLambdaAPIP::calculate_lambda_input_ta()
|
void FixLambdaAPIP::calculate_lambda_input_ta()
|
||||||
{
|
{
|
||||||
int i, nlocal;
|
int i, nlocal;
|
||||||
int *mask;
|
|
||||||
double *lambda_input_ta = atom->apip_lambda_input_ta;
|
double *lambda_input_ta = atom->apip_lambda_input_ta;
|
||||||
|
|
||||||
nlocal = atom->nlocal;
|
nlocal = atom->nlocal;
|
||||||
mask = atom->mask;
|
|
||||||
|
|
||||||
// store time averaged lambda_input for own atoms
|
// store time averaged lambda_input for own atoms
|
||||||
double **lambda_input_history = fixstore->astore;
|
double **lambda_input_history = fixstore->astore;
|
||||||
for (i = 0; i < nlocal; i++) { lambda_input_ta[i] = lambda_input_history[i][history_length + 1]; }
|
for (i = 0; i < nlocal; i++) lambda_input_ta[i] = lambda_input_history[i][history_length + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -740,9 +739,7 @@ void FixLambdaAPIP::write_restart(FILE *fp)
|
|||||||
|
|
||||||
void FixLambdaAPIP::restart(char *buf)
|
void FixLambdaAPIP::restart(char *buf)
|
||||||
{
|
{
|
||||||
int timesteps_since_invoked_history_update, history_length_br,
|
int history_length_br, history2_length_br;
|
||||||
timesteps_since_invoked_history2_update, history2_length_br;
|
|
||||||
bigint next_file_write_calculated;
|
|
||||||
|
|
||||||
int n = 0;
|
int n = 0;
|
||||||
auto list = (double *) buf;
|
auto list = (double *) buf;
|
||||||
|
|||||||
@ -405,15 +405,11 @@ void FixLambdaThermostatAPIP::calculate_energy_change()
|
|||||||
|
|
||||||
void FixLambdaThermostatAPIP::apply_thermostat()
|
void FixLambdaThermostatAPIP::apply_thermostat()
|
||||||
{
|
{
|
||||||
double xtmp, ytmp, ztmp, delx, dely, delz, delvx, delvy, delvz, r, dotvu, masstmp, massj, muij,
|
double xtmp, ytmp, ztmp, masstmp, massj;
|
||||||
delv, delv_m, epsilon, epsilonsq, deltaK, rinv;
|
|
||||||
double m_cm, v_cm[3], beta_rescaling, k_rel, v_rel[3], radicand;
|
double m_cm, v_cm[3], beta_rescaling, k_rel, v_rel[3], radicand;
|
||||||
int i, ii, inum, *ilist;
|
int i, ii, inum, *ilist;
|
||||||
int j, jj, jnum, *jlist;
|
int j, jj, jnum, *jlist;
|
||||||
|
|
||||||
int nlocal = atom->nlocal;
|
|
||||||
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **v = atom->v;
|
double **v = atom->v;
|
||||||
double *rmass = atom->rmass;
|
double *rmass = atom->rmass;
|
||||||
@ -421,8 +417,6 @@ void FixLambdaThermostatAPIP::apply_thermostat()
|
|||||||
int *type = atom->type;
|
int *type = atom->type;
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
|
|
||||||
double *e_simple = atom->apip_e_fast;
|
|
||||||
double *e_complex = atom->apip_e_precise;
|
|
||||||
double *lambda_const = atom->apip_lambda_const;
|
double *lambda_const = atom->apip_lambda_const;
|
||||||
double *lambda = atom->apip_lambda;
|
double *lambda = atom->apip_lambda;
|
||||||
|
|
||||||
@ -465,7 +459,6 @@ void FixLambdaThermostatAPIP::apply_thermostat()
|
|||||||
"particles in neighbour list particle: {} {} {} groupbit {}\n",
|
"particles in neighbour list particle: {} {} {} groupbit {}\n",
|
||||||
xtmp, ytmp, ztmp, mask[i] & groupbit);
|
xtmp, ytmp, ztmp, mask[i] & groupbit);
|
||||||
|
|
||||||
int i_collisions = 0;
|
|
||||||
double e_remain = energy_change_atom[i];
|
double e_remain = energy_change_atom[i];
|
||||||
|
|
||||||
// copy ngh list
|
// copy ngh list
|
||||||
|
|||||||
@ -143,7 +143,7 @@ void PairEAMAPIP::compute(int eflag, int vflag)
|
|||||||
int n_non_complex = 0;
|
int n_non_complex = 0;
|
||||||
|
|
||||||
int i, j, ii, jj, m, inum, jnum, itype, jtype;
|
int i, j, ii, jj, m, inum, jnum, itype, jtype;
|
||||||
double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair, lambda_ij, fpair_cl;
|
double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair, fpair_cl;
|
||||||
double rsq, r, p, rhoip, rhojp, z2, z2p, recip, phip, psip, phi, psip_cl;
|
double rsq, r, p, rhoip, rhojp, z2, z2p, recip, phip, psip, phi, psip_cl;
|
||||||
double *coeff;
|
double *coeff;
|
||||||
int *ilist, *jlist, *numneigh, **firstneigh;
|
int *ilist, *jlist, *numneigh, **firstneigh;
|
||||||
@ -181,7 +181,6 @@ void PairEAMAPIP::compute(int eflag, int vflag)
|
|||||||
}
|
}
|
||||||
int *type = atom->type;
|
int *type = atom->type;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
int nall = nlocal + atom->nghost;
|
|
||||||
int newton_pair = force->newton_pair;
|
int newton_pair = force->newton_pair;
|
||||||
|
|
||||||
inum = list->inum;
|
inum = list->inum;
|
||||||
|
|||||||
@ -265,7 +265,7 @@ void PairLambdaInputCSPAPIP::select(int k, int n, double *arr)
|
|||||||
|
|
||||||
void PairLambdaInputCSPAPIP::select2(int k, int n, double *arr, int *iarr)
|
void PairLambdaInputCSPAPIP::select2(int k, int n, double *arr, int *iarr)
|
||||||
{
|
{
|
||||||
int i, ir, j, l, mid, ia, itmp;
|
int i, ir, j, l, mid, ia;
|
||||||
double a;
|
double a;
|
||||||
|
|
||||||
arr--;
|
arr--;
|
||||||
|
|||||||
@ -28,8 +28,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
PairLambdaZoneAPIP::PairLambdaZoneAPIP(LAMMPS *lmp) :
|
PairLambdaZoneAPIP::PairLambdaZoneAPIP(LAMMPS *lmp) : Pair(lmp), cut(nullptr), lambda_ta(nullptr)
|
||||||
Pair(lmp), lambda_ta(nullptr), cut(nullptr)
|
|
||||||
{
|
{
|
||||||
// set defaults
|
// set defaults
|
||||||
|
|
||||||
@ -186,7 +185,7 @@ void PairLambdaZoneAPIP::calculate_lambda()
|
|||||||
|
|
||||||
double xtmp, ytmp, ztmp, delx, dely, delz, lambda_tmp, rsq, lambda_new;
|
double xtmp, ytmp, ztmp, delx, dely, delz, lambda_tmp, rsq, lambda_new;
|
||||||
double **x, *lambda_input_ta;
|
double **x, *lambda_input_ta;
|
||||||
int allnum, ii, i, nlocal, nall, jnum, j, jj, loop_iterations;
|
int allnum, ii, i, nlocal, jnum, j, jj, loop_iterations;
|
||||||
int *ilist, *mask, *jlist, *numneigh, **firstneigh;
|
int *ilist, *mask, *jlist, *numneigh, **firstneigh;
|
||||||
|
|
||||||
mask = atom->mask;
|
mask = atom->mask;
|
||||||
@ -194,7 +193,6 @@ void PairLambdaZoneAPIP::calculate_lambda()
|
|||||||
lambda_input_ta = atom->apip_lambda_input_ta;
|
lambda_input_ta = atom->apip_lambda_input_ta;
|
||||||
|
|
||||||
nlocal = atom->nlocal;
|
nlocal = atom->nlocal;
|
||||||
nall = nlocal + atom->nghost;
|
|
||||||
|
|
||||||
if (nlocal > nmax_ta) {
|
if (nlocal > nmax_ta) {
|
||||||
memory->destroy(lambda_ta);
|
memory->destroy(lambda_ta);
|
||||||
|
|||||||
Reference in New Issue
Block a user