diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index cef875ed7c..67342d91d6 100755 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -79,8 +79,9 @@ PairPolymorphic::~PairPolymorphic() void PairPolymorphic::compute(int eflag, int vflag) { + tagint itag,jtag; int i,j,k,ii,jj,kk,inum,jnum; - int itag,jtag,iel,jel,kel,iparam_ij,iparam_ik,iparam_ijk; + int iel,jel,kel,iparam_ij,iparam_ik,iparam_ijk; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; double rsq,rsq1,rsq2,r0,r1,r2; double delr1[3],delr2[3],fi[3],fj[3],fk[3]; @@ -94,7 +95,7 @@ void PairPolymorphic::compute(int eflag, int vflag) double **x = atom->x; double **f = atom->f; - int *tag = atom->tag; + tagint *tag = atom->tag; int *type = atom->type; int nlocal = atom->nlocal; int newton_pair = force->newton_pair; @@ -512,7 +513,7 @@ void PairPolymorphic::read_file(char *file, char** elements) // open file on proc 0 FILE *fp=NULL; if (comm->me == 0) { - fp = fopen(file,"r"); + fp = force->open_potential(file); if (fp == NULL) { char str[128]; sprintf(str,"Cannot open polymorphic potential file %s",file); diff --git a/src/USER-SMD/atom_vec_smd.cpp b/src/USER-SMD/atom_vec_smd.cpp index f9af5d3d92..6b61b5c1ef 100644 --- a/src/USER-SMD/atom_vec_smd.cpp +++ b/src/USER-SMD/atom_vec_smd.cpp @@ -146,7 +146,6 @@ void AtomVecSMD::grow_reset() { radius = atom->radius; rmass = atom->rmass; - molecule = atom->molecule; vfrac = atom->vfrac; x0 = atom->x0; contact_radius = atom->contact_radius; @@ -657,7 +656,7 @@ void AtomVecSMD::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; - molecule[i] = (int) ubuf(buf[m++]).i; // 10 + molecule[i] = (tagint) ubuf(buf[m++]).i; // 10 radius[i] = buf[m++]; rmass[i] = buf[m++]; @@ -698,7 +697,7 @@ int AtomVecSMD::unpack_border_hybrid(int n, int first, double *buf) { x0[i][0] = buf[m++]; x0[i][1] = buf[m++]; x0[i][2] = buf[m++]; // 3 - molecule[i] = (int) ubuf(buf[m++]).i; // 4 + molecule[i] = (tagint) ubuf(buf[m++]).i; // 4 radius[i] = buf[m++]; rmass[i] = buf[m++]; vfrac[i] = buf[m++]; @@ -790,7 +789,7 @@ int AtomVecSMD::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; - molecule[nlocal] = (int) ubuf(buf[m++]).i; // 11 + molecule[nlocal] = (tagint) ubuf(buf[m++]).i; // 11 radius[nlocal] = buf[m++]; rmass[nlocal] = buf[m++]; @@ -920,7 +919,7 @@ int AtomVecSMD::unpack_restart(double *buf) { type[nlocal] = (int) ubuf(buf[m++]).i; mask[nlocal] = (int) ubuf(buf[m++]).i; image[nlocal] = (imageint) ubuf(buf[m++]).i; - molecule[nlocal] = (int) ubuf(buf[m++]).i; // 11 + molecule[nlocal] = (tagint) ubuf(buf[m++]).i; // 11 radius[nlocal] = buf[m++]; rmass[nlocal] = buf[m++]; @@ -1034,7 +1033,7 @@ void AtomVecSMD::data_atom(double *coord, imageint imagetmp, char **values) { if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR, "Invalid atom type in Atoms section of data file"); - molecule[nlocal] = atoi(values[2]); + molecule[nlocal] = ATOTAGINT(values[2]); if (molecule[nlocal] <= 0) error->one(FLERR, "Invalid molecule in Atoms section of data file"); diff --git a/src/USER-SMD/atom_vec_smd.h b/src/USER-SMD/atom_vec_smd.h index c79c60c352..cea9a31f86 100644 --- a/src/USER-SMD/atom_vec_smd.h +++ b/src/USER-SMD/atom_vec_smd.h @@ -88,7 +88,7 @@ class AtomVecSMD : public AtomVec { double **x,**v,**f; double *radius,*rmass; - int *molecule; + tagint *molecule; double *vfrac,**x0,*contact_radius, **smd_data_9, *e, *de, **vest; double **tlsph_stress; double *eff_plastic_strain; diff --git a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp index 407eabf452..ab81caeba3 100644 --- a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp +++ b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp @@ -255,7 +255,7 @@ void FixSMDMoveTriSurf::initial_integrate(int vflag) { double **v = atom->v; double **vest = atom->vest; double **smd_data_9 = atom->smd_data_9; - int *mol = atom->molecule; + tagint *mol = atom->molecule; int *mask = atom->mask; int nlocal = atom->nlocal; diff --git a/src/USER-SMD/fix_smd_wall_surface.cpp b/src/USER-SMD/fix_smd_wall_surface.cpp index 776acff7a8..41866b1d3e 100644 --- a/src/USER-SMD/fix_smd_wall_surface.cpp +++ b/src/USER-SMD/fix_smd_wall_surface.cpp @@ -437,7 +437,7 @@ void FixSMDWallSurface::read_triangles(int pass) { * due to calling grow() in create_atoms() above; */ - int *mol = atom->molecule; + tagint *mol = atom->molecule; int *type = atom->type; double *radius = atom->radius; double *contact_radius = atom->contact_radius; diff --git a/src/USER-SMD/pair_smd_tlsph.cpp b/src/USER-SMD/pair_smd_tlsph.cpp index 77a45ee754..9b293d77d8 100644 --- a/src/USER-SMD/pair_smd_tlsph.cpp +++ b/src/USER-SMD/pair_smd_tlsph.cpp @@ -137,7 +137,7 @@ PairTlsph::~PairTlsph() { ---------------------------------------------------------------------- */ void PairTlsph::PreCompute() { - int *mol = atom->molecule; + tagint *mol = atom->molecule; double *vfrac = atom->vfrac; double *radius = atom->radius; double **x0 = atom->x0; @@ -145,7 +145,7 @@ void PairTlsph::PreCompute() { double **v = atom->vest; // extrapolated velocities corresponding to current positions double **vint = atom->v; // Velocity-Verlet algorithm velocities double *damage = atom->damage; - int *tag = atom->tag; + tagint *tag = atom->tag; int *type = atom->type; int nlocal = atom->nlocal; int jnum, jj, i, j, itype, idim; @@ -417,7 +417,7 @@ void PairTlsph::compute(int eflag, int vflag) { } void PairTlsph::ComputeForces(int eflag, int vflag) { - int *mol = atom->molecule; + tagint *mol = atom->molecule; double **x = atom->x; double **v = atom->vest; double **x0 = atom->x0; @@ -702,7 +702,7 @@ void PairTlsph::ComputeForces(int eflag, int vflag) { shape matrix correction ------------------------------------------------------------------------- */ void PairTlsph::AssembleStress() { - int *mol = atom->molecule; + tagint *mol = atom->molecule; double *eff_plastic_strain = atom->eff_plastic_strain; double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; double **tlsph_stress = atom->smd_stress; @@ -1842,7 +1842,7 @@ void *PairTlsph::extract(const char *str, int &i) { int PairTlsph::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) { int i, j, m; - int *mol = atom->molecule; + tagint *mol = atom->molecule; double *damage = atom->damage; double *eff_plastic_strain = atom->eff_plastic_strain; double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; @@ -1885,7 +1885,7 @@ int PairTlsph::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, in void PairTlsph::unpack_forward_comm(int n, int first, double *buf) { int i, m, last; - int *mol = atom->molecule; + tagint *mol = atom->molecule; double *damage = atom->damage; double *eff_plastic_strain = atom->eff_plastic_strain; double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; diff --git a/src/USER-SMD/pair_smd_triangulated_surface.cpp b/src/USER-SMD/pair_smd_triangulated_surface.cpp index 9fc057e1db..6d27187260 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.cpp +++ b/src/USER-SMD/pair_smd_triangulated_surface.cpp @@ -101,7 +101,7 @@ void PairTriSurf::compute(int eflag, int vflag) { else evflag = vflag_fdotr = 0; - int *mol = atom->molecule; + tagint *mol = atom->molecule; double **f = atom->f; double **smd_data_9 = atom->smd_data_9; double **x = atom->x; diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index f5f0f55f63..4746a22c0b 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -1433,7 +1433,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values) // size = length of one edge - double c2mc1[2],c3mc1[3]; + double c2mc1[3],c3mc1[3]; MathExtra::sub3(c2,c1,c2mc1); MathExtra::sub3(c3,c1,c3mc1); double size = MAX(MathExtra::len3(c2mc1),MathExtra::len3(c3mc1)); @@ -1557,7 +1557,7 @@ int AtomVecTri::data_vel_hybrid(int m, char **values) void AtomVecTri::pack_data(double **buf) { - double c2mc1[2],c3mc1[3],norm[3]; + double c2mc1[3],c3mc1[3],norm[3]; double area; int nlocal = atom->nlocal; @@ -1595,7 +1595,7 @@ int AtomVecTri::pack_data_hybrid(int i, double *buf) else buf[1] = ubuf(1).d; if (tri[i] < 0) buf[2] = rmass[i]; else { - double c2mc1[2],c3mc1[3],norm[3]; + double c2mc1[3],c3mc1[3],norm[3]; MathExtra::sub3(bonus[tri[i]].c2,bonus[tri[i]].c1,c2mc1); MathExtra::sub3(bonus[tri[i]].c3,bonus[tri[i]].c1,c3mc1); MathExtra::cross3(c2mc1,c3mc1,norm); diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index d5a7a8abf1..0aaa3713ae 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -722,9 +722,9 @@ void DeleteAtoms::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"mol") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal delete_atoms command"); - if (atom->molecular == 0) - error->all(FLERR,"Cannot delete_atoms mol yes for " - "non-molecular systems"); + if (atom->molecule_flag == 0) + error->all(FLERR,"Delete_atoms mol yes requires " + "atom attribute molecule"); if (strcmp(arg[iarg+1],"yes") == 0) mol_flag = 1; else if (strcmp(arg[iarg+1],"no") == 0) mol_flag = 0; else error->all(FLERR,"Illegal delete_atoms command"); diff --git a/src/math_extra.cpp b/src/math_extra.cpp index dda3205817..eb2afcea2c 100644 --- a/src/math_extra.cpp +++ b/src/math_extra.cpp @@ -61,7 +61,7 @@ int mldivide3(const double m[3][3], const double *v, double *ans) } } - while (aug[p][i] == 0.0 && p < 3) p++; + while (p < 3 && aug[p][i] == 0.0) p++; if (p == 3) return 1; else diff --git a/src/set.cpp b/src/set.cpp index 737568a085..d8cbbf6806 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -642,7 +642,7 @@ void Set::set(int keyword) double *c1 = avec_tri->bonus[atom->tri[i]].c1; double *c2 = avec_tri->bonus[atom->tri[i]].c2; double *c3 = avec_tri->bonus[atom->tri[i]].c3; - double c2mc1[2],c3mc1[3]; + double c2mc1[3],c3mc1[3]; MathExtra::sub3(c2,c1,c2mc1); MathExtra::sub3(c3,c1,c3mc1); double norm[3];