Merge pull request #2634 from evoyiatzis/master

Small extension of extract method in Buckingham pair styles
This commit is contained in:
Axel Kohlmeyer
2021-03-01 09:03:49 -05:00
committed by GitHub
13 changed files with 38 additions and 10 deletions

View File

@ -163,7 +163,7 @@ the meaning of these parameters:
+------------------------------------------------------------------------------+-------------------------+------------+
| :doc:`born <pair_born>` | a,b,c | type pairs |
+------------------------------------------------------------------------------+-------------------------+------------+
| :doc:`buck <pair_buck>` | a,c | type pairs |
| :doc:`buck, buck/coul/cut, buck/coul/long, buck/coul/msm <pair_buck>` | a,c | type pairs |
+------------------------------------------------------------------------------+-------------------------+------------+
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
+------------------------------------------------------------------------------+-------------------------+------------+

View File

@ -128,9 +128,9 @@ formulas for the meaning of these parameters:
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
| :doc:`born/coul/long, born/coul/msm <pair_born>` | coulombic_cutoff | type global |
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
| :doc:`buck <pair_buck>` | a,c | type pairs |
| :doc:`buck, buck/coul/cut <pair_buck>` | a,c | type pairs |
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
| :doc:`buck/coul/long, buck/coul/msm <pair_buck>` | coulombic_cutoff | type global |
| :doc:`buck/coul/long, buck/coul/msm <pair_buck>` | a,c,coulombic_cutoff | type pairs |
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+

View File

@ -120,7 +120,7 @@ styles and their energy formulas for the meaning of these parameters:
+------------------------------------------------------------------------------+-------------------------+------------+
| :doc:`born <pair_born>` | a,b,c | type pairs |
+------------------------------------------------------------------------------+-------------------------+------------+
| :doc:`buck <pair_buck>` | a,c | type pairs |
| :doc:`buck, buck/coul/cut, buck/coul/long, buck/coul/msm <pair_buck>` | a,c | type pairs |
+------------------------------------------------------------------------------+-------------------------+------------+
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
+------------------------------------------------------------------------------+-------------------------+------------+

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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