From 8f71979ba16db69de719a4620bf2874d2304ec86 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 23 Aug 2021 20:46:09 -0400 Subject: [PATCH] update formatting in src folder with clang-format --- src/arg_info.cpp | 4 +- src/atom.h | 2 +- src/atom_vec.h | 2 +- src/compute_property_atom.h | 2 +- src/dump_custom.h | 92 ++++++++++++++++++------------------- src/fix_property_atom.h | 14 +++--- src/library.h | 3 +- src/main.cpp | 2 +- 8 files changed, 61 insertions(+), 60 deletions(-) diff --git a/src/arg_info.cpp b/src/arg_info.cpp index 5063b6b471..4bdbfc8c92 100644 --- a/src/arg_info.cpp +++ b/src/arg_info.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; ArgInfo::ArgInfo(const std::string &arg, int allowed) : type(NONE), dim(0), index1(-1), index2(-1) { - if (((arg.size() > 3) && (arg[1] == '2') && (arg[2] == '_')) - || ((arg.size() > 2) && (arg[1] == '_'))) { + if (((arg.size() > 3) && (arg[1] == '2') && (arg[2] == '_')) || + ((arg.size() > 2) && (arg[1] == '_'))) { if ((arg[0] == 'c') && (allowed & COMPUTE)) type = COMPUTE; else if ((arg[0] == 'f') && (allowed & FIX)) diff --git a/src/atom.h b/src/atom.h index a16f1e2752..e196d2d135 100644 --- a/src/atom.h +++ b/src/atom.h @@ -163,7 +163,7 @@ class Atom : protected Pointers { // DIELECTRIC package - double *area,*ed,*em,*epsilon,*curvature,*q_unscaled; + double *area, *ed, *em, *epsilon, *curvature, *q_unscaled; // end of customization section // -------------------------------------------------------------------- diff --git a/src/atom_vec.h b/src/atom_vec.h index ad3b4c6626..0a86d1122c 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -129,7 +129,7 @@ class AtomVec : protected Pointers { virtual void data_atom_bonus(int, char **) {} virtual void data_body(int, int, int, int *, double *) {} - virtual void data_bonds_post(int, int , tagint, tagint, tagint) {} + virtual void data_bonds_post(int, int, tagint, tagint, tagint) {} virtual void pack_data(double **); virtual void write_data(FILE *, int, double **); diff --git a/src/compute_property_atom.h b/src/compute_property_atom.h index d8b1cae449..5a7fe787bd 100644 --- a/src/compute_property_atom.h +++ b/src/compute_property_atom.h @@ -35,7 +35,7 @@ class ComputePropertyAtom : public Compute { private: int nvalues; int nmax; - int *index,*colindex; + int *index, *colindex; double *buf; class AtomVecEllipsoid *avec_ellipsoid; class AtomVecLine *avec_line; diff --git a/src/dump_custom.h b/src/dump_custom.h index 4077a9374b..4209d8e46f 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -38,62 +38,62 @@ class DumpCustom : public Dump { int iregion; // -1 if no region, else which region char *idregion; // region ID - int nthresh; // # of defined thresholds - int nthreshlast; // # of defined thresholds with value = LAST - - int *thresh_array; // array to threshold on for each nthresh - int *thresh_op; // threshold operation for each nthresh - double *thresh_value; // threshold value for each nthresh - int *thresh_last; // for threshold value = LAST, - // index into thresh_fix - // -1 if not LAST, value is numeric - + int nthresh; // # of defined thresholds + int nthreshlast; // # of defined thresholds with value = LAST + // + int *thresh_array; // array to threshold on for each nthresh + int *thresh_op; // threshold operation for each nthresh + double *thresh_value; // threshold value for each nthresh + int *thresh_last; // for threshold value = LAST, + // index into thresh_fix + // -1 if not LAST, value is numeric + // class FixStore **thresh_fix; // stores values for each threshold LAST char **thresh_fixID; // IDs of thresh_fixes int *thresh_first; // 1 the first time a FixStore values accessed - int expand; // flag for whether field args were expanded - char **earg; // field names with wildcard expansion - int nargnew; // size of earg - - int *vtype; // type of each vector (INT, DOUBLE) - char **vformat; // format string for each vector element - - char *columns; // column labels - + int expand; // flag for whether field args were expanded + char **earg; // field names with wildcard expansion + int nargnew; // size of earg + // + int *vtype; // type of each vector (INT, DOUBLE) + char **vformat; // format string for each vector element + // + char *columns; // column labels + // int nchoose; // # of selected atoms int maxlocal; // size of atom selection and variable arrays int *choose; // local indices of selected atoms double *dchoose; // value for each atom to threshold against int *clist; // compressed list of indices of selected atoms - int nfield; // # of keywords listed by user - int ioptional; // index of start of optional args - - int *field2index; // which compute,fix,variable,custom calcs this field - int *argindex; // index into compute,fix,custom per-atom data - // 0 for per-atom vector, 1-N for cols of per-atom array - - int ncompute; // # of Computes accessed by dump - char **id_compute; // their IDs - class Compute **compute; // list of ptrs to the Computes - - int nfix; // # of Fixes used by dump - char **id_fix; // their IDs - class Fix **fix; // list of ptrs to the Fixes - - int nvariable; // # of Variables used by dump - char **id_variable; // their names - int *variable; // list of Variable indices in Variable class - double **vbuf; // local storage for variable evaluation - - int ncustom; // # of Custom atom properties used by dump - char **id_custom; // their names - int *custom; // list of Custom indices in Atom class - int *custom_flag; // list of IVEC,DVEC,IARRAY,DARRAY styles - - int ntypes; // # of atom types - char **typenames; // array of element names for each type + int nfield; // # of keywords listed by user + int ioptional; // index of start of optional args + // + int *field2index; // which compute,fix,variable,custom calcs this field + int *argindex; // index into compute,fix,custom per-atom data + // 0 for per-atom vector, 1-N for cols of per-atom array + // + int ncompute; // # of Computes accessed by dump + char **id_compute; // their IDs + class Compute **compute; // list of ptrs to the Computes + // + int nfix; // # of Fixes used by dump + char **id_fix; // their IDs + class Fix **fix; // list of ptrs to the Fixes + // + int nvariable; // # of Variables used by dump + char **id_variable; // their names + int *variable; // list of Variable indices in Variable class + double **vbuf; // local storage for variable evaluation + // + int ncustom; // # of Custom atom properties used by dump + char **id_custom; // their names + int *custom; // list of Custom indices in Atom class + int *custom_flag; // list of IVEC,DVEC,IARRAY,DARRAY styles + // + int ntypes; // # of atom types + char **typenames; // array of element names for each type // private methods diff --git a/src/fix_property_atom.h b/src/fix_property_atom.h index d7f2b56751..08cee7d94c 100644 --- a/src/fix_property_atom.h +++ b/src/fix_property_atom.h @@ -52,14 +52,14 @@ class FixPropertyAtom : public Fix { protected: int nvalue, border; - int molecule_flag, q_flag, rmass_flag; // flags for specific fields - int *style; // style of each value, see enum - int *index; // indices into atom custom data structs - int *cols; // columns per value, for arrays - char *astyle; // atom style at instantiation + int molecule_flag, q_flag, rmass_flag; // flags for specific fields + int *style; // style of each value, see enum + int *index; // indices into atom custom data structs + int *cols; // columns per value, for arrays + char *astyle; // atom style at instantiation - int values_peratom; // # of values per atom, including multiple for arrays - int nmax_old; // length of peratom arrays the last time they grew + int values_peratom; // # of values per atom, including multiple for arrays + int nmax_old; // length of peratom arrays the last time they grew }; } // namespace LAMMPS_NS diff --git a/src/library.h b/src/library.h index 91146e8526..17943e3808 100644 --- a/src/library.h +++ b/src/library.h @@ -228,7 +228,8 @@ void lammps_decode_image_flags(int64_t image, int *flags); #if defined(LAMMPS_BIGBIG) typedef void (*FixExternalFnPtr)(void *, int64_t, int, int64_t *, double **, double **); -void lammps_set_fix_external_callback(void *handle, const char *id, FixExternalFnPtr funcptr, void *ptr); +void lammps_set_fix_external_callback(void *handle, const char *id, FixExternalFnPtr funcptr, + void *ptr); #elif defined(LAMMPS_SMALLBIG) typedef void (*FixExternalFnPtr)(void *, int64_t, int, int *, double **, double **); void lammps_set_fix_external_callback(void *, const char *, FixExternalFnPtr, void *); diff --git a/src/main.cpp b/src/main.cpp index d65247c224..608ef4ae5b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,8 +13,8 @@ #include "lammps.h" -#include "input.h" #include "accelerator_kokkos.h" +#include "input.h" #if defined(LAMMPS_EXCEPTIONS) #include "exceptions.h" #endif