From 8500a197ae132c1853a041a168176932e9611c25 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Wed, 14 Jun 2017 23:13:10 -0400 Subject: [PATCH] whitespace cleanup --- src/dump.cpp | 23 +++++++++++++---------- src/dump.h | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/dump.cpp b/src/dump.cpp index c69bc4a308..88711deff4 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -80,7 +80,7 @@ Dump::Dump(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) buffer_flag = 0; padflag = 0; pbcflag = 0; - + maxbuf = maxids = maxsort = maxproc = 0; buf = bufsort = NULL; ids = idsort = NULL; @@ -166,13 +166,13 @@ Dump::~Dump() delete irregular; memory->destroy(sbuf); - + if (pbcflag) { memory->destroy(xpbc); memory->destroy(vpbc); memory->destroy(imagepbc); } - + if (multiproc) MPI_Comm_free(&clustercomm); // XTC style sets fp to NULL since it closes file in its destructor @@ -273,7 +273,7 @@ void Dump::init() } // preallocation for PBC copies if requested - + if (pbcflag && atom->nlocal > maxpbc) pbc_allocate(); } @@ -386,7 +386,7 @@ void Dump::write() atom->image = imagepbc; domain->pbc(); } - + // pack my data into buf // if sorting on IDs also request ID list from pack() // sort buf as needed @@ -717,7 +717,8 @@ void Dump::sort() compare two atom IDs called via merge_sort() in sort() method ------------------------------------------------------------------------- */ -int Dump::idcompare(const int i, const int j, void *ptr) { +int Dump::idcompare(const int i, const int j, void *ptr) +{ tagint *idsort = ((Dump *)ptr)->idsort; if (idsort[i] < idsort[j]) return -1; else if (idsort[i] > idsort[j]) return 1; @@ -730,7 +731,8 @@ int Dump::idcompare(const int i, const int j, void *ptr) { sort in ASCENDing order ------------------------------------------------------------------------- */ -int Dump::bufcompare(const int i, const int j, void *ptr) { +int Dump::bufcompare(const int i, const int j, void *ptr) +{ Dump *dptr = (Dump *) ptr; double *bufsort = dptr->bufsort; const int size_one = dptr->size_one; @@ -738,7 +740,7 @@ int Dump::bufcompare(const int i, const int j, void *ptr) { const int ii=i*size_one + sortcolm1; const int jj=j*size_one + sortcolm1; - + if (bufsort[ii] < bufsort[jj]) return -1; else if (bufsort[ii] > bufsort[jj]) return 1; else return 0; @@ -749,7 +751,8 @@ int Dump::bufcompare(const int i, const int j, void *ptr) { sort in DESCENDing order ------------------------------------------------------------------------- */ -int Dump::bufcompare_reverse(const int i, const int j, void *ptr) { +int Dump::bufcompare_reverse(const int i, const int j, void *ptr) +{ Dump *dptr = (Dump *) ptr; double *bufsort = dptr->bufsort; const int size_one = dptr->size_one; @@ -757,7 +760,7 @@ int Dump::bufcompare_reverse(const int i, const int j, void *ptr) { const int ii=i*size_one + sortcolm1; const int jj=j*size_one + sortcolm1; - + if (bufsort[ii] < bufsort[jj]) return 1; else if (bufsort[ii] > bufsort[jj]) return -1; else return 0; diff --git a/src/dump.h b/src/dump.h index 5d44f4d0b4..ae83d75d20 100644 --- a/src/dump.h +++ b/src/dump.h @@ -128,7 +128,7 @@ class Dump : protected Pointers { virtual int convert_string(int, double *) {return 0;} virtual void write_data(int, double *) = 0; void pbc_allocate(); - + void sort(); static int idcompare(const int, const int, void *); static int bufcompare(const int, const int, void *); -- GitLab