Merge pull request #4498 from evoyiatzis/patch-4

implement extract() in pair_style yukawa
This commit is contained in:
Axel Kohlmeyer
2025-03-14 13:27:44 -04:00
committed by GitHub
4 changed files with 14 additions and 1 deletions

View File

@ -236,6 +236,8 @@ formulas for the meaning of these parameters:
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
| :doc:`wf/cut <pair_wf_cut>` | epsilon,sigma,nu,mu | type pairs |
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
| :doc:`yukawa <pair_yukawa>` | alpha | type pairs |
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
.. note::

View File

@ -332,3 +332,12 @@ double PairYukawa::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq
phi = a[itype][jtype] * screening * rinv - offset[itype][jtype];
return factor_lj * phi;
}
/* ---------------------------------------------------------------------- */
void *PairYukawa::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str, "alpha") == 0) return (void *) a;
return nullptr;
}

View File

@ -39,6 +39,7 @@ class PairYukawa : public Pair {
void write_data(FILE *) override;
void write_data_all(FILE *) override;
double single(int, int, int, int, double, double, double, double &) override;
void *extract(const char *, int &) override;
protected:
double cut_global;

View File

@ -17,7 +17,8 @@ pair_coeff: ! |
3 3 350.0
4 4 250.0
5 5 250.0
extract: ! ""
extract: ! |
alpha 2
natoms: 29
init_vdwl: 12.114009254533281
init_coul: 0