test for buck/mdf, fixed bug in broadcasting inner cutoff, typos in doc

This commit is contained in:
abhishandy
2020-08-03 20:07:24 -04:00
parent 6576c4cbf3
commit 33aa96b1bf
4 changed files with 108 additions and 2 deletions

View File

@ -151,7 +151,7 @@ commands:
* cutoff2 (distance units) * cutoff2 (distance units)
The second coefficient, :math:`\rho`, must be greater than zero. The second coefficient, :math:`\rho`, must be greater than zero.
The coefficients A,:math:`\rho`, and C can be written as analytical expressions The coefficients A, :math:`\rho`, and C can be written as analytical expressions
of :math:`\epsilon` and :math:`\sigma`, in analogy to the Lennard-Jones potential of :math:`\epsilon` and :math:`\sigma`, in analogy to the Lennard-Jones potential
:ref:`(Khrapak) <Khrapak>`. :ref:`(Khrapak) <Khrapak>`.

View File

@ -40,7 +40,7 @@ Examples
pair_coeff * * 1.0 1.0 pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.1 2.8 3.0 3.2 pair_coeff 1 1 1.1 2.8 3.0 3.2
pair_style buck 2.5 3.0 pair_style buck/mdf 2.5 3.0
pair_coeff * * 100.0 1.5 200.0 pair_coeff * * 100.0 1.5 200.0
pair_coeff * * 100.0 1.5 200.0 3.0 3.5 pair_coeff * * 100.0 1.5 200.0 3.0 3.5

View File

@ -285,6 +285,7 @@ void PairBuckMDF::write_restart(FILE *fp)
fwrite(&rho[i][j],sizeof(double),1,fp); fwrite(&rho[i][j],sizeof(double),1,fp);
fwrite(&c[i][j],sizeof(double),1,fp); fwrite(&c[i][j],sizeof(double),1,fp);
fwrite(&cut[i][j],sizeof(double),1,fp); fwrite(&cut[i][j],sizeof(double),1,fp);
fwrite(&cut_inner[i][j],sizeof(double),1,fp);
} }
} }
} }
@ -311,11 +312,13 @@ void PairBuckMDF::read_restart(FILE *fp)
utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error);
} }
MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
} }
} }
} }
@ -327,6 +330,7 @@ void PairBuckMDF::read_restart(FILE *fp)
void PairBuckMDF::write_restart_settings(FILE *fp) void PairBuckMDF::write_restart_settings(FILE *fp)
{ {
fwrite(&cut_global,sizeof(double),1,fp); fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&cut_inner_global,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp); fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp); fwrite(&mix_flag,sizeof(int),1,fp);
fwrite(&tail_flag,sizeof(int),1,fp); fwrite(&tail_flag,sizeof(int),1,fp);
@ -340,11 +344,13 @@ void PairBuckMDF::read_restart_settings(FILE *fp)
{ {
if (comm->me == 0) { if (comm->me == 0) {
utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error);
utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error);
utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error);
} }
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
MPI_Bcast(&tail_flag,1,MPI_INT,0,world); MPI_Bcast(&tail_flag,1,MPI_INT,0,world);

View File

@ -0,0 +1,100 @@
---
lammps_version: 21 Jul 2020
date_generated: Mon Aug 3 20:03:37 202
epsilon: 5e-14
prerequisites: ! |
atom full
pair buck/mdf
pre_commands: ! ""
post_commands: ! ""
input_file: in.fourmol
pair_style: buck/mdf 6.5 8.0
pair_coeff: ! |
1 1 170339.505032359 0.166879344173798 13.642356513989
1 2 85988.1490021027 0.116722557424471 0.80085535265993
1 3 169866.420176425 0.190286500706475 29.9623467274028
1 4 147160.913151695 0.186942613268455 23.3320434749744
1 5 147160.913151695 0.186942613268455 23.3320434749744
2 2 43972.4676803832 0.0665738276248451 0.0138732735747516
2 3 85535.686235147 0.140128612516736 2.39406114840173
2 4 45975.8370021332 0.0331639834863857 0.000214673167591639
2 5 74124.142292174 0.136784828511181 1.79395952625758
3 3 169504.649065961 0.213692863412526 60.0617510100503
3 4 146835.114678908 0.210349185259049 47.3225728524629
3 5 146835.114678908 0.210349185259049 47.3225728524629
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: ! |
a 2
c 2
natoms: 29
init_vdwl: 143.750172479889
init_coul: 0
init_stress: ! |2-
2.8545976884034133e+02 2.8737056463500437e+02 4.6112835758703841e+02 -5.4336275648975430e+01 3.0319466756231911e+01 4.6620664187526550e+01
init_forces: ! |2
1 -4.1623775151169555e+00 3.8386433272823908e+01 4.8752021330530219e+01
2 2.3627361587143497e+01 1.9437613546652713e+01 -2.7808992069327079e+01
3 -1.9523183463523988e+01 -5.0755464292132672e+01 -2.0167041215602033e+01
4 -4.2090797368144548e+00 1.1066584315991297e+00 -2.9972388697672767e+00
5 -1.3267826706072230e+00 -2.2204322651025663e+00 6.0778809239934031e+00
6 -7.1123087387748683e+01 7.7052619768181358e+01 6.6070798021478453e+01
7 1.0818938743625450e-01 -2.1456243768010403e+01 -1.2988779129476640e+02
8 2.7685557706153210e+00 -6.4055292922227114e+00 3.5054112799000308e+01
9 1.0385287961110039e+01 1.1200082491913735e+01 4.5981266170177641e+01
10 4.8483647065769190e+01 -6.2863074345822859e+01 -1.7919412685351613e+01
11 -1.1854581336088006e+00 -3.0186793607682243e+00 -4.9190264271625024e+00
12 8.7531866758949892e+00 4.0319784496217750e+00 -3.6939594183275126e+00
13 4.4340053941471904e+00 -1.7594770981988275e+00 -8.0345378469635742e-02
14 -1.8210424913812684e+00 3.6741934665079351e-01 -4.6918123727015333e+00
15 -1.0513516741244620e-01 4.6130035923795170e+00 1.6347265243446252e+00
16 4.1042300521196935e+01 -3.2293527205761428e+01 -9.0261475177059907e+01
17 -3.6114860006015803e+01 2.4604268415609937e+01 9.8841340163463499e+01
18 -1.8825765982480234e-02 -3.1986826093735314e-02 2.8598555002578602e-02
19 2.6246126725284639e-04 -1.3985991770179971e-04 1.2500135502022498e-03
20 -7.4158628864573635e-04 -7.5372669545694228e-04 2.6948946623672683e-04
21 -1.0785489161434048e+01 -1.2742891547555134e+01 3.6432159976717223e+01
22 -1.7555580076314030e+01 -4.2541303797868011e+00 -2.7543135747499065e+01
23 2.8333539309671401e+01 1.7005761819019146e+01 -8.8808401648973057e+00
24 6.9230215474812358e+00 -3.3463347678609331e+01 1.8600721086131170e+01
25 -2.4509700105485905e+01 3.9444178844087432e+00 -2.0606959962131530e+01
26 1.7575837949428792e+01 2.9510208924646768e+01 1.9863422163776494e+00
27 6.6487363315433221e+00 -3.6337564791281956e+01 1.3616115657254987e+01
28 -2.7672094503404313e+01 1.1892775106158119e+01 -1.8723460085236635e+01
29 2.1029505808433630e+01 2.4450001388294194e+01 5.1038879408118385e+00
run_vdwl: 120.390339444037
run_coul: 0
run_stress: ! |2-
2.5557076115460899e+02 2.5949083036036279e+02 3.7924820713448941e+02 -5.4331912086309863e+01 2.7329510888117166e+01 4.1741880429358943e+01
run_forces: ! |2
1 -9.5106296778717858e-01 3.5350903139580076e+01 3.9457788501955015e+01
2 1.8087885768281200e+01 1.4881431751248465e+01 -2.0866803303326282e+01
3 -1.9025510717853550e+01 -4.1963958840837172e+01 -1.6664478809553827e+01
4 -3.9859941166892718e+00 1.0788502407049387e+00 -2.9029954145128887e+00
5 -1.2023709090005723e+00 -2.0086881004005659e+00 5.6818744816238880e+00
6 -6.0409708693069774e+01 6.4308051724265454e+01 4.2296795072550239e+01
7 9.3619774012754076e-01 -1.7314182498123468e+01 -9.7141371175003627e+01
8 8.4374815617239507e-01 -3.2803127898386091e+00 3.3704959962345320e+01
9 8.3054223919475838e+00 8.6081913218743473e+00 3.6111642806027483e+01
10 4.2561464320368003e+01 -5.5914107881428244e+01 -1.7451016581627673e+01
11 -1.1800067991818264e+00 -2.7475271110814830e+00 -4.5818283809538558e+00
12 8.4354686158616836e+00 3.9901659185061922e+00 -4.1473570573211056e+00
13 4.1920571556670385e+00 -1.5869395008460414e+00 -6.2699936272915119e-02
14 -1.6199433911252872e+00 2.6217248188321979e-01 -4.1331654538138283e+00
15 -2.0331708492334666e-01 4.5411734718704624e+00 1.7063124925553061e+00
16 3.3204345703794395e+01 -2.7557620088049639e+01 -6.8101198549810292e+01
17 -2.7956867632127889e+01 1.9379723739082340e+01 7.7078799406759330e+01
18 -1.8736484154392354e-02 -3.1832301275527011e-02 2.8465565812628272e-02
19 1.9235280815687152e-04 -1.9937323111483010e-04 1.2555083173809050e-03
20 -6.5720491792300236e-04 -6.8003272156836258e-04 2.7292955437743918e-04
21 -9.1337929183030120e+00 -9.9740199991125511e+00 2.9985651190373691e+01
22 -1.4775515115956688e+01 -3.7890888804029199e+00 -2.2670105420722507e+01
23 2.3901606557704575e+01 1.3772050192861254e+01 -7.3071673474361880e+00
24 7.5921777719466190e+00 -2.9274214151414398e+01 1.7211122387283904e+01
25 -2.2853224935112188e+01 3.3601440486173679e+00 -1.9347511864642978e+01
26 1.5250008770356276e+01 2.5905305780853841e+01 2.1161920651718211e+00
27 5.7138512823990517e+00 -3.0278816202265425e+01 1.0694975152036214e+01
28 -2.2862795498173114e+01 9.8830391808041718e+00 -1.5214428418290540e+01
29 1.7155077880941484e+01 2.0400984758876589e+01 4.5160201909218829e+00
...