From 51745e2c95b75d0985faea4b90d0ba5500e85ace Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 16:01:39 +0000 Subject: [PATCH 01/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14409 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/USER-SMTBQ/pair_smtbq.cpp | 2303 ++++++++++++++++----------------- src/USER-SMTBQ/pair_smtbq.h | 392 +++--- 2 files changed, 1325 insertions(+), 1370 deletions(-) diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index 0955f7eee2..b2d17109be 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -9,7 +9,7 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. - ------------------------------------------------------------------------- */ + ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- The SMTBQ code has been developed with the financial support of CNRS and @@ -36,12 +36,12 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details: . - ------------------------------------------------------------------------- */ + ------------------------------------------------------------------------- */ -#include -#include -#include -#include +#include "math.h" +#include "stdio.h" +#include "stdlib.h" +#include "string.h" #include "pair_smtbq.h" #include "atom.h" #include "comm.h" @@ -52,32 +52,36 @@ #include "group.h" #include "update.h" #include "math_const.h" +#include "math_special.h" #include "memory.h" #include "error.h" #include "domain.h" -#include -#include -#include #include +#include -//to DELETE -//#include -//#include -//#include -//#include -//to DELETE using namespace std; using namespace LAMMPS_NS; using namespace MathConst; +using namespace MathSpecial; #define MAXLINE 2048 #define MAXTOKENS 2048 #define DELTA 4 #define PGDELTA 1 #define MAXNEIGH 24 -#define Pi 4*atan(1) + +/* ------------------------------------------------------------------------------------ + + Calculates the factorial of an integer n via recursion. + + ------------------------------------------------------------------------------------ */ +static double factorial(int n) +{ + if (n <= 1) return 1.0; + else return static_cast(n)*factorial(n-1); +} /* ---------------------------------------------------------------------- */ @@ -282,13 +286,13 @@ void PairSMTBQ::coeff(int narg, char **arg) } for (j = 0; j < nelements; j++) if (strcmp(arg[i],elements[j]) == 0) break; - map[i-2] = j; - if (j == nelements) { - n = strlen(arg[i]) + 1; - elements[j] = new char[n]; - strcpy(elements[j],arg[i]); - nelements++; - } + map[i-2] = j; + if (j == nelements) { + n = strlen(arg[i]) + 1; + elements[j] = new char[n]; + strcpy(elements[j],arg[i]); + nelements++; + } } // read potential file and initialize potential parameters @@ -374,7 +378,7 @@ double PairSMTBQ::init_one(int i, int j) void PairSMTBQ::read_file(char *file) { - int c, num_atom_types,i,k,m,test,j,verbose; + int num_atom_types,i,k,m,test,j,verbose; char **words; memory->sfree(params); @@ -388,14 +392,15 @@ void PairSMTBQ::read_file(char *file) verbose = 1; verbose = 0; - // open file on proc 0 + // open file on all processors FILE *fp; - fp = fopen( file, "r" ); + fp = force->open_potential(file); if ( fp == NULL ) { - fprintf( stderr, "error opening the force filed file! terminating...\n" ); + char str[128]; + sprintf(str,"Cannot open SMTBQ potential file %s",file); + error->one(FLERR,str); } - // read each line out of file, skipping blank lines or leading '#' // store line of params if all 3 element tags are in element list @@ -412,14 +417,14 @@ void PairSMTBQ::read_file(char *file) if (verbose) printf ("\n"); fgets(ptr,MAXLINE,fp); while (strchr(ptr,'#')) { - if (verbose) printf ("%s",ptr); - fgets(ptr,MAXLINE,fp); + if (verbose) printf ("%s",ptr); + fgets(ptr,MAXLINE,fp); } // Nombre d'atome different dans la structure // =============================================== - c = Tokenize( ptr, &words ); + Tokenize( ptr, &words ); num_atom_types = atoi(words[1]); if (verbose) printf (" %s %d\n", words[0], num_atom_types); @@ -430,7 +435,7 @@ void PairSMTBQ::read_file(char *file) for (j = 0; j < num_atom_types; j++) { if (j < i) { intype[i][j] = intype[j][i];} else { intype[i][j] = 0; - m = m + 1; } + m = m + 1; } if (verbose) printf ("i %d, j %d, intype %d - nb pair %d\n",i,j,intype[i][j],m); } } @@ -440,10 +445,10 @@ void PairSMTBQ::read_file(char *file) if (nparams == maxparam) { maxparam += DELTA; params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), - "pair:params"); + "pair:params"); maxintparam += m; intparams = (Intparam *) memory->srealloc(intparams,(maxintparam+1)*sizeof(Intparam), - "pair:intparams"); + "pair:intparams"); } for (i=0; i < num_atom_types; i++) @@ -471,7 +476,7 @@ void PairSMTBQ::read_file(char *file) // Line 2 - Al fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); strcpy(params[i].nom , words[1]); params[i].sto = atof(words[2]); if (verbose) printf (" %s %s %f\n", words[0],params[i].nom,params[i].sto); @@ -479,7 +484,7 @@ void PairSMTBQ::read_file(char *file) //Line 3 - Charges fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); params[i].qform = atof(words[1]); params[i].masse = atof(words[2]); @@ -488,7 +493,7 @@ void PairSMTBQ::read_file(char *file) // Line 4 - Parametres QEq fgets( ptr, MAXLINE, fp); - c=Tokenize ( ptr, &words ); + Tokenize ( ptr, &words ); params[i].ne = atof(words[1]) ; params[i].chi = atof(words[2]) ; params[i].dj = atof(words[3]) ; @@ -496,7 +501,7 @@ void PairSMTBQ::read_file(char *file) if(strcmp(params[i].nom,"O")!=0){ params[i].R = atof(words[4]) ; if (verbose) printf(" %s %f %f %f %f\n",words[0],params[i].ne,params[i].chi, - params[i].dj,params[i].R); + params[i].dj,params[i].R); } else { if (verbose) printf(" %s %f %f %f\n",words[0],params[i].ne,params[i].chi,params[i].dj); } @@ -506,7 +511,7 @@ void PairSMTBQ::read_file(char *file) if(strcmp(params[i].nom,"O")==0){ fgets( ptr, MAXLINE, fp); - c=Tokenize ( ptr, &words ); + Tokenize ( ptr, &words ); coordOxBB= atof(words[1]) ; coordOxBulk= atof(words[2]) ; @@ -520,7 +525,7 @@ void PairSMTBQ::read_file(char *file) // Ligne 5 - Nombre d'etats partages fgets( ptr, MAXLINE, fp); - c=Tokenize ( ptr, &words ); + Tokenize ( ptr, &words ); params[i].n0 = atof(words[1]); if (verbose) printf(" %s %f\n",words[0],params[i].n0); @@ -534,7 +539,7 @@ void PairSMTBQ::read_file(char *file) reading the interaction's parameters ===================================================================== */ - m = 0; maxintsm = 0; // + m = 0; maxintsm = 0; // for (k=0 ; k<=maxintparam ; k++){intparams[k].intsm = 0;} // --------------------------------- for (k = 0; k < maxintparam; k++) { @@ -546,20 +551,20 @@ void PairSMTBQ::read_file(char *file) // Lecture des protagonistes fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); test = 0; for (i = 0; i %d = %s\n",words[1],i,params[i].nom); for (j = 0; j %d = %s\n",words[2],j,params[j].nom); @@ -578,7 +583,7 @@ void PairSMTBQ::read_file(char *file) if (strcmp(intparams[m].typepot,"second_moment") !=0 && strcmp(intparams[m].typepot,"buck") != 0 && strcmp(intparams[m].typepot,"buckPlusAttr") != 0) { - error->all(FLERR,"the potential other than second_moment or buckingham have not treated here\n");} + error->all(FLERR,"the potential other than second_moment or buckingham have not treated here\n");} // On detemrine le type d'interaction @@ -589,29 +594,29 @@ void PairSMTBQ::read_file(char *file) intparams[m].intsm = maxintsm; if (strcmp(intparams[m].mode,"oxide") != 0 && - strcmp(intparams[m].mode,"metal") != 0){ - error->all(FLERR,"needs mode to second moment interaction : oxide or metal"); } + strcmp(intparams[m].mode,"metal") != 0){ + error->all(FLERR,"needs mode to second moment interaction : oxide or metal"); } -// if (strcmp(intparams[m].mode,"oxide") == 0) -// intparams[m].ncov = min((params[i].sto)*(params[i].n0),(params[j].sto)*(params[j].n0)); + // if (strcmp(intparams[m].mode,"oxide") == 0) + // intparams[m].ncov = min((params[i].sto)*(params[i].n0),(params[j].sto)*(params[j].n0)); if (verbose) printf(" %s %s %s %s %s \n",words[0],words[1],words[2], - intparams[m].typepot,intparams[m].mode); + intparams[m].typepot,intparams[m].mode); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); intparams[m].a = atof(words[1]) ; intparams[m].p = atof(words[2]) ; intparams[m].ksi = atof(words[3]) ; intparams[m].q = atof(words[4]) ; if (verbose) printf (" %s %f %f %f %f\n",words[0], - intparams[m].a,intparams[m].p,intparams[m].ksi,intparams[m].q); + intparams[m].a,intparams[m].p,intparams[m].ksi,intparams[m].q); // Ligne 6 - rayon de coupure potentiel SM fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); intparams[m].dc1 = atof(words[1]) ; intparams[m].dc2 = atof(words[2]) ; @@ -619,21 +624,21 @@ void PairSMTBQ::read_file(char *file) if (strcmp(intparams[m].mode,"metal") == 0) { - if (verbose) printf (" %s %f %f %f\n",words[0], - intparams[m].dc1,intparams[m].dc2,intparams[m].r0); - } else { - if (verbose) printf (" %s %f %f %f\n",words[0], - intparams[m].dc1,intparams[m].dc2,intparams[m].r0); - } + if (verbose) printf (" %s %f %f %f\n",words[0], + intparams[m].dc1,intparams[m].dc2,intparams[m].r0); + } else { + if (verbose) printf (" %s %f %f %f\n",words[0], + intparams[m].dc1,intparams[m].dc2,intparams[m].r0); + } } else if (strcmp(intparams[m].typepot,"buck") == 0) { if (verbose) printf(" %s %s %s %s\n",words[0],words[1],words[2], - intparams[m].typepot); + intparams[m].typepot); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); intparams[m].abuck = atof(words[1]) ; intparams[m].rhobuck = atof(words[2]) ; if (verbose) printf (" %s %f %f\n",words[0],intparams[m].abuck,intparams[m].rhobuck); @@ -643,22 +648,22 @@ void PairSMTBQ::read_file(char *file) else if (strcmp(intparams[m].typepot,"buckPlusAttr") == 0) { if (verbose) printf(" %s %s %s %s\n",words[0],words[1],words[2], - intparams[m].typepot); + intparams[m].typepot); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); intparams[m].abuck = atof(words[1]) ; intparams[m].rhobuck = atof(words[2]) ; if (verbose) printf (" %s %f %f\n",words[0],intparams[m].abuck,intparams[m].rhobuck); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); intparams[m].aOO = atof(words[1]) ; intparams[m].bOO = atof(words[2]) ; intparams[m].r1OO = atof(words[3]) ;intparams[m].r2OO = atof(words[4]) ; if (verbose) printf (" %s %f %f %f %f \n",words[0],intparams[m].aOO, - intparams[m].bOO,intparams[m].r1OO,intparams[m].r2OO); + intparams[m].bOO,intparams[m].r1OO,intparams[m].r2OO); } if (verbose) printf (" intsm %d \n",intparams[m].intsm); @@ -672,12 +677,12 @@ void PairSMTBQ::read_file(char *file) // Ligne 9 - rayon de coupure Electrostatique if (test == 0) { - fgets(ptr,MAXLINE,fp); - if (verbose) printf ("%s\n",ptr); + fgets(ptr,MAXLINE,fp); + if (verbose) printf ("%s\n",ptr); - fgets( ptr, MAXLINE, fp); + fgets( ptr, MAXLINE, fp); } - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); for (i=0 ; i(kmax) ; if (verbose) printf (" kmax %d et ds %f\n",kmax,ds); /* ======================================================== */ @@ -700,12 +705,12 @@ void PairSMTBQ::read_file(char *file) if (verbose) printf ("%s",ptr); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); Qstep = atoi(words[1]); - if (verbose) printf (" %s %d\n",words[0],Qstep); + if (verbose) printf (" %s " BIGINT_FORMAT "\n",words[0],Qstep); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); loopmax = atoi(words[1]); precision = atof(words[2]); if (verbose) printf (" %s %d %f\n",words[0],loopmax,precision); @@ -716,22 +721,20 @@ void PairSMTBQ::read_file(char *file) if (verbose) printf ("%s",ptr); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); r1Coord = atof(words[1]); r2Coord = atof(words[2]); if (verbose) printf (" %s %f %f\n",words[0],r1Coord,r2Coord); - - /* Mode for QInit============================================= */ fgets( ptr, MAXLINE, fp); if (verbose) printf ("%s",ptr); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); strcpy( QInitMode , words[1] ); - if (strcmp(QInitMode,"true") == 0) { QOxInit= atof(words[2]); } - else { QOxInit = 0.0; } + if (strcmp(QInitMode,"true") == 0) QOxInit= atof(words[2]); + else QOxInit = 0.0; if (verbose) printf (" %s %s %f\n",words[0],QInitMode,QOxInit); @@ -741,32 +744,33 @@ void PairSMTBQ::read_file(char *file) if (verbose) printf ("%s",ptr); fgets( ptr, MAXLINE, fp); - c= Tokenize( ptr, &words ); + Tokenize( ptr, &words ); strcpy( QEqMode , words[1] ); if (verbose) printf (" %s %s\n",words[0],QEqMode); fgets( ptr, MAXLINE, fp); - if (strcmp(QEqMode,"BulkFromSlab") == 0) - { + if (strcmp(QEqMode,"BulkFromSlab") == 0) { + Tokenize( ptr, &words ); + zlim1QEq = atof(words[1]); + zlim2QEq = atof(words[2]); + if (verbose) printf (" %s %f %f\n",words[0],zlim1QEq,zlim2QEq); - c= Tokenize( ptr, &words ); - zlim1QEq = atof(words[1]); - zlim2QEq = atof(words[2]); - if (verbose) printf (" %s %f %f\n",words[0],zlim1QEq,zlim2QEq); + } else if (strcmp(QEqMode,"Surface") == 0) { + Tokenize( ptr, &words ); + zlim1QEq = atof(words[1]); + if (verbose) printf (" %s %f \n",words[0],zlim1QEq); - } - else if (strcmp(QEqMode,"Surface") == 0) - { - c= Tokenize( ptr, &words ); - zlim1QEq = atof(words[1]); - if (verbose) printf (" %s %f \n",words[0],zlim1QEq); - - } - else if (strcmp(QEqMode,"QEqAll") != 0 && - strcmp(QEqMode,"QEqAllParallel") != 0 && - strcmp(QEqMode,"Surface") != 0 ) - { error->all(FLERR,"The QEq Mode is not known. QEq mode should be :\n Possible QEq modes | parameters\n QEqAll | no parameters\n QEqAllParallel | no parameters\n Surface | zlim (QEq only for z>zlim)\n BulkFromSlab | zlim1 zlim2 (QEq only for zlim1all(FLERR,"The QEq Mode is not known. QEq mode should be :\n" + " Possible QEq modes | parameters\n" + " QEqAll | no parameters\n" + " QEqAllParallel | no parameters\n" + " Surface | zlim (QEq only for z>zlim)\n" + " BulkFromSlab | zlim1 zlim2 (QEq only for zlim1 %f Ang\n", - intparams[m].typepot,intparams[m].neig_cut); - } + intparams[m].neig_cut = 1.2*intparams[m].r0; + if (strcmp(intparams[m].typepot,"second_moment") == 0 ) + if (verbose) printf (" Rc 1er voisin, typepot %s -> %f Ang\n", + intparams[m].typepot,intparams[m].neig_cut); + } } //A adapter au STO @@ -828,19 +830,17 @@ void PairSMTBQ::read_file(char *file) if (verbose) printf (" Parametre ncov = %f\n",ncov); if (verbose) printf (" ********************************************* \n"); - - - } /* ---------------------------------------------------------------------- * COMPUTE - ---------------------------------------------------------------------- */ + ---------------------------------------------------------------------- */ void PairSMTBQ::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,m,gp; - int itag,jtag,itype,jtype; + tagint itag,jtag; + int itype,jtype; int *ilist,*jlist,*numneigh,**firstneigh; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair; @@ -849,10 +849,6 @@ void PairSMTBQ::compute(int eflag, int vflag) double **tmp,**tmpAll,*nmol; double dq,dqcov; - - int bavard; - - if (atom->nmax > nmax) { memory->destroy(ecov); memory->destroy(potmad); @@ -895,28 +891,32 @@ void PairSMTBQ::compute(int eflag, int vflag) double **x = atom->x; double **f = atom->f; double *q = atom->q; - int *tag = atom->tag; + +#ifdef LAMMPS_BIGBIG + long int *tag = atom->tag; +#else + tagint *tag = atom->tag; +#endif + int *type = atom->type; int newton_pair = force->newton_pair; int nlocal = atom->nlocal; - int step = update->ntimestep; - struct timeval start, end; - inum = list->inum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - if (step == 0 || (Qstep !=0 && fmod(double(step), double(Qstep)) == 0.0 )) Charge(); -// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -// this is necessary to get sbcov or sbmet table in order to caclulate the covalent or metal bonding - if (Qstep == 0 || fmod(double(step), double(Qstep)) != 0.0 ) QForce_charge(0); + const bigint step = update->ntimestep; + if (step == 0 || ((Qstep > 0) && (step % Qstep == 0))) Charge(); + // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + // this is necessary to get sbcov or sbmet table in order to caclulate the covalent or metal bonding + if (Qstep == 0 || (step % Qstep != 0)) QForce_charge(0); // Charges Communication // ---------------------- - forward(q) ; reverse(q); + forward(q) ; // reverse(q); memory->create(nmol,nteam+1,"pair:nmol"); memory->create(tmp,nteam+1,7,"pair:tmp"); @@ -924,7 +924,7 @@ void PairSMTBQ::compute(int eflag, int vflag) for (i=0; i(nQEqall[i]); for (j=0; j<7; j++) { tmp[i][j] = 0.0; tmpAll[i][j] = 0.0; } } @@ -940,14 +940,10 @@ void PairSMTBQ::compute(int eflag, int vflag) 6 -> Somme des Q(i)² ------------------------------------------------------------------------- */ - // ----------- - bavard = 0; - // ----------- - /* -------------- N-body forces Calcul --------------- */ for (ii = 0; ii < inum; ii++) { -// =============================== + // =============================== i = ilist[ii]; itag = tag[i]; itype = map[type[i]]; @@ -966,8 +962,8 @@ void PairSMTBQ::compute(int eflag, int vflag) tmp[gp][6] += iq*iq; -// self energy, only on i atom -// --------------------------- + // self energy, only on i atom + // --------------------------- Eself = self(¶ms[itype],iq); tmp[gp][0] += Eself; tmp[gp][2] += Eself; @@ -975,8 +971,8 @@ void PairSMTBQ::compute(int eflag, int vflag) if (evflag) ev_tally_full (i,0.0,2.0*Eself,0.0,0.0,0.0,0.0); -// N-body energy of i -// --------------------- + // N-body energy of i + // --------------------- dq = fabs(params[itype].qform) - fabs(iq); dqcov = dq*(2.0*ncov/params[itype].sto - dq); @@ -987,8 +983,8 @@ void PairSMTBQ::compute(int eflag, int vflag) if (evflag) ev_tally_full(i,0.0,2.0*ecov[i],0.0,0.0,0.0,0.0); -// Coulombian Interaction -// ----------------------- + // Coulombian Interaction + // ----------------------- evdwl = 2.0*Vself*iq*iq ; tmp[gp][1] += Vself*iq*iq; tmp[gp][2] += Vself*iq*iq; @@ -1001,13 +997,13 @@ void PairSMTBQ::compute(int eflag, int vflag) jnum = numneigh[i]; for (jj = 0; jj < jnum; jj++) { -// =============================== + // =============================== j = jlist[jj]; jtype = map[type[j]]; jtag = tag[j]; jq = q[j]; -// ....................................................................... + // ....................................................................... if (itag > jtag) { if ((itag+jtag) % 2 == 0) continue; } else if (itag < jtag) { @@ -1017,7 +1013,7 @@ void PairSMTBQ::compute(int eflag, int vflag) if (x[j][2] == ztmp && x[j][1] < ytmp) continue; if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue; } -// ....................................................................... + // ....................................................................... // # of interaction @@ -1031,9 +1027,9 @@ void PairSMTBQ::compute(int eflag, int vflag) rsq = delx*delx + dely*dely + delz*delz; -// --------------------------------- + // --------------------------------- if (sqrt(rsq) > cutmax) continue; -// --------------------------------- + // --------------------------------- // Coulombian Energy @@ -1056,106 +1052,106 @@ void PairSMTBQ::compute(int eflag, int vflag) if (evflag) - ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz); + ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz); evdwl = 0.0; fpair = 0.0 ; -// --------------------- + // --------------------- if (m == 0) continue; -// --------------------- + // --------------------- -// ---------------------------------------------- + // ---------------------------------------------- if ( strcmp(intparams[m].typepot,"buck") == 0 || strcmp(intparams[m].typepot,"buckPlusAttr") ==0 ) { -// ---------------------------------------------- + // ---------------------------------------------- - evdwl = 0.0; fpair =0.0; - rep_OO (&intparams[m],rsq,fpair,eflag,evdwl); - ErepOO += evdwl ; - tmp[gp][3] += evdwl; + evdwl = 0.0; fpair =0.0; + rep_OO (&intparams[m],rsq,fpair,eflag,evdwl); + ErepOO += evdwl ; + tmp[gp][3] += evdwl; - // repulsion is pure two-body, sums up pair repulsive forces - f[i][0] += delx*fpair; - f[i][1] += dely*fpair; - f[i][2] += delz*fpair; + // repulsion is pure two-body, sums up pair repulsive forces + f[i][0] += delx*fpair; + f[i][1] += dely*fpair; + f[i][2] += delz*fpair; f[j][0] -= delx*fpair; f[j][1] -= dely*fpair; f[j][2] -= delz*fpair; - if (evflag) - ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz); + if (evflag) + ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz); evdwl = 0.0; fpair = 0.0 ; } // ----------------------------------- Rep O-O if (strcmp(intparams[m].typepot,"buckPlusAttr") == 0 ) { -// ---------------------------------------------- + // ---------------------------------------------- - evdwl = 0.0; fpair =0.0; - Attr_OO (&intparams[m],rsq,fpair,eflag,evdwl); - ErepOO += evdwl ; - tmp[gp][3] += evdwl; + evdwl = 0.0; fpair =0.0; + Attr_OO (&intparams[m],rsq,fpair,eflag,evdwl); + ErepOO += evdwl ; + tmp[gp][3] += evdwl; - // repulsion is pure two-body, sums up pair repulsive forces - f[i][0] += delx*fpair; - f[i][1] += dely*fpair; - f[i][2] += delz*fpair; + // repulsion is pure two-body, sums up pair repulsive forces + f[i][0] += delx*fpair; + f[i][1] += dely*fpair; + f[i][2] += delz*fpair; f[j][0] -= delx*fpair; f[j][1] -= dely*fpair; f[j][2] -= delz*fpair; - if (evflag) - ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz); + if (evflag) + ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz); evdwl = 0.0; fpair = 0.0 ; } // ----------------------------------- Attr O-O -// ----------------------------------------------------------------- + // ----------------------------------------------------------------- if (strcmp(intparams[m].typepot,"second_moment") != 0 ) continue; -// ----------------------------------------------------------------- + // ----------------------------------------------------------------- if (sqrt(rsq) > intparams[m].dc2) continue; -// ------------------------------------------- + // ------------------------------------------- -// Repulsion : Energy + force -// ---------------------------- - evdwl = 0.0; fpair = 0.0 ; - repulsive(&intparams[m],rsq,i,j,fpair,eflag,evdwl); - ErepMO += evdwl; - tmp[gp][4] += 2.0*evdwl; + // Repulsion : Energy + force + // ---------------------------- + evdwl = 0.0; fpair = 0.0 ; + repulsive(&intparams[m],rsq,i,j,fpair,eflag,evdwl); + ErepMO += evdwl; + tmp[gp][4] += 2.0*evdwl; - f[i][0] += delx*fpair; - f[i][1] += dely*fpair; - f[i][2] += delz*fpair; - f[j][0] -= delx*fpair; - f[j][1] -= dely*fpair; - f[j][2] -= delz*fpair; + f[i][0] += delx*fpair; + f[i][1] += dely*fpair; + f[i][2] += delz*fpair; + f[j][0] -= delx*fpair; + f[j][1] -= dely*fpair; + f[j][2] -= delz*fpair; - if (evflag) - ev_tally(i,j,nlocal,newton_pair,2.0*evdwl,0.0,fpair,delx,dely,delz); + if (evflag) + ev_tally(i,j,nlocal,newton_pair,2.0*evdwl,0.0,fpair,delx,dely,delz); - evdwl = 0.0 ; fpair = 0.0; -// ----- ----- ----- ----- ----- ----- + evdwl = 0.0 ; fpair = 0.0; + // ----- ----- ----- ----- ----- ----- -// Attraction : force -// ------------------ - fpair = 0.0; - f_att(&intparams[m], i, j, rsq, fpair) ; + // Attraction : force + // ------------------ + fpair = 0.0; + f_att(&intparams[m], i, j, rsq, fpair) ; - f[i][0] += delx*fpair; - f[i][1] += dely*fpair; - f[i][2] += delz*fpair; - f[j][0] -= delx*fpair; - f[j][1] -= dely*fpair; - f[j][2] -= delz*fpair; + f[i][0] += delx*fpair; + f[i][1] += dely*fpair; + f[i][2] += delz*fpair; + f[j][0] -= delx*fpair; + f[j][1] -= dely*fpair; + f[j][2] -= delz*fpair; if (evflag) ev_tally(i,j,nlocal,newton_pair,0.0,0.0,fpair,delx,dely,delz); @@ -1173,31 +1169,31 @@ void PairSMTBQ::compute(int eflag, int vflag) MPI_Allreduce(tmp[i],tmpAll[i],7,MPI_DOUBLE,MPI_SUM,world); } -// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - if (me == 0 && fmod(double(step), Nevery) == 0.0 && strcmp(writeenerg,"true") == 0) { + // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + if (me == 0 && fmod(static_cast(step), Nevery) == 0.0 && strcmp(writeenerg,"true") == 0) { - ofstream fichierE; + ofstream fichierE; - if (step == 0) { fichierE.open ("Energy_component.txt", ios::out | ios::trunc) ;} - else { fichierE.open ("Energy_component.txt", ios::out | ios::app) ;} + if (step == 0) { fichierE.open ("Energy_component.txt", ios::out | ios::trunc) ;} + else { fichierE.open ("Energy_component.txt", ios::out | ios::app) ;} - if (fichierE) fichierE<< setprecision(9) <pair->tail_flag,vflag_fdotr); + newton_pair,evflag,force->pair->tail_flag,vflag_fdotr); printf ("neighbor->includegroup %d\n",neighbor->includegroup); @@ -1207,8 +1203,8 @@ void PairSMTBQ::compute(int eflag, int vflag) printf ("Energie de la team %d -- %d atome -------(nteam = %d) \n ",gp,int(nmol[gp]),nteam); if (nmol[gp] == 0) { - printf (" ============================================ \n \n"); - continue; + printf (" ============================================ \n \n"); + continue; } printf ("Vself %f, Som q2 : %f, nmol %f\n",Vself,tmpAll[gp][6],nmol[gp]); // printf ("nmol %f\n",nmol[gp]); @@ -1234,7 +1230,6 @@ void PairSMTBQ::compute(int eflag, int vflag) memory->destroy(nmol); memory->destroy(tmp); memory->destroy(tmpAll); - } /* ---------------------------------------------------------------------- @@ -1373,7 +1368,7 @@ void PairSMTBQ::tabqeq() for (k=0; k < kmax+5; k++) //------------------------- { - s = double(k)*ds ; r = sqrt(s); + s = static_cast(k)*ds ; r = sqrt(s); if (k==0) r=10e-30; potqn[k] = 14.4*(erfc(alf*r)/r - mu) ; @@ -1432,107 +1427,107 @@ void PairSMTBQ::tabqeq() ii = 0 ; nang =cang= 5.0 ; // -------------------------- for (k = 0; k < kmax+5; k++) - // -------------------------- - { - gam = dgam = dza = dzb = d2zaa = d2zab = - d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; - dij = 0.0 ; + // -------------------------- + { + gam = dgam = dza = dzb = d2zaa = d2zab = + d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; + dij = 0.0 ; - s = double(k)*ds ; r = sqrt(s) ; - if (k==0) r=10e-30; + s = static_cast(k)*ds ; r = sqrt(s) ; + if (k==0) r=10e-30; - gammas(na,nb,za,zb,r,gam,dgam,dza,dzb, - d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; + gammas(na,nb,za,zb,r,gam,dgam,dza,dzb, + d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; - // --- Jij + // --- Jij - dij = 14.4 * (1.0/r - double(gam)); - ddij = 14.4 * (-1.0/(r*r) - double(dgam)) ; + dij = 14.4 * (1.0/r - static_cast(gam)); + ddij = 14.4 * (-1.0/(r*r) - static_cast(dgam)) ; - // Cutting Fonction + // Cutting Fonction - if (dij < 0.01 && ii==0) - { - ii=2; - if (ii==2) if (verbose) printf ("rc : %f\n",r); - rc = r ; ii=1 ; - if ((rc+nang)>rcoupe) nang = rcoupe - rc ; - bCoeff = (2*dij+ddij*nang)/(dij*nang); - aCoeff = dij*exp(-bCoeff*rc) /pow(nang,2); - } - if (r > rc) {dij = aCoeff *pow((r- rc-nang),2) *exp(bCoeff*r); - ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r); - } + if (dij < 0.01 && ii==0) + { + ii=2; + if (ii==2) if (verbose) printf ("rc : %f\n",r); + rc = r ; ii=1 ; + if ((rc+nang)>rcoupe) nang = rcoupe - rc ; + bCoeff = (2*dij+ddij*nang)/(dij*nang); + aCoeff = dij*exp(-bCoeff*rc) /square(nang); + } + if (r > rc) {dij = aCoeff *square(r- rc-nang) *exp(bCoeff*r); + ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r); + } - if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;} + if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;} - fafb[k][m] = potqn[k] - dij ; - if (k == 1) fafb[0][m] = fafb[k][m] ; + fafb[k][m] = potqn[k] - dij ; + if (k == 1) fafb[0][m] = fafb[k][m] ; - dfafb[k][m] = dpotqn[k] - ddij/r ; - } + dfafb[k][m] = dpotqn[k] - ddij/r ; + } // Make the table fafbOxOxSurf rc = cutmax; if(strcmp(params[i].nom,"O")==0 || strcmp(params[j].nom,"O")==0){ - if(strcmp(params[i].nom,"O")==0) { - ra = ROxSurf; - za = (2.0*params[i].ne + 1.0)/(4.0*ra);} - if(strcmp(params[j].nom,"O")==0) { - rb = ROxSurf; - zb = (2.0*params[j].ne + 1.0)/(4.0*rb); } + if(strcmp(params[i].nom,"O")==0) { + ra = ROxSurf; + za = (2.0*params[i].ne + 1.0)/(4.0*ra);} + if(strcmp(params[j].nom,"O")==0) { + rb = ROxSurf; + zb = (2.0*params[j].ne + 1.0)/(4.0*rb); } - ii = 0 ; nang =cang= 5.0 ; - // -------------------------- - for (k = 0; k < kmax+5; k++) - // -------------------------- - { - gam = dgam = dza = dzb = d2zaa = d2zab = - d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; - dij = 0.0 ; + ii = 0 ; nang =cang= 5.0 ; + // -------------------------- + for (k = 0; k < kmax+5; k++) + // -------------------------- + { + gam = dgam = dza = dzb = d2zaa = d2zab = + d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; + dij = 0.0 ; - s = double(k)*ds ; r = sqrt(s) ; - if (k==0) r=10e-30; + s = static_cast(k)*ds ; r = sqrt(s) ; + if (k==0) r=10e-30; - gammas(na,nb,za,zb,r,gam,dgam,dza,dzb, - d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; + gammas(na,nb,za,zb,r,gam,dgam,dza,dzb, + d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; - // --- Jij + // --- Jij - dij = 14.4 * (1.0/r - double(gam)); - ddij = 14.4 * (-1.0/(r*r) - double(dgam)) ; + dij = 14.4 * (1.0/r - static_cast(gam)); + ddij = 14.4 * (-1.0/(r*r) - static_cast(dgam)) ; - if (dij < 0.01 && ii==0) - { - ii=2; - if (ii==2) if (verbose) printf ("rc : %f\n",r); - rc = r ; ii=1 ; - if ((rc+nang)>rcoupe) nang = rcoupe - rc ; - bCoeff = (2*dij+ddij*nang)/(dij*nang); - aCoeff = dij*exp(-bCoeff*rc) /pow(nang,2); - } - if (r > rc) {dij = aCoeff *pow((r- rc-nang),2) *exp(bCoeff*r); - ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r); - } + if (dij < 0.01 && ii==0) + { + ii=2; + if (ii==2) if (verbose) printf ("rc : %f\n",r); + rc = r ; ii=1 ; + if ((rc+nang)>rcoupe) nang = rcoupe - rc ; + bCoeff = (2*dij+ddij*nang)/(dij*nang); + aCoeff = dij*exp(-bCoeff*rc) /square(nang); + } + if (r > rc) {dij = aCoeff *square(r- rc-nang) *exp(bCoeff*r); + ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r); + } - if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;} + if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;} - if(strcmp(params[i].nom,"O")==0 && strcmp(params[j].nom,"O")==0){ - fafbOxOxSurf[k] = potqn[k] - dij ; - if (k == 1) fafbOxOxSurf[0] = fafbOxOxSurf[k] ; + if(strcmp(params[i].nom,"O")==0 && strcmp(params[j].nom,"O")==0){ + fafbOxOxSurf[k] = potqn[k] - dij ; + if (k == 1) fafbOxOxSurf[0] = fafbOxOxSurf[k] ; - dfafbOxOxSurf[k] = dpotqn[k] - ddij/r ; - } - else { fafbTiOxSurf[k] = potqn[k] - dij ; - if (k == 1) fafbTiOxSurf[0] = fafbTiOxSurf[k] ; + dfafbOxOxSurf[k] = dpotqn[k] - ddij/r ; + } + else { fafbTiOxSurf[k] = potqn[k] - dij ; + if (k == 1) fafbTiOxSurf[0] = fafbTiOxSurf[k] ; - dfafbTiOxSurf[k] = dpotqn[k] - ddij/r ;} + dfafbTiOxSurf[k] = dpotqn[k] - ddij/r ;} - } + } } //for k @@ -1541,67 +1536,63 @@ void PairSMTBQ::tabqeq() // Makes the table fafbOxOxBB rc = cutmax; if(strcmp(params[i].nom,"O")==0 || strcmp(params[j].nom,"O")==0){ - if(strcmp(params[i].nom,"O")==0) { - ra = ROxBB; - za = (2.0*params[i].ne + 1.0)/(4.0*ra);} - if(strcmp(params[j].nom,"O")==0) { - rb = ROxBB; - zb = (2.0*params[j].ne + 1.0)/(4.0*rb); } + if(strcmp(params[i].nom,"O")==0) { + ra = ROxBB; + za = (2.0*params[i].ne + 1.0)/(4.0*ra);} + if(strcmp(params[j].nom,"O")==0) { + rb = ROxBB; + zb = (2.0*params[j].ne + 1.0)/(4.0*rb); } - ii = 0 ; nang =cang= 5.0 ; - // -------------------------- - for (k = 0; k < kmax+5; k++) - // -------------------------- - { - gam = dgam = dza = dzb = d2zaa = d2zab = - d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; - dij = 0.0 ; + ii = 0 ; nang =cang= 5.0 ; + // -------------------------- + for (k = 0; k < kmax+5; k++) + // -------------------------- + { + gam = dgam = dza = dzb = d2zaa = d2zab = + d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; + dij = 0.0 ; - s = double(k)*ds ; r = sqrt(s) ; - if (k==0) r=10e-30; + s = static_cast(k)*ds ; r = sqrt(s) ; + if (k==0) r=10e-30; - gammas(na,nb,za,zb,r,gam,dgam,dza,dzb, - d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; + gammas(na,nb,za,zb,r,gam,dgam,dza,dzb, + d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; - // --- Jij + // --- Jij - dij = 14.4 * (1.0/r - double(gam)); - ddij = 14.4 * (-1.0/(r*r) - double(dgam)) ; + dij = 14.4 * (1.0/r - static_cast(gam)); + ddij = 14.4 * (-1.0/(r*r) - static_cast(dgam)) ; - if (dij < 0.01 && ii==0) { - ii=2; - if (ii==2) if (verbose) printf ("rc : %f\n",r); - rc = r ; ii=1 ; - if ((rc+nang)>rcoupe) nang = rcoupe - rc ; - bCoeff = (2*dij+ddij*nang)/(dij*nang); - aCoeff = dij*exp(-bCoeff*rc) /pow(nang,2); - } - if (r > rc) { - dij = aCoeff *pow((r- rc-nang),2) *exp(bCoeff*r); - ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r); - } + if (dij < 0.01 && ii==0) { + ii=2; + if (ii==2) if (verbose) printf ("rc : %f\n",r); + rc = r ; ii=1 ; + if ((rc+nang)>rcoupe) nang = rcoupe - rc ; + bCoeff = (2*dij+ddij*nang)/(dij*nang); + aCoeff = dij*exp(-bCoeff*rc) /square(nang); + } + if (r > rc) { + dij = aCoeff *square(r- rc-nang) *exp(bCoeff*r); + ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r); + } - if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;} - - if(strcmp(params[i].nom,"O")==0 && strcmp(params[j].nom,"O")==0){ - fafbOxOxBB[k] = potqn[k] - dij ; - if (k == 1) fafbOxOxBB[0] = fafbOxOxBB[k] ; - dfafbOxOxBB[k] = dpotqn[k] - ddij/r ; } - else { fafbTiOxBB[k] = potqn[k] - dij ; - if (k == 1) fafbTiOxBB[0] = fafbTiOxBB[k] ; - dfafbTiOxBB[k] = dpotqn[k] - ddij/r ; - } - } - + if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;} + if(strcmp(params[i].nom,"O")==0 && strcmp(params[j].nom,"O")==0){ + fafbOxOxBB[k] = potqn[k] - dij ; + if (k == 1) fafbOxOxBB[0] = fafbOxOxBB[k] ; + dfafbOxOxBB[k] = dpotqn[k] - ddij/r ; } + else { fafbTiOxBB[k] = potqn[k] - dij ; + if (k == 1) fafbTiOxBB[0] = fafbTiOxBB[k] ; + dfafbTiOxBB[k] = dpotqn[k] - ddij/r ; + } + } } //for k //end of make the table fafbOxOxBB - - } } //for i,j @@ -1636,7 +1627,7 @@ void PairSMTBQ::potqeq(int i, int j, double qi, double qj, double rsq, r = rsq; sds = r/ds ; l = int(sds) ; - xi = sds - double(l) ; + xi = sds - static_cast(l) ; iCoord=coord[i]; @@ -1665,7 +1656,7 @@ void PairSMTBQ::potqeq(int i, int j, double qi, double qj, double rsq, if(strcmp(params[itype].nom,"O")==0 || strcmp(params[jtype].nom,"O")==0){ if(strcmp(params[itype].nom,"O")==0 && strcmp(params[jtype].nom,"O")==0){ - // between two oxygens + // between two oxygens t1 = fafbOxOxSurf[l] + (fafbOxOxSurf[l+1] - fafbOxOxSurf[l])*xi; t2 = fafbOxOxSurf[l+1] + (fafbOxOxSurf[l+2] - fafbOxOxSurf[l+1])*(xi-1.0); @@ -1676,8 +1667,8 @@ void PairSMTBQ::potqeq(int i, int j, double qi, double qj, double rsq, engBB = qi*qj*(t1 + (t2 - t1)*xi/2.0); eng= engBulk + (iCoord+jCoord-2*coordOxBulk)/(2*(coordOxBB-coordOxBulk)) *(engBB-engBulk) - + (iIntfCoup2+jIntfCoup2)*((engBulk-engSurf)/(2*(coordOxBulk-coordOxSurf)) - - (engBB-engBulk)/(2*(coordOxBB-coordOxBulk))) ; + + (iIntfCoup2+jIntfCoup2)*((engBulk-engSurf)/(2*(coordOxBulk-coordOxSurf)) + - (engBB-engBulk)/(2*(coordOxBB-coordOxBulk))) ; // ---- Interpolation des forces @@ -1692,11 +1683,10 @@ void PairSMTBQ::potqeq(int i, int j, double qi, double qj, double rsq, fforceBB = - qi*qj*(t1 + (t2 - t1)*xi/2.0) ; fforce= fforceBulk + (iCoord+jCoord-2*coordOxBulk)/(2*(coordOxBB-coordOxBulk))*(fforceBB-fforceBulk) - + (iIntfCoup2+jIntfCoup2)*((fforceBulk-fforceSurf)/(2*(coordOxBulk-coordOxSurf)) - - (fforceBB-fforceBulk)/(2*(coordOxBB-coordOxBulk))) ; + + (iIntfCoup2+jIntfCoup2)*((fforceBulk-fforceSurf)/(2*(coordOxBulk-coordOxSurf)) + - (fforceBB-fforceBulk)/(2*(coordOxBB-coordOxBulk))) ; - } - else{ // between metal and oxygen + } else { // between metal and oxygen t1 = fafbTiOxSurf[l] + (fafbTiOxSurf[l+1] - fafbTiOxSurf[l])*xi; t2 = fafbTiOxSurf[l+1] + (fafbTiOxSurf[l+2] - fafbTiOxSurf[l+1])*(xi-1.0); @@ -1706,11 +1696,11 @@ void PairSMTBQ::potqeq(int i, int j, double qi, double qj, double rsq, engBB = qi*qj*(t1 + (t2 - t1)*xi/2.0); if(strcmp(params[jtype].nom,"O")==0) //the atom j is an oxygen - { iIntfCoup2=jIntfCoup2; - iCoord=jCoord; } + { iIntfCoup2=jIntfCoup2; + iCoord=jCoord; } eng = engBulk + (engBulk-engSurf)/(coordOxBulk-coordOxSurf) * iIntfCoup2 - + (engBB-engBulk)/(coordOxBB-coordOxBulk) * (iCoord-coordOxBulk-iIntfCoup2); + + (engBB-engBulk)/(coordOxBB-coordOxBulk) * (iCoord-coordOxBulk-iIntfCoup2); // ---- Forces Interpolation @@ -1730,18 +1720,13 @@ void PairSMTBQ::potqeq(int i, int j, double qi, double qj, double rsq, dcoupureloc = fcoupured(iCoord,coordOxSurf,coordOxBulk) ; dIntfcoup2loc= fcoup2(iCoord,coordOxBulk,0.15)*dcoupureloc ; fforce = fforceBulk + 1/(coordOxBulk-coordOxSurf) * ((fforceBulk-fforceSurf)* iIntfCoup2 - - (engBulk-engSurf) *dIntfcoup2loc) - + 1/(coordOxBB-coordOxBulk) * ((fforceBB-fforceBulk)*(iCoord-coordOxBulk- iIntfCoup2) - - (engBB-engBulk) *(dcoordloc-dIntfcoup2loc)); + - (engBulk-engSurf) *dIntfcoup2loc) + + 1/(coordOxBB-coordOxBulk) * ((fforceBB-fforceBulk)*(iCoord-coordOxBulk- iIntfCoup2) + - (engBB-engBulk) *(dcoordloc-dIntfcoup2loc)); } - - - } - - } /* -------------------------------------------------------------------- */ @@ -1758,8 +1743,8 @@ void PairSMTBQ::pot_ES (int i, int j, double rsq, double &eng) ==================================================================== */ int itype,jtype,l,m; - double r,t1,t2,sds,xi,engBulk,engSurf,dcoordloc,dcoupureloc; - double engBB, dIntfcoup2loc,iCoord,jCoord,iIntfCoup2,jIntfCoup2; + double r,t1,t2,sds,xi,engBulk,engSurf; + double engBB,iCoord,jCoord,iIntfCoup2,jIntfCoup2; int *type = atom->type; // int n = atom->ntypes; @@ -1770,7 +1755,7 @@ void PairSMTBQ::pot_ES (int i, int j, double rsq, double &eng) r = rsq; sds = r/ds ; l = int(sds) ; - xi = sds - double(l) ; + xi = sds - static_cast(l) ; iCoord=coord[i]; @@ -1801,8 +1786,8 @@ void PairSMTBQ::pot_ES (int i, int j, double rsq, double &eng) engBB = (t1 + (t2 - t1)*xi/2.0); eng= engBulk + (iCoord+jCoord-2*coordOxBulk)/(2*(coordOxBB-coordOxBulk))*(engBB-engBulk) - + (iIntfCoup2+jIntfCoup2)*((engBulk-engSurf)/(2*(coordOxBulk-coordOxSurf)) - - (engBB-engBulk)/(2*(coordOxBB-coordOxBulk))) ; + + (iIntfCoup2+jIntfCoup2)*((engBulk-engSurf)/(2*(coordOxBulk-coordOxSurf)) + - (engBB-engBulk)/(2*(coordOxBB-coordOxBulk))) ; } else { // between metal and oxygen @@ -1815,12 +1800,12 @@ void PairSMTBQ::pot_ES (int i, int j, double rsq, double &eng) engBB = (t1 + (t2 - t1)*xi/2.0); if (jtype==0) { //the atom j is an oxygen - iIntfCoup2=jIntfCoup2; - iCoord=jCoord; - } + iIntfCoup2=jIntfCoup2; + iCoord=jCoord; + } eng = engBulk + (engBulk-engSurf)/(coordOxBulk-coordOxSurf)*iIntfCoup2 - + (engBB-engBulk)/(coordOxBB-coordOxBulk) * (iCoord-coordOxBulk-iIntfCoup2); + + (engBB-engBulk)/(coordOxBB-coordOxBulk) * (iCoord-coordOxBulk-iIntfCoup2); } @@ -1850,7 +1835,7 @@ void PairSMTBQ::pot_ES2 (int i, int j, double rsq, double &pot) r = rsq ; sds = r/ds ; l = int(sds) ; - xi = sds - double(l) ; + xi = sds - static_cast(l) ; // ---- Energies Interpolation @@ -1862,11 +1847,11 @@ void PairSMTBQ::pot_ES2 (int i, int j, double rsq, double &pot) } /* -------------------------------------------------------------------- - Oxygen-Oxygen Interaction + Oxygen-Oxygen Interaction -------------------------------------------------------------------- */ void PairSMTBQ::rep_OO(Intparam *intparam, double rsq, double &fforce, - int eflag, double &eng) + int eflag, double &eng) { double r,tmp_exp,tmp; double A = intparam->abuck ; @@ -1884,9 +1869,9 @@ void PairSMTBQ::rep_OO(Intparam *intparam, double rsq, double &fforce, void PairSMTBQ::Attr_OO(Intparam *intparam, double rsq, double &fforce, - int eflag, double &eng) + int eflag, double &eng) { - double r,tmp_exp,tmp; + double r,tmp_exp; double aOO = intparam->aOO ; double bOO = intparam->bOO ; double r1OO = intparam->r1OO ; @@ -1902,7 +1887,7 @@ void PairSMTBQ::Attr_OO(Intparam *intparam, double rsq, double &fforce, /* ---------------------------------------------------------------------- - covalente Interaction + covalente Interaction ----------------------------------------------------------------------*/ @@ -1933,63 +1918,63 @@ void PairSMTBQ::tabsm() for (k=0; k < kmax; k++) { - s = double(k)*ds ; r = sqrt(s); - if (k==0) r=10e-30; - tmpb = exp( -2.0*q*(r/rzero - 1.0)); - tmpr = exp( -p*(r/rzero - 1.0)); + s = static_cast(k)*ds ; r = sqrt(s); + if (k==0) r=10e-30; + tmpb = exp( -2.0*q*(r/rzero - 1.0)); + tmpr = exp( -p*(r/rzero - 1.0)); - if (r <= rc1) - { + if (r <= rc1) + { - // -- Energy - tabsmb[k][sm] = Ksi*Ksi * tmpb ; - tabsmr[k][sm] = A * tmpr ; + // -- Energy + tabsmb[k][sm] = Ksi*Ksi * tmpb ; + tabsmr[k][sm] = A * tmpr ; - // -- Force - /* dtabsmb ne correspond pas vraiment a une force puisqu'il y a le /r - (on a donc une unite force/distance). Le programme multiplie ensuite - (dans le PairSMTBQ::compute ) dtabsmb par la projection du vecteur r - sur un axe x (ou y ou z) pour determiner la composante de la force selon - cette direction. Donc tout est ok au final. */ + // -- Force + /* dtabsmb ne correspond pas vraiment a une force puisqu'il y a le /r + (on a donc une unite force/distance). Le programme multiplie ensuite + (dans le PairSMTBQ::compute ) dtabsmb par la projection du vecteur r + sur un axe x (ou y ou z) pour determiner la composante de la force selon + cette direction. Donc tout est ok au final. */ - dtabsmb[k][sm] = - 2.0 *Ksi*Ksi* q/rzero * tmpb /r; - dtabsmr[k][sm] = - A * p/rzero * tmpr/r ; + dtabsmb[k][sm] = - 2.0 *Ksi*Ksi* q/rzero * tmpb /r; + dtabsmr[k][sm] = - A * p/rzero * tmpr/r ; - } // if + } // if - else if (r > rc1 && r <= rc2) - { + else if (r > rc1 && r <= rc2) + { - // -- Energie - fcv = fcoupure(r,intparams[sm].dc1,intparams[sm].dc2); - tabsmb[k][sm] = fcv* Ksi*Ksi * tmpb ; - tabsmr[k][sm] = fcv* A * tmpr ; + // -- Energie + fcv = fcoupure(r,intparams[sm].dc1,intparams[sm].dc2); + tabsmb[k][sm] = fcv* Ksi*Ksi * tmpb ; + tabsmr[k][sm] = fcv* A * tmpr ; - // -- Force - /* dtabsmb ne correspond pas vraiment a une force puisqu'il y a le /r - (on a donc une unite force/distance). Le programme multiplie ensuite - (dans le PairSMTBQ::compute ) d tabsmb par la projection du vecteur - r sur un axe x (ou y ou z) pour determiner la composante de la force - selon cette direction. Donc tout est ok au final. */ + // -- Force + /* dtabsmb ne correspond pas vraiment a une force puisqu'il y a le /r + (on a donc une unite force/distance). Le programme multiplie ensuite + (dans le PairSMTBQ::compute ) d tabsmb par la projection du vecteur + r sur un axe x (ou y ou z) pour determiner la composante de la force + selon cette direction. Donc tout est ok au final. */ - fcdv = fcoupured(r,intparams[sm].dc1,intparams[sm].dc2); - dtabsmb[k][sm] = (fcv*( - 2.0 *Ksi*Ksi* q/rzero * tmpb )+fcdv* Ksi*Ksi * tmpb )/r ; - dtabsmr[k][sm] = (fcv*( - A * p/rzero * tmpr )+fcdv*A * tmpr )/r ; + fcdv = fcoupured(r,intparams[sm].dc1,intparams[sm].dc2); + dtabsmb[k][sm] = (fcv*( - 2.0 *Ksi*Ksi* q/rzero * tmpb )+fcdv* Ksi*Ksi * tmpb )/r ; + dtabsmr[k][sm] = (fcv*( - A * p/rzero * tmpr )+fcdv*A * tmpr )/r ; - } + } - else - { + else + { - // -- Energie - tabsmb[k][sm] = 0.0; - tabsmr[k][sm] = 0.0; + // -- Energie + tabsmb[k][sm] = 0.0; + tabsmr[k][sm] = 0.0; - // -- Force - dtabsmb[k][sm] = 0.0; - dtabsmr[k][sm] = 0.0; + // -- Force + dtabsmb[k][sm] = 0.0; + dtabsmr[k][sm] = 0.0; - } + } @@ -2007,7 +1992,7 @@ void PairSMTBQ::tabsm() /* -------------------------------------------------------------- */ void PairSMTBQ::repulsive(Intparam *intparam, double rsq, int i, int j, - double &fforce, int eflag, double &eng) + double &fforce, int eflag, double &eng) { /* ================================================ @@ -2018,7 +2003,7 @@ void PairSMTBQ::repulsive(Intparam *intparam, double rsq, int i, int j, =================================================*/ int l; - double r,sds,xi,t1,t2,dt1,dt2,sweet,iq,jq; + double r,sds,xi,t1,t2,dt1,dt2,sweet; double rrcs = intparam->dc2; int sm = intparam->intsm; @@ -2030,7 +2015,7 @@ void PairSMTBQ::repulsive(Intparam *intparam, double rsq, int i, int j, if (sqrt(r) > rrcs) return ; sds = r/ds ; l = int(sds) ; - xi = sds - double(l) ; + xi = sds - static_cast(l) ; t1 = tabsmr[l][sm] + (tabsmr[l+1][sm] - tabsmr[l][sm])*xi ; t2 = tabsmr[l+1][sm] + (tabsmr[l+2][sm] - tabsmr[l+1][sm])*(xi-1.0) ; @@ -2057,11 +2042,11 @@ void PairSMTBQ::repulsive(Intparam *intparam, double rsq, int i, int j, void PairSMTBQ::attractive(Intparam *intparam, double rsq, - int eflag, int i, double iq, int j, double jq) + int eflag, int i, double iq, int j, double jq) { int itype,l; double r,t1,t2,xi,sds; - double dqcov,sweet,dq,mu; + double sweet,mu; double rrcs = intparam->dc2; int *type = atom->type; @@ -2074,7 +2059,7 @@ void PairSMTBQ::attractive(Intparam *intparam, double rsq, sds = r/ds ; l = int(sds) ; - xi = sds - double(l) ; + xi = sds - static_cast(l) ; t1 = tabsmb[l][sm] + (tabsmb[l+1][sm] - tabsmb[l][sm])*xi ; t2 = tabsmb[l+1][sm] + (tabsmb[l+2][sm] - tabsmb[l+1][sm])*(xi-1.0) ; @@ -2082,24 +2067,24 @@ void PairSMTBQ::attractive(Intparam *intparam, double rsq, if (strcmp(intparam->mode,"oxide") == 0) { - mu = 0.5*(sqrt(params[1].sto) + sqrt(params[0].sto)); + mu = 0.5*(sqrt(params[1].sto) + sqrt(params[0].sto)); -// dq = fabs(params[itype].qform) - fabs(iq); -// dqcov = dq*(2.0*ncov/params[itype].sto - dq); + // dq = fabs(params[itype].qform) - fabs(iq); + // dqcov = dq*(2.0*ncov/params[itype].sto - dq); - sbcov[i] += (t1 + (t2 - t1)*xi/2.0) *params[itype].sto*mu*mu; + sbcov[i] += (t1 + (t2 - t1)*xi/2.0) *params[itype].sto*mu*mu; -// if (i < 10) printf ("i %d, iq %f sbcov %f \n",i,iq,sbcov[i]); + // if (i < 10) printf ("i %d, iq %f sbcov %f \n",i,iq,sbcov[i]); - if (sqrt(r)mode,"metal") == 0) { - sweet = 1.0; - sbmet[i] += (t1 + (t2 - t1)*xi/2.0) * sweet ; - } + sweet = 1.0; + sbmet[i] += (t1 + (t2 - t1)*xi/2.0) * sweet ; + } } @@ -2123,7 +2108,7 @@ void PairSMTBQ::f_att(Intparam *intparam, int i, int j,double rsq, double &fforc r = rsq; sds = r/ds ; l = int(sds) ; - xi = sds - double(l) ; + xi = sds - static_cast(l) ; dt1 = dtabsmb[l][sm] + (dtabsmb[l+1][sm] - dtabsmb[l][sm])*xi ; dt2 = dtabsmb[l+1][sm] + (dtabsmb[l+2][sm] - dtabsmb[l+1][sm])*(xi-1.0) ; @@ -2135,22 +2120,22 @@ void PairSMTBQ::f_att(Intparam *intparam, int i, int j,double rsq, double &fforc dqcovj = dq*(2.0*ncov/params[jtype].sto - dq); if (strcmp(intparam->mode,"oxide") == 0) { -//------------------------------------------ + //------------------------------------------ mu = 0.5*(sqrt(params[1].sto) + sqrt(params[0].sto)); fcov_ij = (dt1 + (dt2 - dt1)*xi/2.0) * dqcovi *params[itype].sto*mu*mu; fcov_ji = (dt1 + (dt2 - dt1)*xi/2.0) * dqcovj *params[jtype].sto*mu*mu; fforce = 0.5 * ( fcov_ij/sqrt(sbcov[i]*dqcovi + sbmet[i]) - + fcov_ji/sqrt(sbcov[j]*dqcovj + sbmet[j]) ) ; + + fcov_ji/sqrt(sbcov[j]*dqcovj + sbmet[j]) ) ; } else if (strcmp(intparam->mode,"metal") == 0) { -//----------------------------------------------- + //----------------------------------------------- sweet = 1.0; fcov_ij = (dt1 + (dt2 - dt1)*xi/2.0) * sweet ; fforce = 0.5 * fcov_ij*( 1.0/sqrt(sbcov[i]*dqcovi + sbmet[i]) - + 1.0/sqrt(sbcov[j]*dqcovj + sbmet[j]) ) ; + + 1.0/sqrt(sbcov[j]*dqcovj + sbmet[j]) ) ; } } @@ -2172,9 +2157,9 @@ void PairSMTBQ::pot_COV(Param *param, int i, double &qforce) DQ = dq*(2.0*ncov/sto - dq); if (fabs(iq) < 1.0e-7 || fabs(sbcov[i]) < 1.0e-7) { - qforce = 0.0; } + qforce = 0.0; } else { - qforce = sign*sbcov[i]/sqrt(sbcov[i]*DQ + sbmet[i])*(ncov/sto - dq) ; + qforce = sign*sbcov[i]/sqrt(sbcov[i]*DQ + sbmet[i])*(ncov/sto - dq) ; } } @@ -2182,7 +2167,7 @@ void PairSMTBQ::pot_COV(Param *param, int i, double &qforce) /* ---------------------------------------------------------------------- */ double PairSMTBQ::potmet(Intparam *intparam, double rsq, - int i, double iq, int j, double jq) + int i, double iq, int j, double jq) { int l,itype,jtype; int *type = atom->type; @@ -2194,7 +2179,7 @@ double PairSMTBQ::potmet(Intparam *intparam, double rsq, r = rsq; sds = r/ds ; l = int(sds) ; - xi = sds - double(l) ; + xi = sds - static_cast(l) ; t1 = tabsmb[l][sm] + (tabsmb[l+1][sm] - tabsmb[l][sm])*xi ; t2 = tabsmb[l+1][sm] + (tabsmb[l+2][sm] - tabsmb[l+1][sm])*(xi-1.0) ; @@ -2207,14 +2192,14 @@ double PairSMTBQ::potmet(Intparam *intparam, double rsq, dsweet = 0.0; chi = (t1 + (t2 - t1)*xi/2.0) * dsweet *( 1.0/(2.0*sqrt(sbcov[i]*dqcovi+sbmet[i])) - + 1.0/(2.0*sqrt(sbcov[j]*dqcovj+sbmet[j])) ); + + 1.0/(2.0*sqrt(sbcov[j]*dqcovj+sbmet[j])) ); return chi; } /* ---------------------------------------------------------------------- - Cutting Function + Cutting Function ----------------------------------------------------------------------*/ @@ -2242,7 +2227,7 @@ double PairSMTBQ::fcoupure(double r, double rep_dc1, double rep_dc2) } /* ---------------------------------------------------------------------- - Derivate of cutting function + Derivate of cutting function ----------------------------------------------------------------------*/ @@ -2301,7 +2286,7 @@ double PairSMTBQ::Primfcoup2(double c, double x, double delta) { return (c*(c*c*c - 4* c*c* x - 4* (x - 2 *delta) * (x+delta)*(x+delta) + - 6* c *(x*x - delta*delta)))/(16* delta*delta*delta); + 6* c *(x*x - delta*delta)))/(16* delta*delta*delta); } @@ -2327,15 +2312,15 @@ double PairSMTBQ::Intfcoup2(double c, double x, double delta) /* --------------------------------------------------------------------- - Energy derivation respect charge Q + Energy derivation respect charge Q --------------------------------------------------------------------- */ void PairSMTBQ::QForce_charge(int loop) { int i,j,ii,jj,jnum; int itype,jtype,m,gp; - double xtmp,ytmp,ztmp,evdwlCoul,fpairCoul; - double rsq,delr[3],chi_ij; + double xtmp,ytmp,ztmp; + double rsq; int *ilist,*jlist,*numneigh,**firstneigh; double iq,jq,fqi,fqj,fqij,fqij2,fqjj; int eflag; @@ -2351,89 +2336,85 @@ void PairSMTBQ::QForce_charge(int loop) numneigh = list->numneigh; firstneigh = list->firstneigh; - int nlocal = atom->nlocal; - - // loop over full neighbor list of my atoms fqi = fqj = fqij = fqij2 = fqjj = 0.0; - // ================== - if (loop == 0) { - // ================== + // ================== + if (loop == 0) { + // ================== - for (ii = 0; ii < inum; ii ++) { - //-------------------------------- - i = ilist[ii]; - itype = map[type[i]]; + for (ii = 0; ii < inum; ii ++) { + //-------------------------------- + i = ilist[ii]; + itype = map[type[i]]; - gp = flag_QEq[i]; + gp = flag_QEq[i]; - sbcov[i] =coord[i]= sbmet[i] = 0.0; + sbcov[i] =coord[i]= sbmet[i] = 0.0; - itype = map[type[i]]; - xtmp = x[i][0]; - ytmp = x[i][1]; - ztmp = x[i][2]; - iq = q[i]; + itype = map[type[i]]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + iq = q[i]; - // two-body interactions + // two-body interactions - jlist = firstneigh[i]; - jnum = numneigh[i]; + jlist = firstneigh[i]; + jnum = numneigh[i]; - for (jj = 0; jj < jnum; jj++) { -// ------------------------------- - j = jlist[jj]; - j &= NEIGHMASK; + for (jj = 0; jj < jnum; jj++) { + // ------------------------------- + j = jlist[jj]; + j &= NEIGHMASK; - jtype = map[type[j]]; - jq = q[j]; + jtype = map[type[j]]; + jq = q[j]; - m = intype[itype][jtype]; - if (intparams[m].intsm == 0) continue ; + m = intype[itype][jtype]; + if (intparams[m].intsm == 0) continue ; - delr[0] = x[j][0] - xtmp; - delr[1] = x[j][1] - ytmp; - delr[2] = x[j][2] - ztmp; - rsq = vec3_dot(delr,delr); + const double delx = x[j][0] - xtmp; + const double dely = x[j][1] - ytmp; + const double delz = x[j][2] - ztmp; + rsq = delx*delx + dely*dely + delz*delz; + + // Covalente charge forces - sbcov initialization + // ------------------------------------------------ + if (sqrt(rsq) > intparams[m].dc2) continue; + + attractive (&intparams[m],rsq,eflag,i,iq,j,jq); -// Covalente charge forces - sbcov initialization -// ------------------------------------------------ - if (sqrt(rsq) > intparams[m].dc2) continue; - - attractive (&intparams[m],rsq,eflag,i,iq,j,jq); + } // ---------------------------------------------- for jj - } // ---------------------------------------------- for jj + } // -------------------------------------------- ii + + // =============================================== + // Communicates the tables *sbcov and *sbmet + // to calculate the N-body forces + // ================================================ + + forward (sbcov) ; // reverse (sbcov); + forward (coord) ; // reverse (coord); + forward (sbmet) ; // reverse (sbmet); - } // -------------------------------------------- ii + if (nteam == 0) return; //no oxide + if (Qstep == 0 || (step % Qstep != 0)) return; - // =============================================== - // Communicates the tables *sbcov and *sbmet - // to calculate the N-body forces - // ================================================ - - forward (sbcov) ; reverse (sbcov); - forward (coord) ; reverse (coord); - forward (sbmet) ; reverse (sbmet); - - - if (nteam == 0) return; //no oxide - if (Qstep == 0 || fmod(double(step), double(Qstep)) != 0.0) return; - - // ======================= - } // End of If(loop) - // ======================= + // ======================= + } // End of If(loop) + // ======================= // =============================================== @@ -2455,12 +2436,12 @@ void PairSMTBQ::QForce_charge(int loop) // Madelung potential // -------------------- - potmad[i] += 2.0*Vself*iq ; + potmad[i] += 2.0*Vself*iq ; // charge force from self energy // ----------------------------- - fqi = qfo_self(¶ms[itype],iq); - potself[i] = fqi ; + fqi = qfo_self(¶ms[itype],iq); + potself[i] = fqi ; @@ -2473,29 +2454,29 @@ void PairSMTBQ::QForce_charge(int loop) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; - jtype = map[type[j]]; - m = intype[itype][jtype]; - jq = q[j]; + jtype = map[type[j]]; + m = intype[itype][jtype]; + jq = q[j]; - delr[0] = x[j][0] - xtmp; - delr[1] = x[j][1] - ytmp; - delr[2] = x[j][2] - ztmp; - rsq = vec3_dot(delr,delr); + const double delx = x[j][0] - xtmp; + const double dely = x[j][1] - ytmp; + const double delz = x[j][2] - ztmp; + rsq = delx*delx + dely*dely + delz*delz; - // long range q-dependent - if (sqrt(rsq) > cutmax) continue; + // long range q-dependent + if (sqrt(rsq) > cutmax) continue; - // 1/r charge forces - // -------------------- - fqij = 0.0; -// pot_ES2 (i,j,rsq,fqij2); + // 1/r charge forces + // -------------------- + fqij = 0.0; + // pot_ES2 (i,j,rsq,fqij2); pot_ES (i,j,rsq,fqij); - potmad[i] += jq*fqij ; + potmad[i] += jq*fqij ; - } // ------ jj + } // ------ jj fqi = 0.0; pot_COV (¶ms[itype],i,fqi) ; @@ -2620,7 +2601,7 @@ void PairSMTBQ::Charge() i = ilist[ii]; itype = map[type[i]]; gp = flag_QEq[i]; -// if (gp == 0) continue; + // if (gp == 0) continue; if (itype == 0) q[i] = QOxInit ; if (itype > 0) q[i] = -QOxInit * nQEqaall[gp]/nQEqcall[gp]; @@ -2628,7 +2609,7 @@ void PairSMTBQ::Charge() } if (nteam == 0 || Qstep == 0) return; - if (fmod(double(step), double(Qstep)) != 0.0) return; + if (step % Qstep != 0) return; // -------------------------------------- // ---- @@ -2640,8 +2621,8 @@ void PairSMTBQ::Charge() for (gp = 0; gp < nteam+1; gp++) { printf (" ++++ Groupe %d - Nox %d Ncat %d\n",gp,nQEqaall[gp],nQEqcall[gp]); if (nQEqcall[gp] !=0 && nQEqaall[gp] !=0 ) - printf (" neutralite des charges %f\n qtotc %f qtota %f\n", - qtotll,qtotcll[gp]/nQEqcall[gp],qtotall[gp]/nQEqaall[gp]); + printf (" neutralite des charges %f\n qtotc %f qtota %f\n", + qtotll,qtotcll[gp]/nQEqcall[gp],qtotall[gp]/nQEqaall[gp]); printf (" ---------------------------- \n");} } @@ -2658,7 +2639,7 @@ void PairSMTBQ::Charge() // -------------------------------------------- for (iloop = 0; iloop < loopmax; iloop ++ ) { - // -------------------------------------------- + // -------------------------------------------- qtot = qtotll = Transf[3*cluster] = 0.0 ; for (gp=0; gp(nQEqall[i]); enegchk[i] = enegmax[i] = 0.0; } @@ -2729,9 +2710,9 @@ void PairSMTBQ::Charge() for (gp = 0; gp < nteam+1; gp++) { if(nQEqall[gp] !=0) { - enegchk[gp] = enegchkall[gp]/double(nQEqall[gp]); - enegmax[gp] = enegmaxall[gp]; - } + enegchk[gp] = enegchkall[gp]/static_cast(nQEqall[gp]); + enegmax[gp] = enegmaxall[gp]; + } } // ----------------------------------------------------- @@ -2744,7 +2725,7 @@ void PairSMTBQ::Charge() } for (gp = 1; gp < nteam+1; gp++) { m += end[gp] ; } - if (m == nteam) { break; } + if (m == nteam) { break; } // ----------------------------------------------------- // ----------------------------------------------------- @@ -2761,40 +2742,40 @@ void PairSMTBQ::Charge() // ======================================= // Charge Communication. // ======================================= - forward(q); reverse(q); + forward(q); // reverse(q); //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // ========================================== // Ecriture des potentiels dans un fichier // ========================================== - if (strcmp(writepot,"true") == 0 && fmod(double(step), Neverypot) == 0.0) { + if (strcmp(writepot,"true") == 0 && fmod(static_cast(step), Neverypot) == 0.0) { - ofstream fichierpot("Electroneg_component.txt", ios::out | ios::trunc) ; + ofstream fichierpot("Electroneg_component.txt", ios::out | ios::trunc) ; - for (ii = 0; ii < inum; ii++) { + for (ii = 0; ii < inum; ii++) { i = ilist[ii]; itype = map[type[i]]; gp = flag_QEq[i]; if (fichierpot) fichierpot<< setprecision(9) <(nQEqcall[i]) ; + TransfAll[i+2*cluster] /= static_cast(nQEqaall[i]) ;} sigmaa[i] = sigmac[i] = 0.0; } @@ -2816,8 +2797,8 @@ void PairSMTBQ::Charge() MPI_Allreduce(sigmac,sigmacll,nteam+1,MPI_DOUBLE,MPI_SUM,world); for (gp = 1; gp < nteam+1; gp++) { - sigmaall[gp] = sqrt(sigmaall[gp]/double(nQEqaall[gp])) ; - sigmacll[gp] = sqrt(sigmacll[gp]/double(nQEqcall[gp])) ; + sigmaall[gp] = sqrt(sigmaall[gp]/static_cast(nQEqaall[gp])) ; + sigmacll[gp] = sqrt(sigmacll[gp]/static_cast(nQEqcall[gp])) ; } @@ -2826,7 +2807,7 @@ void PairSMTBQ::Charge() for (gp = 0; gp < nteam+1; gp++) { printf (" -------------- Groupe %d -----------------\n",gp); printf (" qtotc %f(+- %f) qtota %f(+- %f)\n", - TransfAll[gp+cluster],sigmacll[gp],TransfAll[gp+2*cluster],sigmaall[gp]); + TransfAll[gp+cluster],sigmacll[gp],TransfAll[gp+2*cluster],sigmaall[gp]); printf (" Potentiel elec total : %f\n iloop %d, qtot %f\n",TransfAll[gp],iloop,TransfAll[3*cluster]); printf (" convergence : %f - %f\n",enegchk[gp],enegmax[gp]); } @@ -2858,9 +2839,9 @@ void PairSMTBQ::groupBulkFromSlab_QEq() i = ilist[ii]; ztmp = x[i][2]; if (ztmp>zlim1QEq && ztmp< zlim2QEq) - flag_QEq[i]=1; + flag_QEq[i]=1; else - flag_QEq[i]=0; + flag_QEq[i]=0; nteam=1; @@ -2901,9 +2882,9 @@ void PairSMTBQ::groupSurface_QEq() i = ilist[ii]; ztmp = x[i][2]; if (ztmp>zlim1QEq) - flag_QEq[i]=1; + flag_QEq[i]=1; else - flag_QEq[i]=0; + flag_QEq[i]=0; nteam=1; @@ -2986,22 +2967,22 @@ void PairSMTBQ::groupQEqAllParallel_QEq() jlist = firstneigh[i]; jnum = numneigh[i]; for (jj = 0; jj < jnum; jj++ ) - { - j = jlist[jj] ; jtype = map[type[j]]; - if (jtype == itype) continue; - m = intype[itype][jtype]; + { + j = jlist[jj] ; jtype = map[type[j]]; + if (jtype == itype) continue; + m = intype[itype][jtype]; - delr[0] = x[j][0] - xtmp; - delr[1] = x[j][1] - ytmp; - delr[2] = x[j][2] - ztmp; - rsq = vec3_dot(delr,delr); + delr[0] = x[j][0] - xtmp; + delr[1] = x[j][1] - ytmp; + delr[2] = x[j][2] - ztmp; + rsq = vec3_dot(delr,delr); - if (sqrt(rsq) <= intparams[m].dc2) { - flag_QEq[i] = 1; flag_QEq[j] = 1; - } - } + if (sqrt(rsq) <= intparams[m].dc2) { + flag_QEq[i] = 1; flag_QEq[j] = 1; + } + } if (flag_QEq[i] == 1) { - QEq = 1; + QEq = 1; } } @@ -3063,84 +3044,84 @@ void PairSMTBQ::groupQEqAllParallel_QEq() // ---------------------- for (kk = 0; kk < nelt[ngp]; kk++) { - k = tab_gp[ngp][kk]; - ktype = map[type[k]]; - // printf ("[me %d] kk - gp %d elemt %d : atom %d(%d)\n",me,ngp,kk,k,ktype); - if (k >= nlocal) continue; + k = tab_gp[ngp][kk]; + ktype = map[type[k]]; + // printf ("[me %d] kk - gp %d elemt %d : atom %d(%d)\n",me,ngp,kk,k,ktype); + if (k >= nlocal) continue; - xtmp = x[k][0]; - ytmp = x[k][1]; - ztmp = x[k][2]; + xtmp = x[k][0]; + ytmp = x[k][1]; + ztmp = x[k][2]; - // Loop on the oxygen's neighbor of the group - // --------------------------------------------- - jlist = firstneigh[k]; - jnum = numneigh[k]; - for (j = 0; j < nboite; j++ ) - { - jtype = map[type[j]]; - if (jtype == ktype) continue; - m = intype[itype][jtype]; + // Loop on the oxygen's neighbor of the group + // --------------------------------------------- + jlist = firstneigh[k]; + jnum = numneigh[k]; + for (j = 0; j < nboite; j++ ) + { + jtype = map[type[j]]; + if (jtype == ktype) continue; + m = intype[itype][jtype]; - if (jtype == 0 && flag_QEq[j] == 0) continue; + if (jtype == 0 && flag_QEq[j] == 0) continue; - if (flag_gp[me][j] == ngp) continue; + if (flag_gp[me][j] == ngp) continue; - delr[0] = x[j][0] - xtmp; - delr[1] = x[j][1] - ytmp; - delr[2] = x[j][2] - ztmp; - rsq = vec3_dot(delr,delr); + delr[0] = x[j][0] - xtmp; + delr[1] = x[j][1] - ytmp; + delr[2] = x[j][2] - ztmp; + rsq = vec3_dot(delr,delr); - // ------------------------------------- - if (sqrt(rsq) <= cutmax) { + // ------------------------------------- + if (sqrt(rsq) <= cutmax) { - flag_QEq[j] = 1; //Entre dans le schema QEq + flag_QEq[j] = 1; //Entre dans le schema QEq - // :::::::::::::::::::: Meeting of two group in the same proc ::::::::::::::::::::: + // :::::::::::::::::::: Meeting of two group in the same proc ::::::::::::::::::::: - if (flag_gp[me][j] != 0 && flag_gp[me][j] != ngp && nelt[flag_gp[me][j]] != 0) { - printf("[me %d] (atom %d) %d [elt %d] rencontre un nouveau groupe %d [elt %d] (atom %d)\n", - me,k,ngp,nelt[ngp],flag_gp[me][j],nelt[flag_gp[me][j]],j); + if (flag_gp[me][j] != 0 && flag_gp[me][j] != ngp && nelt[flag_gp[me][j]] != 0) { + printf("[me %d] (atom %d) %d [elt %d] rencontre un nouveau groupe %d [elt %d] (atom %d)\n", + me,k,ngp,nelt[ngp],flag_gp[me][j],nelt[flag_gp[me][j]],j); - // On met a jours les tableaux - // ----------------------------- - igp = flag_gp[me][j]; - z = min(igp,ngp); + // On met a jours les tableaux + // ----------------------------- + igp = flag_gp[me][j]; + z = min(igp,ngp); - if (z == igp) { igp = z; } - else if (z == ngp) { - ngp = igp ; igp = z; - flag_gp[me][j] = ngp; - } + if (z == igp) { igp = z; } + else if (z == ngp) { + ngp = igp ; igp = z; + flag_gp[me][j] = ngp; + } - for (zz = 0; zz < nelt[ngp]; zz++) { - z = tab_gp[ngp][zz]; - tab_gp[igp][nelt[igp]] = z; - nelt[igp] += 1; - flag_gp[me][z] = igp; - tab_gp[ngp][zz] = 0; - } + for (zz = 0; zz < nelt[ngp]; zz++) { + z = tab_gp[ngp][zz]; + tab_gp[igp][nelt[igp]] = z; + nelt[igp] += 1; + flag_gp[me][z] = igp; + tab_gp[ngp][zz] = 0; + } - nelt[ngp] = 0; - for (z = nlocal; z < nboite; z++) { - if (flag_gp[me][z] == ngp) flag_gp[me][z] = igp; - } + nelt[ngp] = 0; + for (z = nlocal; z < nboite; z++) { + if (flag_gp[me][z] == ngp) flag_gp[me][z] = igp; + } - m = 1; kk = 0; - ngp = igp; - break; - } - // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + m = 1; kk = 0; + ngp = igp; + break; + } + // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - flag_gp[me][j] = ngp; - if (j < nlocal) - { - tab_gp[ngp][nelt[ngp]] = j; - nelt[ngp] += 1; - } - } - } // for j + flag_gp[me][j] = ngp; + if (j < nlocal) + { + tab_gp[ngp][nelt[ngp]] = j; + nelt[ngp] += 1; + } + } + } // for j } // for k } // for ii @@ -3148,7 +3129,7 @@ void PairSMTBQ::groupQEqAllParallel_QEq() // Groups communication // OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO for (i = 0; i < nproc; i++) { - forward_int(flag_gp[i]); reverse_int(flag_gp[i]); + forward_int(flag_gp[i]); //reverse_int(flag_gp[i]); } // --- @@ -3170,73 +3151,73 @@ void PairSMTBQ::groupQEqAllParallel_QEq() jlist = firstneigh[i]; jnum = numneigh[i]; for (jj = 0; jj < jnum; jj++ ) - { - j = jlist[jj] ; jtype = map[type[j]]; - if (jtype != 0) continue; + { + j = jlist[jj] ; jtype = map[type[j]]; + if (jtype != 0) continue; - m = 0; - for (iproc = 0; iproc < nproc; iproc++) { - if (flag_gp[iproc][j] != 0) m = flag_gp[iproc][j]; - } - if (m == 0) continue; + m = 0; + for (iproc = 0; iproc < nproc; iproc++) { + if (flag_gp[iproc][j] != 0) m = flag_gp[iproc][j]; + } + if (m == 0) continue; - delr[0] = x[j][0] - xtmp; - delr[1] = x[j][1] - ytmp; - delr[2] = x[j][2] - ztmp; - rsq = vec3_dot(delr,delr); + delr[0] = x[j][0] - xtmp; + delr[1] = x[j][1] - ytmp; + delr[2] = x[j][2] - ztmp; + rsq = vec3_dot(delr,delr); - // ---------------------------------------- - if (sqrt(rsq) <= cutmax) { - // if (sqrt(rsq) <= intparams[m].dc2) { - // ---------------------------------------- + // ---------------------------------------- + if (sqrt(rsq) <= cutmax) { + // if (sqrt(rsq) <= intparams[m].dc2) { + // ---------------------------------------- - flag_QEq[i] = 1; igp = flag_gp[me][j]; + flag_QEq[i] = 1; igp = flag_gp[me][j]; - if (flag_gp[me][i] == 0) flag_gp[me][i] = igp; + if (flag_gp[me][i] == 0) flag_gp[me][i] = igp; - if (flag_gp[me][i] != igp && igp != 0) { - printf ("[me %d] Cation i %d gp %d [nelt %d] rencontre j %d(%d)du groupe %d [nelt %d]\n", - me,i,flag_gp[me][i],nelt[flag_gp[me][i]],j,jtype,igp,nelt[igp]); + if (flag_gp[me][i] != igp && igp != 0) { + printf ("[me %d] Cation i %d gp %d [nelt %d] rencontre j %d(%d)du groupe %d [nelt %d]\n", + me,i,flag_gp[me][i],nelt[flag_gp[me][i]],j,jtype,igp,nelt[igp]); - igp = min(flag_gp[me][i],flag_gp[me][j]); - if (igp == flag_gp[me][i]) { kgp = flag_gp[me][j]; } - else { kgp = flag_gp[me][i]; } + igp = min(flag_gp[me][i],flag_gp[me][j]); + if (igp == flag_gp[me][i]) { kgp = flag_gp[me][j]; } + else { kgp = flag_gp[me][i]; } - for (k = 0; k < nelt[kgp]; k++) { - z = tab_gp[kgp][k]; - tab_gp[igp][nelt[igp]] = z; - nelt[igp] += 1; - flag_gp[me][z] = igp; - tab_gp[kgp][k] = 0; - } - nelt[kgp] = 0; + for (k = 0; k < nelt[kgp]; k++) { + z = tab_gp[kgp][k]; + tab_gp[igp][nelt[igp]] = z; + nelt[igp] += 1; + flag_gp[me][z] = igp; + tab_gp[kgp][k] = 0; + } + nelt[kgp] = 0; - for (k = 0; k < nboite; k++) { - if (flag_gp[me][k] == kgp) flag_gp[me][k] = igp; - } + for (k = 0; k < nboite; k++) { + if (flag_gp[me][k] == kgp) flag_gp[me][k] = igp; + } - } - m = 0; - for (k = 0; k < nelt[igp]; k++) { - if (tab_gp[igp][k] == i) m = 1; - } + } + m = 0; + for (k = 0; k < nelt[igp]; k++) { + if (tab_gp[igp][k] == i) m = 1; + } - if (i >= nlocal || m == 1 ) continue; - // printf ("[me %d] igp %d - nelt %d atom %d\n",me,igp,nelt[igp],i); - tab_gp[igp][nelt[igp]] = i; - nelt[igp] += 1; - break; - } + if (i >= nlocal || m == 1 ) continue; + // printf ("[me %d] igp %d - nelt %d atom %d\n",me,igp,nelt[igp],i); + tab_gp[igp][nelt[igp]] = i; + nelt[igp] += 1; + break; + } - } // voisin j + } // voisin j } // atom i /* ================================================== - Group Communication between proc for unification + Group Communication between proc for unification ================================================== */ for (i = 0; i < nproc; i++) { - forward_int(flag_gp[i]); reverse_int(flag_gp[i]); + forward_int(flag_gp[i]);// reverse_int(flag_gp[i]); } // =============== End of COMM ================= @@ -3253,7 +3234,7 @@ void PairSMTBQ::groupQEqAllParallel_QEq() if (tabtemp[m][k] != 0) continue; if (flag_gp[k][i] != 0) { - tabtemp[m][k] = 10*k + flag_gp[k][i]; + tabtemp[m][k] = 10*k + flag_gp[k][i]; } } @@ -3266,7 +3247,7 @@ void PairSMTBQ::groupQEqAllParallel_QEq() nteam = 0; iproc = 0; for (igp = 0; igp < 10*nproc; igp++) { if (Allgptmp[igp] == 0) continue; - iproc = int(double(igp)/10.0); + iproc = int(static_cast(igp)/10.0); ngp = igp - 10*iproc; if (nteam == 0) { @@ -3277,17 +3258,17 @@ void PairSMTBQ::groupQEqAllParallel_QEq() } else { m = 0; for (i = 1; i < nteam+1; i++) { - for (k = 0; k < team_elt[i][iproc]; k++) { - if (ngp == team_QEq[i][iproc][k]) m = 1; - } } + for (k = 0; k < team_elt[i][iproc]; k++) { + if (ngp == team_QEq[i][iproc][k]) m = 1; + } } if (m == 1) continue; // create a new team!! // --------------------------- if (m == 0) { - nteam += 1; - team_elt[nteam][iproc] = 0; - team_QEq[nteam][iproc][team_elt[nteam][iproc]] = ngp; - team_elt[nteam][iproc] += 1; + nteam += 1; + team_elt[nteam][iproc] = 0; + team_QEq[nteam][iproc][team_elt[nteam][iproc]] = ngp; + team_elt[nteam][iproc] += 1; } } // ------- @@ -3297,31 +3278,31 @@ void PairSMTBQ::groupQEqAllParallel_QEq() for (kk = 0; kk < nproc; kk++) { for (k = 0; k < team_elt[nteam][kk]; k++) { - // On prend le gp le k ieme element de la team nteam sur le proc iproc - // ngp = 0; - ngp = team_QEq[nteam][kk][k]; - kgp = 10*kk + ngp; + // On prend le gp le k ieme element de la team nteam sur le proc iproc + // ngp = 0; + ngp = team_QEq[nteam][kk][k]; + kgp = 10*kk + ngp; - // On regarde sur les autre proc si ce gp ne pointe pas vers un autre. - for (i = 0; i < nproc; i++) { - if (i == kk) continue; - if (Alltabtemp[kgp][i] == 0) continue; + // On regarde sur les autre proc si ce gp ne pointe pas vers un autre. + for (i = 0; i < nproc; i++) { + if (i == kk) continue; + if (Alltabtemp[kgp][i] == 0) continue; - if (Alltabtemp[kgp][i] != 0) ngp = Alltabtemp[kgp][i]; - ngp = ngp - 10*i; + if (Alltabtemp[kgp][i] != 0) ngp = Alltabtemp[kgp][i]; + ngp = ngp - 10*i; - // Est ce que ce groupe est nouveau? - m = 0; - for (j = 0; j < team_elt[nteam][i]; j++) { - if (team_QEq[nteam][i][j] == ngp) m = 1; - } + // Est ce que ce groupe est nouveau? + m = 0; + for (j = 0; j < team_elt[nteam][i]; j++) { + if (team_QEq[nteam][i][j] == ngp) m = 1; + } - if (m == 0) { - iproc = i; k = 0; - team_QEq[nteam][i][team_elt[nteam][i]] = ngp ; - team_elt[nteam][i] += 1; - } - } // regard sur les autre proc + if (m == 0) { + iproc = i; k = 0; + team_QEq[nteam][i][team_elt[nteam][i]] = ngp ; + team_elt[nteam][i] += 1; + } + } // regard sur les autre proc } // On rempli de proche en proche } // boucle kk sur les proc @@ -3339,8 +3320,8 @@ void PairSMTBQ::groupQEqAllParallel_QEq() for (j = 1; j <= nteam; j++) { for (k = 0; k < team_elt[j][me]; k++) { if (gp == team_QEq[j][me][k]) { - flag_QEq[i] = j; m = 1; - break; + flag_QEq[i] = j; m = 1; + break; } } if (m == 1) break; @@ -3404,7 +3385,7 @@ void PairSMTBQ::Init_charge(int *nQEq, int *nQEqa, int *nQEqc) if (gp != 0 && init[gp] != 0) { if (itype == 0) q[i] = -1.96; - if (itype != 0) q[i] = 1.96 * double(nQEqaall[gp]) / double(nQEqcall[gp]); + if (itype != 0) q[i] = 1.96 * static_cast(nQEqaall[gp]) / static_cast(nQEqcall[gp]); } tot += q[i]; } @@ -3424,9 +3405,9 @@ int PairSMTBQ::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, in for (i = 0; i < n; i ++) { j = list[i]; buf[m++] = tab_comm[j]; -// if (j < 3) printf ("[%d] %d pfc %d %d buf_send = %f \n",me,n,i,m-1,buf[m-1]); + // if (j < 3) printf ("[%d] %d pfc %d %d buf_send = %f \n",me,n,i,m-1,buf[m-1]); } - return 1; + return m; } /* ---------------------------------------------------------------------- */ @@ -3439,7 +3420,7 @@ void PairSMTBQ::unpack_forward_comm(int n, int first, double *buf) last = first + n ; for (i = first; i < last; i++) { tab_comm[i] = buf[m++]; -// if (inlocal; int nghost = atom->nghost; - for (i=0; i(tab[i]);} comm->forward_comm_pair(this); @@ -3527,7 +3508,7 @@ void PairSMTBQ::reverse_int(int *tab) int nlocal = atom->nlocal; int nghost = atom->nghost; - for (i=0; i(tab[i]);} comm->reverse_comm_pair(this); @@ -3595,7 +3576,7 @@ void PairSMTBQ::CheckEnergyVSForce() double za,zb,gam,dgam,dza,dzb, d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2,na,nb; int *type = atom->type; - char *NameFile; + const char *NameFile; i=0; @@ -3625,25 +3606,25 @@ void PairSMTBQ::CheckEnergyVSForce() { if (iCoord==1) - {coord[i]=2.2; - coord[j]=2.1; - NameFile="energyandForceOxOxUnderCoord.txt"; - } + {coord[i]=2.2; + coord[j]=2.1; + NameFile=(const char *)"energyandForceOxOxUnderCoord.txt"; + } if (iCoord==2) - {coord[i]=coordOxBulk; - coord[j]=coordOxBulk; - NameFile="energyandForceOxOxCoordBulk.txt"; - } + {coord[i]=coordOxBulk; + coord[j]=coordOxBulk; + NameFile=(const char *)"energyandForceOxOxCoordBulk.txt"; + } if (iCoord==3) - {coord[i]=3.8; - coord[j]=4; - NameFile="energyandForceOxOxOverCoord.txt"; - } + {coord[i]=3.8; + coord[j]=4; + NameFile=(const char *)"energyandForceOxOxOverCoord.txt"; + } if (iCoord==4) - {coord[i]=2.2; - coord[j]=3.5; - NameFile="energyandForceOxOxUnderOverCoord.txt"; - } + {coord[i]=2.2; + coord[j]=3.5; + NameFile=(const char *)"energyandForceOxOxUnderOverCoord.txt"; + } ofstream fichierOxOx(NameFile, ios::out | ios::trunc) ; @@ -3651,56 +3632,56 @@ void PairSMTBQ::CheckEnergyVSForce() drL=0.0001; iiiMax=int((cutmax-1.2)/drL); for (iii=1; iii< iiiMax ; iii++){ - r=1.2+drL*iii; - rsq=r*r; - evdwlCoul = 0.0 ; fpairCoul = 0.0; - potqeq(i,j,iq,jq,rsq,fpairCoul,eflag,evdwlCoul); - fpairCoul=fpairCoul*r; + r=1.2+drL*iii; + rsq=r*r; + evdwlCoul = 0.0 ; fpairCoul = 0.0; + potqeq(i,j,iq,jq,rsq,fpairCoul,eflag,evdwlCoul); + fpairCoul=fpairCoul*r; - rep_OO (&intparams[m],rsq,fpair,eflag,evdwl); - ErepR = evdwl; - frepR= fpair*r; + rep_OO (&intparams[m],rsq,fpair,eflag,evdwl); + ErepR = evdwl; + frepR= fpair*r; - gam = dgam = dza = dzb = d2zaa = d2zab = - d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; + gam = dgam = dza = dzb = d2zaa = d2zab = + d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; -// gammas_(na,nb,za,zb,r,gam,dgam,dza,dzb, -// d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; + // gammas_(na,nb,za,zb,r,gam,dgam,dza,dzb, + // d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; gammas(na,nb,za,zb,r,gam,dgam,dza,dzb, - d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; + d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ; - sds = rsq/ds ; l = int(sds) ; - xi = sds - double(l) ; + sds = rsq/ds ; l = int(sds) ; + xi = sds - static_cast(l) ; - t1 = fafb[l][m] + (fafb[l+1][m] - fafb[l][m])*xi; - t2 = fafb[l+1][m] + (fafb[l+2][m] - fafb[l+1][m])*(xi-1.0); - eng = iq*jq*(t1 + (t2 - t1)*xi/2.0); + t1 = fafb[l][m] + (fafb[l+1][m] - fafb[l][m])*xi; + t2 = fafb[l+1][m] + (fafb[l+2][m] - fafb[l+1][m])*(xi-1.0); + eng = iq*jq*(t1 + (t2 - t1)*xi/2.0); - t1 = dfafb[l][m] + (dfafb[l+1][m] - dfafb[l][m])*xi; - t2 = dfafb[l+1][m] + (dfafb[l+2][m] - dfafb[l+1][m])*(xi-1); - fforce = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ; + t1 = dfafb[l][m] + (dfafb[l+1][m] - dfafb[l][m])*xi; + t2 = dfafb[l+1][m] + (dfafb[l+2][m] - dfafb[l+1][m])*(xi-1); + fforce = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ; - t1 = fafbOxOxSurf[l] + (fafbOxOxSurf[l+1] - fafbOxOxSurf[l])*xi; - t2 = fafbOxOxSurf[l+1] + (fafbOxOxSurf[l+2] - fafbOxOxSurf[l+1])*(xi-1.0); - engSurf = iq*jq*(t1 + (t2 - t1)*xi/2.0); + t1 = fafbOxOxSurf[l] + (fafbOxOxSurf[l+1] - fafbOxOxSurf[l])*xi; + t2 = fafbOxOxSurf[l+1] + (fafbOxOxSurf[l+2] - fafbOxOxSurf[l+1])*(xi-1.0); + engSurf = iq*jq*(t1 + (t2 - t1)*xi/2.0); - t1 = fafbOxOxBB[l] + (fafbOxOxBB[l+1] - fafbOxOxBB[l])*xi; - t2 = fafbOxOxBB[l+1] + (fafbOxOxBB[l+2] - fafbOxOxBB[l+1])*(xi-1.0); - engBB = iq*jq*(t1 + (t2 - t1)*xi/2.0); + t1 = fafbOxOxBB[l] + (fafbOxOxBB[l+1] - fafbOxOxBB[l])*xi; + t2 = fafbOxOxBB[l+1] + (fafbOxOxBB[l+2] - fafbOxOxBB[l+1])*(xi-1.0); + engBB = iq*jq*(t1 + (t2 - t1)*xi/2.0); - t1 = dfafbOxOxSurf[l] + (dfafbOxOxSurf[l+1] - dfafbOxOxSurf[l])*xi; - t2 = dfafbOxOxSurf[l+1] + (dfafbOxOxSurf[l+2] - dfafbOxOxSurf[l+1])*(xi-1); - fforceSurf = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ; + t1 = dfafbOxOxSurf[l] + (dfafbOxOxSurf[l+1] - dfafbOxOxSurf[l])*xi; + t2 = dfafbOxOxSurf[l+1] + (dfafbOxOxSurf[l+2] - dfafbOxOxSurf[l+1])*(xi-1); + fforceSurf = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ; - t1 = dfafbOxOxBB[l] + (dfafbOxOxBB[l+1] - dfafbOxOxBB[l])*xi; - t2 = dfafbOxOxBB[l+1] + (dfafbOxOxBB[l+2] - dfafbOxOxBB[l+1])*(xi-1); - fforceBB = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ; + t1 = dfafbOxOxBB[l] + (dfafbOxOxBB[l+1] - dfafbOxOxBB[l])*xi; + t2 = dfafbOxOxBB[l+1] + (dfafbOxOxBB[l+2] - dfafbOxOxBB[l+1])*(xi-1); + fforceBB = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ; - if (fichierOxOx) { fichierOxOx<< setprecision (9) <(na)*drtrm*ss; + dza=rtrm*dzeta1; + d2zaa=rtrm*d2zeta11; + d2zra=rtrm*d2zeta1r+static_cast(na)*drtrm*dzeta1; + d2gamr2=d2gamr2+0.5*static_cast(na*(na2-1))*d2rtrm*ss + 2.0*static_cast(na)*drtrm*deriv+rtrm*deriv2; -// Sum over 2*nb + // Sum over 2*nb - rtrm=drtrm; - drtrm=d2rtrm; - ztrm=0.5/(zb*float(nb2)); + rtrm=drtrm; + drtrm=d2rtrm; + ztrm=0.5/(zb*static_cast(nb2)); - for (i = nb2; i >= 1; i--) { - rtrm=rtrm*halfr; - drtrm=drtrm*halfr; - ztrm=ztrm*2.0*zb; - ctrm=ztrm/factorial(nb2-i); + for (i = nb2; i >= 1; i--) { + rtrm=rtrm*halfr; + drtrm=drtrm*halfr; + ztrm=ztrm*2.0*zb; + ctrm=ztrm/factorial(static_cast(nb2-i)); - css(ss,na2-1,nb2-i,z2ra,z2rb,r,deriv,dzeta1,dzeta2, - d2zeta11,d2zeta12,d2zeta22,d2zeta1r,d2zeta2r,deriv2); + css(ss,na2-1,nb2-i,z2ra,z2rb,r,deriv,dzeta1,dzeta2, + d2zeta11,d2zeta12,d2zeta22,d2zeta1r,d2zeta2r,deriv2); - trm1=float(i)*ctrm; - trm2=trm1*rtrm; - gam=gam-trm2*ss; - trm3=trm1*float(na2+nb2-i)*drtrm; - dgam=dgam-trm2*deriv-0.5*trm3*ss; - d2gamr2=d2gamr2-trm2*deriv2-trm3*deriv-0.5*trm3*float(na2+nb2-i-1)*ss/r; - dza=dza-trm2*dzeta1; - dzb=dzb-(trm2/zb)*((float(nb2-i))*ss+zb*dzeta2); - d2zaa=d2zaa-trm2*d2zeta11; - d2zab=d2zab-(trm2/zb)*((float(nb2-i))*dzeta1+zb*d2zeta12); - d2zbb=d2zbb-(trm2/zb)*(2.0*(float(nb2-i))*dzeta2+zb*d2zeta22 + - (float((nb2-i-1)*(nb2-i))*ss/zb)); - d2zra=d2zra-trm2*d2zeta1r-0.5*trm3*dzeta1; - d2zrb=d2zrb-(trm2/zb)*((float(nb2-i))*deriv+zb*d2zeta2r) - - 0.5*(trm3/zb)*((float(nb2-i))*ss+zb*dzeta2); - } + trm1=static_cast(i)*ctrm; + trm2=trm1*rtrm; + gam=gam-trm2*ss; + trm3=trm1*static_cast(na2+nb2-i)*drtrm; + dgam=dgam-trm2*deriv-0.5*trm3*ss; + d2gamr2=d2gamr2-trm2*deriv2-trm3*deriv-0.5*trm3*static_cast(na2+nb2-i-1)*ss/r; + dza=dza-trm2*dzeta1; + dzb=dzb-(trm2/zb)*((static_cast(nb2-i))*ss+zb*dzeta2); + d2zaa=d2zaa-trm2*d2zeta11; + d2zab=d2zab-(trm2/zb)*((static_cast(nb2-i))*dzeta1+zb*d2zeta12); + d2zbb=d2zbb-(trm2/zb)*(2.0*(static_cast(nb2-i))*dzeta2+zb*d2zeta22 + + (static_cast((nb2-i-1)*(nb2-i))*ss/zb)); + d2zra=d2zra-trm2*d2zeta1r-0.5*trm3*dzeta1; + d2zrb=d2zrb-(trm2/zb)*((static_cast(nb2-i))*deriv+zb*d2zeta2r) - + 0.5*(trm3/zb)*((static_cast(nb2-i))*ss+zb*dzeta2); + } -// Multiply by coefficients + // Multiply by coefficients - trm3=pow(2.0*za,na2+1)/factorial(na2); - gam=gam*trm3; - dgam=dgam*trm3; - rfct1=((float(na2+1))/za); - rgam1=rfct1*gam; - dza=dza*trm3; - rdza1=2.0*rfct1*dza; - dza=dza+rgam1; - dzb=dzb*trm3; - rgam2=rgam1*float(na2)/za; - d2zaa=d2zaa*trm3+rgam2+rdza1; - d2zab=d2zab*trm3+rfct1*dzb; - d2zbb=d2zbb*trm3; - d2zra=d2zra*trm3+rfct1*dgam; - d2zrb=d2zrb*trm3; - d2gamr2=d2gamr2*trm3; - return; + trm3=powint(2.0*za,na2+1)/factorial(static_cast(na2)); + gam=gam*trm3; + dgam=dgam*trm3; + rfct1=((static_cast(na2+1))/za); + rgam1=rfct1*gam; + dza=dza*trm3; + rdza1=2.0*rfct1*dza; + dza=dza+rgam1; + dzb=dzb*trm3; + rgam2=rgam1*static_cast(na2)/za; + d2zaa=d2zaa*trm3+rgam2+rdza1; + d2zab=d2zab*trm3+rfct1*dzb; + d2zbb=d2zbb*trm3; + d2zra=d2zra*trm3+rfct1*dgam; + d2zrb=d2zrb*trm3; + d2gamr2=d2gamr2*trm3; + return; - } +} /* -------------------------------------------------------------------------------- - Css + Css -------------------------------------------------------------------------------- */ void PairSMTBQ::css(double &s, double nn1, double nn2, double alpha, double beta, double r, double &deriv, double &dzeta1, double &dzeta2, double &d2zeta11, double &d2zeta12, double &d2zeta22, double &d2zeta1r, double &d2zeta2r, double &deriv2) { -// implicit real (a-h,o-z) -// common /fctrl/ fct(30) // A RAJOUTER DANS Pair_SMTBQ.h -/* ------------------------------------------------------------------ - Modified integral calculation routine for Slater orbitals - including derivatives. This version is for S orbitals only. + // implicit real (a-h,o-z) + // common /fctrl/ fct(30) // A RAJOUTER DANS Pair_SMTBQ.h + /* ------------------------------------------------------------------ + Modified integral calculation routine for Slater orbitals + including derivatives. This version is for S orbitals only. - dzeta1 and dzeta2 are the first derivatives with respect to zetas - and d2zeta11/d2zeta12/d2zeta22 are the second. - d2zeta1r and d2zeta2r are the mixed zeta/r second derivatives - deriv2 is the second derivative with respect to r + dzeta1 and dzeta2 are the first derivatives with respect to zetas + and d2zeta11/d2zeta12/d2zeta22 are the second. + d2zeta1r and d2zeta2r are the mixed zeta/r second derivatives + deriv2 is the second derivative with respect to r - Julian Gale, Imperial College, December 1997 - ------------------------------------------------------------------- */ + Julian Gale, Imperial College, December 1997 + ------------------------------------------------------------------- */ int i,i1,nni1; //ulim double ulim,n1,n2,p,pt,x,k,dpdz1,dpdz2,dptdz1,dptdz2,dpdr,dptdr,d2pdz1r, - d2pdz2r,d2ptdz1r,d2ptdz2r,zeta1,zeta2,sumzeta,difzeta,coff; + d2pdz2r,d2ptdz1r,d2ptdz2r,zeta1,zeta2,sumzeta,difzeta,coff; double da1[30],da2[30],db1[30],db2[30]; double d2a11[30],d2a12[30],d2a22[30],dar[30]; @@ -3956,163 +3937,163 @@ void PairSMTBQ::css(double &s, double nn1, double nn2, double alpha, double beta memory->create(b,31,"pair:a"); -// Set up factorials - stored as factorial(n) in location(n+1) + // Set up factorials - stored as factorial(n) in location(n+1) - for (i = 1; i <= 30; i++) { - fct[i]=factorial(i-1); - } - dzeta1=0.0; - dzeta2=0.0; - d2zeta11=0.0; - d2zeta12=0.0; - d2zeta22=0.0; - d2zeta1r=0.0; - d2zeta2r=0.0; - deriv=0.0; - deriv2=0.0; - n1=nn1; - n2=nn2; - p =(alpha + beta)*0.5; - pt=(alpha - beta)*0.5; - x = 0.0; - zeta1=alpha/r; - zeta2=beta/r; - sumzeta=zeta1+zeta2; - difzeta=zeta1-zeta2; + for (i = 1; i <= 30; i++) { + fct[i]=factorial(i-1); + } + dzeta1=0.0; + dzeta2=0.0; + d2zeta11=0.0; + d2zeta12=0.0; + d2zeta22=0.0; + d2zeta1r=0.0; + d2zeta2r=0.0; + deriv=0.0; + deriv2=0.0; + n1=nn1; + n2=nn2; + p =(alpha + beta)*0.5; + pt=(alpha - beta)*0.5; + x = 0.0; + zeta1=alpha/r; + zeta2=beta/r; + sumzeta=zeta1+zeta2; + difzeta=zeta1-zeta2; -// Partial derivative terms for zeta derivatives + // Partial derivative terms for zeta derivatives - dpdz1=r; - dpdz2=r; - dptdz1=r; - dptdz2=-r; - dpdr=0.5*sumzeta; - dptdr=0.5*difzeta; - d2pdz1r=1.0; - d2pdz2r=1.0; - d2ptdz1r=1.0; - d2ptdz2r=-1.0; + dpdz1=r; + dpdz2=r; + dptdz1=r; + dptdz2=-r; + dpdr=0.5*sumzeta; + dptdr=0.5*difzeta; + d2pdz1r=1.0; + d2pdz2r=1.0; + d2ptdz1r=1.0; + d2ptdz2r=-1.0; -// Reverse quantum numbers if necessary - -// also change the sign of difzeta to match -// change in sign of pt + // Reverse quantum numbers if necessary - + // also change the sign of difzeta to match + // change in sign of pt - if (n2 < n1) { - k = n1; - n1= n2; - n2= k; - pt=-pt; - difzeta=-difzeta; - dptdr=-dptdr; - dptdz1=-dptdz1; - dptdz2=-dptdz2; - d2ptdz1r=-d2ptdz1r; - d2ptdz2r=-d2ptdz2r; - } + if (n2 < n1) { + k = n1; + n1= n2; + n2= k; + pt=-pt; + difzeta=-difzeta; + dptdr=-dptdr; + dptdz1=-dptdz1; + dptdz2=-dptdz2; + d2ptdz1r=-d2ptdz1r; + d2ptdz2r=-d2ptdz2r; + } -// Trap for enormously long distances which would cause -// caintgs or cbintgs to crash with an overflow + // Trap for enormously long distances which would cause + // caintgs or cbintgs to crash with an overflow - if (p > 86.0 || pt > 86.0) { - s=0.0; - return; - } -//*************************** -// Find a and b integrals * -//*************************** - caintgs(p,n1+n2+3,a); - cbintgs(pt,n1+n2+3,b); + if (p > 86.0 || pt > 86.0) { + s=0.0; + return; + } + //*************************** + // Find a and b integrals * + //*************************** + caintgs(p,n1+n2+3,a); + cbintgs(pt,n1+n2+3,b); -// Convert derivatives with respect to p and pt -// into derivatives with respect to zeta1 and -// zeta2 + // Convert derivatives with respect to p and pt + // into derivatives with respect to zeta1 and + // zeta2 - ulim=n1+n2+1; - for (i = 1; i <= int(ulim); i++) { - da1[i]=-a[i+1]*dpdz1; - da2[i]=-a[i+1]*dpdz2; - db1[i]=-b[i+1]*dptdz1; - db2[i]=-b[i+1]*dptdz2; - d2a11[i]=a[i+2]*dpdz1*dpdz1; - d2a12[i]=a[i+2]*dpdz1*dpdz2; - d2a22[i]=a[i+2]*dpdz2*dpdz2; - d2b11[i]=b[i+2]*dptdz1*dptdz1; - d2b12[i]=b[i+2]*dptdz1*dptdz2; - d2b22[i]=b[i+2]*dptdz2*dptdz2; - dar[i]=-a[i+1]*dpdr; - dbr[i]=-b[i+1]*dptdr; - d2a1r[i]=a[i+2]*dpdz1*dpdr-a[i+1]*d2pdz1r; - d2a2r[i]=a[i+2]*dpdz2*dpdr-a[i+1]*d2pdz2r; - d2b1r[i]=b[i+2]*dptdz1*dptdr-b[i+1]*d2ptdz1r; - d2b2r[i]=b[i+2]*dptdz2*dptdr-b[i+1]*d2ptdz2r; - d2ar2[i]=a[i+2]*dpdr*dpdr; - d2br2[i]=b[i+2]*dptdr*dptdr; - } + ulim=n1+n2+1; + for (i = 1; i <= int(ulim); i++) { + da1[i]=-a[i+1]*dpdz1; + da2[i]=-a[i+1]*dpdz2; + db1[i]=-b[i+1]*dptdz1; + db2[i]=-b[i+1]*dptdz2; + d2a11[i]=a[i+2]*dpdz1*dpdz1; + d2a12[i]=a[i+2]*dpdz1*dpdz2; + d2a22[i]=a[i+2]*dpdz2*dpdz2; + d2b11[i]=b[i+2]*dptdz1*dptdz1; + d2b12[i]=b[i+2]*dptdz1*dptdz2; + d2b22[i]=b[i+2]*dptdz2*dptdz2; + dar[i]=-a[i+1]*dpdr; + dbr[i]=-b[i+1]*dptdr; + d2a1r[i]=a[i+2]*dpdz1*dpdr-a[i+1]*d2pdz1r; + d2a2r[i]=a[i+2]*dpdz2*dpdr-a[i+1]*d2pdz2r; + d2b1r[i]=b[i+2]*dptdz1*dptdr-b[i+1]*d2ptdz1r; + d2b2r[i]=b[i+2]*dptdz2*dptdr-b[i+1]*d2ptdz2r; + d2ar2[i]=a[i+2]*dpdr*dpdr; + d2br2[i]=b[i+2]*dptdr*dptdr; + } -// Begin section used for overlap integrals involving s functions + // Begin section used for overlap integrals involving s functions - for (i1 = 1; i1 <= int(ulim); i1++) { - nni1=n1+n2-i1+2; - coff=coeffs(n1,n2,i1-1); - deriv=deriv+coff*(dar[i1]*b[nni1]+a[i1]*dbr[nni1]); - x=x+coff*a[i1]*b[nni1]; - dzeta1=dzeta1+coff*(da1[i1]*b[nni1]+a[i1]*db1[nni1]); - dzeta2=dzeta2+coff*(da2[i1]*b[nni1]+a[i1]*db2[nni1]); - d2zeta11=d2zeta11+coff*(d2a11[i1]*b[nni1]+a[i1]*d2b11[nni1]+ - 2.0*da1[i1]*db1[nni1]); - d2zeta12=d2zeta12+coff*(d2a12[i1]*b[nni1]+a[i1]*d2b12[nni1]+ - da1[i1]*db2[nni1]+da2[i1]*db1[nni1]); - d2zeta22=d2zeta22+coff*(d2a22[i1]*b[nni1]+a[i1]*d2b22[nni1]+ - 2.0*da2[i1]*db2[nni1]); - d2zeta1r=d2zeta1r+coff*(d2a1r[i1]*b[nni1]+dar[i1]*db1[nni1]+ - da1[i1]*dbr[nni1]+a[i1]*d2b1r[nni1]); - d2zeta2r=d2zeta2r+coff*(d2a2r[i1]*b[nni1]+dar[i1]*db2[nni1]+ - da2[i1]*dbr[nni1]+a[i1]*d2b2r[nni1]); - deriv2=deriv2+coff*(d2ar2[i1]*b[nni1]+a[i1]*d2br2[nni1]+ - 2.0*dar[i1]*dbr[nni1]); - } - s=x*0.5; - deriv=0.5*deriv; - deriv2=0.5*deriv2; - dzeta1=0.5*dzeta1; - dzeta2=0.5*dzeta2; - d2zeta11=0.5*d2zeta11; - d2zeta12=0.5*d2zeta12; - d2zeta22=0.5*d2zeta22; - d2zeta1r=0.5*d2zeta1r; - d2zeta2r=0.5*d2zeta2r; + for (i1 = 1; i1 <= int(ulim); i1++) { + nni1=n1+n2-i1+2; + coff=coeffs(n1,n2,i1-1); + deriv=deriv+coff*(dar[i1]*b[nni1]+a[i1]*dbr[nni1]); + x=x+coff*a[i1]*b[nni1]; + dzeta1=dzeta1+coff*(da1[i1]*b[nni1]+a[i1]*db1[nni1]); + dzeta2=dzeta2+coff*(da2[i1]*b[nni1]+a[i1]*db2[nni1]); + d2zeta11=d2zeta11+coff*(d2a11[i1]*b[nni1]+a[i1]*d2b11[nni1]+ + 2.0*da1[i1]*db1[nni1]); + d2zeta12=d2zeta12+coff*(d2a12[i1]*b[nni1]+a[i1]*d2b12[nni1]+ + da1[i1]*db2[nni1]+da2[i1]*db1[nni1]); + d2zeta22=d2zeta22+coff*(d2a22[i1]*b[nni1]+a[i1]*d2b22[nni1]+ + 2.0*da2[i1]*db2[nni1]); + d2zeta1r=d2zeta1r+coff*(d2a1r[i1]*b[nni1]+dar[i1]*db1[nni1]+ + da1[i1]*dbr[nni1]+a[i1]*d2b1r[nni1]); + d2zeta2r=d2zeta2r+coff*(d2a2r[i1]*b[nni1]+dar[i1]*db2[nni1]+ + da2[i1]*dbr[nni1]+a[i1]*d2b2r[nni1]); + deriv2=deriv2+coff*(d2ar2[i1]*b[nni1]+a[i1]*d2br2[nni1]+ + 2.0*dar[i1]*dbr[nni1]); + } + s=x*0.5; + deriv=0.5*deriv; + deriv2=0.5*deriv2; + dzeta1=0.5*dzeta1; + dzeta2=0.5*dzeta2; + d2zeta11=0.5*d2zeta11; + d2zeta12=0.5*d2zeta12; + d2zeta22=0.5*d2zeta22; + d2zeta1r=0.5*d2zeta1r; + d2zeta2r=0.5*d2zeta2r; - memory->destroy(a); - memory->destroy(b); + memory->destroy(a); + memory->destroy(b); - return; + return; } /* ------------------------------------------------------------------------------- - coeffs + coeffs ------------------------------------------------------------------------------- */ - double PairSMTBQ::coeffs(int na, int nb, int k) - { - // implicit real (a-h,o-z) - // common /fctrl/ fct(30) +double PairSMTBQ::coeffs(int na, int nb, int k) +{ + // implicit real (a-h,o-z) + // common /fctrl/ fct(30) - int il,lie,je,ia,i,j,ie,l; - double coeffs; + int il,je,ia,i,j,ie,l; + double coeffs; -// Statement function -// binm(n,i)=fct(n+1)/(fct(n-i+1)*fct(i+1)); + // Statement function + // binm(n,i)=fct(n+1)/(fct(n-i+1)*fct(i+1)); - coeffs=0.0; - l=na+nb-k; - ie=min(l,na)+1; - je=min(l,nb); - ia=l-je+1; - for (il = ia; il <= ie; il++) { - i=il-1; - j=l-i; // D'ou vient le i - coeffs=coeffs + binm(na,i)*binm(nb,j)*pow(-1.,j); - } - return coeffs; - } + coeffs=0.0; + l=na+nb-k; + ie=min(l,na)+1; + je=min(l,nb); + ia=l-je+1; + for (il = ia; il <= ie; il++) { + i=il-1; + j=l-i; // D'ou vient le i + coeffs=coeffs + binm(na,i)*binm(nb,j)*powint(-1.,j); + } + return coeffs; +} // ============================================ @@ -4122,120 +4103,96 @@ double PairSMTBQ::binm(int n, int i) } /* --------------------------------------------------------------------------------- - Caintgs + Caintgs -------------------------------------------------------------------------------- */ - void PairSMTBQ::caintgs (double x, int k, double *a) - { -// implicit real (a-h,o-z) -// dimension a(30) - int i; - double cste,rx; +void PairSMTBQ::caintgs (double x, int k, double *a) +{ + // implicit real (a-h,o-z) + // dimension a(30) + int i; + double cste,rx; - cste=exp(-x); - rx=1.0/x; - a[1]=cste*rx; - for (i = 1; i <= k; i++) { - a[i+1]=(a[i]*float(i)+cste)*rx; - } - return; - } + cste=exp(-x); + rx=1.0/x; + a[1]=cste*rx; + for (i = 1; i <= k; i++) { + a[i+1]=(a[i]*static_cast(i)+cste)*rx; + } + return; +} /* ----------------------------------------------------------------------------------- - Cbintgs + Cbintgs ----------------------------------------------------------------------------------- */ void PairSMTBQ::cbintgs( double x, int k, double *b) { -// implicit real (a-h,o-z) -/* ******************************************************************* -! Fills array of b-integrals. note that b(i) is b(i-1) in the -! usual notation -! for x.gt.3 exponential formula is used -! for 2.lt.x.le.3 and k.le.10 exponential formula is used -! for 2.lt.x.le.3 and k.gt.10 15 term series is used -! for 1.lt.x .e.2 and k.le.7 exponential formula is used -! for 1.lt.x.le.2 and k.gt.7 12 term series is used -! for .5.lt.x.le.1 and k.le.5 exponential formula is used -! for .5.lt.x.le.1 and k.gt.5 7 term series is used -! for x.le..5 6 term series is used -!******************************************************************* */ -// dimension b(30) -// common /fctrl/ fct(30) + // implicit real (a-h,o-z) + /* ******************************************************************* + ! Fills array of b-integrals. note that b(i) is b(i-1) in the + ! usual notation + ! for x.gt.3 exponential formula is used + ! for 2.lt.x.le.3 and k.le.10 exponential formula is used + ! for 2.lt.x.le.3 and k.gt.10 15 term series is used + ! for 1.lt.x .e.2 and k.le.7 exponential formula is used + ! for 1.lt.x.le.2 and k.gt.7 12 term series is used + ! for .5.lt.x.le.1 and k.le.5 exponential formula is used + ! for .5.lt.x.le.1 and k.gt.5 7 term series is used + ! for x.le..5 6 term series is used + !******************************************************************* */ + // dimension b(30) + // common /fctrl/ fct(30) - int i0,m,last,i; - double absx,expx,expmx,ytrm,y,rx; + int i0,m,last,i; + double absx,expx,expmx,ytrm,y,rx; - i0=0; - absx=fabs(x); + i0=0; + absx=fabs(x); - if (absx > 3.0) goto g120; - if (absx > 2.0) goto g20; - if (absx > 1.0) goto g50; - if (absx > 0.5) goto g80; - if (absx > 1.0e-8) goto g110; - goto g170; - g110: last=6; - goto g140; - g80: if (k <= 5) goto g120; - last=7; - goto g140; - g50: if (k <= 7) goto g120; - last=12; - goto g140; - g20: if (k <= 10) goto g120; - last=15; - goto g140; + if (absx > 3.0) goto g120; + if (absx > 2.0) goto g20; + if (absx > 1.0) goto g50; + if (absx > 0.5) goto g80; + if (absx > 1.0e-8) goto g110; + goto g170; + g110: last=6; + goto g140; + g80: if (k <= 5) goto g120; + last=7; + goto g140; + g50: if (k <= 7) goto g120; + last=12; + goto g140; + g20: if (k <= 10) goto g120; + last=15; + goto g140; - g120: expx=exp(x); - expmx=1./expx; - rx=1.0/x; - b[1]=(expx-expmx)*rx; - for (i = 1; i <= k ; i++) { - b[i+1]=(float(i)*b[i]+ pow(-1.0,i)*expx-expmx)*rx; - } - goto g190; -// -// Series to calculate b(i) -// - g140: for (i = i0; i <= k ; i++) { - y=0.; - for (m = i0; m <= last; m++) { - ytrm = pow(-x,m-1)*(1. - pow(-1.,m+i+1))/(fct[m+1]*float(m+i+1)); - y = y + ytrm*(-x); - } - b[i+1] = y; - } - goto g190; -// -// x extremely small -// - g170: for (i = i0; i <= k; i++) { - b[i+1] = (1.-pow(-1.,i+1))/float(i+1); - } - g190: - return; - } -/* ------------------------------------------------------------------------------------ - Factorial - ------------------------------------------------------------------------------------ */ -double PairSMTBQ::factorial(double n) -{ -// implicit real(a-h,o-z) - double rn,factorial; - int i; - -// -// Calculates the factorial of an integer n -// - rn = n; - if (n <= 1.) { - factorial=1.0; - return factorial; - } - factorial=1.0; - for (i = 2; i <= int(n); i++) { - factorial = factorial*float(i); - } - return factorial; + g120: expx=exp(x); + expmx=1./expx; + rx=1.0/x; + b[1]=(expx-expmx)*rx; + for (i = 1; i <= k ; i++) { + b[i+1]=(static_cast(i)*b[i]+ powint(-1.0,i)*expx-expmx)*rx; + } + goto g190; + // + // Series to calculate b(i) + // + g140: for (i = i0; i <= k ; i++) { + y=0.; + for (m = i0; m <= last; m++) { + ytrm = powint(-x,m-1)*(1. - powint(-1.,m+i+1))/(fct[m+1]*static_cast(m+i+1)); + y = y + ytrm*(-x); + } + b[i+1] = y; + } + goto g190; + // + // x extremely small + // + g170: for (i = i0; i <= k; i++) { + b[i+1] = (1.-powint(-1.,i+1))/static_cast(i+1); + } + g190: + return; } - /* ============================== This is the END... ================================== */ diff --git a/src/USER-SMTBQ/pair_smtbq.h b/src/USER-SMTBQ/pair_smtbq.h index 2a1dc3bb8a..49fbe8768b 100644 --- a/src/USER-SMTBQ/pair_smtbq.h +++ b/src/USER-SMTBQ/pair_smtbq.h @@ -1,197 +1,195 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifdef PAIR_CLASS - -PairStyle(smtbq,PairSMTBQ) - -#else - -#ifndef LMP_PAIR_SMTBQ_H -#define LMP_PAIR_SMTBQ_H - -#include "pair.h" - -namespace LAMMPS_NS { - -class PairSMTBQ : public Pair { - public: - PairSMTBQ(class LAMMPS *); - virtual ~PairSMTBQ(); - virtual void compute(int, int); - - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - double memory_usage(); - - -protected: - struct Param { - double sto,n0,ne,chi,dj; - double R,dzeta; //Rayon slater - double cutsq; - double qform, masse; // Charge formelle - char *nom; - }; - - struct Intparam { - double a,p,ksi,q,r0,dc1,dc2; - double abuck,rhobuck,neig_cut,aOO,bOO,r1OO,r2OO; - char *typepot,*mode; - int intsm; - }; - - double rmin,dr,ds; // table parameter - int kmax; - int Qstep; // Frenquence of charge resolution - double precision; // acurate of convergence - int loopmax; // max of interation - - double cutmax; // max cutoff for all elements - int nelements; // # of unique elements - char **elements; // names of unique elements - char *QEqMode; // name of QEqMode - char *Bavard; // Verbose parameter - char *writepot; // write or not the electronegativity component - char *writeenerg; // write or not the energy component - char *QInitMode; // mode of initialization of charges - double zlim1QEq; // z limit for QEq equilibration - double zlim2QEq; // z limit for QEq equilibration - double QOxInit; // Initial charge for oxygen atoms (if the charge is not specified) - int *map; // mapping from atom types to elements - int nparams; // # of stored parameter sets - int maxparam; // max # of parameter sets - int maxintparam; // max # of interaction sets - int maxintsm; // max # of interaction SM - double r1Coord,r2Coord; - Param *params; // parameter set for an I atom - Intparam *intparams; // parameter set for an I interaction - - int nmax,*nQEqall,*nQEqaall,*nQEqcall; - double *qf,*q1,*q2,Nevery,Neverypot; - -// Coulombian interaction - double *esm, **fafb, **dfafb, *fafbOxOxSurf, *dfafbOxOxSurf, *fafbTiOxSurf,*dfafbTiOxSurf; - double *potqn, *dpotqn, Vself, *Zsm,*coord, *fafbOxOxBB, *dfafbOxOxBB,*fafbTiOxBB, *dfafbTiOxBB ; - int **intype, **coultype; - int *NCo; - double coordOxBulk,coordOxSurf,ROxSurf,coordOxBB,ROxBB; - -// Covalent interaction - double *ecov, *potmad, *potself, *potcov, *chimet; - double **tabsmb,**dtabsmb, **tabsmr, **dtabsmr, *sbcov, *sbmet; - double ncov; - -// Neighbor Table - int nteam,cluster,*hybrid; - int *nvsm, **vsm, *flag_QEq; - -// Parallelisation - int me, nproc; - double *tab_comm; - -// GAMMAS function - double *fct; - -// HERE its routines -// ===================================== - void allocate(); - virtual void read_file(char *); - - void tabsm(); - void tabqeq(); - - void potqeq(int, int, double, double, double, - double &, int, double &); - void pot_ES (int, int, double, double &); - void pot_ES2 (int, int, double, double &); - - double self(Param *, double); - double qfo_self(Param *, double); - - virtual void repulsive(Intparam *, double, int, int, double &, int, double &); - virtual void rep_OO (Intparam *, double, double &, int, double &); - virtual void Attr_OO (Intparam *, double, double &, int, double &); - virtual void attractive(Intparam *, double, int, int, double, int, double ); - void f_att(Intparam *, int, int, double, double &) ; - void pot_COV(Param *, int, double &); - double potmet(Intparam *, double, int, double, int, double); - - double fcoupure(double, double, double); - double fcoupured(double, double, double); - - double fcoup2(double, double, double); - double Intfcoup2(double, double, double); - double Primfcoup2(double, double, double); - - void groupBulkFromSlab_QEq(); - void groupQEqAllParallel_QEq(); - void groupQEqAll_QEq(); - void groupSurface_QEq(); - void QForce_charge(int); - void Charge(); - void Init_charge(int*, int*, int*); - void CheckEnergyVSForce(); - -// =========================================== -// Communication pack - int pack_forward_comm (int, int*, double*, int, int*); - void unpack_forward_comm (int, int, double*); - int pack_reverse_comm (int, int, double*); - void unpack_reverse_comm (int, int*, double*); - void forward (double*); void reverse (double*); - void forward_int (int*); void reverse_int (int*); - - int Tokenize( char* , char*** ); - - inline double vec3_dot(const double x[3], const double y[3]) const { - return x[0]*y[0] + x[1]*y[1] + x[2]*y[2]; - } - - template const T& min ( const T& a, const T& b ) { - return !(b const T& min ( const T& a, const T& b ) { + return !(b Date: Mon, 11 Jan 2016 17:58:37 +0000 Subject: [PATCH 02/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14410 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- examples/USER/smtbq/log.smtbq.Al.g++.1 | 280 ++++++++++++++++++++++ examples/USER/smtbq/log.smtbq.Al.g++.4 | 278 +++++++++++++++++++++ examples/USER/smtbq/log.smtbq.Al2O3.g++.1 | 210 ++++++++++++++++ examples/USER/smtbq/log.smtbq.Al2O3.g++.4 | 210 ++++++++++++++++ examples/USER/smtbq/log.smtbq.TiO2.g++.1 | 255 ++++++++++++++++++++ examples/USER/smtbq/log.smtbq.TiO2.g++.4 | 256 ++++++++++++++++++++ 6 files changed, 1489 insertions(+) create mode 100644 examples/USER/smtbq/log.smtbq.Al.g++.1 create mode 100644 examples/USER/smtbq/log.smtbq.Al.g++.4 create mode 100644 examples/USER/smtbq/log.smtbq.Al2O3.g++.1 create mode 100644 examples/USER/smtbq/log.smtbq.Al2O3.g++.4 create mode 100644 examples/USER/smtbq/log.smtbq.TiO2.g++.1 create mode 100644 examples/USER/smtbq/log.smtbq.TiO2.g++.4 diff --git a/examples/USER/smtbq/log.smtbq.Al.g++.1 b/examples/USER/smtbq/log.smtbq.Al.g++.1 new file mode 100644 index 0000000000..11cecd89f1 --- /dev/null +++ b/examples/USER/smtbq/log.smtbq.Al.g++.1 @@ -0,0 +1,280 @@ +LAMMPS (24 Dec 2015) +# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants + +variable T_depart equal 300 +variable dt equal 0.0002 + +#Constante +variable rac3 equal sqrt(3.0) +variable rac1_2 equal sqrt(0.5) +variable rac3_2 equal sqrt(1.5) + +#Structure +variable a equal 4.05 + +variable nx equal 10 +variable ny equal 7 +variable nz equal 4 + +variable bx equal ${a}*${nx}*${rac1_2} +variable bx equal 4.05*${nx}*${rac1_2} +variable bx equal 4.05*10*${rac1_2} +variable bx equal 4.05*10*0.707106781186548 +variable by equal ${a}*${ny}*${rac3_2} +variable by equal 4.05*${ny}*${rac3_2} +variable by equal 4.05*7*${rac3_2} +variable by equal 4.05*7*1.22474487139159 +variable bz equal ${a}*${nz}*${rac3} +variable bz equal 4.05*${nz}*${rac3} +variable bz equal 4.05*4*${rac3} +variable bz equal 4.05*4*1.73205080756888 +# ======================================================================= + +units metal +atom_style charge +dimension 3 +boundary p p p + + +lattice sc 1.0 +Lattice spacing in x,y,z = 1 1 1 +region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 28.6378246380552 0 ${by} 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 28.0592230826159 0.0 0.0 0.0 +create_box 1 box_vide +Created triclinic box = (0 0 0) to (28.6378 34.7215 28.0592) with tilt (0 0 0) + 1 by 1 by 1 MPI processor grid + +# Aluminium atoms z = [111] +lattice custom ${a} a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +lattice custom 4.05 a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 1.73205080756888 basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +Lattice spacing in x,y,z = 2.86378 4.96022 7.01481 + +create_atoms 1 region box_vide +Created 1680 atoms + +mass 1 26.98 + +velocity all create ${T_depart} 277387 +velocity all create 300 277387 + +pair_style smtbq +pair_coeff * * ffield.smtbq.Al Al +Reading potential file ffield.smtbq.Al with DATE: 2015-10-22 + +neighbor 0.5 bin +neigh_modify every 20 delay 0 check yes + +timestep ${dt} +timestep 0.0002 + +thermo_style custom step temp press pe ke etotal lx ly lz vol +thermo_modify flush yes +thermo 1 + + +#dump 5 all custom 1 box_Al.lammpstrj id type q x y z + +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 6 5 +Memory usage per processor = 4.52298 Mbytes +Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume + 0 300 729.26605 -5600.8541 65.108335 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 1 299.98323 729.90439 -5600.8505 65.104695 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 2 299.93288 731.82072 -5600.8395 65.093767 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 3 299.84896 735.01448 -5600.8213 65.075556 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 4 299.7315 739.48472 -5600.7958 65.050064 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 5 299.58053 745.23012 -5600.7631 65.017299 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 6 299.39609 752.24896 -5600.723 64.977269 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 7 299.17822 760.5391 -5600.6757 64.929985 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 8 298.92698 770.098 -5600.6212 64.875459 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 9 298.64244 780.92261 -5600.5595 64.813707 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 10 298.32468 793.00943 -5600.4905 64.744743 -5535.7458 28.637825 34.721517 28.059223 27900.653 +Loop time of 5.10475 on 1 procs for 10 steps with 1680 atoms + +Performance: 0.034 ns/day, 708.993 hours/ns, 1.959 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 5.1037 | 5.1037 | 5.1037 | 0.0 | 99.98 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00044179 | 0.00044179 | 0.00044179 | 0.0 | 0.01 +Output | 0.00024772 | 0.00024772 | 0.00024772 | 0.0 | 0.00 +Modify | 0.00026011 | 0.00026011 | 0.00026011 | 0.0 | 0.01 +Other | | 0.0001063 | | | 0.00 + +Nlocal: 1680 ave 1680 max 1680 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 7518 ave 7518 max 7518 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 638400 ave 638400 max 638400 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 638400 +Ave neighs/atom = 380 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 3 +#thermo 15 +fix 1 all box/relax tri 0.0 vmax 0.001 +minimize 1.0e-8 1.0e-10 1000 10000 +WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) +Neighbor list info ... + 1 neighbor list requests + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 6 5 +Memory usage per processor = 5.64798 Mbytes +Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume + 10 298.32468 793.00943 -5600.4905 64.744743 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 11 298.32468 2483.3228 -5600.5212 64.744743 -5535.7764 28.617938 34.697425 28.039771 27842.617 + 12 298.32468 3102.6624 -5600.6242 64.744743 -5535.8795 28.594201 34.68783 28.048729 27820.715 + 13 298.32468 1681.0688 -5600.6477 64.744743 -5535.903 28.619779 34.708131 28.055945 27869.065 + 14 298.32468 949.90841 -5600.6635 64.744743 -5535.9187 28.648416 34.718691 28.044409 27893.966 + 15 298.32468 2009.1662 -5600.7072 64.744743 -5535.9625 28.652241 34.703261 28.01635 27857.391 + 16 298.32468 2867.1434 -5600.7192 64.744743 -5535.9744 28.626861 34.69005 28.022309 27828.038 + 17 298.32468 2480.3207 -5600.7238 64.744743 -5535.9791 28.618046 34.695106 28.040113 27841.2 + 18 298.32468 2482.4906 -5600.7249 64.744743 -5535.9802 28.614169 34.704237 28.036452 27841.119 + 19 298.32468 2495.6209 -5600.7261 64.744743 -5535.9813 28.616207 34.697481 28.039453 27840.662 + 20 298.32468 2210.2897 -5600.7271 64.744743 -5535.9823 28.620852 34.699678 28.042926 27850.393 + 21 298.32468 2464.137 -5600.734 64.744743 -5535.9893 28.625239 34.687085 28.040022 27841.67 + 22 298.32468 3091.7034 -5600.7471 64.744743 -5536.0024 28.623565 34.674943 28.02983 27820.181 + 23 298.32468 2334.9443 -5600.7598 64.744743 -5536.0151 28.634413 34.684598 28.037298 27845.891 + 24 298.32468 2462.2836 -5600.7767 64.744743 -5536.032 28.615834 34.692433 28.044664 27841.422 + 25 298.32468 2652.08 -5600.7914 64.744743 -5536.0466 28.61528 34.695645 28.035991 27834.85 + 26 298.32468 2365.4126 -5600.7923 64.744743 -5536.0476 28.618526 34.699347 28.039662 27844.623 + 27 298.32468 2334.9429 -5600.7934 64.744743 -5536.0486 28.61826 34.698136 28.041941 27845.656 + 28 298.32468 2501.1598 -5600.7937 64.744743 -5536.0489 28.616356 34.695993 28.039825 27839.982 + 29 298.32468 2506.0962 -5600.794 64.744743 -5536.0493 28.617255 34.699031 28.036317 27839.811 + 30 298.32468 2400.7588 -5600.7942 64.744743 -5536.0495 28.618372 34.698464 28.039299 27843.404 + 31 298.32468 2499.8528 -5600.7945 64.744743 -5536.0497 28.61702 34.69385 28.040945 27840.021 + 32 298.32468 2629.5393 -5600.7967 64.744743 -5536.0519 28.619399 34.691546 28.036003 27835.58 + 33 298.32468 2397.5939 -5600.7973 64.744743 -5536.0526 28.621863 34.69535 28.03848 27843.488 + 34 298.32468 2222.7714 -5600.8007 64.744743 -5536.056 28.609815 34.705091 28.048395 27849.426 + 35 298.32468 2748.5871 -5600.8042 64.744743 -5536.0594 28.600322 34.6998 28.043876 27831.457 + 36 298.32468 2661.1018 -5600.8166 64.744743 -5536.0719 28.615123 34.696499 28.034947 27834.344 + 37 298.32468 2255.4994 -5600.8185 64.744743 -5536.0737 28.618919 34.702261 28.040497 27848.173 + 38 298.32468 2260.815 -5600.8239 64.744743 -5536.0791 28.614993 34.70246 28.043972 27847.962 + 39 298.32468 2549.2876 -5600.8248 64.744743 -5536.0801 28.612892 34.697988 28.039725 27838.113 + 40 298.32468 2488.3825 -5600.8266 64.744743 -5536.0819 28.623347 34.695524 28.033557 27840.182 + 41 298.32468 2400.9714 -5600.8283 64.744743 -5536.0835 28.619176 34.695733 28.040468 27843.155 + 42 298.32468 2496.6566 -5600.8284 64.744743 -5536.0837 28.617629 34.694692 28.039536 27839.89 + 43 298.32468 2486.2773 -5600.8285 64.744743 -5536.0838 28.617585 34.697413 28.037736 27840.243 + 44 298.32468 2446.3916 -5600.8287 64.744743 -5536.0839 28.617115 34.696389 28.040393 27841.603 + 45 298.32468 2547.2311 -5600.8288 64.744743 -5536.0841 28.615267 34.694882 28.039956 27838.161 + 46 298.32468 2479.9982 -5600.8321 64.744743 -5536.0874 28.603008 34.71581 28.037344 27840.427 + 47 298.32468 2449.645 -5600.8444 64.744743 -5536.0997 28.612743 34.683541 28.054837 27841.375 + 48 298.32468 2682.7109 -5600.8695 64.744743 -5536.1248 28.617414 34.683477 28.042139 27833.265 + 49 298.32468 2350.1707 -5600.8711 64.744743 -5536.1263 28.619236 34.694213 28.043092 27844.6 + 50 298.32468 2486.1481 -5600.8719 64.744743 -5536.1271 28.615167 34.699435 28.038181 27839.955 + 51 298.32468 2498.3384 -5600.8721 64.744743 -5536.1274 28.616069 34.696071 28.039596 27839.537 + 52 298.32468 2443.1247 -5600.8722 64.744743 -5536.1274 28.617616 34.696737 28.039439 27841.421 +Loop time of 36.8807 on 1 procs for 42 steps with 1680 atoms + +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = energy tolerance + Energy initial, next-to-last, final = + -5600.49050006 -5600.87213771 -5600.87218615 + Force two-norm initial, final = 50.879 1.39888 + Force max component initial, final = 29.3783 0.749036 + Final line search alpha, max atom move = 0.0013373 0.00100168 + Iterations, force evaluations = 42 71 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 36.86 | 36.86 | 36.86 | 0.0 | 99.95 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0032628 | 0.0032628 | 0.0032628 | 0.0 | 0.01 +Output | 0.001102 | 0.001102 | 0.001102 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.0159 | | | 0.04 + +Nlocal: 1680 ave 1680 max 1680 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 7518 ave 7518 max 7518 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 638400 ave 638400 max 638400 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 638400 +Ave neighs/atom = 380 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 1 +thermo 1 +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 6 5 +Memory usage per processor = 4.52298 Mbytes +Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume + 52 298.32468 2443.1247 -5600.8722 64.744743 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 53 298.28341 2444.4342 -5600.8632 64.735788 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 54 298.20852 2447.019 -5600.847 64.719534 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 55 298.1 2450.8786 -5600.8234 64.695982 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 56 297.95788 2456.0119 -5600.7926 64.665139 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 57 297.7822 2462.4173 -5600.7545 64.62701 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 58 297.57298 2470.0928 -5600.709 64.581604 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 59 297.33028 2479.0363 -5600.6564 64.528932 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 60 297.05416 2489.245 -5600.5964 64.469006 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 61 296.74469 2500.7159 -5600.5293 64.401842 -5536.1274 28.617616 34.696737 28.039439 27841.421 + 62 296.40194 2513.4457 -5600.4549 64.327455 -5536.1274 28.617616 34.696737 28.039439 27841.421 +Loop time of 5.13584 on 1 procs for 10 steps with 1680 atoms + +Performance: 0.034 ns/day, 713.311 hours/ns, 1.947 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 5.1346 | 5.1346 | 5.1346 | 0.0 | 99.98 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00047112 | 0.00047112 | 0.00047112 | 0.0 | 0.01 +Output | 0.00036144 | 0.00036144 | 0.00036144 | 0.0 | 0.01 +Modify | 0.00029016 | 0.00029016 | 0.00029016 | 0.0 | 0.01 +Other | | 0.0001101 | | | 0.00 + +Nlocal: 1680 ave 1680 max 1680 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 7518 ave 7518 max 7518 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 638400 ave 638400 max 638400 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 638400 +Ave neighs/atom = 380 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:49 diff --git a/examples/USER/smtbq/log.smtbq.Al.g++.4 b/examples/USER/smtbq/log.smtbq.Al.g++.4 new file mode 100644 index 0000000000..89f959ec76 --- /dev/null +++ b/examples/USER/smtbq/log.smtbq.Al.g++.4 @@ -0,0 +1,278 @@ +LAMMPS (24 Dec 2015) +# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants + +variable T_depart equal 300 +variable dt equal 0.0002 + +#Constante +variable rac3 equal sqrt(3.0) +variable rac1_2 equal sqrt(0.5) +variable rac3_2 equal sqrt(1.5) + +#Structure +variable a equal 4.05 + +variable nx equal 10 +variable ny equal 7 +variable nz equal 4 + +variable bx equal ${a}*${nx}*${rac1_2} +variable bx equal 4.05*${nx}*${rac1_2} +variable bx equal 4.05*10*${rac1_2} +variable bx equal 4.05*10*0.707106781186548 +variable by equal ${a}*${ny}*${rac3_2} +variable by equal 4.05*${ny}*${rac3_2} +variable by equal 4.05*7*${rac3_2} +variable by equal 4.05*7*1.22474487139159 +variable bz equal ${a}*${nz}*${rac3} +variable bz equal 4.05*${nz}*${rac3} +variable bz equal 4.05*4*${rac3} +variable bz equal 4.05*4*1.73205080756888 +# ======================================================================= + +units metal +atom_style charge +dimension 3 +boundary p p p + + +lattice sc 1.0 +Lattice spacing in x,y,z = 1 1 1 +region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 28.6378246380552 0 ${by} 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 28.0592230826159 0.0 0.0 0.0 +create_box 1 box_vide +Created triclinic box = (0 0 0) to (28.6378 34.7215 28.0592) with tilt (0 0 0) + 2 by 2 by 1 MPI processor grid + +# Aluminium atoms z = [111] +lattice custom ${a} a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +lattice custom 4.05 a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 1.73205080756888 basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 +Lattice spacing in x,y,z = 2.86378 4.96022 7.01481 + +create_atoms 1 region box_vide +Created 1680 atoms + +mass 1 26.98 + +velocity all create ${T_depart} 277387 +velocity all create 300 277387 + +pair_style smtbq +pair_coeff * * ffield.smtbq.Al Al +Reading potential file ffield.smtbq.Al with DATE: 2015-10-22 + +neighbor 0.5 bin +neigh_modify every 20 delay 0 check yes + +timestep ${dt} +timestep 0.0002 + +thermo_style custom step temp press pe ke etotal lx ly lz vol +thermo_modify flush yes +thermo 1 + + +#dump 5 all custom 1 box_Al.lammpstrj id type q x y z + +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 6 5 +Memory usage per processor = 4.2858 Mbytes +Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume + 0 300 729.26605 -5600.8541 65.108335 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 1 299.98339 729.897 -5600.8505 65.104731 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 2 299.93356 731.7909 -5600.8397 65.093915 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 3 299.8505 734.94708 -5600.8217 65.07589 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 4 299.73426 739.36449 -5600.7964 65.050662 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 5 299.58486 745.04171 -5600.764 65.018238 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 6 299.40234 751.97694 -5600.7244 64.978627 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 7 299.18677 760.16798 -5600.6776 64.931841 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 8 298.9382 769.6122 -5600.6237 64.877894 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 9 298.65669 780.3065 -5600.5626 64.8168 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 10 298.34234 792.24735 -5600.4943 64.748578 -5535.7458 28.637825 34.721517 28.059223 27900.653 +Loop time of 1.49703 on 4 procs for 10 steps with 1680 atoms + +Performance: 0.115 ns/day, 207.920 hours/ns, 6.680 timesteps/s +98.4% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.4956 | 1.4957 | 1.4957 | 0.0 | 99.91 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00078988 | 0.00090927 | 0.0010064 | 0.3 | 0.06 +Output | 0.00022459 | 0.00027347 | 0.00034189 | 0.3 | 0.02 +Modify | 6.4373e-05 | 7.8619e-05 | 9.3222e-05 | 0.1 | 0.01 +Other | | 8.106e-05 | | | 0.01 + +Nlocal: 420 ave 484 max 360 min +Histogram: 1 0 1 0 0 0 1 0 0 1 +Nghost: 4305 ave 4365 max 4241 min +Histogram: 1 0 0 1 0 0 0 1 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 159600 ave 183920 max 136800 min +Histogram: 1 0 1 0 0 0 1 0 0 1 + +Total # of neighbors = 638400 +Ave neighs/atom = 380 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 3 +#thermo 15 +fix 1 all box/relax tri 0.0 vmax 0.001 +minimize 1.0e-8 1.0e-10 1000 10000 +WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) +Neighbor list info ... + 1 neighbor list requests + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 6 5 +Memory usage per processor = 5.4127 Mbytes +Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume + 10 298.34234 792.24735 -5600.4943 64.748578 -5535.7458 28.637825 34.721517 28.059223 27900.653 + 11 298.34234 2483.41 -5600.5251 64.748578 -5535.7765 28.617939 34.697415 28.039749 27842.588 + 12 298.34234 3212.2068 -5600.6294 64.748578 -5535.8809 28.605195 34.685635 28.035928 27816.95 + 13 298.34234 1756.312 -5600.6529 64.748578 -5535.9044 28.62806 34.701751 28.05036 27866.456 + 14 298.34234 845.30512 -5600.6668 64.748578 -5535.9182 28.652683 34.704776 28.055059 27897.528 + 15 298.34234 1950.7901 -5600.7433 64.748578 -5535.9948 28.66644 34.670055 28.031028 27859.115 + 16 298.34234 2860.9521 -5600.7579 64.748578 -5536.0093 28.637802 34.669634 28.028024 27827.963 + 17 298.34234 2406.0293 -5600.7642 64.748578 -5536.0156 28.624953 34.689277 28.040313 27843.439 + 18 298.34234 2531.6658 -5600.7645 64.748578 -5536.0159 28.619984 34.690929 28.039526 27839.151 + 19 298.34234 2410.8263 -5600.7651 64.748578 -5536.0166 28.615355 34.70117 28.039934 27843.27 + 20 298.34234 2538.4705 -5600.7654 64.748578 -5536.0169 28.613142 34.700755 28.038049 27838.913 + 21 298.34234 2455.2909 -5600.7657 64.748578 -5536.0171 28.615273 34.700334 28.039158 27841.749 + 22 298.34234 2578.5637 -5600.766 64.748578 -5536.0174 28.614997 34.695849 28.038814 27837.541 + 23 298.34234 2413.5858 -5600.7667 64.748578 -5536.0181 28.617591 34.695982 28.041829 27843.164 + 24 298.34234 2575.34 -5600.7677 64.748578 -5536.0191 28.614711 34.696953 28.038299 27837.636 + 25 298.34234 2313.5501 -5600.7689 64.748578 -5536.0203 28.618801 34.702208 28.039031 27846.559 + 26 298.34234 2589.6554 -5600.7724 64.748578 -5536.0239 28.622807 34.692685 28.033282 27837.106 + 27 298.34234 2258.4841 -5600.7755 64.748578 -5536.0269 28.633037 34.683012 28.042438 27848.382 + 28 298.34234 2668.7002 -5600.7789 64.748578 -5536.0303 28.632179 34.665065 28.043666 27834.358 + 29 298.34234 2339.309 -5600.8141 64.748578 -5536.0655 28.626885 34.675842 28.051214 27845.356 + 30 298.34234 2846.4227 -5600.8223 64.748578 -5536.0737 28.612492 34.69364 28.033449 27828.006 + 31 298.34234 2534.6985 -5600.8246 64.748578 -5536.076 28.611965 34.709562 28.031793 27838.619 + 32 298.34234 2278.6053 -5600.8262 64.748578 -5536.0776 28.617042 34.703828 28.040241 27847.349 + 33 298.34234 2477.381 -5600.8269 64.748578 -5536.0783 28.616395 34.695005 28.041167 27840.56 + 34 298.34234 2561.8128 -5600.8271 64.748578 -5536.0785 28.615917 34.69647 28.037549 27837.678 + 35 298.34234 2470.4145 -5600.8273 64.748578 -5536.0787 28.617208 34.699332 28.037111 27840.795 + 36 298.34234 2415.0452 -5600.8276 64.748578 -5536.079 28.617651 34.69562 28.041578 27842.683 + 37 298.34234 2514.0703 -5600.8277 64.748578 -5536.0791 28.616929 34.693138 28.040886 27839.303 + 38 298.34234 2515.7338 -5600.828 64.748578 -5536.0794 28.619947 34.694884 28.03646 27839.244 + 39 298.34234 2402.2948 -5600.8281 64.748578 -5536.0796 28.620623 34.69709 28.037911 27843.113 + 40 298.34234 2457.1081 -5600.8289 64.748578 -5536.0804 28.612617 34.697892 28.043218 27841.237 + 41 298.34234 2729.4589 -5600.8299 64.748578 -5536.0814 28.610746 34.694899 28.038106 27831.941 + 42 298.34234 2487.8313 -5600.8331 64.748578 -5536.0845 28.620239 34.701333 28.031882 27840.157 + 43 298.34234 1959.1329 -5600.8393 64.748578 -5536.0908 28.609631 34.719775 28.045509 27858.164 + 44 298.34234 2535.5621 -5600.8461 64.748578 -5536.0975 28.587496 34.720535 28.046731 27838.433 + 45 298.34234 2978.3628 -5600.858 64.748578 -5536.1095 28.609197 34.699148 28.027451 27823.264 + 46 298.34234 2351.5532 -5600.8632 64.748578 -5536.1146 28.624986 34.701661 28.031447 27844.605 + 47 298.34234 2294.1629 -5600.8704 64.748578 -5536.1218 28.614261 34.700247 28.045027 27846.522 + 48 298.34234 2528.0548 -5600.871 64.748578 -5536.1225 28.612265 34.696612 28.041878 27838.536 + 49 298.34234 2516.2649 -5600.8715 64.748578 -5536.1229 28.618047 34.695729 28.037328 27838.936 + 50 298.34234 2461.5711 -5600.8715 64.748578 -5536.1229 28.61865 34.696255 28.038191 27840.802 +Loop time of 10.0107 on 4 procs for 40 steps with 1680 atoms + +98.5% CPU use with 4 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = energy tolerance + Energy initial, next-to-last, final = + -5600.49433365 -5600.87146764 -5600.87150075 + Force two-norm initial, final = 50.9055 1.01476 + Force max component initial, final = 29.378 0.811083 + Final line search alpha, max atom move = 0.00128157 0.00103946 + Iterations, force evaluations = 40 75 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 9.9932 | 9.9933 | 9.9933 | 0.0 | 99.83 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0059471 | 0.0059789 | 0.0059991 | 0.0 | 0.06 +Output | 0.00088 | 0.0010666 | 0.0015972 | 0.9 | 0.01 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.01039 | | | 0.10 + +Nlocal: 420 ave 426 max 416 min +Histogram: 1 1 0 0 0 1 0 0 0 1 +Nghost: 4305 ave 4309 max 4299 min +Histogram: 1 0 0 0 0 1 0 0 0 2 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 159600 ave 161880 max 158080 min +Histogram: 1 1 0 0 0 1 0 0 0 1 + +Total # of neighbors = 638400 +Ave neighs/atom = 380 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 1 +thermo 1 +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 6 5 +Memory usage per processor = 4.2877 Mbytes +Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume + 50 298.34234 2461.5711 -5600.8715 64.748578 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 51 298.30489 2462.7206 -5600.8634 64.740449 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 52 298.23415 2465.1307 -5600.848 64.725096 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 53 298.13012 2468.8007 -5600.8254 64.702519 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 54 297.99284 2473.7295 -5600.7956 64.672726 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 55 297.82234 2479.9155 -5600.7586 64.635722 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 56 297.61866 2487.3567 -5600.7144 64.591518 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 57 297.38185 2496.0508 -5600.663 64.540124 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 58 297.11198 2505.9952 -5600.6045 64.481554 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 59 296.80911 2517.1867 -5600.5387 64.415823 -5536.1229 28.61865 34.696255 28.038191 27840.802 + 60 296.47332 2529.6221 -5600.4659 64.342947 -5536.1229 28.61865 34.696255 28.038191 27840.802 +Loop time of 1.2969 on 4 procs for 10 steps with 1680 atoms + +Performance: 0.133 ns/day, 180.125 hours/ns, 7.711 timesteps/s +98.4% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.2955 | 1.2955 | 1.2955 | 0.0 | 99.89 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00080395 | 0.00095397 | 0.0010161 | 0.3 | 0.07 +Output | 0.00023341 | 0.00028217 | 0.00041556 | 0.5 | 0.02 +Modify | 7.2241e-05 | 7.993e-05 | 8.8692e-05 | 0.1 | 0.01 +Other | | 8.166e-05 | | | 0.01 + +Nlocal: 420 ave 424 max 416 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Nghost: 4305 ave 4309 max 4301 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 159600 ave 161120 max 158080 min +Histogram: 1 0 0 0 0 2 0 0 0 1 + +Total # of neighbors = 638400 +Ave neighs/atom = 380 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:13 diff --git a/examples/USER/smtbq/log.smtbq.Al2O3.g++.1 b/examples/USER/smtbq/log.smtbq.Al2O3.g++.1 new file mode 100644 index 0000000000..b7d2ad5ae3 --- /dev/null +++ b/examples/USER/smtbq/log.smtbq.Al2O3.g++.1 @@ -0,0 +1,210 @@ +LAMMPS (23 Oct 2015) +# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants + +variable T_depart equal 300 + +variable dt equal 0.0002 + +# ======================================================================= + +units metal +atom_style charge +dimension 3 +boundary p p p + +read_data data.Alpha + triclinic box = (0 0 0) to (23.769 24.7015 25.9564) with tilt (0 0 0) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 1800 atoms +# ^ Orthorombic box of corundum strcture + +mass 1 16.00 +group Oxy type 1 +1080 atoms in group Oxy +compute chargeOxy Oxy property/atom q +compute q_Oxy Oxy reduce ave c_chargeOxy + +mass 2 26.98 +group Al type 2 +720 atoms in group Al +compute chargeAl Al property/atom q +compute q_Al Al reduce ave c_chargeAl + +velocity all create ${T_depart} 277387 +velocity all create 300 277387 + +pair_style smtbq +pair_coeff * * ffield.smtbq.Al2O3 O Al + +neighbor 0.5 bin +neigh_modify every 20 delay 0 check yes + +timestep ${dt} +timestep 0.0002 + +thermo_style custom step temp press pe ke etotal c_q_Al c_q_Oxy lx ly lz vol +thermo_modify flush yes +thermo 1 + + +#dump 5 all custom 500 boxAlpha_alumina.lammpstrj id type q x y z + +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 5 5 +Memory usage per processor = 4.12573 Mbytes +Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume + 0 300 91921.482 -11494.543 69.7617 -11424.781 2.6095997 -1.7397331 23.769 24.7015 25.9564 15239.78 + 1 299.96467 91922.303 -11494.535 69.753485 -11424.781 2.6095996 -1.739733 23.769 24.7015 25.9564 15239.78 + 2 299.75126 91933.246 -11494.485 69.703859 -11424.781 2.6095978 -1.7397318 23.769 24.7015 25.9564 15239.78 + 3 299.36045 91954.835 -11494.394 69.61298 -11424.781 2.6095941 -1.7397294 23.769 24.7015 25.9564 15239.78 + 4 298.79335 91986.343 -11494.262 69.481107 -11424.781 2.6095886 -1.7397257 23.769 24.7015 25.9564 15239.78 + 5 298.05151 92027.62 -11494.09 69.3086 -11424.781 2.6095812 -1.7397208 23.769 24.7015 25.9564 15239.78 + 6 297.13689 92078.615 -11493.877 69.095915 -11424.781 2.6095721 -1.7397147 23.769 24.7015 25.9564 15239.78 + 7 296.05187 92139.141 -11493.625 68.843606 -11424.781 2.6095613 -1.7397075 23.769 24.7015 25.9564 15239.78 + 8 294.79923 92209.15 -11493.334 68.552319 -11424.781 2.6095488 -1.7396992 23.769 24.7015 25.9564 15239.78 + 9 293.38215 92288.12 -11493.004 68.222793 -11424.781 2.6095347 -1.7396898 23.769 24.7015 25.9564 15239.78 + 10 291.80421 92376.81 -11492.637 67.855859 -11424.781 2.6095191 -1.7396794 23.769 24.7015 25.9564 15239.78 +Loop time of 169.694 on 1 procs for 10 steps with 1800 atoms + +Performance: 0.001 ns/day, 23568.600 hours/ns, 0.059 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 169.69 | 169.69 | 169.69 | 0.0 |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00075507 | 0.00075507 | 0.00075507 | 0.0 | 0.00 +Output | 0.00078607 | 0.00078607 | 0.00078607 | 0.0 | 0.00 +Modify | 0.00034666 | 0.00034666 | 0.00034666 | 0.0 | 0.00 +Other | | 0.0001752 | | | 0.00 + +Nlocal: 1800 ave 1800 max 1800 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 11490 ave 11490 max 11490 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 1.4472e+06 ave 1.4472e+06 max 1.4472e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1447200 +Ave neighs/atom = 804 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 3 +thermo 1 +fix 1 all box/relax tri 0.0 vmax 0.001 +minimize 1.0e-3 1.0e-5 1000 10000 +WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) +Neighbor list info ... + 1 neighbor list requests + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 5 5 +Memory usage per processor = 5.50073 Mbytes +Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume + 10 291.80421 92376.81 -11492.637 67.855859 -11424.781 2.6095191 -1.7396794 23.769 24.7015 25.9564 15239.78 + 11 291.80421 84416.246 -11494.722 67.855859 -11426.866 2.6087748 -1.7391832 23.787835 24.721015 25.982356 15279.17 +Loop time of 25.4145 on 1 procs for 1 steps with 1800 atoms + +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = energy tolerance + Energy initial, next-to-last, final = + -11492.6369832 -11492.6369832 -11494.7221261 + Force two-norm initial, final = 1453.27 1325.26 + Force max component initial, final = 968.201 892.249 + Final line search alpha, max atom move = 1.03284e-06 0.000921553 + Iterations, force evaluations = 1 1 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 25.414 | 25.414 | 25.414 | -nan |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00013995 | 0.00013995 | 0.00013995 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.0005064 | | | 0.00 + +Nlocal: 1800 ave 1800 max 1800 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 11408 ave 11408 max 11408 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 1.44456e+06 ave 1.44456e+06 max 1.44456e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1444562 +Ave neighs/atom = 802.534 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 1 +thermo 1 +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 5 5 +Memory usage per processor = 4.37573 Mbytes +Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume + 11 291.80421 84416.246 -11494.722 67.855859 -11426.866 2.6087748 -1.7391832 23.787835 24.721015 25.982356 15279.17 + 12 290.08293 84514.767 -11494.322 67.455594 -11426.866 2.6087578 -1.7391718 23.787835 24.721015 25.982356 15279.17 + 13 288.21041 84622.406 -11493.886 67.020161 -11426.866 2.6087394 -1.7391596 23.787835 24.721015 25.982356 15279.17 + 14 286.19128 84738.689 -11493.417 66.550634 -11426.866 2.6087199 -1.7391466 23.787835 24.721015 25.982356 15279.17 + 15 284.03049 84864.242 -11492.914 66.048166 -11426.866 2.6086993 -1.7391329 23.787835 24.721015 25.982356 15279.17 + 16 281.73331 84998.125 -11492.38 65.513983 -11426.866 2.6086776 -1.7391184 23.787835 24.721015 25.982356 15279.17 + 17 279.30534 85140.233 -11491.815 64.949384 -11426.866 2.6086551 -1.7391034 23.787835 24.721015 25.982356 15279.17 + 18 276.75244 85290.405 -11491.221 64.355737 -11426.866 2.6086319 -1.7390879 23.787835 24.721015 25.982356 15279.17 + 19 274.08079 85448.449 -11490.6 63.734472 -11426.866 2.608608 -1.739072 23.787835 24.721015 25.982356 15279.17 + 20 271.29678 85614.064 -11489.953 63.087082 -11426.866 2.6085837 -1.7390558 23.787835 24.721015 25.982356 15279.17 + 21 268.40708 85786.72 -11489.281 62.415114 -11426.865 2.608559 -1.7390393 23.787835 24.721015 25.982356 15279.17 +Loop time of 170.699 on 1 procs for 10 steps with 1800 atoms + +Performance: 0.001 ns/day, 23708.143 hours/ns, 0.059 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 170.7 | 170.7 | 170.7 | 0.0 |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00068879 | 0.00068879 | 0.00068879 | 0.0 | 0.00 +Output | 0.0008359 | 0.0008359 | 0.0008359 | 0.0 | 0.00 +Modify | 0.00031424 | 0.00031424 | 0.00031424 | 0.0 | 0.00 +Other | | 0.0001593 | | | 0.00 + +Nlocal: 1800 ave 1800 max 1800 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 11222 ave 11222 max 11222 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 1.44126e+06 ave 1.44126e+06 max 1.44126e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1441262 +Ave neighs/atom = 800.701 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:06:42 diff --git a/examples/USER/smtbq/log.smtbq.Al2O3.g++.4 b/examples/USER/smtbq/log.smtbq.Al2O3.g++.4 new file mode 100644 index 0000000000..06f06fbb70 --- /dev/null +++ b/examples/USER/smtbq/log.smtbq.Al2O3.g++.4 @@ -0,0 +1,210 @@ +LAMMPS (24 Dec 2015) +# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants + +variable T_depart equal 300 + +variable dt equal 0.0002 + +# ======================================================================= + +units metal +atom_style charge +dimension 3 +boundary p p p + +read_data data.Alpha + triclinic box = (0 0 0) to (23.769 24.7015 25.9564) with tilt (0 0 0) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 1800 atoms +# ^ Orthorombic box of corundum strcture + +mass 1 16.00 +group Oxy type 1 +1080 atoms in group Oxy +compute chargeOxy Oxy property/atom q +compute q_Oxy Oxy reduce ave c_chargeOxy + +mass 2 26.98 +group Al type 2 +720 atoms in group Al +compute chargeAl Al property/atom q +compute q_Al Al reduce ave c_chargeAl + +velocity all create ${T_depart} 277387 +velocity all create 300 277387 + +pair_style smtbq +pair_coeff * * ffield.smtbq.Al2O3 O Al +Reading potential file ffield.smtbq.Al2O3 with DATE: 2015-10-22 + +neighbor 0.5 bin +neigh_modify every 20 delay 0 check yes + +timestep ${dt} +timestep 0.0002 + +thermo_style custom step temp press pe ke etotal c_q_Al c_q_Oxy lx ly lz vol +thermo_modify flush yes +thermo 1 + +#dump 5 all custom 500 boxAlpha_alumina.lammpstrj id type q x y z + +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 5 5 +Memory usage per processor = 3.94008 Mbytes +Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume + 0 300 91921.482 -11494.543 69.7617 -11424.781 2.6095997 -1.7397331 23.769 24.7015 25.9564 15239.78 + 1 299.96467 91922.303 -11494.535 69.753485 -11424.781 2.6095996 -1.739733 23.769 24.7015 25.9564 15239.78 + 2 299.75126 91933.246 -11494.485 69.703859 -11424.781 2.6095978 -1.7397318 23.769 24.7015 25.9564 15239.78 + 3 299.36045 91954.835 -11494.394 69.61298 -11424.781 2.6095941 -1.7397294 23.769 24.7015 25.9564 15239.78 + 4 298.79335 91986.343 -11494.262 69.481107 -11424.781 2.6095886 -1.7397257 23.769 24.7015 25.9564 15239.78 + 5 298.05151 92027.62 -11494.09 69.3086 -11424.781 2.6095812 -1.7397208 23.769 24.7015 25.9564 15239.78 + 6 297.13689 92078.615 -11493.877 69.095915 -11424.781 2.6095721 -1.7397147 23.769 24.7015 25.9564 15239.78 + 7 296.05187 92139.141 -11493.625 68.843606 -11424.781 2.6095613 -1.7397075 23.769 24.7015 25.9564 15239.78 + 8 294.79923 92209.15 -11493.334 68.552319 -11424.781 2.6095488 -1.7396992 23.769 24.7015 25.9564 15239.78 + 9 293.38215 92288.12 -11493.004 68.222793 -11424.781 2.6095347 -1.7396898 23.769 24.7015 25.9564 15239.78 + 10 291.80421 92376.81 -11492.637 67.855859 -11424.781 2.6095191 -1.7396794 23.769 24.7015 25.9564 15239.78 +Loop time of 43.8203 on 4 procs for 10 steps with 1800 atoms + +Performance: 0.004 ns/day, 6086.154 hours/ns, 0.228 timesteps/s +99.9% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 43.817 | 43.817 | 43.817 | 0.0 | 99.99 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0020506 | 0.0024325 | 0.0026755 | 0.5 | 0.01 +Output | 0.00047874 | 0.00057358 | 0.00084901 | 0.7 | 0.00 +Modify | 9.8944e-05 | 0.00010616 | 0.00011468 | 0.1 | 0.00 +Other | | 0.0001459 | | | 0.00 + +Nlocal: 450 ave 450 max 450 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 6820 ave 6820 max 6820 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 361800 ave 361800 max 361800 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1447200 +Ave neighs/atom = 804 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 3 +thermo 1 +fix 1 all box/relax tri 0.0 vmax 0.001 +minimize 1.0e-3 1.0e-5 1000 10000 +WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) +Neighbor list info ... + 1 neighbor list requests + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 5 5 +Memory usage per processor = 5.31508 Mbytes +Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume + 10 291.80421 92376.81 -11492.637 67.855859 -11424.781 2.6095191 -1.7396794 23.769 24.7015 25.9564 15239.78 + 11 291.80421 84416.246 -11494.722 67.855859 -11426.866 2.6087748 -1.7391832 23.787835 24.721015 25.982356 15279.17 +Loop time of 6.48552 on 4 procs for 1 steps with 1800 atoms + +99.9% CPU use with 4 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = energy tolerance + Energy initial, next-to-last, final = + -11492.6369832 -11492.6369832 -11494.7221261 + Force two-norm initial, final = 1453.27 1325.26 + Force max component initial, final = 968.201 892.249 + Final line search alpha, max atom move = 1.03284e-06 0.000921553 + Iterations, force evaluations = 1 1 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 6.4848 | 6.4848 | 6.4848 | 0.0 | 99.99 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00037098 | 0.00037396 | 0.00037694 | 0.0 | 0.01 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.0003674 | | | 0.01 + +Nlocal: 450 ave 450 max 450 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 6759 ave 6772 max 6750 min +Histogram: 1 1 0 0 1 0 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 361140 ave 361150 max 361130 min +Histogram: 1 0 0 1 0 0 0 1 0 1 + +Total # of neighbors = 1444562 +Ave neighs/atom = 802.534 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 1 +thermo 1 +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.6714 + ghost atom cutoff = 11.6714 + binsize = 5.8357 -> bins = 5 5 5 +Memory usage per processor = 4.19008 Mbytes +Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume + 11 291.80421 84416.246 -11494.722 67.855859 -11426.866 2.6087748 -1.7391832 23.787835 24.721015 25.982356 15279.17 + 12 290.08293 84514.767 -11494.322 67.455594 -11426.866 2.6087578 -1.7391718 23.787835 24.721015 25.982356 15279.17 + 13 288.21041 84622.406 -11493.886 67.020161 -11426.866 2.6087394 -1.7391596 23.787835 24.721015 25.982356 15279.17 + 14 286.19128 84738.689 -11493.417 66.550634 -11426.866 2.6087199 -1.7391466 23.787835 24.721015 25.982356 15279.17 + 15 284.03049 84864.242 -11492.914 66.048166 -11426.866 2.6086993 -1.7391329 23.787835 24.721015 25.982356 15279.17 + 16 281.73331 84998.125 -11492.38 65.513983 -11426.866 2.6086776 -1.7391184 23.787835 24.721015 25.982356 15279.17 + 17 279.30534 85140.233 -11491.815 64.949384 -11426.866 2.6086551 -1.7391034 23.787835 24.721015 25.982356 15279.17 + 18 276.75244 85290.405 -11491.221 64.355737 -11426.866 2.6086319 -1.7390879 23.787835 24.721015 25.982356 15279.17 + 19 274.08079 85448.449 -11490.6 63.734472 -11426.866 2.608608 -1.739072 23.787835 24.721015 25.982356 15279.17 + 20 271.29678 85614.064 -11489.953 63.087082 -11426.866 2.6085837 -1.7390558 23.787835 24.721015 25.982356 15279.17 + 21 268.40708 85786.72 -11489.281 62.415114 -11426.865 2.608559 -1.7390393 23.787835 24.721015 25.982356 15279.17 +Loop time of 47.1154 on 4 procs for 10 steps with 1800 atoms + +Performance: 0.004 ns/day, 6543.802 hours/ns, 0.212 timesteps/s +99.9% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 47.112 | 47.112 | 47.112 | 0.0 | 99.99 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0019891 | 0.0023952 | 0.0026395 | 0.5 | 0.01 +Output | 0.0004952 | 0.00062233 | 0.00096345 | 0.8 | 0.00 +Modify | 0.00010109 | 0.00010723 | 0.00012183 | 0.1 | 0.00 +Other | | 0.0001532 | | | 0.00 + +Nlocal: 450 ave 450 max 450 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 6611 ave 6620 max 6600 min +Histogram: 1 0 0 0 0 0 2 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 360316 ave 360333 max 360300 min +Histogram: 1 1 0 0 0 0 1 0 0 1 + +Total # of neighbors = 1441262 +Ave neighs/atom = 800.701 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:01:48 diff --git a/examples/USER/smtbq/log.smtbq.TiO2.g++.1 b/examples/USER/smtbq/log.smtbq.TiO2.g++.1 new file mode 100644 index 0000000000..433a7ceabb --- /dev/null +++ b/examples/USER/smtbq/log.smtbq.TiO2.g++.1 @@ -0,0 +1,255 @@ +LAMMPS (23 Oct 2015) +# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants + +variable T_depart equal 300 + +variable dt equal 0.0002 + +variable a equal 4.5937 +variable c equal 2.9587 +variable ca equal ${c}/${a} +variable ca equal 2.9587/${a} +variable ca equal 2.9587/4.5937 + +variable nx equal 6 +variable ny equal 6 +variable nz equal 11 + +variable bx equal ${a}*${nx} +variable bx equal 4.5937*${nx} +variable bx equal 4.5937*6 +variable by equal ${a}*${ny} +variable by equal 4.5937*${ny} +variable by equal 4.5937*6 +variable bz equal ${c}*${nz} +variable bz equal 2.9587*${nz} +variable bz equal 2.9587*11 +# ======================================================================= + +units metal +atom_style charge +dimension 3 +boundary p p p + + +lattice sc 1.0 +Lattice spacing in x,y,z = 1 1 1 +region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 27.5622 0 ${by} 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 27.5622 0 27.5622 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 27.5622 0 27.5622 0 32.5457 0.0 0.0 0.0 +create_box 2 box_vide +Created triclinic box = (0 0 0) to (27.5622 27.5622 32.5457) with tilt (0 0 0) + 1 by 1 by 1 MPI processor grid + +#lattice sc 1.0 +#region box_TiO2 block 0 ${bx} 0 ${by} 0 ${bz} + +# titanium atoms +lattice custom ${a} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 +lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 +lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.644077758669482 basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 +Lattice spacing in x,y,z = 4.5937 4.5937 2.9587 + +create_atoms 2 region box_vide +Created 792 atoms + +# Oxygen atoms +lattice custom ${a} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 +lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 +lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.644077758669482 basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 +Lattice spacing in x,y,z = 4.5937 4.5937 2.9587 + +create_atoms 1 region box_vide +Created 1584 atoms + + +mass 1 16.00 +group Oxy type 1 +1584 atoms in group Oxy +compute chargeOxy Oxy property/atom q +compute q_Oxy Oxy reduce ave c_chargeOxy + +mass 2 47.867 +group Ti type 2 +792 atoms in group Ti +compute chargeTi Ti property/atom q +compute q_Ti Ti reduce ave c_chargeTi + +velocity all create ${T_depart} 277387 +velocity all create 300 277387 + +pair_style smtbq +pair_coeff * * ffield.smtbq.TiO2 O Ti + +neighbor 0.5 bin +neigh_modify every 20 delay 0 check yes + +timestep ${dt} +timestep 0.0002 + +thermo_style custom step temp press pe ke etotal c_q_Ti c_q_Oxy lx ly lz vol +thermo_modify flush yes +thermo 1 + + +#dump 5 all custom 500 boxAlpha_alumina.lammpstrj id type q x y z + +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12.6744 + ghost atom cutoff = 12.6744 + binsize = 6.3372 -> bins = 5 5 6 +Memory usage per processor = 4.77264 Mbytes +Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume + 0 300 44365.066 -15815.239 92.097853 -15723.142 2.5521775 -1.2760888 27.5622 27.5622 32.5457 24724.15 + 1 299.90455 44375.373 -15815.21 92.06855 -15723.142 2.552178 -1.276089 27.5622 27.5622 32.5457 24724.15 + 2 299.63739 44392.241 -15815.128 91.986534 -15723.142 2.5521725 -1.2760863 27.5622 27.5622 32.5457 24724.15 + 3 299.19899 44415.606 -15814.994 91.85195 -15723.142 2.5521616 -1.2760808 27.5622 27.5622 32.5457 24724.15 + 4 298.59012 44445.345 -15814.808 91.665031 -15723.143 2.5521454 -1.2760727 27.5622 27.5622 32.5457 24724.15 + 5 297.81185 44481.382 -15814.57 91.426105 -15723.144 2.5521238 -1.2760619 27.5622 27.5622 32.5457 24724.15 + 6 296.86552 44523.683 -15814.28 91.135592 -15723.144 2.5520969 -1.2760484 27.5622 27.5622 32.5457 24724.15 + 7 295.75281 44572.175 -15813.939 90.793996 -15723.145 2.5520648 -1.2760324 27.5622 27.5622 32.5457 24724.15 + 8 294.47564 44626.778 -15813.548 90.401913 -15723.147 2.5520274 -1.2760137 27.5622 27.5622 32.5457 24724.15 + 9 293.03623 44687.401 -15813.108 89.960027 -15723.148 2.5519849 -1.2759925 27.5622 27.5622 32.5457 24724.15 + 10 291.43711 44753.932 -15812.618 89.469107 -15723.149 2.5519374 -1.2759687 27.5622 27.5622 32.5457 24724.15 +Loop time of 570.52 on 1 procs for 10 steps with 2376 atoms + +Performance: 0.000 ns/day, 79238.948 hours/ns, 0.018 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 570.52 | 570.52 | 570.52 | 0.0 |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00087428 | 0.00087428 | 0.00087428 | 0.0 | 0.00 +Output | 0.00091386 | 0.00091386 | 0.00091386 | 0.0 | 0.00 +Modify | 0.00045085 | 0.00045085 | 0.00045085 | 0.0 | 0.00 +Other | | 0.0001979 | | | 0.00 + +Nlocal: 2376 ave 2376 max 2376 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 13138 ave 13138 max 13138 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 1.9705e+06 ave 1.9705e+06 max 1.9705e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1970496 +Ave neighs/atom = 829.333 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 3 +#thermo 15 +fix 1 all box/relax tri 0.0 vmax 0.001 +minimize 1.0e-3 1.0e-5 1000 10000 +WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) +Neighbor list info ... + 1 neighbor list requests + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12.6744 + ghost atom cutoff = 12.6744 + binsize = 6.3372 -> bins = 5 5 6 +Memory usage per processor = 6.14764 Mbytes +Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume + 10 291.43711 44753.932 -15812.618 89.469107 -15723.149 2.5519374 -1.2759687 27.5622 27.5622 32.5457 24724.15 + 11 291.43711 39000.467 -15814.109 89.469107 -15724.639 2.5514249 -1.2757124 27.582771 27.582775 32.578246 24785.834 +Loop time of 80.5411 on 1 procs for 1 steps with 2376 atoms + +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = energy tolerance + Energy initial, next-to-last, final = + -15812.6183471 -15812.6183471 -15814.1085593 + Force two-norm initial, final = 1104.2 951.386 + Force max component initial, final = 759.352 657.815 + Final line search alpha, max atom move = 1.31691e-06 0.000866285 + Iterations, force evaluations = 1 1 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 80.54 | 80.54 | 80.54 | 0.0 |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00016761 | 0.00016761 | 0.00016761 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.0006053 | | | 0.00 + +Nlocal: 2376 ave 2376 max 2376 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 13138 ave 13138 max 13138 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 1.96864e+06 ave 1.96864e+06 max 1.96864e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1968636 +Ave neighs/atom = 828.551 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 1 +thermo 1 +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12.6744 + ghost atom cutoff = 12.6744 + binsize = 6.3372 -> bins = 5 5 6 +Memory usage per processor = 5.02264 Mbytes +Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume + 11 291.43711 39000.467 -15814.109 89.469107 -15724.639 2.5514249 -1.2757124 27.582771 27.582775 32.578246 24785.834 + 12 289.69465 39072.309 -15813.575 88.934185 -15724.641 2.551372 -1.275686 27.582771 27.582775 32.578246 24785.834 + 13 287.79928 39149.855 -15812.994 88.352321 -15724.642 2.5513146 -1.2756573 27.582771 27.582775 32.578246 24785.834 + 14 285.75427 39232.968 -15812.368 87.724515 -15724.644 2.5512525 -1.2756262 27.582771 27.582775 32.578246 24785.834 + 15 283.56312 39321.472 -15811.697 87.05185 -15724.645 2.5511856 -1.2755928 27.582771 27.582775 32.578246 24785.834 + 16 281.22962 39415.185 -15810.983 86.335481 -15724.647 2.5511143 -1.2755571 27.582771 27.582775 32.578246 24785.834 + 17 278.75777 39513.921 -15810.226 85.57664 -15724.649 2.5510384 -1.2755192 27.582771 27.582775 32.578246 24785.834 + 18 276.15182 39617.471 -15809.428 84.776632 -15724.651 2.5509583 -1.2754791 27.582771 27.582775 32.578246 24785.834 + 19 273.41625 39725.622 -15808.591 83.936831 -15724.654 2.5508739 -1.275437 27.582771 27.582775 32.578246 24785.834 + 20 270.55575 39838.144 -15807.715 83.058679 -15724.656 2.5507855 -1.2753928 27.582771 27.582775 32.578246 24785.834 + 21 267.57523 39954.804 -15806.802 82.14368 -15724.659 2.5506932 -1.2753466 27.582771 27.582775 32.578246 24785.834 +Loop time of 606.774 on 1 procs for 10 steps with 2376 atoms + +Performance: 0.000 ns/day, 84274.222 hours/ns, 0.016 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 606.77 | 606.77 | 606.77 | 0.0 |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00085855 | 0.00085855 | 0.00085855 | 0.0 | 0.00 +Output | 0.00087833 | 0.00087833 | 0.00087833 | 0.0 | 0.00 +Modify | 0.00041723 | 0.00041723 | 0.00041723 | 0.0 | 0.00 +Other | | 0.0001888 | | | 0.00 + +Nlocal: 2376 ave 2376 max 2376 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 13138 ave 13138 max 13138 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 1.96049e+06 ave 1.96049e+06 max 1.96049e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1960492 +Ave neighs/atom = 825.123 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:23:48 diff --git a/examples/USER/smtbq/log.smtbq.TiO2.g++.4 b/examples/USER/smtbq/log.smtbq.TiO2.g++.4 new file mode 100644 index 0000000000..6034a67305 --- /dev/null +++ b/examples/USER/smtbq/log.smtbq.TiO2.g++.4 @@ -0,0 +1,256 @@ +LAMMPS (24 Dec 2015) +# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants + +variable T_depart equal 300 + +variable dt equal 0.0002 + +variable a equal 4.5937 +variable c equal 2.9587 +variable ca equal ${c}/${a} +variable ca equal 2.9587/${a} +variable ca equal 2.9587/4.5937 + +variable nx equal 6 +variable ny equal 6 +variable nz equal 11 + +variable bx equal ${a}*${nx} +variable bx equal 4.5937*${nx} +variable bx equal 4.5937*6 +variable by equal ${a}*${ny} +variable by equal 4.5937*${ny} +variable by equal 4.5937*6 +variable bz equal ${c}*${nz} +variable bz equal 2.9587*${nz} +variable bz equal 2.9587*11 +# ======================================================================= + +units metal +atom_style charge +dimension 3 +boundary p p p + + +lattice sc 1.0 +Lattice spacing in x,y,z = 1 1 1 +region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 27.5622 0 ${by} 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 27.5622 0 27.5622 0 ${bz} 0.0 0.0 0.0 +region box_vide prism 0 27.5622 0 27.5622 0 32.5457 0.0 0.0 0.0 +create_box 2 box_vide +Created triclinic box = (0 0 0) to (27.5622 27.5622 32.5457) with tilt (0 0 0) + 1 by 2 by 2 MPI processor grid + +#lattice sc 1.0 +#region box_TiO2 block 0 ${bx} 0 ${by} 0 ${bz} + +# titanium atoms +lattice custom ${a} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 +lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 +lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.644077758669482 basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 +Lattice spacing in x,y,z = 4.5937 4.5937 2.9587 + +create_atoms 2 region box_vide +Created 792 atoms + +# Oxygen atoms +lattice custom ${a} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 +lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 +lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.644077758669482 basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 +Lattice spacing in x,y,z = 4.5937 4.5937 2.9587 + +create_atoms 1 region box_vide +Created 1584 atoms + + +mass 1 16.00 +group Oxy type 1 +1584 atoms in group Oxy +compute chargeOxy Oxy property/atom q +compute q_Oxy Oxy reduce ave c_chargeOxy + +mass 2 47.867 +group Ti type 2 +792 atoms in group Ti +compute chargeTi Ti property/atom q +compute q_Ti Ti reduce ave c_chargeTi + +velocity all create ${T_depart} 277387 +velocity all create 300 277387 + +pair_style smtbq +pair_coeff * * ffield.smtbq.TiO2 O Ti +Reading potential file ffield.smtbq.TiO2 with DATE: 2015-10-22 + +neighbor 0.5 bin +neigh_modify every 20 delay 0 check yes + +timestep ${dt} +timestep 0.0002 + +thermo_style custom step temp press pe ke etotal c_q_Ti c_q_Oxy lx ly lz vol +thermo_modify flush yes +thermo 1 + + +#dump 5 all custom 500 boxAlpha_alumina.lammpstrj id type q x y z + +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12.6744 + ghost atom cutoff = 12.6744 + binsize = 6.3372 -> bins = 5 5 6 +Memory usage per processor = 4.60415 Mbytes +Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume + 0 300 44365.066 -15815.239 92.097853 -15723.142 2.5521775 -1.2760888 27.5622 27.5622 32.5457 24724.15 + 1 299.90799 44372.657 -15815.211 92.069608 -15723.142 2.5521771 -1.2760885 27.5622 27.5622 32.5457 24724.15 + 2 299.64406 44386.645 -15815.13 91.988581 -15723.142 2.5521705 -1.2760852 27.5622 27.5622 32.5457 24724.15 + 3 299.20863 44406.97 -15814.997 91.854908 -15723.142 2.5521584 -1.2760792 27.5622 27.5622 32.5457 24724.15 + 4 298.60246 44433.509 -15814.812 91.668818 -15723.143 2.552141 -1.2760705 27.5622 27.5622 32.5457 24724.15 + 5 297.82659 44466.206 -15814.574 91.430631 -15723.144 2.5521181 -1.276059 27.5622 27.5622 32.5457 24724.15 + 6 296.88235 44505.016 -15814.285 91.140758 -15723.144 2.5520898 -1.2760449 27.5622 27.5622 32.5457 24724.15 + 7 295.77139 44549.856 -15813.945 90.7997 -15723.145 2.5520562 -1.2760281 27.5622 27.5622 32.5457 24724.15 + 8 294.49562 44600.663 -15813.555 90.408048 -15723.147 2.5520173 -1.2760087 27.5622 27.5622 32.5457 24724.15 + 9 293.05725 44657.353 -15813.114 89.966478 -15723.148 2.5519732 -1.2759866 27.5622 27.5622 32.5457 24724.15 + 10 291.45876 44719.821 -15812.625 89.475755 -15723.149 2.551924 -1.275962 27.5622 27.5622 32.5457 24724.15 +Loop time of 161.071 on 4 procs for 10 steps with 2376 atoms + +Performance: 0.001 ns/day, 22370.960 hours/ns, 0.062 timesteps/s +99.8% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 161.07 | 161.07 | 161.07 | 0.0 |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0021119 | 0.0024694 | 0.0026705 | 0.4 | 0.00 +Output | 0.00060225 | 0.00070065 | 0.00098777 | 0.6 | 0.00 +Modify | 0.00012326 | 0.00013238 | 0.00014782 | 0.1 | 0.00 +Other | | 0.0001593 | | | 0.00 + +Nlocal: 594 ave 630 max 558 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 7638 ave 7674 max 7602 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 492624 ave 522720 max 462528 min +Histogram: 2 0 0 0 0 0 0 0 0 2 + +Total # of neighbors = 1970496 +Ave neighs/atom = 829.333 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 3 +#thermo 15 +fix 1 all box/relax tri 0.0 vmax 0.001 +minimize 1.0e-3 1.0e-5 1000 10000 +WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) +Neighbor list info ... + 1 neighbor list requests + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12.6744 + ghost atom cutoff = 12.6744 + binsize = 6.3372 -> bins = 5 5 6 +Memory usage per processor = 5.97915 Mbytes +Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume + 10 291.45876 44719.821 -15812.625 89.475755 -15723.149 2.551924 -1.275962 27.5622 27.5622 32.5457 24724.15 + 11 291.45876 38966.735 -15814.114 89.475755 -15724.638 2.5514114 -1.2757057 27.582769 27.582778 32.578246 24785.835 +Loop time of 22.3212 on 4 procs for 1 steps with 2376 atoms + +99.9% CPU use with 4 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = energy tolerance + Energy initial, next-to-last, final = + -15812.6250198 -15812.6250198 -15814.1138993 + Force two-norm initial, final = 1103.27 950.466 + Force max component initial, final = 758.704 657.184 + Final line search alpha, max atom move = 1.31804e-06 0.000866193 + Iterations, force evaluations = 1 1 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 22.32 | 22.32 | 22.32 | 0.0 |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00042605 | 0.00043178 | 0.00043893 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.0004204 | | | 0.00 + +Nlocal: 594 ave 600 max 587 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Nghost: 7638 ave 7645 max 7632 min +Histogram: 1 0 0 1 0 1 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 492126 ave 497133 max 486366 min +Histogram: 1 0 0 0 1 0 1 0 0 1 + +Total # of neighbors = 1968506 +Ave neighs/atom = 828.496 +Neighbor list builds = 0 +Dangerous builds = 0 + +unfix 1 +thermo 1 +fix 3 all nve +run 10 +Neighbor list info ... + 1 neighbor list requests + update every 20 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12.6744 + ghost atom cutoff = 12.6744 + binsize = 6.3372 -> bins = 5 5 6 +Memory usage per processor = 4.85415 Mbytes +Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume + 11 291.45876 38966.735 -15814.114 89.475755 -15724.638 2.5514114 -1.2757057 27.582769 27.582778 32.578246 24785.835 + 12 289.71602 39034.428 -15813.58 88.940745 -15724.639 2.5513568 -1.2756784 27.582769 27.582778 32.578246 24785.835 + 13 287.81994 39107.705 -15813 88.358662 -15724.641 2.5512976 -1.2756488 27.582769 27.582778 32.578246 24785.835 + 14 285.77378 39186.429 -15812.373 87.730505 -15724.642 2.5512335 -1.2756168 27.582769 27.582778 32.578246 24785.835 + 15 283.58105 39270.434 -15811.702 87.057353 -15724.644 2.5511647 -1.2755824 27.582769 27.582778 32.578246 24785.835 + 16 281.24552 39359.544 -15810.986 86.340362 -15724.646 2.5510913 -1.2755457 27.582769 27.582778 32.578246 24785.835 + 17 278.77119 39453.574 -15810.229 85.580761 -15724.648 2.5510134 -1.2755067 27.582769 27.582778 32.578246 24785.835 + 18 276.16232 39552.323 -15809.43 84.779855 -15724.65 2.5509311 -1.2754655 27.582769 27.582778 32.578246 24785.835 + 19 273.42337 39655.586 -15808.592 83.939017 -15724.652 2.5508445 -1.2754223 27.582769 27.582778 32.578246 24785.835 + 20 270.55904 39763.139 -15807.715 83.05969 -15724.655 2.5507538 -1.2753769 27.582769 27.582778 32.578246 24785.835 + 21 267.57425 39874.754 -15806.801 82.14338 -15724.658 2.5506591 -1.2753296 27.582769 27.582778 32.578246 24785.835 +Loop time of 170.172 on 4 procs for 10 steps with 2376 atoms + +Performance: 0.001 ns/day, 23634.979 hours/ns, 0.059 timesteps/s +99.9% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 170.17 | 170.17 | 170.17 | 0.0 |100.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0025029 | 0.0028628 | 0.0030224 | 0.4 | 0.00 +Output | 0.00063372 | 0.00081372 | 0.0011685 | 0.7 | 0.00 +Modify | 0.00012541 | 0.0001539 | 0.00021005 | 0.3 | 0.00 +Other | | 0.0001655 | | | 0.00 + +Nlocal: 594 ave 600 max 587 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Nghost: 7638 ave 7645 max 7632 min +Histogram: 1 0 0 1 0 1 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 490100 ave 495079 max 484284 min +Histogram: 1 0 0 0 1 0 1 0 0 1 + +Total # of neighbors = 1960398 +Ave neighs/atom = 825.083 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:06:39 From eb063200bf1a8d69170e37e506448a4d07817166 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 17:59:15 +0000 Subject: [PATCH 03/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14411 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- examples/USER/smtbq/log.smtbq.Al | 279 ---------------------------- examples/USER/smtbq/log.smtbq.Al2O3 | 210 --------------------- examples/USER/smtbq/log.smtbq.TiO2 | 255 ------------------------- 3 files changed, 744 deletions(-) delete mode 100644 examples/USER/smtbq/log.smtbq.Al delete mode 100644 examples/USER/smtbq/log.smtbq.Al2O3 delete mode 100644 examples/USER/smtbq/log.smtbq.TiO2 diff --git a/examples/USER/smtbq/log.smtbq.Al b/examples/USER/smtbq/log.smtbq.Al deleted file mode 100644 index b52a37c2ed..0000000000 --- a/examples/USER/smtbq/log.smtbq.Al +++ /dev/null @@ -1,279 +0,0 @@ -LAMMPS (23 Oct 2015) -# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants - -variable T_depart equal 300 -variable dt equal 0.0002 - -#Constante -variable rac3 equal sqrt(3.0) -variable rac1_2 equal sqrt(0.5) -variable rac3_2 equal sqrt(1.5) - -#Structure -variable a equal 4.05 - -variable nx equal 10 -variable ny equal 7 -variable nz equal 4 - -variable bx equal ${a}*${nx}*${rac1_2} -variable bx equal 4.05*${nx}*${rac1_2} -variable bx equal 4.05*10*${rac1_2} -variable bx equal 4.05*10*0.707106781186548 -variable by equal ${a}*${ny}*${rac3_2} -variable by equal 4.05*${ny}*${rac3_2} -variable by equal 4.05*7*${rac3_2} -variable by equal 4.05*7*1.22474487139159 -variable bz equal ${a}*${nz}*${rac3} -variable bz equal 4.05*${nz}*${rac3} -variable bz equal 4.05*4*${rac3} -variable bz equal 4.05*4*1.73205080756888 -# ======================================================================= - -units metal -atom_style charge -dimension 3 -boundary p p p - - -lattice sc 1.0 -Lattice spacing in x,y,z = 1 1 1 -region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0 -region box_vide prism 0 28.6378246380552 0 ${by} 0 ${bz} 0.0 0.0 0.0 -region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 ${bz} 0.0 0.0 0.0 -region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 28.0592230826159 0.0 0.0 0.0 -create_box 1 box_vide -Created triclinic box = (0 0 0) to (28.6378 34.7215 28.0592) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid - -# Aluminium atoms z = [111] -lattice custom ${a} a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 -lattice custom 4.05 a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 -lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 -lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 -lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 1.73205080756888 basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667 -Lattice spacing in x,y,z = 2.86378 4.96022 7.01481 - -create_atoms 1 region box_vide -Created 1680 atoms - -mass 1 26.98 - -velocity all create ${T_depart} 277387 -velocity all create 300 277387 - -pair_style smtbq -pair_coeff * * ffield.smtbq.Al Al - -neighbor 0.5 bin -neigh_modify every 20 delay 0 check yes - -timestep ${dt} -timestep 0.0002 - -thermo_style custom step temp press pe ke etotal lx ly lz vol -thermo_modify flush yes -thermo 1 - - -#dump 5 all custom 1 box_Al.lammpstrj id type q x y z - -fix 3 all nve -run 10 -Neighbor list info ... - 1 neighbor list requests - update every 20 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 11.6714 - ghost atom cutoff = 11.6714 - binsize = 5.8357 -> bins = 5 6 5 -Memory usage per processor = 4.52298 Mbytes -Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume - 0 300 729.26605 -5600.8541 65.108335 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 1 299.98323 729.90439 -5600.8505 65.104695 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 2 299.93288 731.82072 -5600.8395 65.093767 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 3 299.84896 735.01448 -5600.8213 65.075556 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 4 299.7315 739.48472 -5600.7958 65.050064 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 5 299.58053 745.23012 -5600.7631 65.017299 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 6 299.39609 752.24896 -5600.723 64.977269 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 7 299.17822 760.5391 -5600.6757 64.929985 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 8 298.92698 770.098 -5600.6212 64.875459 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 9 298.64244 780.92261 -5600.5595 64.813707 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 10 298.32468 793.00943 -5600.4905 64.744743 -5535.7458 28.637825 34.721517 28.059223 27900.653 -Loop time of 5.10336 on 1 procs for 10 steps with 1680 atoms - -Performance: 0.034 ns/day, 708.800 hours/ns, 1.959 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 5.1023 | 5.1023 | 5.1023 | 0.0 | 99.98 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00045538 | 0.00045538 | 0.00045538 | 0.0 | 0.01 -Output | 0.00024509 | 0.00024509 | 0.00024509 | 0.0 | 0.00 -Modify | 0.00026131 | 0.00026131 | 0.00026131 | 0.0 | 0.01 -Other | | 0.0001056 | | | 0.00 - -Nlocal: 1680 ave 1680 max 1680 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7518 ave 7518 max 7518 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 638400 ave 638400 max 638400 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 638400 -Ave neighs/atom = 380 -Neighbor list builds = 0 -Dangerous builds = 0 - -unfix 3 -#thermo 15 -fix 1 all box/relax tri 0.0 vmax 0.001 -minimize 1.0e-8 1.0e-10 1000 10000 -WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 11.6714 - ghost atom cutoff = 11.6714 - binsize = 5.8357 -> bins = 5 6 5 -Memory usage per processor = 5.64798 Mbytes -Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume - 10 298.32468 793.00943 -5600.4905 64.744743 -5535.7458 28.637825 34.721517 28.059223 27900.653 - 11 298.32468 2483.3228 -5600.5212 64.744743 -5535.7764 28.617938 34.697425 28.039771 27842.617 - 12 298.32468 3102.6624 -5600.6242 64.744743 -5535.8795 28.594201 34.68783 28.048729 27820.715 - 13 298.32468 1681.0688 -5600.6477 64.744743 -5535.903 28.619779 34.708131 28.055945 27869.065 - 14 298.32468 949.90841 -5600.6635 64.744743 -5535.9187 28.648416 34.718691 28.044409 27893.966 - 15 298.32468 2009.1662 -5600.7072 64.744743 -5535.9625 28.652241 34.703261 28.01635 27857.391 - 16 298.32468 2867.1434 -5600.7192 64.744743 -5535.9744 28.626861 34.69005 28.022309 27828.038 - 17 298.32468 2480.3207 -5600.7238 64.744743 -5535.9791 28.618046 34.695106 28.040113 27841.2 - 18 298.32468 2482.4906 -5600.7249 64.744743 -5535.9802 28.614169 34.704237 28.036452 27841.119 - 19 298.32468 2495.6209 -5600.7261 64.744743 -5535.9813 28.616207 34.697481 28.039453 27840.662 - 20 298.32468 2210.2897 -5600.7271 64.744743 -5535.9823 28.620852 34.699678 28.042926 27850.393 - 21 298.32468 2464.137 -5600.734 64.744743 -5535.9893 28.625239 34.687085 28.040022 27841.67 - 22 298.32468 3091.7034 -5600.7471 64.744743 -5536.0024 28.623565 34.674943 28.02983 27820.181 - 23 298.32468 2334.9443 -5600.7598 64.744743 -5536.0151 28.634413 34.684598 28.037298 27845.891 - 24 298.32468 2462.2836 -5600.7767 64.744743 -5536.032 28.615834 34.692433 28.044664 27841.422 - 25 298.32468 2652.08 -5600.7914 64.744743 -5536.0466 28.61528 34.695645 28.035991 27834.85 - 26 298.32468 2365.4126 -5600.7923 64.744743 -5536.0476 28.618526 34.699347 28.039662 27844.623 - 27 298.32468 2334.9429 -5600.7934 64.744743 -5536.0486 28.61826 34.698136 28.041941 27845.656 - 28 298.32468 2501.1598 -5600.7937 64.744743 -5536.0489 28.616356 34.695993 28.039825 27839.982 - 29 298.32468 2506.0962 -5600.794 64.744743 -5536.0493 28.617255 34.699031 28.036317 27839.811 - 30 298.32468 2400.7588 -5600.7942 64.744743 -5536.0495 28.618372 34.698464 28.039299 27843.404 - 31 298.32468 2499.8528 -5600.7945 64.744743 -5536.0497 28.61702 34.69385 28.040945 27840.021 - 32 298.32468 2629.5393 -5600.7967 64.744743 -5536.0519 28.619399 34.691546 28.036003 27835.58 - 33 298.32468 2397.5939 -5600.7973 64.744743 -5536.0526 28.621863 34.69535 28.03848 27843.488 - 34 298.32468 2222.7714 -5600.8007 64.744743 -5536.056 28.609815 34.705091 28.048395 27849.426 - 35 298.32468 2748.5871 -5600.8042 64.744743 -5536.0594 28.600322 34.6998 28.043876 27831.457 - 36 298.32468 2661.1018 -5600.8166 64.744743 -5536.0719 28.615123 34.696499 28.034947 27834.344 - 37 298.32468 2255.4994 -5600.8185 64.744743 -5536.0737 28.618919 34.702261 28.040497 27848.173 - 38 298.32468 2260.815 -5600.8239 64.744743 -5536.0791 28.614993 34.70246 28.043972 27847.962 - 39 298.32468 2549.2876 -5600.8248 64.744743 -5536.0801 28.612892 34.697988 28.039725 27838.113 - 40 298.32468 2488.3825 -5600.8266 64.744743 -5536.0819 28.623347 34.695524 28.033557 27840.182 - 41 298.32468 2400.9714 -5600.8283 64.744743 -5536.0835 28.619176 34.695733 28.040468 27843.155 - 42 298.32468 2496.6566 -5600.8284 64.744743 -5536.0837 28.617629 34.694692 28.039536 27839.89 - 43 298.32468 2486.2773 -5600.8285 64.744743 -5536.0838 28.617585 34.697413 28.037736 27840.243 - 44 298.32468 2446.3916 -5600.8287 64.744743 -5536.0839 28.617115 34.696389 28.040393 27841.603 - 45 298.32468 2547.2311 -5600.8288 64.744743 -5536.0841 28.615267 34.694882 28.039956 27838.161 - 46 298.32468 2479.9982 -5600.8321 64.744743 -5536.0874 28.603008 34.71581 28.037344 27840.427 - 47 298.32468 2449.645 -5600.8444 64.744743 -5536.0997 28.612743 34.683541 28.054837 27841.375 - 48 298.32468 2682.7109 -5600.8695 64.744743 -5536.1248 28.617414 34.683477 28.042139 27833.265 - 49 298.32468 2350.1707 -5600.8711 64.744743 -5536.1263 28.619236 34.694213 28.043092 27844.6 - 50 298.32468 2486.1481 -5600.8719 64.744743 -5536.1271 28.615167 34.699435 28.038181 27839.955 - 51 298.32468 2498.3384 -5600.8721 64.744743 -5536.1274 28.616069 34.696071 28.039596 27839.537 - 52 298.32468 2443.1247 -5600.8722 64.744743 -5536.1274 28.617616 34.696737 28.039439 27841.421 -Loop time of 36.9389 on 1 procs for 42 steps with 1680 atoms - -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = energy tolerance - Energy initial, next-to-last, final = - -5600.49050006 -5600.87213771 -5600.87218615 - Force two-norm initial, final = 50.879 1.39888 - Force max component initial, final = 29.3783 0.749036 - Final line search alpha, max atom move = 0.0013373 0.00100168 - Iterations, force evaluations = 42 71 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 36.918 | 36.918 | 36.918 | 0.0 | 99.94 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.0033035 | 0.0033035 | 0.0033035 | 0.0 | 0.01 -Output | 0.0011785 | 0.0011785 | 0.0011785 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.01603 | | | 0.04 - -Nlocal: 1680 ave 1680 max 1680 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7518 ave 7518 max 7518 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 638400 ave 638400 max 638400 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 638400 -Ave neighs/atom = 380 -Neighbor list builds = 0 -Dangerous builds = 0 - -unfix 1 -thermo 1 -fix 3 all nve -run 10 -Neighbor list info ... - 1 neighbor list requests - update every 20 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 11.6714 - ghost atom cutoff = 11.6714 - binsize = 5.8357 -> bins = 5 6 5 -Memory usage per processor = 4.52298 Mbytes -Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume - 52 298.32468 2443.1247 -5600.8722 64.744743 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 53 298.28341 2444.4342 -5600.8632 64.735788 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 54 298.20852 2447.019 -5600.847 64.719534 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 55 298.1 2450.8786 -5600.8234 64.695982 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 56 297.95788 2456.0119 -5600.7926 64.665139 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 57 297.7822 2462.4173 -5600.7545 64.62701 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 58 297.57298 2470.0928 -5600.709 64.581604 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 59 297.33028 2479.0363 -5600.6564 64.528932 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 60 297.05416 2489.245 -5600.5964 64.469006 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 61 296.74469 2500.7159 -5600.5293 64.401842 -5536.1274 28.617616 34.696737 28.039439 27841.421 - 62 296.40194 2513.4457 -5600.4549 64.327455 -5536.1274 28.617616 34.696737 28.039439 27841.421 -Loop time of 5.13028 on 1 procs for 10 steps with 1680 atoms - -Performance: 0.034 ns/day, 712.539 hours/ns, 1.949 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 5.1292 | 5.1292 | 5.1292 | 0.0 | 99.98 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00045729 | 0.00045729 | 0.00045729 | 0.0 | 0.01 -Output | 0.00024509 | 0.00024509 | 0.00024509 | 0.0 | 0.00 -Modify | 0.00026488 | 0.00026488 | 0.00026488 | 0.0 | 0.01 -Other | | 0.0001016 | | | 0.00 - -Nlocal: 1680 ave 1680 max 1680 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7518 ave 7518 max 7518 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 638400 ave 638400 max 638400 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 638400 -Ave neighs/atom = 380 -Neighbor list builds = 0 -Dangerous builds = 0 - -Total wall time: 0:00:49 diff --git a/examples/USER/smtbq/log.smtbq.Al2O3 b/examples/USER/smtbq/log.smtbq.Al2O3 deleted file mode 100644 index b7d2ad5ae3..0000000000 --- a/examples/USER/smtbq/log.smtbq.Al2O3 +++ /dev/null @@ -1,210 +0,0 @@ -LAMMPS (23 Oct 2015) -# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants - -variable T_depart equal 300 - -variable dt equal 0.0002 - -# ======================================================================= - -units metal -atom_style charge -dimension 3 -boundary p p p - -read_data data.Alpha - triclinic box = (0 0 0) to (23.769 24.7015 25.9564) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 1800 atoms -# ^ Orthorombic box of corundum strcture - -mass 1 16.00 -group Oxy type 1 -1080 atoms in group Oxy -compute chargeOxy Oxy property/atom q -compute q_Oxy Oxy reduce ave c_chargeOxy - -mass 2 26.98 -group Al type 2 -720 atoms in group Al -compute chargeAl Al property/atom q -compute q_Al Al reduce ave c_chargeAl - -velocity all create ${T_depart} 277387 -velocity all create 300 277387 - -pair_style smtbq -pair_coeff * * ffield.smtbq.Al2O3 O Al - -neighbor 0.5 bin -neigh_modify every 20 delay 0 check yes - -timestep ${dt} -timestep 0.0002 - -thermo_style custom step temp press pe ke etotal c_q_Al c_q_Oxy lx ly lz vol -thermo_modify flush yes -thermo 1 - - -#dump 5 all custom 500 boxAlpha_alumina.lammpstrj id type q x y z - -fix 3 all nve -run 10 -Neighbor list info ... - 1 neighbor list requests - update every 20 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 11.6714 - ghost atom cutoff = 11.6714 - binsize = 5.8357 -> bins = 5 5 5 -Memory usage per processor = 4.12573 Mbytes -Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume - 0 300 91921.482 -11494.543 69.7617 -11424.781 2.6095997 -1.7397331 23.769 24.7015 25.9564 15239.78 - 1 299.96467 91922.303 -11494.535 69.753485 -11424.781 2.6095996 -1.739733 23.769 24.7015 25.9564 15239.78 - 2 299.75126 91933.246 -11494.485 69.703859 -11424.781 2.6095978 -1.7397318 23.769 24.7015 25.9564 15239.78 - 3 299.36045 91954.835 -11494.394 69.61298 -11424.781 2.6095941 -1.7397294 23.769 24.7015 25.9564 15239.78 - 4 298.79335 91986.343 -11494.262 69.481107 -11424.781 2.6095886 -1.7397257 23.769 24.7015 25.9564 15239.78 - 5 298.05151 92027.62 -11494.09 69.3086 -11424.781 2.6095812 -1.7397208 23.769 24.7015 25.9564 15239.78 - 6 297.13689 92078.615 -11493.877 69.095915 -11424.781 2.6095721 -1.7397147 23.769 24.7015 25.9564 15239.78 - 7 296.05187 92139.141 -11493.625 68.843606 -11424.781 2.6095613 -1.7397075 23.769 24.7015 25.9564 15239.78 - 8 294.79923 92209.15 -11493.334 68.552319 -11424.781 2.6095488 -1.7396992 23.769 24.7015 25.9564 15239.78 - 9 293.38215 92288.12 -11493.004 68.222793 -11424.781 2.6095347 -1.7396898 23.769 24.7015 25.9564 15239.78 - 10 291.80421 92376.81 -11492.637 67.855859 -11424.781 2.6095191 -1.7396794 23.769 24.7015 25.9564 15239.78 -Loop time of 169.694 on 1 procs for 10 steps with 1800 atoms - -Performance: 0.001 ns/day, 23568.600 hours/ns, 0.059 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 169.69 | 169.69 | 169.69 | 0.0 |100.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00075507 | 0.00075507 | 0.00075507 | 0.0 | 0.00 -Output | 0.00078607 | 0.00078607 | 0.00078607 | 0.0 | 0.00 -Modify | 0.00034666 | 0.00034666 | 0.00034666 | 0.0 | 0.00 -Other | | 0.0001752 | | | 0.00 - -Nlocal: 1800 ave 1800 max 1800 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 11490 ave 11490 max 11490 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 1.4472e+06 ave 1.4472e+06 max 1.4472e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1447200 -Ave neighs/atom = 804 -Neighbor list builds = 0 -Dangerous builds = 0 - -unfix 3 -thermo 1 -fix 1 all box/relax tri 0.0 vmax 0.001 -minimize 1.0e-3 1.0e-5 1000 10000 -WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 11.6714 - ghost atom cutoff = 11.6714 - binsize = 5.8357 -> bins = 5 5 5 -Memory usage per processor = 5.50073 Mbytes -Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume - 10 291.80421 92376.81 -11492.637 67.855859 -11424.781 2.6095191 -1.7396794 23.769 24.7015 25.9564 15239.78 - 11 291.80421 84416.246 -11494.722 67.855859 -11426.866 2.6087748 -1.7391832 23.787835 24.721015 25.982356 15279.17 -Loop time of 25.4145 on 1 procs for 1 steps with 1800 atoms - -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = energy tolerance - Energy initial, next-to-last, final = - -11492.6369832 -11492.6369832 -11494.7221261 - Force two-norm initial, final = 1453.27 1325.26 - Force max component initial, final = 968.201 892.249 - Final line search alpha, max atom move = 1.03284e-06 0.000921553 - Iterations, force evaluations = 1 1 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 25.414 | 25.414 | 25.414 | -nan |100.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00013995 | 0.00013995 | 0.00013995 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.0005064 | | | 0.00 - -Nlocal: 1800 ave 1800 max 1800 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 11408 ave 11408 max 11408 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 1.44456e+06 ave 1.44456e+06 max 1.44456e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1444562 -Ave neighs/atom = 802.534 -Neighbor list builds = 0 -Dangerous builds = 0 - -unfix 1 -thermo 1 -fix 3 all nve -run 10 -Neighbor list info ... - 1 neighbor list requests - update every 20 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 11.6714 - ghost atom cutoff = 11.6714 - binsize = 5.8357 -> bins = 5 5 5 -Memory usage per processor = 4.37573 Mbytes -Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume - 11 291.80421 84416.246 -11494.722 67.855859 -11426.866 2.6087748 -1.7391832 23.787835 24.721015 25.982356 15279.17 - 12 290.08293 84514.767 -11494.322 67.455594 -11426.866 2.6087578 -1.7391718 23.787835 24.721015 25.982356 15279.17 - 13 288.21041 84622.406 -11493.886 67.020161 -11426.866 2.6087394 -1.7391596 23.787835 24.721015 25.982356 15279.17 - 14 286.19128 84738.689 -11493.417 66.550634 -11426.866 2.6087199 -1.7391466 23.787835 24.721015 25.982356 15279.17 - 15 284.03049 84864.242 -11492.914 66.048166 -11426.866 2.6086993 -1.7391329 23.787835 24.721015 25.982356 15279.17 - 16 281.73331 84998.125 -11492.38 65.513983 -11426.866 2.6086776 -1.7391184 23.787835 24.721015 25.982356 15279.17 - 17 279.30534 85140.233 -11491.815 64.949384 -11426.866 2.6086551 -1.7391034 23.787835 24.721015 25.982356 15279.17 - 18 276.75244 85290.405 -11491.221 64.355737 -11426.866 2.6086319 -1.7390879 23.787835 24.721015 25.982356 15279.17 - 19 274.08079 85448.449 -11490.6 63.734472 -11426.866 2.608608 -1.739072 23.787835 24.721015 25.982356 15279.17 - 20 271.29678 85614.064 -11489.953 63.087082 -11426.866 2.6085837 -1.7390558 23.787835 24.721015 25.982356 15279.17 - 21 268.40708 85786.72 -11489.281 62.415114 -11426.865 2.608559 -1.7390393 23.787835 24.721015 25.982356 15279.17 -Loop time of 170.699 on 1 procs for 10 steps with 1800 atoms - -Performance: 0.001 ns/day, 23708.143 hours/ns, 0.059 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 170.7 | 170.7 | 170.7 | 0.0 |100.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00068879 | 0.00068879 | 0.00068879 | 0.0 | 0.00 -Output | 0.0008359 | 0.0008359 | 0.0008359 | 0.0 | 0.00 -Modify | 0.00031424 | 0.00031424 | 0.00031424 | 0.0 | 0.00 -Other | | 0.0001593 | | | 0.00 - -Nlocal: 1800 ave 1800 max 1800 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 11222 ave 11222 max 11222 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 1.44126e+06 ave 1.44126e+06 max 1.44126e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1441262 -Ave neighs/atom = 800.701 -Neighbor list builds = 0 -Dangerous builds = 0 - -Total wall time: 0:06:42 diff --git a/examples/USER/smtbq/log.smtbq.TiO2 b/examples/USER/smtbq/log.smtbq.TiO2 deleted file mode 100644 index 433a7ceabb..0000000000 --- a/examples/USER/smtbq/log.smtbq.TiO2 +++ /dev/null @@ -1,255 +0,0 @@ -LAMMPS (23 Oct 2015) -# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants - -variable T_depart equal 300 - -variable dt equal 0.0002 - -variable a equal 4.5937 -variable c equal 2.9587 -variable ca equal ${c}/${a} -variable ca equal 2.9587/${a} -variable ca equal 2.9587/4.5937 - -variable nx equal 6 -variable ny equal 6 -variable nz equal 11 - -variable bx equal ${a}*${nx} -variable bx equal 4.5937*${nx} -variable bx equal 4.5937*6 -variable by equal ${a}*${ny} -variable by equal 4.5937*${ny} -variable by equal 4.5937*6 -variable bz equal ${c}*${nz} -variable bz equal 2.9587*${nz} -variable bz equal 2.9587*11 -# ======================================================================= - -units metal -atom_style charge -dimension 3 -boundary p p p - - -lattice sc 1.0 -Lattice spacing in x,y,z = 1 1 1 -region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0 -region box_vide prism 0 27.5622 0 ${by} 0 ${bz} 0.0 0.0 0.0 -region box_vide prism 0 27.5622 0 27.5622 0 ${bz} 0.0 0.0 0.0 -region box_vide prism 0 27.5622 0 27.5622 0 32.5457 0.0 0.0 0.0 -create_box 2 box_vide -Created triclinic box = (0 0 0) to (27.5622 27.5622 32.5457) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid - -#lattice sc 1.0 -#region box_TiO2 block 0 ${bx} 0 ${by} 0 ${bz} - -# titanium atoms -lattice custom ${a} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 -lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 -lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.644077758669482 basis 0.0 0.0 0.0 basis 0.5 0.5 0.5 -Lattice spacing in x,y,z = 4.5937 4.5937 2.9587 - -create_atoms 2 region box_vide -Created 792 atoms - -# Oxygen atoms -lattice custom ${a} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 -lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 -lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.644077758669482 basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5 -Lattice spacing in x,y,z = 4.5937 4.5937 2.9587 - -create_atoms 1 region box_vide -Created 1584 atoms - - -mass 1 16.00 -group Oxy type 1 -1584 atoms in group Oxy -compute chargeOxy Oxy property/atom q -compute q_Oxy Oxy reduce ave c_chargeOxy - -mass 2 47.867 -group Ti type 2 -792 atoms in group Ti -compute chargeTi Ti property/atom q -compute q_Ti Ti reduce ave c_chargeTi - -velocity all create ${T_depart} 277387 -velocity all create 300 277387 - -pair_style smtbq -pair_coeff * * ffield.smtbq.TiO2 O Ti - -neighbor 0.5 bin -neigh_modify every 20 delay 0 check yes - -timestep ${dt} -timestep 0.0002 - -thermo_style custom step temp press pe ke etotal c_q_Ti c_q_Oxy lx ly lz vol -thermo_modify flush yes -thermo 1 - - -#dump 5 all custom 500 boxAlpha_alumina.lammpstrj id type q x y z - -fix 3 all nve -run 10 -Neighbor list info ... - 1 neighbor list requests - update every 20 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12.6744 - ghost atom cutoff = 12.6744 - binsize = 6.3372 -> bins = 5 5 6 -Memory usage per processor = 4.77264 Mbytes -Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume - 0 300 44365.066 -15815.239 92.097853 -15723.142 2.5521775 -1.2760888 27.5622 27.5622 32.5457 24724.15 - 1 299.90455 44375.373 -15815.21 92.06855 -15723.142 2.552178 -1.276089 27.5622 27.5622 32.5457 24724.15 - 2 299.63739 44392.241 -15815.128 91.986534 -15723.142 2.5521725 -1.2760863 27.5622 27.5622 32.5457 24724.15 - 3 299.19899 44415.606 -15814.994 91.85195 -15723.142 2.5521616 -1.2760808 27.5622 27.5622 32.5457 24724.15 - 4 298.59012 44445.345 -15814.808 91.665031 -15723.143 2.5521454 -1.2760727 27.5622 27.5622 32.5457 24724.15 - 5 297.81185 44481.382 -15814.57 91.426105 -15723.144 2.5521238 -1.2760619 27.5622 27.5622 32.5457 24724.15 - 6 296.86552 44523.683 -15814.28 91.135592 -15723.144 2.5520969 -1.2760484 27.5622 27.5622 32.5457 24724.15 - 7 295.75281 44572.175 -15813.939 90.793996 -15723.145 2.5520648 -1.2760324 27.5622 27.5622 32.5457 24724.15 - 8 294.47564 44626.778 -15813.548 90.401913 -15723.147 2.5520274 -1.2760137 27.5622 27.5622 32.5457 24724.15 - 9 293.03623 44687.401 -15813.108 89.960027 -15723.148 2.5519849 -1.2759925 27.5622 27.5622 32.5457 24724.15 - 10 291.43711 44753.932 -15812.618 89.469107 -15723.149 2.5519374 -1.2759687 27.5622 27.5622 32.5457 24724.15 -Loop time of 570.52 on 1 procs for 10 steps with 2376 atoms - -Performance: 0.000 ns/day, 79238.948 hours/ns, 0.018 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 570.52 | 570.52 | 570.52 | 0.0 |100.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00087428 | 0.00087428 | 0.00087428 | 0.0 | 0.00 -Output | 0.00091386 | 0.00091386 | 0.00091386 | 0.0 | 0.00 -Modify | 0.00045085 | 0.00045085 | 0.00045085 | 0.0 | 0.00 -Other | | 0.0001979 | | | 0.00 - -Nlocal: 2376 ave 2376 max 2376 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 13138 ave 13138 max 13138 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 1.9705e+06 ave 1.9705e+06 max 1.9705e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1970496 -Ave neighs/atom = 829.333 -Neighbor list builds = 0 -Dangerous builds = 0 - -unfix 3 -#thermo 15 -fix 1 all box/relax tri 0.0 vmax 0.001 -minimize 1.0e-3 1.0e-5 1000 10000 -WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168) -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12.6744 - ghost atom cutoff = 12.6744 - binsize = 6.3372 -> bins = 5 5 6 -Memory usage per processor = 6.14764 Mbytes -Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume - 10 291.43711 44753.932 -15812.618 89.469107 -15723.149 2.5519374 -1.2759687 27.5622 27.5622 32.5457 24724.15 - 11 291.43711 39000.467 -15814.109 89.469107 -15724.639 2.5514249 -1.2757124 27.582771 27.582775 32.578246 24785.834 -Loop time of 80.5411 on 1 procs for 1 steps with 2376 atoms - -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = energy tolerance - Energy initial, next-to-last, final = - -15812.6183471 -15812.6183471 -15814.1085593 - Force two-norm initial, final = 1104.2 951.386 - Force max component initial, final = 759.352 657.815 - Final line search alpha, max atom move = 1.31691e-06 0.000866285 - Iterations, force evaluations = 1 1 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 80.54 | 80.54 | 80.54 | 0.0 |100.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00016761 | 0.00016761 | 0.00016761 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.0006053 | | | 0.00 - -Nlocal: 2376 ave 2376 max 2376 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 13138 ave 13138 max 13138 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 1.96864e+06 ave 1.96864e+06 max 1.96864e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1968636 -Ave neighs/atom = 828.551 -Neighbor list builds = 0 -Dangerous builds = 0 - -unfix 1 -thermo 1 -fix 3 all nve -run 10 -Neighbor list info ... - 1 neighbor list requests - update every 20 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12.6744 - ghost atom cutoff = 12.6744 - binsize = 6.3372 -> bins = 5 5 6 -Memory usage per processor = 5.02264 Mbytes -Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume - 11 291.43711 39000.467 -15814.109 89.469107 -15724.639 2.5514249 -1.2757124 27.582771 27.582775 32.578246 24785.834 - 12 289.69465 39072.309 -15813.575 88.934185 -15724.641 2.551372 -1.275686 27.582771 27.582775 32.578246 24785.834 - 13 287.79928 39149.855 -15812.994 88.352321 -15724.642 2.5513146 -1.2756573 27.582771 27.582775 32.578246 24785.834 - 14 285.75427 39232.968 -15812.368 87.724515 -15724.644 2.5512525 -1.2756262 27.582771 27.582775 32.578246 24785.834 - 15 283.56312 39321.472 -15811.697 87.05185 -15724.645 2.5511856 -1.2755928 27.582771 27.582775 32.578246 24785.834 - 16 281.22962 39415.185 -15810.983 86.335481 -15724.647 2.5511143 -1.2755571 27.582771 27.582775 32.578246 24785.834 - 17 278.75777 39513.921 -15810.226 85.57664 -15724.649 2.5510384 -1.2755192 27.582771 27.582775 32.578246 24785.834 - 18 276.15182 39617.471 -15809.428 84.776632 -15724.651 2.5509583 -1.2754791 27.582771 27.582775 32.578246 24785.834 - 19 273.41625 39725.622 -15808.591 83.936831 -15724.654 2.5508739 -1.275437 27.582771 27.582775 32.578246 24785.834 - 20 270.55575 39838.144 -15807.715 83.058679 -15724.656 2.5507855 -1.2753928 27.582771 27.582775 32.578246 24785.834 - 21 267.57523 39954.804 -15806.802 82.14368 -15724.659 2.5506932 -1.2753466 27.582771 27.582775 32.578246 24785.834 -Loop time of 606.774 on 1 procs for 10 steps with 2376 atoms - -Performance: 0.000 ns/day, 84274.222 hours/ns, 0.016 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 606.77 | 606.77 | 606.77 | 0.0 |100.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00085855 | 0.00085855 | 0.00085855 | 0.0 | 0.00 -Output | 0.00087833 | 0.00087833 | 0.00087833 | 0.0 | 0.00 -Modify | 0.00041723 | 0.00041723 | 0.00041723 | 0.0 | 0.00 -Other | | 0.0001888 | | | 0.00 - -Nlocal: 2376 ave 2376 max 2376 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 13138 ave 13138 max 13138 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 1.96049e+06 ave 1.96049e+06 max 1.96049e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1960492 -Ave neighs/atom = 825.123 -Neighbor list builds = 0 -Dangerous builds = 0 - -Total wall time: 0:23:48 From eb20bcf1831f99b369e995dc6d2a17f8796656d6 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 18:56:25 +0000 Subject: [PATCH 04/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14412 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 1c6f40c403..e9d9cbba4c 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "24 Dec 2015" +#define LAMMPS_VERSION "11 Jan 2016" From 9e4140c9540d90c815f248e45b9d59801a676bbc Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 18:57:20 +0000 Subject: [PATCH 05/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14413 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Manual.html | 4 ++-- doc/Manual.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Manual.html b/doc/Manual.html index d21ad9e988..b5e44f7a1f 100644 --- a/doc/Manual.html +++ b/doc/Manual.html @@ -134,8 +134,8 @@

LAMMPS Documentation¶

-
-

24 Dec 2015 version¶

+
+

11 Jan 2016 version¶

Version info:¶

diff --git a/doc/Manual.txt b/doc/Manual.txt index 849d4b5a62..02dc5528fc 100644 --- a/doc/Manual.txt +++ b/doc/Manual.txt @@ -1,7 +1,7 @@ LAMMPS Users Manual - + @@ -21,7 +21,7 @@

LAMMPS Documentation :c,h3 -24 Dec 2015 version :c,h4 +11 Jan 2016 version :c,h4 Version info: :h4 From 173d4861a2d46b827db70662ad81b1a172db2906 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 21:59:38 +0000 Subject: [PATCH 06/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14415 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/BODY/body_nparticle.cpp | 68 ++++++++++++++++++++++++++----------- src/BODY/body_nparticle.h | 3 +- src/GRANULAR/fix_pour.cpp | 30 +++++++++++----- 3 files changed, 71 insertions(+), 30 deletions(-) diff --git a/src/BODY/body_nparticle.cpp b/src/BODY/body_nparticle.cpp index e719435693..0e1afd51f4 100644 --- a/src/BODY/body_nparticle.cpp +++ b/src/BODY/body_nparticle.cpp @@ -98,25 +98,16 @@ int BodyNparticle::unpack_border_body(AtomVecBody::Bonus *bonus, double *buf) ------------------------------------------------------------------------- */ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble, - char **ifile, char **dfile) + int *ifile, double *dfile) { AtomVecBody::Bonus *bonus = &avec->bonus[ibonus]; - // error in data file if any values are NULL - - for (int i = 0; i < ninteger; i++) - if (ifile[i] == NULL) - error->one(FLERR,"Invalid format in Bodies section of data file"); - for (int i = 0; i < ndouble; i++) - if (dfile[i] == NULL) - error->one(FLERR,"Invalid format in Bodies section of data file"); - // set ninteger, ndouble in bonus and allocate 2 vectors of ints, doubles if (ninteger != 1) error->one(FLERR,"Incorrect # of integer values in " "Bodies section of data file"); - int nsub = atoi(ifile[0]); + int nsub = ifile[0]; if (nsub < 1) error->one(FLERR,"Incorrect integer value in " "Bodies section of data file"); @@ -133,12 +124,12 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble, // diagonalize inertia tensor double tensor[3][3]; - tensor[0][0] = atof(dfile[0]); - tensor[1][1] = atof(dfile[1]); - tensor[2][2] = atof(dfile[2]); - tensor[0][1] = tensor[1][0] = atof(dfile[3]); - tensor[0][2] = tensor[2][0] = atof(dfile[4]); - tensor[1][2] = tensor[2][1] = atof(dfile[5]); + tensor[0][0] = dfile[0]; + tensor[1][1] = dfile[1]; + tensor[2][2] = dfile[2]; + tensor[0][1] = tensor[1][0] = dfile[3]; + tensor[0][2] = tensor[2][0] = dfile[4]; + tensor[1][2] = tensor[2][1] = dfile[5]; double *inertia = bonus->inertia; double evectors[3][3]; @@ -188,9 +179,9 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble, int j = 6; int k = 0; for (int i = 0; i < nsub; i++) { - delta[0] = atof(dfile[j]); - delta[1] = atof(dfile[j+1]); - delta[2] = atof(dfile[j+2]); + delta[0] = dfile[j]; + delta[1] = dfile[j+1]; + delta[2] = dfile[j+2]; MathExtra::transpose_matvec(ex_space,ey_space,ez_space, delta,&bonus->dvalue[k]); j += 3; @@ -198,6 +189,43 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble, } } +/* ---------------------------------------------------------------------- + return radius of body particle defined by ifile/dfile params + params are ordered as in data file + called by Molecule class which needs single body size +------------------------------------------------------------------------- */ + +double BodyNparticle::radius_body(int ninteger, int ndouble, + int *ifile, double *dfile) +{ + int nsub = ifile[0]; + if (nsub < 1) + error->one(FLERR,"Incorrect integer value in " + "Bodies section of data file"); + if (ndouble != 6 + 3*nsub) + error->one(FLERR,"Incorrect # of floating-point values in " + "Bodies section of data file"); + + // sub-particle coords are relative to body center at (0,0,0) + // offset = 6 for sub-particle coords + + double onerad; + double maxrad = 0.0; + double delta[3]; + + int offset = 6; + for (int i = 0; i < nsub; i++) { + delta[0] = dfile[offset]; + delta[1] = dfile[offset+1]; + delta[2] = dfile[offset+2]; + offset += 3; + onerad = MathExtra::len3(delta); + maxrad = MAX(maxrad,onerad); + } + + return maxrad; +} + /* ---------------------------------------------------------------------- */ int BodyNparticle::noutcol() diff --git a/src/BODY/body_nparticle.h b/src/BODY/body_nparticle.h index 1e7e082a46..8d6fb27bf6 100644 --- a/src/BODY/body_nparticle.h +++ b/src/BODY/body_nparticle.h @@ -34,7 +34,8 @@ class BodyNparticle : public Body { int pack_border_body(struct AtomVecBody::Bonus *, double *); int unpack_border_body(struct AtomVecBody::Bonus *, double *); - void data_body(int, int, int, char **, char **); + void data_body(int, int, int, int *, double *); + double radius_body(int, int, int *, double *); int noutrow(int); int noutcol(); diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 8086a68d40..3e1ea6b89c 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -378,6 +378,13 @@ void FixPour::pre_exchange() if (next_reneighbor != update->ntimestep) return; + // clear ghost count and any ghost bonus data internal to AtomVec + // same logic as beginning of Comm::exchange() + // do it now b/c inserting atoms will overwrite ghost atoms + + atom->nghost = 0; + atom->avec->clear_bonus(); + // find current max atom and molecule IDs if necessary if (!idnext) find_maxid(); @@ -638,7 +645,11 @@ void FixPour::pre_exchange() radtmp = newcoord[3]; atom->radius[n] = radtmp; atom->rmass[n] = 4.0*MY_PI/3.0 * radtmp*radtmp*radtmp * denstmp; - } else atom->add_molecule_atom(onemols[imol],m,n,maxtag_all); + } else { + onemols[imol]->quat_external = quat; + atom->add_molecule_atom(onemols[imol],m,n,maxtag_all); + } + modify->create_attribute(n); } } @@ -667,7 +678,8 @@ void FixPour::pre_exchange() // reset global natoms,nbonds,etc // increment maxtag_all and maxmol_all if necessary // if global map exists, reset it now instead of waiting for comm - // since adding atoms messes up ghosts + // since other pre-exchange fixes may use it + // invoke map_init() b/c atom count has grown if (ninserted_atoms) { atom->natoms += ninserted_atoms; @@ -682,7 +694,6 @@ void FixPour::pre_exchange() if (maxtag_all >= MAXTAGINT) error->all(FLERR,"New atom IDs exceed maximum allowed ID"); if (atom->map_style) { - atom->nghost = 0; atom->map_init(); atom->map_set(); } @@ -1008,23 +1019,24 @@ void *FixPour::extract(const char *str, int &itype) } else { - // find a molecule in template with matching type + // loop over onemols molecules + // skip a molecule with no atoms as large as itype + oneradius = 0.0; for (int i = 0; i < nmol; i++) { - if (itype-ntype > onemols[i]->ntypes) continue; + if (itype > ntype+onemols[i]->ntypes) continue; double *radius = onemols[i]->radius; int *type = onemols[i]->type; int natoms = onemols[i]->natoms; - // check radii of matching types in Molecule + // check radii of atoms in Molecule with matching types // default to 0.5, if radii not defined in Molecule // same as atom->avec->create_atom(), invoked in pre_exchange() - oneradius = 0.0; for (int i = 0; i < natoms; i++) - if (type[i] == itype-ntype) { + if (type[i]+ntype == itype) { if (radius) oneradius = MAX(oneradius,radius[i]); - else oneradius = 0.5; + else oneradius = MAX(oneradius,0.5); } } } From b5086e3d69705f0be97f9e854f6b3134c0cdc09d Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 21:59:49 +0000 Subject: [PATCH 07/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14416 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/atom.cpp | 64 ++++++++++++++++++++++++++++++--------------------- src/set.cpp | 65 +++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 90 insertions(+), 39 deletions(-) diff --git a/src/atom.cpp b/src/atom.cpp index 24362be4d4..9f822a6071 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1318,45 +1318,51 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus, tagint id_offset) void Atom::data_bodies(int n, char *buf, AtomVecBody *avec_body, tagint id_offset) { - int j,m,tagdata,ninteger,ndouble; + int j,m,nvalues,tagdata,ninteger,ndouble; int maxint = 0; int maxdouble = 0; - char **ivalues = NULL; - char **dvalues = NULL; + int *ivalues = NULL; + double *dvalues = NULL; // loop over lines of body data - // tokenize the lines into ivalues and dvalues - // if I own atom tag, unpack its values + // if I own atom tag, tokenize lines into ivalues/dvalues, call data_body() + // else skip values for (int i = 0; i < n; i++) { if (i == 0) tagdata = ATOTAGINT(strtok(buf," \t\n\r\f")) + id_offset; else tagdata = ATOTAGINT(strtok(NULL," \t\n\r\f")) + id_offset; - ninteger = atoi(strtok(NULL," \t\n\r\f")); - ndouble = atoi(strtok(NULL," \t\n\r\f")); - - if (ninteger > maxint) { - delete [] ivalues; - maxint = ninteger; - ivalues = new char*[maxint]; - } - if (ndouble > maxdouble) { - delete [] dvalues; - maxdouble = ndouble; - dvalues = new char*[maxdouble]; - } - - for (j = 0; j < ninteger; j++) - ivalues[j] = strtok(NULL," \t\n\r\f"); - for (j = 0; j < ndouble; j++) - dvalues[j] = strtok(NULL," \t\n\r\f"); - if (tagdata <= 0 || tagdata > map_tag_max) error->one(FLERR,"Invalid atom ID in Bodies section of data file"); + + if ((m = map(tagdata)) >= 0) { + ninteger = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); + ndouble = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); - if ((m = map(tagdata)) >= 0) + if (ninteger > maxint) { + delete [] ivalues; + maxint = ninteger; + ivalues = new int[maxint]; + } + if (ndouble > maxdouble) { + delete [] dvalues; + maxdouble = ndouble; + dvalues = new double[maxdouble]; + } + + for (j = 0; j < ninteger; j++) + ivalues[j] = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); + for (j = 0; j < ndouble; j++) + dvalues[j] = force->numeric(FLERR,strtok(NULL," \t\n\r\f")); + avec_body->data_body(m,ninteger,ndouble,ivalues,dvalues); + + } else { + nvalues = 2 + ninteger + ndouble; // number of values to skip + for (j = 0; j < nvalues; j++) + strtok(NULL," \t\n\r\f"); + } } delete [] ivalues; @@ -1588,7 +1594,13 @@ void Atom::add_molecule_atom(Molecule *onemol, int iatom, else if (rmass_flag) rmass[ilocal] = 4.0*MY_PI/3.0 * radius[ilocal]*radius[ilocal]*radius[ilocal]; - + if (onemol->bodyflag) { + body[ilocal] = 0; // as if a body read from data file + onemol->avec_body->data_body(ilocal,onemol->nibody,onemol->ndbody, + onemol->ibodyparams,onemol->dbodyparams); + onemol->avec_body->set_quat(ilocal,onemol->quat_external); + } + if (molecular != 1) return; // add bond topology info diff --git a/src/set.cpp b/src/set.cpp index 33f6b77dc7..8ee5d7654b 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -21,6 +21,7 @@ #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" +#include "atom_vec_body.h" #include "domain.h" #include "region.h" #include "group.h" @@ -41,7 +42,7 @@ using namespace MathConst; enum{ATOM_SELECT,MOL_SELECT,TYPE_SELECT,GROUP_SELECT,REGION_SELECT}; enum{TYPE,TYPE_FRACTION,MOLECULE,X,Y,Z,CHARGE,MASS,SHAPE,LENGTH,TRI, - DIPOLE,DIPOLE_RANDOM,QUAT,QUAT_RANDOM,THETA,ANGMOM,OMEGA, + DIPOLE,DIPOLE_RANDOM,QUAT,QUAT_RANDOM,THETA,THETA_RANDOM,ANGMOM,OMEGA, DIAMETER,DENSITY,VOLUME,IMAGE,BOND,ANGLE,DIHEDRAL,IMPROPER, MESO_E,MESO_CV,MESO_RHO,SMD_MASS_DENSITY,SMD_CONTACT_RADIUS,INAME,DNAME}; @@ -221,7 +222,7 @@ void Set::command(int narg, char **arg) else zvalue = force->numeric(FLERR,arg[iarg+3]); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) varparse(arg[iarg+4],4); else wvalue = force->numeric(FLERR,arg[iarg+4]); - if (!atom->ellipsoid_flag && !atom->tri_flag) + if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(QUAT); iarg += 5; @@ -229,7 +230,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"quat/random") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); ivalue = force->inumeric(FLERR,arg[iarg+1]); - if (!atom->ellipsoid_flag && !atom->tri_flag) + if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) error->all(FLERR,"Invalid random number seed in set command"); @@ -248,6 +249,16 @@ void Set::command(int narg, char **arg) set(THETA); iarg += 2; + } else if (strcmp(arg[iarg],"theta/random") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); + ivalue = force->inumeric(FLERR,arg[iarg+1]); + if (!atom->line_flag) + error->all(FLERR,"Cannot set this attribute for this atom style"); + if (ivalue <= 0) + error->all(FLERR,"Invalid random number seed in set command"); + set(THETA_RANDOM); + iarg += 2; + } else if (strcmp(arg[iarg],"angmom") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); @@ -256,7 +267,7 @@ void Set::command(int narg, char **arg) else yvalue = force->numeric(FLERR,arg[iarg+2]); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); else zvalue = force->numeric(FLERR,arg[iarg+3]); - if (!atom->ellipsoid_flag && !atom->tri_flag) + if (!atom->angmom_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(ANGMOM); iarg += 4; @@ -269,7 +280,7 @@ void Set::command(int narg, char **arg) else yvalue = force->numeric(FLERR,arg[iarg+2]); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); else zvalue = force->numeric(FLERR,arg[iarg+3]); - if (!atom->sphere_flag) + if (!atom->omega_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(OMEGA); iarg += 4; @@ -558,6 +569,7 @@ void Set::set(int keyword) (AtomVecEllipsoid *) atom->style_match("ellipsoid"); AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line"); AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri"); + AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body"); int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { @@ -604,8 +616,9 @@ void Set::set(int keyword) else if (keyword == MESO_E) atom->e[i] = dvalue; else if (keyword == MESO_CV) atom->cv[i] = dvalue; else if (keyword == MESO_RHO) atom->rho[i] = dvalue; - else if (keyword == SMD_MASS_DENSITY) { // set mass from volume and supplied mass density - atom->rmass[i] = atom->vfrac[i] * dvalue; + else if (keyword == SMD_MASS_DENSITY) { + // set mass from volume and supplied mass density + atom->rmass[i] = atom->vfrac[i] * dvalue; } else if (keyword == SMD_CONTACT_RADIUS) atom->contact_radius[i] = dvalue; @@ -678,17 +691,23 @@ void Set::set(int keyword) mu[i][2]*mu[i][2]); } - // set quaternion orientation of ellipsoid or tri particle - + // set quaternion orientation of ellipsoid or tri or body particle + // enforce quat rotation vector in z dir for 2d systems + else if (keyword == QUAT) { double *quat; if (avec_ellipsoid && atom->ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; else if (avec_tri && atom->tri[i] >= 0) quat = avec_tri->bonus[atom->tri[i]].quat; + else if (avec_body && atom->body[i] >= 0) + quat = avec_body->bonus[atom->body[i]].quat; else error->one(FLERR,"Cannot set quaternion for atom that has none"); - + if (domain->dimension == 2 && (xvalue != 0.0 || yvalue != 0.0)) + error->one(FLERR,"Cannot set quaternion with xy components " + "for 2d system"); + double theta2 = MY_PI2 * wvalue/180.0; double sintheta2 = sin(theta2); quat[0] = cos(theta2); @@ -706,7 +725,7 @@ void Set::set(int keyword) avec_line->bonus[atom->line[i]].theta = dvalue; } - // set angmom of ellipsoidal or tri particle + // set angmom or omega of particle else if (keyword == ANGMOM) { atom->angmom[i][0] = xvalue; @@ -720,7 +739,6 @@ void Set::set(int keyword) atom->omega[i][2] = zvalue; } - // reset any or all of 3 image flags else if (keyword == IMAGE) { @@ -768,7 +786,9 @@ void Set::setrandom(int keyword) AtomVecEllipsoid *avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line"); AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri"); + AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body"); RanPark *random = new RanPark(lmp,1); double **x = atom->x; @@ -828,7 +848,7 @@ void Set::setrandom(int keyword) } } - // set quaternions to random orientations in 3d or 2d + // set quaternions to random orientations in 3d and 2d } else if (keyword == QUAT_RANDOM) { int nlocal = atom->nlocal; @@ -842,6 +862,8 @@ void Set::setrandom(int keyword) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; else if (avec_tri && atom->tri[i] >= 0) quat = avec_tri->bonus[atom->tri[i]].quat; + else if (avec_body && atom->body[i] >= 0) + quat = avec_body->bonus[atom->body[i]].quat; else error->one(FLERR,"Cannot set quaternion for atom that has none"); @@ -864,6 +886,8 @@ void Set::setrandom(int keyword) if (select[i]) { if (avec_ellipsoid && atom->ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; + else if (avec_body && atom->body[i] >= 0) + quat = avec_body->bonus[atom->body[i]].quat; else error->one(FLERR,"Cannot set quaternion for atom that has none"); @@ -876,6 +900,21 @@ void Set::setrandom(int keyword) count++; } } + + // set theta to random orientation in 2d + + } else if (keyword == QUAT_RANDOM) { + int nlocal = atom->nlocal; + double theta; + for (i = 0; i < nlocal; i++) { + if (select[i]) { + if (atom->line[i] < 0) + error->one(FLERR,"Cannot set theta for atom that is not a line"); + random->reset(seed,x[i]); + avec_line->bonus[atom->line[i]].theta = MY_2PI*random->uniform(); + count++; + } + } } delete random; From 7ae65d4dcf2494ad8e2e2f9755a56fe5b42c21fc Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 22:00:02 +0000 Subject: [PATCH 08/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14417 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/molecule.cpp | 94 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/src/molecule.cpp b/src/molecule.cpp index 8e772218c1..8ac2c037ee 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -16,6 +16,7 @@ #include "molecule.h" #include "atom.h" #include "atom_vec.h" +#include "atom_vec_body.h" #include "force.h" #include "comm.h" #include "domain.h" @@ -163,7 +164,8 @@ Molecule::~Molecule() compute center = geometric center of molecule also compute: dx = displacement of each atom from center - molradius = radius of molecule from center including finite-size particles + molradius = radius of molecule from center + including finite-size particles or body particles ------------------------------------------------------------------------- */ void Molecule::compute_center() @@ -446,6 +448,13 @@ void Molecule::read(int flag) itensor[4] *= sizescale*sizescale*sizescale*sizescale*sizescale; itensor[5] *= sizescale*sizescale*sizescale*sizescale*sizescale; } + else if (strstr(line,"body")) { + bodyflag = 1; + avec_body = (AtomVecBody *) atom->style_match("body"); + if (!avec_body) + error->all(FLERR,"Molecule file requires atom style body"); + sscanf(line,"%d %d",&nibody,&ndbody); + } else break; } @@ -542,6 +551,19 @@ void Molecule::read(int flag) if (flag) shaketype_read(line); else skip_lines(natoms,line); + } else if (strcmp(keyword,"Body Integers") == 0) { + if (bodyflag == 0 || nibody == 0) + error->all(FLERR,"Molecule file has body params " + "but no setting for them"); + ibodyflag = 1; + body(flag,0,line); + } else if (strcmp(keyword,"Body Doubles") == 0) { + if (bodyflag == 0 || ndbody == 0) + error->all(FLERR,"Molecule file has body params " + "but no setting for them"); + dbodyflag = 1; + body(flag,1,line); + } else error->one(FLERR,"Unknown section in molecule file"); parse_keyword(1,line,keyword); @@ -560,6 +582,10 @@ void Molecule::read(int flag) error->all(FLERR,"Molecule file has special flags but no bonds"); if ((shakeflagflag || shakeatomflag || shaketypeflag) && !shakeflag) error->all(FLERR,"Molecule file shake info is incomplete"); + if (bodyflag && nibody && ibodyflag == 0) + error->all(FLERR,"Molecule file has no Body Integers section"); + if (bodyflag && ndbody && dbodyflag == 0) + error->all(FLERR,"Molecule file has no Body Doubles section"); } // auto-generate special bonds @@ -570,6 +596,21 @@ void Molecule::read(int flag) maxspecial = atom->maxspecial; if (flag) special_generate(); } + + // body particle must have natom = 1 + // set radius by having body class compute its own radius + + if (bodyflag) { + radiusflag = 1; + if (natoms != 1) + error->all(FLERR,"Molecule natoms must be 1 for body particle"); + if (sizescale != 1.0) + error->all(FLERR,"Molecule sizescale must be 1.0 for body particle"); + if (flag) { + radius[0] = avec_body->radius_body(nibody,ndbody,ibodyparams,dbodyparams); + maxradius = radius[0]; + } + } } /* ---------------------------------------------------------------------- @@ -1244,6 +1285,44 @@ void Molecule::shaketype_read(char *line) } } +/* ---------------------------------------------------------------------- + read body params from file + pflag = 0/1 for integer/double params +------------------------------------------------------------------------- */ + +void Molecule::body(int flag, int pflag, char *line) +{ + int i,ncount; + + int nparam = nibody; + if (pflag) nparam = ndbody; + + int nword = 0; + while (nword < nparam) { + readline(line); + + ncount = atom->count_words(line); + if (ncount == 0) + error->one(FLERR,"Too few values in body section of molecule file"); + if (nword+ncount > nparam) + error->all(FLERR,"Too many values in body section of molecule file"); + + if (flag) { + if (pflag == 0) { + ibodyparams[nword++] = force->inumeric(FLERR,strtok(line," \t\n\r\f")); + for (i = 1; i < ncount; i++) + ibodyparams[nword++] = + force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); + } else { + dbodyparams[nword++] = force->numeric(FLERR,strtok(line," \t\n\r\f")); + for (i = 1; i < ncount; i++) + dbodyparams[nword++] = + force->numeric(FLERR,strtok(NULL," \t\n\r\f")); + } + } else nword += ncount; + } +} + /* ---------------------------------------------------------------------- error check molecule attributes and topology against system settings flag = 0, just check this molecule @@ -1318,6 +1397,7 @@ void Molecule::initialize() nbonds = nangles = ndihedrals = nimpropers = 0; ntypes = 0; nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0; + nibody = ndbody = 0; bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0; maxspecial = 0; @@ -1326,6 +1406,7 @@ void Molecule::initialize() bondflag = angleflag = dihedralflag = improperflag = 0; nspecialflag = specialflag = 0; shakeflag = shakeflagflag = shakeatomflag = shaketypeflag = 0; + bodyflag = ibodyflag = dbodyflag = 0; centerflag = massflag = comflag = inertiaflag = 0; tag_require = 0; @@ -1359,6 +1440,9 @@ void Molecule::initialize() shake_atom = NULL; shake_type = NULL; + ibodyparams = NULL; + dbodyparams = NULL; + dx = NULL; dxcom = NULL; dxbody = NULL; @@ -1445,6 +1529,11 @@ void Molecule::allocate() memory->create(shake_atom,natoms,4,"molecule:shake_flag"); memory->create(shake_type,natoms,3,"molecule:shake_flag"); } + + if (bodyflag) { + if (nibody) memory->create(ibodyparams,nibody,"molecule:ibodyparams"); + if (ndbody) memory->create(dbodyparams,ndbody,"molecule:dbodyparams"); + } } /* ---------------------------------------------------------------------- @@ -1493,6 +1582,9 @@ void Molecule::deallocate() memory->destroy(dx); memory->destroy(dxcom); memory->destroy(dxbody); + + memory->destroy(ibodyparams); + memory->destroy(dbodyparams); } /* ---------------------------------------------------------------------- From f5946c73f74c0cf2b6392a65769fb58c0e175a07 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 22:00:04 +0000 Subject: [PATCH 09/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14418 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/molecule.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/molecule.h b/src/molecule.h index 35b25edf88..5f45a47d2c 100644 --- a/src/molecule.h +++ b/src/molecule.h @@ -26,11 +26,13 @@ class Molecule : protected Pointers { int last; // 1 if last molecule in set, else 0 // number of atoms,bonds,etc in molecule + // nibody,ndbody = # of integer/double fields in body int natoms; int nbonds,nangles,ndihedrals,nimpropers; int ntypes; int nbondtypes,nangletypes,ndihedraltypes,nimpropertypes; + int nibody,ndbody; // max bond,angle,etc per atom @@ -43,6 +45,7 @@ class Molecule : protected Pointers { int bondflag,angleflag,dihedralflag,improperflag; int nspecialflag,specialflag; int shakeflag,shakeflagflag,shakeatomflag,shaketypeflag; + int bodyflag,ibodyflag,dbodyflag; // 1 if attribute defined or computed, 0 if not @@ -83,6 +86,10 @@ class Molecule : protected Pointers { tagint **shake_atom; int **shake_type; + class AtomVecBody *avec_body; + int *ibodyparams; // integer and double body params + double *dbodyparams; + double center[3]; // geometric center of molecule double masstotal; // total mass of molecule double com[3]; // center of mass of molecule @@ -102,6 +109,9 @@ class Molecule : protected Pointers { double **dxbody; // displacement of each atom relative to COM // in body frame (diagonalized interia tensor) + double *quat_external; // orientation imposed by external class + // e.g. FixPour or CreateAtoms + Molecule(class LAMMPS *, int, char **, int &); ~Molecule(); void compute_center(); @@ -117,7 +127,7 @@ class Molecule : protected Pointers { int toffset,boffset,aoffset,doffset,ioffset; int autospecial; double sizescale; - + void read(int); void coords(char *); void types(char *); @@ -134,6 +144,7 @@ class Molecule : protected Pointers { void shakeflag_read(char *); void shakeatom_read(char *); void shaketype_read(char *); + void body(int, int, char *); void initialize(); void allocate(); From d3f534f5cc922563478e8b999a03fe19f33bd601 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 22:00:09 +0000 Subject: [PATCH 10/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14419 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/atom_vec_body.cpp | 68 ++++++++++++++++++++++++++++++++++++++----- src/atom_vec_body.h | 8 ++++- 2 files changed, 67 insertions(+), 9 deletions(-) diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index 2f6c4e48b3..27fdaa1a7b 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -26,6 +26,10 @@ #include "memory.h" #include "error.h" +// debug +#include "update.h" + + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -48,6 +52,7 @@ AtomVecBody::AtomVecBody(LAMMPS *lmp) : AtomVec(lmp) atom->body_flag = 1; atom->rmass_flag = 1; atom->angmom_flag = atom->torque_flag = 1; + atom->radius_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; bonus = NULL; @@ -103,7 +108,7 @@ void AtomVecBody::process_args(int narg, char **arg) // bptr values = max number of additional ivalues/dvalues from Body class size_forward = 7 + bptr->size_forward; - size_border = 16 + bptr->size_border; + size_border = 18 + bptr->size_border; } /* ---------------------------------------------------------------------- @@ -128,6 +133,7 @@ void AtomVecBody::grow(int n) v = memory->grow(atom->v,nmax,3,"atom:v"); f = memory->grow(atom->f,nmax*comm->nthreads,3,"atom:f"); + radius = memory->grow(atom->radius,nmax,"atom:radius"); rmass = memory->grow(atom->rmass,nmax,"atom:rmass"); angmom = memory->grow(atom->angmom,nmax,3,"atom:angmom"); torque = memory->grow(atom->torque,nmax*comm->nthreads,3,"atom:torque"); @@ -147,7 +153,8 @@ void AtomVecBody::grow_reset() tag = atom->tag; type = atom->type; mask = atom->mask; image = atom->image; x = atom->x; v = atom->v; f = atom->f; - rmass = atom->rmass; angmom = atom->angmom; torque = atom->torque; + radius = atom->radius; rmass = atom->rmass; + angmom = atom->angmom; torque = atom->torque; body = atom->body; } @@ -183,6 +190,7 @@ void AtomVecBody::copy(int i, int j, int delflag) v[j][1] = v[i][1]; v[j][2] = v[i][2]; + radius[j] = radius[i]; rmass[j] = rmass[i]; angmom[j][0] = angmom[i][0]; angmom[j][1] = angmom[i][1]; @@ -571,6 +579,8 @@ int AtomVecBody::pack_border(int n, int *list, double *buf, buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(mask[j]).d; + buf[m++] = radius[j]; + buf[m++] = rmass[j]; if (body[j] < 0) buf[m++] = ubuf(0).d; else { buf[m++] = ubuf(1).d; @@ -606,6 +616,8 @@ int AtomVecBody::pack_border(int n, int *list, double *buf, buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(mask[j]).d; + buf[m++] = radius[j]; + buf[m++] = rmass[j]; if (body[j] < 0) buf[m++] = ubuf(0).d; else { buf[m++] = ubuf(1).d; @@ -651,6 +663,8 @@ int AtomVecBody::pack_border_vel(int n, int *list, double *buf, buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(mask[j]).d; + buf[m++] = radius[j]; + buf[m++] = rmass[j]; if (body[j] < 0) buf[m++] = ubuf(0).d; else { buf[m++] = ubuf(1).d; @@ -693,6 +707,8 @@ int AtomVecBody::pack_border_vel(int n, int *list, double *buf, buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(mask[j]).d; + buf[m++] = radius[j]; + buf[m++] = rmass[j]; if (body[j] < 0) buf[m++] = ubuf(0).d; else { buf[m++] = ubuf(1).d; @@ -777,6 +793,8 @@ int AtomVecBody::pack_border_hybrid(int n, int *list, double *buf) m = 0; for (i = 0; i < n; i++) { j = list[i]; + buf[m++] = radius[j]; + buf[m++] = rmass[j]; if (body[j] < 0) buf[m++] = ubuf(0).d; else { buf[m++] = ubuf(1).d; @@ -814,6 +832,8 @@ void AtomVecBody::unpack_border(int n, int first, double *buf) tag[i] = (tagint) ubuf(buf[m++]).i; type[i] = (int) ubuf(buf[m++]).i; mask[i] = (int) ubuf(buf[m++]).i; + radius[i] = buf[m++]; + rmass[i] = buf[m++]; body[i] = (int) ubuf(buf[m++]).i; if (body[i] == 0) body[i] = -1; else { @@ -862,6 +882,8 @@ void AtomVecBody::unpack_border_vel(int n, int first, double *buf) tag[i] = (tagint) ubuf(buf[m++]).i; type[i] = (int) ubuf(buf[m++]).i; mask[i] = (int) ubuf(buf[m++]).i; + radius[i] = buf[m++]; + rmass[i] = buf[m++]; body[i] = (int) ubuf(buf[m++]).i; if (body[i] == 0) body[i] = -1; else { @@ -909,6 +931,8 @@ int AtomVecBody::unpack_border_hybrid(int n, int first, double *buf) m = 0; last = first + n; for (i = first; i < last; i++) { + radius[i] = buf[m++]; + rmass[i] = buf[m++]; body[i] = (int) ubuf(buf[m++]).i; if (body[i] == 0) body[i] = -1; else { @@ -954,7 +978,7 @@ int AtomVecBody::pack_exchange(int i, double *buf) buf[m++] = ubuf(type[i]).d; buf[m++] = ubuf(mask[i]).d; buf[m++] = ubuf(image[i]).d; - + buf[m++] = radius[i]; buf[m++] = rmass[i]; buf[m++] = angmom[i][0]; buf[m++] = angmom[i][1]; @@ -1008,7 +1032,7 @@ int AtomVecBody::unpack_exchange(double *buf) type[nlocal] = (int) ubuf(buf[m++]).i; mask[nlocal] = (int) ubuf(buf[m++]).i; image[nlocal] = (imageint) ubuf(buf[m++]).i; - + radius[nlocal] = buf[m++]; rmass[nlocal] = buf[m++]; angmom[nlocal][0] = buf[m++]; angmom[nlocal][1] = buf[m++]; @@ -1067,11 +1091,11 @@ int AtomVecBody::size_restart() int nlocal = atom->nlocal; for (i = 0; i < nlocal; i++) if (body[i] >= 0) { - n += 25; + n += 26; if (intdoubleratio == 1) n += bonus[body[i]].ninteger; else n += (bonus[body[i]].ninteger+1)/2; n += bonus[body[i]].ndouble; - } else n += 16; + } else n += 17; if (atom->nextra_restart) for (int iextra = 0; iextra < atom->nextra_restart; iextra++) @@ -1101,6 +1125,7 @@ int AtomVecBody::pack_restart(int i, double *buf) buf[m++] = v[i][1]; buf[m++] = v[i][2]; + buf[m++] = radius[i]; buf[m++] = rmass[i]; buf[m++] = angmom[i][0]; buf[m++] = angmom[i][1]; @@ -1161,6 +1186,7 @@ int AtomVecBody::unpack_restart(double *buf) v[nlocal][1] = buf[m++]; v[nlocal][2] = buf[m++]; + radius[nlocal] = buf[m++]; rmass[nlocal] = buf[m++]; angmom[nlocal][0] = buf[m++]; angmom[nlocal][1] = buf[m++]; @@ -1228,6 +1254,7 @@ void AtomVecBody::create_atom(int itype, double *coord) v[nlocal][1] = 0.0; v[nlocal][2] = 0.0; + radius[nlocal] = 0.5; rmass[nlocal] = 1.0; angmom[nlocal][0] = 0.0; angmom[nlocal][1] = 0.0; @@ -1274,6 +1301,7 @@ void AtomVecBody::data_atom(double *coord, imageint imagetmp, char **values) angmom[nlocal][0] = 0.0; angmom[nlocal][1] = 0.0; angmom[nlocal][2] = 0.0; + radius[nlocal] = 0.5; atom->nlocal++; } @@ -1302,12 +1330,12 @@ int AtomVecBody::data_atom_hybrid(int nlocal, char **values) ------------------------------------------------------------------------- */ void AtomVecBody::data_body(int m, int ninteger, int ndouble, - char **ivalues, char **dvalues) + int *ivalues, double *dvalues) { if (body[m]) error->one(FLERR,"Assigning body parameters to non-body atom"); if (nlocal_bonus == nmax_bonus) grow_bonus(); - bptr->data_body(nlocal_bonus,ninteger,ndouble,ivalues,dvalues); bonus[nlocal_bonus].ilocal = m; + bptr->data_body(nlocal_bonus,ninteger,ndouble,ivalues,dvalues); body[m] = nlocal_bonus++; } @@ -1448,6 +1476,29 @@ int AtomVecBody::write_vel_hybrid(FILE *fp, double *buf) return 3; } +/* ---------------------------------------------------------------------- + body computes its size based on ivalues/dvalues and returns it +------------------------------------------------------------------------- */ + +double AtomVecBody::radius_body(int ninteger, int ndouble, + int *ivalues, double *dvalues) +{ + return bptr->radius_body(ninteger,ndouble,ivalues,dvalues); +} + +/* ---------------------------------------------------------------------- + reset quat orientation for atom M to quat_external + called by Atom:add_molecule_atom() +------------------------------------------------------------------------- */ + +void AtomVecBody::set_quat(int m, double *quat_external) +{ + if (body[m] < 0) error->one(FLERR,"Assigning quat to non-body atom"); + double *quat = bonus[body[m]].quat; + quat[0] = quat_external[0]; quat[1] = quat_external[1]; + quat[2] = quat_external[2]; quat[3] = quat_external[3]; +} + /* ---------------------------------------------------------------------- return # of bytes of allocated memory ------------------------------------------------------------------------- */ @@ -1464,6 +1515,7 @@ bigint AtomVecBody::memory_usage() if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3); if (atom->memcheck("f")) bytes += memory->usage(f,nmax*comm->nthreads,3); + if (atom->memcheck("radius")) bytes += memory->usage(radius,nmax); if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax); if (atom->memcheck("angmom")) bytes += memory->usage(angmom,nmax,3); if (atom->memcheck("torque")) bytes += diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h index e35f695edd..4ed27f6168 100644 --- a/src/atom_vec_body.h +++ b/src/atom_vec_body.h @@ -85,13 +85,19 @@ class AtomVecBody : public AtomVec { // manipulate Bonus data structure for extra atom info void clear_bonus(); - void data_body(int, int, int, char **, char **); + void data_body(int, int, int, int *, double *); + // methods used by other classes to query/set body info + + double radius_body(int, int, int *, double *); + void set_quat(int, double *); + private: tagint *tag; int *type,*mask; imageint *image; double **x,**v,**f; + double *radius; double *rmass; double **angmom,**torque; int *body; From e24ed78dd11421d88d0140cbae22696cee7415f7 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 22:00:15 +0000 Subject: [PATCH 11/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14420 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/read_data.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/read_data.cpp b/src/read_data.cpp index 7e02f56edf..b0af40140f 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -1469,7 +1469,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type) void ReadData::bodies(int firstpass) { - int i,m,nchunk,nline,nmax,ninteger,ndouble,nword,onebody,tmp; + int i,m,nchunk,nline,nmax,ninteger,ndouble,nword,ncount,onebody,tmp; char *eof; int mapflag = 0; @@ -1500,8 +1500,7 @@ void ReadData::bodies(int firstpass) sscanf(&buffer[m],"%d %d %d",&tmp,&ninteger,&ndouble); m += strlen(&buffer[m]); - // read lines one at a time into buffer - // make copy of line and count words + // read lines one at a time into buffer and count words // count to ninteger and ndouble until have enough lines onebody = 0; @@ -1510,23 +1509,29 @@ void ReadData::bodies(int firstpass) while (nword < ninteger) { eof = fgets(&buffer[m],MAXLINE,fp); if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); - nword += atom->count_words(&buffer[m],copy); + ncount = atom->count_words(&buffer[m],copy); + if (ncount == 0) + error->one(FLERR,"Too few values in body lines in data file"); + nword += ncount; m += strlen(&buffer[m]); onebody++; } if (nword > ninteger) - error->one(FLERR,"Too many value in body lines in data file"); + error->one(FLERR,"Too many values in body lines in data file"); nword = 0; while (nword < ndouble) { eof = fgets(&buffer[m],MAXLINE,fp); if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); - nword += atom->count_words(&buffer[m],copy); + ncount = atom->count_words(&buffer[m],copy); + if (ncount == 0) + error->one(FLERR,"Too few values in body lines in data file"); + nword += ncount; m += strlen(&buffer[m]); onebody++; } if (nword > ndouble) - error->one(FLERR,"Too many value in body lines in data file"); + error->one(FLERR,"Too many values in body lines in data file"); if (onebody+1 > MAXBODY) error->one(FLERR, From e72cef0c3ad3f863dc15988ce5af05fd6b93b01a Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 22:00:29 +0000 Subject: [PATCH 12/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14421 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MISC/fix_deposit.cpp | 28 +++++++++++++++++++--------- src/body.h | 4 +++- src/create_atoms.cpp | 35 +++++++++++++++++++++-------------- 3 files changed, 43 insertions(+), 24 deletions(-) diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp index bfac27fa52..a7729ba839 100644 --- a/src/MISC/fix_deposit.cpp +++ b/src/MISC/fix_deposit.cpp @@ -301,6 +301,13 @@ void FixDeposit::pre_exchange() if (next_reneighbor != update->ntimestep) return; + // clear ghost count and any ghost bonus data internal to AtomVec + // same logic as beginning of Comm::exchange() + // do it now b/c inserting atoms will overwrite ghost atoms + + atom->nghost = 0; + atom->avec->clear_bonus(); + // compute current offset = bottom of insertion volume double offset = 0.0; @@ -524,8 +531,10 @@ void FixDeposit::pre_exchange() atom->v[n][0] = vnew[0]; atom->v[n][1] = vnew[1]; atom->v[n][2] = vnew[2]; - if (mode == MOLECULE) + if (mode == MOLECULE) { + onemols[imol]->quat_external = quat; atom->add_molecule_atom(onemols[imol],m,n,maxtag_all); + } modify->create_attribute(n); } } @@ -559,7 +568,8 @@ void FixDeposit::pre_exchange() // reset global natoms,nbonds,etc // increment maxtag_all and maxmol_all if necessary // if global map exists, reset it now instead of waiting for comm - // since adding atoms messes up ghosts + // since other pre-exchange fixes may use it + // invoke map_init() b/c atom count has grown if (success) { atom->natoms += natom; @@ -576,7 +586,6 @@ void FixDeposit::pre_exchange() error->all(FLERR,"New atom IDs exceed maximum allowed ID"); if (mode == MOLECULE && atom->molecule_flag) maxmol_all++; if (atom->map_style) { - atom->nghost = 0; atom->map_init(); atom->map_set(); } @@ -811,23 +820,24 @@ void *FixDeposit::extract(const char *str, int &itype) } else { - // find a molecule in template with matching type + // loop over onemols molecules + // skip a molecule with no atoms as large as itype + oneradius = 0.0; for (int i = 0; i < nmol; i++) { - if (itype-ntype > onemols[i]->ntypes) continue; + if (itype > ntype+onemols[i]->ntypes) continue; double *radius = onemols[i]->radius; int *type = onemols[i]->type; int natoms = onemols[i]->natoms; - // check radii of matching types in Molecule + // check radii of atoms in Molecule with matching types // default to 0.5, if radii not defined in Molecule // same as atom->avec->create_atom(), invoked in pre_exchange() - oneradius = 0.0; for (int i = 0; i < natoms; i++) - if (type[i] == itype-ntype) { + if (type[i]+ntype == itype) { if (radius) oneradius = MAX(oneradius,radius[i]); - else oneradius = 0.5; + else oneradius = MAX(oneradius,0.5); } } } diff --git a/src/body.h b/src/body.h index 35e2612832..59001620f8 100644 --- a/src/body.h +++ b/src/body.h @@ -41,11 +41,13 @@ class Body : protected Pointers { virtual int unpack_border_body(struct AtomVecBody::Bonus *, double *) {return 0;} - virtual void data_body(int, int, int, char **, char **) = 0; + virtual void data_body(int, int, int, int*, double *) = 0; virtual int noutrow(int) = 0; virtual int noutcol() = 0; virtual void output(int, int, double *) = 0; virtual int image(int, double, double, int *&, double **&) = 0; + + virtual double radius_body(int, int, int *, double *) {return 0.0;} }; } diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 22d58bdc64..8b9a1ea7af 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -347,6 +347,13 @@ void CreateAtoms::command(int narg, char **arg) } } + // clear ghost count and any ghost bonus data internal to AtomVec + // same logic as beginning of Comm::exchange() + // do it now b/c creating atoms will overwrite ghost atoms + + atom->nghost = 0; + atom->avec->clear_bonus(); + // add atoms/molecules in one of 3 ways bigint natoms_previous = atom->natoms; @@ -400,11 +407,10 @@ void CreateAtoms::command(int narg, char **arg) if (atom->tag_enable) atom->tag_extend(); atom->tag_check(); - // create global mapping of atoms - // zero nghost in case are adding new atoms to existing atoms + // if global map exists, reset it + // invoke map_init() b/c atom count has grown if (atom->map_style) { - atom->nghost = 0; atom->map_init(); atom->map_set(); } @@ -595,7 +601,7 @@ void CreateAtoms::add_single() if (mode == ATOM) atom->avec->create_atom(ntype,xone); else if (quatone[0] == 0.0 && quatone[1] == 0.0 && quatone[2] == 0.0) add_molecule(xone); - else add_molecule(xone,&quatone[0]); + else add_molecule(xone,quatone); } } @@ -807,24 +813,25 @@ void CreateAtoms::add_molecule(double *center, double *quat_user) int n; double r[3],rotmat[3][3],quat[4],xnew[3]; - if (domain->dimension == 3) { - r[0] = ranmol->uniform() - 0.5; - r[1] = ranmol->uniform() - 0.5; - r[2] = ranmol->uniform() - 0.5; - } else { - r[0] = r[1] = 0.0; - r[2] = 1.0; - } - if (quat_user) { quat[0] = quat_user[0]; quat[1] = quat_user[1]; quat[2] = quat_user[2]; quat[3] = quat_user[3]; } else { - double theta = ranmol->uniform() * MY_2PI; + if (domain->dimension == 3) { + r[0] = ranmol->uniform() - 0.5; + r[1] = ranmol->uniform() - 0.5; + r[2] = ranmol->uniform() - 0.5; + } else { + r[0] = r[1] = 0.0; + r[2] = 1.0; + } MathExtra::norm3(r); + double theta = ranmol->uniform() * MY_2PI; MathExtra::axisangle_to_quat(r,theta,quat); } + MathExtra::quat_to_mat(quat,rotmat); + onemol->quat_external = quat; // create atoms in molecule with atom ID = 0 and mol ID = 0 // reset in caller after all moleclues created by all procs From 681ebfaf8f72e6aaca2bd87940c008b5ef975c57 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Jan 2016 23:34:59 +0000 Subject: [PATCH 13/18] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14422 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/compute_chunk_atom.html | 18 +++++++++++++- doc/compute_chunk_atom.txt | 19 ++++++++++++++- doc/compute_saed.html | 19 ++++++++------- doc/compute_saed.txt | 29 +++++++++++++---------- doc/compute_xrd.html | 10 ++++---- doc/compute_xrd.txt | 10 +++++--- doc/fix_store_state.html | 34 +++++++++++++-------------- doc/fix_store_state.txt | 32 ++++++++++++------------- doc/searchindex.js | 2 +- doc/set.html | 45 +++++++++++++++++++++-------------- doc/set.txt | 47 ++++++++++++++++++++++--------------- 11 files changed, 164 insertions(+), 101 deletions(-) diff --git a/doc/compute_chunk_atom.html b/doc/compute_chunk_atom.html index ac158cc46a..70b562a06c 100644 --- a/doc/compute_chunk_atom.html +++ b/doc/compute_chunk_atom.html @@ -171,7 +171,7 @@ style = bin/1d or bin/2d or bin/3d or bin/sphere<
  • zero or more keyword/values pairs may be appended
  • -
  • keyword = region or nchunk or static or compress or bound or discard or units
  • +
  • keyword = region or nchunk or static or compress or bound or discard or pbc or units
 region value = region-ID
@@ -198,6 +198,8 @@ style = bin/1d or bin/2d or bin/3d or bin/sphere<
   x/y/z = x or y or z to bound sptial bins in this dimension
   lo = lower or coordinate value (distance units)
   hi = upper or coordinate value (distance units)
+pbc value = no or yes
+  yes = use periodic distance for bin/sphere and bin/cylinder styles
 units value = box or lattice or reduced
 
@@ -616,6 +618,19 @@ value, which is assumed to be inside (or at least near) the simulation box boundaries, though LAMMPS does not check for this. Note that using the bound keyword typically reduces the total number of bins and thus the number of chunks Nchunk.

+

The pbc keyword only applies to the bin/sphere and bin/cylinder +styles. If set to yes, the distance an atom is from the sphere +origin or cylinder axis is calculated in a minimum image sense with +respect to periodic dimensions, when determining which bin the atom is +in. I.e. if x is a periodic dimension and the distance between the +atom and the sphere center in the x dimension is greater than 0.5 * +simulation box length in x, then a box length is subtracted to give a +distance < 0.5 * simulation box length. This allosws the sphere or +cylinder center to be near a box edge, and atoms on the other side of +the periodic box will still be close to the center point/axis. Note +that with a setting of yes, the outer sphere or cylinder radius must +also be <= 0.5 * simulation box length in any periodic dimension +except for the cylinder axis dimension, or an error is generated.

The units keyword only applies to the binning styles; otherwise it is ignored. For the bin/1d, bin/2d, bin/3d styles, it determines the meaning of the distance units used for the bin sizes @@ -683,6 +698,7 @@ the restarted simulation begins.

  • discard = yes, for all styles except binning
  • discard = mixed, for binning styles
  • bound = lower and upper in all dimensions
  • +
  • pbc = no
  • units = lattice
  • diff --git a/doc/compute_chunk_atom.txt b/doc/compute_chunk_atom.txt index bef333a4b8..9b56c264c9 100644 --- a/doc/compute_chunk_atom.txt +++ b/doc/compute_chunk_atom.txt @@ -48,7 +48,7 @@ style = {bin/1d} or {bin/2d} or {bin/3d} or {bin/sphere} or {type} or {molecule} v_name = per-atom vector calculated by an atom-style variable with name :pre zero or more keyword/values pairs may be appended :l -keyword = {region} or {nchunk} or {static} or {compress} or {bound} or {discard} or {units} :l +keyword = {region} or {nchunk} or {static} or {compress} or {bound} or {discard} or {pbc} or {units} :l {region} value = region-ID region-ID = ID of region atoms must be in to be part of a chunk {nchunk} value = {once} or {every} @@ -73,6 +73,8 @@ keyword = {region} or {nchunk} or {static} or {compress} or {bound} or {discard} x/y/z = {x} or {y} or {z} to bound sptial bins in this dimension lo = {lower} or coordinate value (distance units) hi = {upper} or coordinate value (distance units) + {pbc} value = {no} or {yes} + yes = use periodic distance for bin/sphere and bin/cylinder styles {units} value = {box} or {lattice} or {reduced} :pre :ule @@ -570,6 +572,20 @@ box boundaries, though LAMMPS does not check for this. Note that using the {bound} keyword typically reduces the total number of bins and thus the number of chunks {Nchunk}. +The {pbc} keyword only applies to the {bin/sphere} and {bin/cylinder} +styles. If set to {yes}, the distance an atom is from the sphere +origin or cylinder axis is calculated in a minimum image sense with +respect to periodic dimensions, when determining which bin the atom is +in. I.e. if x is a periodic dimension and the distance between the +atom and the sphere center in the x dimension is greater than 0.5 * +simulation box length in x, then a box length is subtracted to give a +distance < 0.5 * simulation box length. This allosws the sphere or +cylinder center to be near a box edge, and atoms on the other side of +the periodic box will still be close to the center point/axis. Note +that with a setting of {yes}, the outer sphere or cylinder radius must +also be <= 0.5 * simulation box length in any periodic dimension +except for the cylinder axis dimension, or an error is generated. + The {units} keyword only applies to the {binning} styles; otherwise it is ignored. For the {bin/1d}, {bin/2d}, {bin/3d} styles, it determines the meaning of the distance units used for the bin sizes @@ -645,4 +661,5 @@ compress = no discard = yes, for all styles except binning discard = mixed, for binning styles bound = lower and upper in all dimensions +pbc = no units = lattice :ul diff --git a/doc/compute_saed.html b/doc/compute_saed.html index e035fe1612..86241dd067 100644 --- a/doc/compute_saed.html +++ b/doc/compute_saed.html @@ -169,7 +169,7 @@ fix saed/vtk 1 1 1 c_2 file Ni_000.saed

    Description¶

    Define a computation that calculates electron diffraction intensity as -described in (Coleman) on a mesh of reciprocal lattice nodes +described in (Coleman) on a mesh of reciprocal lattice nodes defined by the entire simulation domain (or manually) using simulated radiation of wavelength lambda.

    The electron diffraction intensity I at each reciprocal lattice point @@ -212,13 +212,14 @@ the Kmax, Zone, and dR_Ewald parameters. The rectili created about the origin of reciprocal space is terminated at the boundary of a sphere of radius Kmax centered at the origin. If Zone parameters z1=z2=z3=0 are used, diffraction intensities are -computed throughout the entire spherical volume - note this can greatly -increase the cost of computation. Otherwise, Zone parameters will -denote the z1=h, z2=k, and z3=l (in a global since) zone axis of an -intersecting Ewald sphere. Diffraction intensities will only be -computed at the intersection of the reciprocal lattice mesh and a -dR_Ewald thick surface of the Ewald sphere. See the example 3D -intestiety data and the intersection of a [010] zone axis in the below image.

    +computed throughout the entire spherical volume - note this can +greatly increase the cost of computation. Otherwise, Zone +parameters will denote the z1=h, z2=k, and z3=l (in a global since) +zone axis of an intersecting Ewald sphere. Diffraction intensities +will only be computed at the intersection of the reciprocal lattice +mesh and a dR_Ewald thick surface of the Ewald sphere. See the +example 3D intestiety data and the intersection of a [010] zone axis +in the below image.

    Restrictions¶

    +

    This compute is part of the USER-DIFFRACTION package. It is only +enabled if LAMMPS was built with that package. See the Making LAMMPS section for more info.

    The compute_saed command does not work for triclinic cells.