diff --git a/src/ML-PACE/pair_pace_extrapolation.cpp b/src/ML-PACE/pair_pace_extrapolation.cpp index c17671d02b..053918ee82 100644 --- a/src/ML-PACE/pair_pace_extrapolation.cpp +++ b/src/ML-PACE/pair_pace_extrapolation.cpp @@ -123,8 +123,6 @@ void PairPACEExtrapolation::compute(int eflag, int vflag) { double delx, dely, delz, evdwl; double fij[3]; int *ilist, *jlist, *numneigh, **firstneigh; - double max_gamma_grade = 0; - max_gamma_grade_per_structure = 0; ev_init(eflag, vflag); // downwards modified by YL @@ -213,9 +211,7 @@ void PairPACEExtrapolation::compute(int eflag, int vflag) { // 'compute_atom' will update the `ace->e_atom` and `ace->neighbours_forces(jj, alpha)` arrays and max_gamma_grade if (flag_compute_extrapolation_grade) { - double current_atom_gamma_grade = aceimpl->ace->max_gamma_grade; - if (max_gamma_grade < current_atom_gamma_grade) max_gamma_grade = current_atom_gamma_grade; - extrapolation_grade_gamma[i] = current_atom_gamma_grade; + extrapolation_grade_gamma[i] = aceimpl->ace->max_gamma_grade;; } Array2D &neighbours_forces = @@ -264,25 +260,6 @@ void PairPACEExtrapolation::compute(int eflag, int vflag) { if (vflag_fdotr) virial_fdotr_compute(); -// if (flag_compute_extrapolation_grade) { -// //gather together max_gamma_grade_per_structure -// MPI_Allreduce(&max_gamma_grade, &max_gamma_grade_per_structure, 1, MPI_DOUBLE, MPI_MAX, world); -// -// // TODO: check, whether to stop here or externally in LAMMPS -// // check if gamma_upper_bound is exceeded -// if (max_gamma_grade_per_structure > gamma_upper_bound) { -// if (comm->me == 0) -// error->all(FLERR, -// "Extrapolation grade is too large (gamma={:.3f} > gamma_upper_bound={:.3f}, " -// "timestep={}), stopping...\n", -// max_gamma_grade_per_structure, gamma_upper_bound, current_timestep); -// -// MPI_Barrier(world); -// MPI_Abort(world, 1); //abort properly with error code '1' if not using many processes -// exit(EXIT_FAILURE); -// } -// } - // end modifications YL } @@ -303,41 +280,13 @@ void PairPACEExtrapolation::allocate() { ------------------------------------------------------------------------- */ void PairPACEExtrapolation::settings(int narg, char **arg) { - if (narg > 3) { - error->all(FLERR, - "Illegal pair_style command. Correct form:\n\tpair_style pace/al " - "[gamma_lower_bound] [gamma_upper_bound] [freq]"); - } - if (narg > 0) { - double glb = atof(arg[0]); // gamma lower bound - if (glb < 1.0) - error->all(FLERR, "Illegal gamma_lower_bound value: it should be real number >= 1.0"); - else - gamma_lower_bound = glb; + error->all(FLERR, + "Illegal pair_style command. Correct form:\n\tpair_style pace/extrapolation "); } - if (narg > 1) { - double gub = atof(arg[1]); // gamma upper bound - if (gub < gamma_lower_bound) - error->all( - FLERR, - "Illegal gamma_upper_bound value: it should be real number >= gamma_lower_bound >= 1.0"); - else - gamma_upper_bound = gub; - } - -// if (narg > 2) { -// gamma_grade_eval_freq = atoi(arg[2]); -// if (gamma_grade_eval_freq < 1) -// error->all(FLERR, "Illegal gamma_grade_eval_freq value: it should be integer number >= 1"); -// } - if (comm->me == 0) { utils::logmesg(lmp, "ACE/AL version: {}.{}.{}\n", VERSION_YEAR, VERSION_MONTH, VERSION_DAY); - utils::logmesg(lmp, "Extrapolation grade thresholds (lower/upper): {}/{}\n", gamma_lower_bound, - gamma_upper_bound); -// utils::logmesg(lmp, "Extrapolation grade evaluation frequency: {}\n", gamma_grade_eval_freq); } } diff --git a/src/ML-PACE/pair_pace_extrapolation.h b/src/ML-PACE/pair_pace_extrapolation.h index 3cacf1dc27..6e4eb53965 100644 --- a/src/ML-PACE/pair_pace_extrapolation.h +++ b/src/ML-PACE/pair_pace_extrapolation.h @@ -47,17 +47,10 @@ class PairPACEExtrapolation : public Pair { protected: struct ACEALImpl *aceimpl; -// bigint gamma_grade_eval_freq = 1; -// bool is_set_energies_forces = true; // if set, then update forces and energies int nmax; - double gamma_lower_bound = 1.5; - double gamma_upper_bound = 10; - double max_gamma_grade_per_structure = 0; - void allocate(); std::vector element_names; // list of elements (used by dump pace/extrapolation) - double rcutmax; // max cutoff for all elements int nelements; // # of unique elements double *extrapolation_grade_gamma; //per-atom gamma value diff --git a/src/fix_pair.cpp b/src/fix_pair.cpp index 36d6372876..93e76f0c74 100644 --- a/src/fix_pair.cpp +++ b/src/fix_pair.cpp @@ -279,3 +279,11 @@ double FixPair::memory_usage() else bytes += (double)atom->nmax*ncols * sizeof(double); return bytes; } + +int FixPair::modify_param(int narg, char **arg) +{ + nevery = utils::inumeric(FLERR,arg[0],false,lmp); + if (nevery < 1) error->all(FLERR,"Illegal fix_modify pair command"); + + return 1; // how many arguments were processed +} \ No newline at end of file diff --git a/src/fix_pair.h b/src/fix_pair.h index a9927cf477..7686adff66 100644 --- a/src/fix_pair.h +++ b/src/fix_pair.h @@ -38,6 +38,8 @@ class FixPair : public Fix { void grow_arrays(int) override; double memory_usage() override; + int modify_param(int, char **) override; + private: int nevery,nfield,ncols; char *pairname;