From 11172c19491cbb5dd0c3247eb5f362a73f1b7979 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Feb 2023 21:49:31 -0500 Subject: [PATCH] make biga0 and r0 accessible via Pair::extract() and add pair style to table in fix adapt --- doc/src/fix_adapt.rst | 2 ++ src/EXTRA-PAIR/pair_born_gauss.cpp | 2 ++ src/EXTRA-PAIR/pair_born_gauss.h | 2 +- unittest/force-styles/tests/atomic-pair-born_gauss.yaml | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/src/fix_adapt.rst b/doc/src/fix_adapt.rst index a3e851faf0..e74d75472f 100644 --- a/doc/src/fix_adapt.rst +++ b/doc/src/fix_adapt.rst @@ -133,6 +133,8 @@ formulas for the meaning of these parameters: +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ | :doc:`born/coul/long, born/coul/msm ` | coulombic_cutoff | type global | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ +| :doc:`born/gauss ` | biga0,biga1,r0 | type pairs | ++------------------------------------------------------------------------------+--------------------------------------------------+-------------+ | :doc:`buck, buck/coul/cut ` | a,c | type pairs | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ | :doc:`buck/coul/long, buck/coul/msm ` | a,c,coulombic_cutoff | type pairs | diff --git a/src/EXTRA-PAIR/pair_born_gauss.cpp b/src/EXTRA-PAIR/pair_born_gauss.cpp index aa4aa4e4bc..062ed4aabe 100644 --- a/src/EXTRA-PAIR/pair_born_gauss.cpp +++ b/src/EXTRA-PAIR/pair_born_gauss.cpp @@ -363,6 +363,8 @@ double PairBornGauss::single(int /*i*/, int /*j*/, int itype, int jtype, double void *PairBornGauss::extract(const char *str, int &dim) { dim = 2; + if (strcmp(str, "biga0") == 0) return (void *) biga0; if (strcmp(str, "biga1") == 0) return (void *) biga1; + if (strcmp(str, "r0") == 0) return (void *) r0; return nullptr; } diff --git a/src/EXTRA-PAIR/pair_born_gauss.h b/src/EXTRA-PAIR/pair_born_gauss.h index c4938c602c..cc3eacc702 100644 --- a/src/EXTRA-PAIR/pair_born_gauss.h +++ b/src/EXTRA-PAIR/pair_born_gauss.h @@ -44,7 +44,7 @@ class PairBornGauss : public Pair { void *extract(const char *, int &) override; protected: - double cut_global, temperature; + double cut_global; double **cut; double **biga0, **alpha, **biga1, **beta, **r0; double **offset; diff --git a/unittest/force-styles/tests/atomic-pair-born_gauss.yaml b/unittest/force-styles/tests/atomic-pair-born_gauss.yaml index ed68b5fee6..164f60e332 100644 --- a/unittest/force-styles/tests/atomic-pair-born_gauss.yaml +++ b/unittest/force-styles/tests/atomic-pair-born_gauss.yaml @@ -12,7 +12,9 @@ pair_style: born/gauss 8.0 pair_coeff: ! | * * 8.2464e13 12.48 0.042644277 0.44 3.56 extract: ! | + biga0 2 biga1 2 + r0 2 natoms: 32 init_vdwl: 2834.5490463003366 init_coul: 0