From 6ff8fc093ec50d396a6113f4fb6baadd38a44911 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 28 Feb 2021 11:20:31 +0100 Subject: [PATCH 01/10] Extent extract method of BuckCoulLong --- src/KSPACE/pair_buck_coul_long.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp index 4a0b8a3a15..20202a8de2 100644 --- a/src/KSPACE/pair_buck_coul_long.cpp +++ b/src/KSPACE/pair_buck_coul_long.cpp @@ -558,5 +558,8 @@ void *PairBuckCoulLong::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; + dim = 2; + if (strcmp(str,"a") == 0) return (void *) a; + if (strcmp(str,"c") == 0) return (void *) c; return nullptr; } From b6224164177c1a392e110118ff71b290ad3234ba Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 28 Feb 2021 11:21:38 +0100 Subject: [PATCH 02/10] Extent extract method of PairBuckCoulMSM --- src/KSPACE/pair_buck_coul_msm.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/KSPACE/pair_buck_coul_msm.cpp b/src/KSPACE/pair_buck_coul_msm.cpp index 4c423a8afd..c7d237b161 100644 --- a/src/KSPACE/pair_buck_coul_msm.cpp +++ b/src/KSPACE/pair_buck_coul_msm.cpp @@ -246,5 +246,9 @@ void *PairBuckCoulMSM::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; + dim = 2; + if (strcmp(str,"a") == 0) return (void *) a; + if (strcmp(str,"c") == 0) return (void *) c; + return nullptr; } From 947fa675311aa079c31d4f480b27ee534f92fe52 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 28 Feb 2021 11:25:49 +0100 Subject: [PATCH 03/10] Addition of extract method in BuckCoulCut --- src/pair_buck_coul_cut.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pair_buck_coul_cut.h b/src/pair_buck_coul_cut.h index b400ca3152..fef8396335 100644 --- a/src/pair_buck_coul_cut.h +++ b/src/pair_buck_coul_cut.h @@ -40,6 +40,7 @@ class PairBuckCoulCut : public Pair { void write_data(FILE *); void write_data_all(FILE *); virtual double single(int, int, int, int, double, double, double, double &); + void *extract(const char *, int &); protected: double cut_lj_global,cut_coul_global; From 2f764edadc0f7c10ff436c4eb09368f16b3a5c62 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 28 Feb 2021 11:30:12 +0100 Subject: [PATCH 04/10] Addition of extract method in PairBuckCoulCut cpp --- src/pair_buck_coul_cut.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index 05b36d3620..579113c992 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -470,3 +470,13 @@ double PairBuckCoulCut::single(int i, int j, int itype, int jtype, } return eng; } + +/* ---------------------------------------------------------------------- */ + +void *PairBuckCoulCut::extract(const char *str, int &dim) +{ + dim = 2; + if (strcmp(str,"a") == 0) return (void *) a; + if (strcmp(str,"c") == 0) return (void *) c; + return nullptr; +} From 39422dff941707a58be19e480762fcf70e90a6c3 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 28 Feb 2021 11:39:02 +0100 Subject: [PATCH 05/10] Update compute_fep.rst --- doc/src/compute_fep.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/compute_fep.rst b/doc/src/compute_fep.rst index 0832d6191a..279148a55d 100644 --- a/doc/src/compute_fep.rst +++ b/doc/src/compute_fep.rst @@ -163,7 +163,7 @@ the meaning of these parameters: +------------------------------------------------------------------------------+-------------------------+------------+ | :doc:`born ` | a,b,c | type pairs | +------------------------------------------------------------------------------+-------------------------+------------+ -| :doc:`buck ` | a,c | type pairs | +| :doc:`buck, buck/coul/cut, buck/coul/long, buck/coul/msm ` | a,c | type pairs | +------------------------------------------------------------------------------+-------------------------+------------+ | :doc:`buck/mdf ` | a,c | type pairs | +------------------------------------------------------------------------------+-------------------------+------------+ From 97718fa957d1fa26a72a617b9cf399a5f1b02c5a Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 28 Feb 2021 11:40:43 +0100 Subject: [PATCH 06/10] Update fix_adapt.rst --- doc/src/fix_adapt.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/fix_adapt.rst b/doc/src/fix_adapt.rst index 638895ecc9..aa34516d52 100644 --- a/doc/src/fix_adapt.rst +++ b/doc/src/fix_adapt.rst @@ -128,9 +128,9 @@ formulas for the meaning of these parameters: +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ | :doc:`born/coul/long, born/coul/msm ` | coulombic_cutoff | type global | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ -| :doc:`buck ` | a,c | type pairs | +| :doc:`buck, buck/coul/cut ` | a,c | type pairs | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ -| :doc:`buck/coul/long, buck/coul/msm ` | coulombic_cutoff | type global | +| :doc:`buck/coul/long, buck/coul/msm ` | a,c,coulombic_cutoff | type pairs | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ | :doc:`buck/mdf ` | a,c | type pairs | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ From 4e7df729aec5496802c50dffcbec4a2b7ca52b3e Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 28 Feb 2021 11:41:28 +0100 Subject: [PATCH 07/10] Update fix_adapt_fep.rst --- doc/src/fix_adapt_fep.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/fix_adapt_fep.rst b/doc/src/fix_adapt_fep.rst index 0666d3965d..b45ac80429 100644 --- a/doc/src/fix_adapt_fep.rst +++ b/doc/src/fix_adapt_fep.rst @@ -120,7 +120,7 @@ styles and their energy formulas for the meaning of these parameters: +------------------------------------------------------------------------------+-------------------------+------------+ | :doc:`born ` | a,b,c | type pairs | +------------------------------------------------------------------------------+-------------------------+------------+ -| :doc:`buck ` | a,c | type pairs | +| :doc:`buck, buck/coul/cut, buck/coul/long, buck/coul/msm ` | a,c | type pairs | +------------------------------------------------------------------------------+-------------------------+------------+ | :doc:`buck/mdf ` | a,c | type pairs | +------------------------------------------------------------------------------+-------------------------+------------+ From 30d15b9b2274010159db50ef29176e39d7956a65 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 28 Feb 2021 11:59:17 -0500 Subject: [PATCH 08/10] test for extract parameters in unit tests --- unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml | 4 +++- unittest/force-styles/tests/mol-pair-buck_coul_long.yaml | 4 +++- unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml | 4 +++- unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml | 4 +++- unittest/force-styles/tests/mol-pair-buck_coul_table.yaml | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml index 928473176d..da5850b91c 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml @@ -25,7 +25,9 @@ pair_coeff: ! | 4 4 127198.698386798 0.207005479340455 37.2289658745028 4 5 127198.698386798 0.207005479340455 37.2289658745028 5 5 127198.698386798 0.207005479340455 37.2289658745028 -extract: ! "" +extract: | + a 2 + c 2 natoms: 29 init_vdwl: 143.749538808172 init_coul: -127.494586297384 diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_long.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_long.yaml index 07606715b8..c6271ab58e 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_long.yaml @@ -30,7 +30,9 @@ pair_coeff: ! | 4 4 127198.698386798 0.207005479340455 37.2289658745028 4 5 127198.698386798 0.207005479340455 37.2289658745028 5 5 127198.698386798 0.207005479340455 37.2289658745028 -extract: ! "" +extract: | + a 2 + c 2 natoms: 29 init_vdwl: 143.749538808172 init_coul: 225.821815126925 diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml index ca38b6369d..41e91c6a9a 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_msm.yaml @@ -32,7 +32,9 @@ pair_coeff: ! | 4 4 127198.698386798 0.207005479340455 37.2289658745028 4 5 127198.698386798 0.207005479340455 37.2289658745028 5 5 127198.698386798 0.207005479340455 37.2289658745028 -extract: ! "" +extract: | + a 2 + c 2 natoms: 29 init_vdwl: 143.749538808172 init_coul: 226.465163473713 diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml index 24a23bb444..676aa0450a 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_msm_table.yaml @@ -32,7 +32,9 @@ pair_coeff: ! | 4 4 127198.698386798 0.207005479340455 37.2289658745028 4 5 127198.698386798 0.207005479340455 37.2289658745028 5 5 127198.698386798 0.207005479340455 37.2289658745028 -extract: ! "" +extract: | + a 2 + c 2 natoms: 29 init_vdwl: 143.749538808172 init_coul: 226.465163473713 diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_table.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_table.yaml index 5e89b1ddf7..f56810d895 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_table.yaml @@ -30,7 +30,9 @@ pair_coeff: ! | 4 4 127198.698386798 0.207005479340455 37.2289658745028 4 5 127198.698386798 0.207005479340455 37.2289658745028 5 5 127198.698386798 0.207005479340455 37.2289658745028 -extract: ! "" +extract: | + a 2 + c 2 natoms: 29 init_vdwl: 143.749538808172 init_coul: 225.821851347828 From a57311ce3aaafac4905ffc62c4bbfb0dfc7d80b0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 28 Feb 2021 12:03:50 -0500 Subject: [PATCH 09/10] whitespace fixes --- src/pair_buck_coul_cut.cpp | 2 +- src/utils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index 579113c992..bc95dfb6ab 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -474,7 +474,7 @@ double PairBuckCoulCut::single(int i, int j, int itype, int jtype, /* ---------------------------------------------------------------------- */ void *PairBuckCoulCut::extract(const char *str, int &dim) -{ +{ dim = 2; if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; diff --git a/src/utils.cpp b/src/utils.cpp index bf88238d4a..d9320f464e 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1655,7 +1655,7 @@ extern "C" { (*matchlen)++; return 1; } - } + } return 0; } From 0ae38fb2ea6e067da192be5b9827712712efbe0d Mon Sep 17 00:00:00 2001 From: Stephen Sanderson Date: Mon, 1 Mar 2021 09:48:31 +1000 Subject: [PATCH 10/10] Fix return values of extract for pressure variables --- src/fix_nh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 46afe7b2d7..49a469d296 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -1754,13 +1754,13 @@ void *FixNH::extract(const char *str, int &dim) } else if (tstat_flag && strcmp(str,"mtchain") == 0) { return &mtchain; } else if (pstat_flag && strcmp(str,"mpchain") == 0) { - return &mtchain; + return &mpchain; } dim=1; if (tstat_flag && strcmp(str,"eta") == 0) { return η } else if (pstat_flag && strcmp(str,"etap") == 0) { - return η + return &etap; } else if (pstat_flag && strcmp(str,"p_flag") == 0) { return &p_flag; } else if (pstat_flag && strcmp(str,"p_start") == 0) {