Merge pull request #2466 from rbberger/bugfixes

Collection of bugfixes
This commit is contained in:
Richard Berger
2020-11-11 11:19:52 -05:00
committed by GitHub
4 changed files with 10 additions and 5 deletions

View File

@ -183,7 +183,7 @@ DumpNetCDF::DumpNetCDF(LAMMPS *lmp, int narg, char **arg) :
for (int j = 0; j < DUMP_NC_MAX_DIMS; j++) {
perat[inc].field[j] = -1;
}
strcpy(perat[inc].name, mangled);
strncpy(perat[inc].name, mangled, NC_FIELD_NAME_MAX);
n_perat++;
}

View File

@ -23,7 +23,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
Integrate::Integrate(LAMMPS *lmp, int /*narg*/, char **/*arg*/) : Pointers(lmp)
Integrate::Integrate(LAMMPS *lmp, int /*narg*/, char ** /*arg*/) : Pointers(lmp)
{
elist_global = elist_atom = nullptr;
vlist_global = vlist_atom = cvlist_atom = nullptr;

View File

@ -1976,7 +1976,7 @@ void lammps_gather_atoms(void *handle, char *name, int type, int count, void *da
// use atom ID to insert each atom's values into copy
// MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID
if (type == LAMMPS_INT) {
if (type == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgunpack = (count == 3) && (strcmp(name,"image") == 0);
@ -2015,7 +2015,7 @@ void lammps_gather_atoms(void *handle, char *name, int type, int count, void *da
MPI_Allreduce(copy,data,count*natoms,MPI_INT,MPI_SUM,lmp->world);
lmp->memory->destroy(copy);
} else if (type == LAMMPS_DOUBLE) {
} else if (type == 1) {
double *vector = nullptr;
double **array = nullptr;
if (count == 1) vector = (double *) vptr;

View File

@ -323,7 +323,12 @@ void Update::create_integrate(int narg, char **arg, int trysuffix)
delete integrate;
int sflag;
new_integrate(arg[0],narg-1,&arg[1],trysuffix,sflag);
if(narg-1 > 0) {
new_integrate(arg[0],narg-1,&arg[1],trysuffix,sflag);
} else {
new_integrate(arg[0],0,nullptr,trysuffix,sflag);
}
std::string estyle = arg[0];
if (sflag) {