diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 27bf4fc707..9947d9a84a 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -217,7 +217,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : // volume_one = volume of inserted particle (with max possible radius) // in 3d, insure dy >= 1, for quasi-2d simulations - double volume,volume_one; + double volume,volume_one=1.0; molradius_max = 0.0; if (mode == MOLECULE) { diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 7c491fdf23..56dc7d1d95 100755 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -1398,25 +1398,28 @@ void FixBondCreate::print_bb() for (int i = 0; i < atom->nlocal; i++) { printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]); for (int j = 0; j < atom->num_bond[i]; j++) { - printf(" %d",atom->bond_atom[i][j]); + printf(" " TAGINT_FORMAT,atom->bond_atom[i][j]); } printf("\n"); printf("TAG " TAGINT_FORMAT ": %d nangles: ",atom->tag[i],atom->num_angle[i]); for (int j = 0; j < atom->num_angle[i]; j++) { - printf(" %d %d %d,",atom->angle_atom1[i][j], - atom->angle_atom2[i][j],atom->angle_atom3[i][j]); + printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT ",", + atom->angle_atom1[i][j], atom->angle_atom2[i][j], + atom->angle_atom3[i][j]); } printf("\n"); printf("TAG " TAGINT_FORMAT ": %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]); for (int j = 0; j < atom->num_dihedral[i]; j++) { - printf(" %d %d %d %d,",atom->dihedral_atom1[i][j], + printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " + TAGINT_FORMAT ",", atom->dihedral_atom1[i][j], atom->dihedral_atom2[i][j],atom->dihedral_atom3[i][j], atom->dihedral_atom4[i][j]); } printf("\n"); printf("TAG " TAGINT_FORMAT ": %d nimpropers: ",atom->tag[i],atom->num_improper[i]); for (int j = 0; j < atom->num_improper[i]; j++) { - printf(" %d %d %d %d,",atom->improper_atom1[i][j], + printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " + TAGINT_FORMAT ",",atom->improper_atom1[i][j], atom->improper_atom2[i][j],atom->improper_atom3[i][j], atom->improper_atom4[i][j]); } @@ -1424,7 +1427,7 @@ void FixBondCreate::print_bb() printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i], atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]); for (int j = 0; j < atom->nspecial[i][2]; j++) { - printf(" %d",atom->special[i][j]); + printf(" " TAGINT_FORMAT,atom->special[i][j]); } printf("\n"); } @@ -1435,7 +1438,7 @@ void FixBondCreate::print_bb() void FixBondCreate::print_copy(const char *str, tagint m, int n1, int n2, int n3, int *v) { - printf("%s %i: %d %d %d nspecial: ",str,m,n1,n2,n3); + printf("%s " TAGINT_FORMAT ": %d %d %d nspecial: ",str,m,n1,n2,n3); for (int j = 0; j < n3; j++) printf(" %d",v[j]); printf("\n"); } diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index b014f44ba2..9dbf6e8266 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -1734,11 +1734,11 @@ void FixRigidSmall::setup_bodies_static() // dorientflag = 1 if any particle stores dipole orientation if (extended) { - grow_arrays(atom->nmax); if (atom->ellipsoid_flag) orientflag = 4; if (atom->line_flag) orientflag = 1; if (atom->tri_flag) orientflag = 4; if (atom->mu_flag) dorientflag = 1; + grow_arrays(atom->nmax); for (i = 0; i < nlocal; i++) { eflags[i] = 0; diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index 03bee46a8a..e008b0c87b 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -163,10 +163,10 @@ void PairSNAP::compute(int eflag, int vflag) void PairSNAP::compute_regular(int eflag, int vflag) { - int i,j,inum,jnum,ninside; + int i,j,jnum,ninside; double delx,dely,delz,evdwl,rsq; double fij[3]; - int *ilist,*jlist,*numneigh,**firstneigh; + int *jlist,*numneigh,**firstneigh; evdwl = 0.0; if (eflag || vflag) ev_setup(eflag,vflag); @@ -179,8 +179,6 @@ void PairSNAP::compute_regular(int eflag, int vflag) int newton_pair = force->newton_pair; class SNA* snaptr = sna[0]; - inum = list->inum; - ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -425,10 +423,10 @@ void PairSNAP::compute_optimized(int eflag, int vflag) } int ielem; - int jj,k,inum,jnum,jtype,ninside; + int jj,k,jnum,jtype,ninside; double delx,dely,delz,evdwl,rsq; double fij[3]; - int *ilist,*jlist,*numneigh,**firstneigh; + int *jlist,*numneigh,**firstneigh; evdwl = 0.0; #if defined(_OPENMP) @@ -450,8 +448,6 @@ void PairSNAP::compute_optimized(int eflag, int vflag) int nlocal = atom->nlocal; int newton_pair = force->newton_pair; - inum = list->inum; - ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -1020,17 +1016,16 @@ void PairSNAP::build_per_atom_arrays() clock_gettime(CLOCK_REALTIME,&starttime); #endif - int i_list[list->inum+ghostinum]; int count = 0; int neighmax = 0; for (int ii = 0; ii < list->inum; ii++) if ((do_load_balance <= 0) || ilistmask[ii]) { neighmax=MAX(neighmax,list->numneigh[list->ilist[ii]]); - i_list[count++]=list->ilist[ii]; + ++count; } for (int ii = 0; ii < ghostinum; ii++) { neighmax=MAX(neighmax,ghostnumneigh[ghostilist[ii]]); - i_list[count++]=ghostilist[ii]; + ++count; } if (i_max < count || i_neighmax < neighmax) { diff --git a/src/citeme.cpp b/src/citeme.cpp index 70b02e83b4..66c6eb9dc9 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -47,10 +47,12 @@ CiteMe::~CiteMe() delete cs; - if (screen) fprintf(screen,cite_nagline); - if (logfile) fprintf(logfile,cite_nagline); + if (fp) { + if (screen) fprintf(screen,cite_nagline); + if (logfile) fprintf(logfile,cite_nagline); - if (fp) fclose(fp); + fclose(fp); + } } /* ---------------------------------------------------------------------- @@ -65,7 +67,7 @@ void CiteMe::add(const char *ref) if (!fp) { fp = fopen("log.cite","w"); - if (!fp) error->universe_one(FLERR,"Cannot open log.cite file"); + if (!fp) return; fputs(cite_header,fp); fflush(fp); } diff --git a/src/fix_recenter.cpp b/src/fix_recenter.cpp index 2d8ee41f93..5d2e2d5e87 100644 --- a/src/fix_recenter.cpp +++ b/src/fix_recenter.cpp @@ -20,10 +20,12 @@ #include "fix_recenter.h" #include "atom.h" #include "group.h" +#include "update.h" #include "domain.h" #include "lattice.h" #include "modify.h" #include "comm.h" +#include "respa.h" #include "error.h" #include "force.h" @@ -110,6 +112,7 @@ int FixRecenter::setmask() { int mask = 0; mask |= INITIAL_INTEGRATE; + mask |= INITIAL_INTEGRATE_RESPA; return mask; } @@ -139,6 +142,9 @@ void FixRecenter::init() yinit = xcm[1]; zinit = xcm[2]; } + + if (strstr(update->integrate_style,"respa")) + nlevels_respa = ((Respa *) update->integrate)->nlevels; } /* ---------------------------------------------------------------------- */ @@ -214,3 +220,13 @@ double FixRecenter::compute_vector(int n) return shift[n]; } +/* ---------------------------------------------------------------------- */ + +void FixRecenter::initial_integrate_respa(int vflag, int ilevel, int iloop) +{ + // outermost level - operate recenter + // all other levels - nothing + + if (ilevel == nlevels_respa-1) initial_integrate(vflag); +} +