apply clang-format

This commit is contained in:
Axel Kohlmeyer
2024-10-06 00:25:53 -04:00
parent 7da8748e90
commit 25dfb03386
28 changed files with 73 additions and 74 deletions

View File

@ -52,12 +52,12 @@ class Angle : protected Pointers {
virtual void compute(int, int) = 0;
virtual void settings(int, char **);
virtual void coeff(int, char **) = 0;
virtual void init_style(){};
virtual void init_style() {};
virtual double equilibrium_angle(int) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual void write_restart_settings(FILE *){};
virtual void read_restart_settings(FILE *){};
virtual void write_restart_settings(FILE *) {};
virtual void read_restart_settings(FILE *) {};
virtual void write_data(FILE *) {}
virtual double single(int, int, int, int) = 0;
virtual void born_matrix(int /*atype*/, int /*at1*/, int /*at2*/, int /*at3*/, double &du,

View File

@ -26,7 +26,7 @@ namespace LAMMPS_NS {
class AngleWrite : public Command {
public:
AngleWrite(class LAMMPS *lmp) : Command(lmp){};
AngleWrite(class LAMMPS *lmp) : Command(lmp) {};
void command(int, char **) override;
};
} // namespace LAMMPS_NS

View File

@ -61,8 +61,8 @@ class Bond : protected Pointers {
virtual double equilibrium_distance(int) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual void write_restart_settings(FILE *){};
virtual void read_restart_settings(FILE *){};
virtual void write_restart_settings(FILE *) {};
virtual void read_restart_settings(FILE *) {};
virtual void write_data(FILE *) {}
virtual double single(int, double, int, int, double &) = 0;
virtual double memory_usage();

View File

@ -44,7 +44,7 @@ class CommBrick : public Comm {
void forward_comm(class Dump *) override; // forward comm from a Dump
void reverse_comm(class Dump *) override; // reverse comm from a Dump
void forward_comm_array(int, double **) override; // forward comm of array
void forward_comm_array(int, double **) override; // forward comm of array
void *extract(const char *, int &) override;
double memory_usage() override;

View File

@ -44,7 +44,7 @@ class CommTiled : public Comm {
void forward_comm(class Dump *) override; // forward comm from a Dump
void reverse_comm(class Dump *) override; // reverse comm from a Dump
void forward_comm_array(int, double **) override; // forward comm of array
void forward_comm_array(int, double **) override; // forward comm of array
void coord2proc_setup() override;
int coord2proc(double *, int &, int &, int &) override;
@ -146,12 +146,12 @@ class CommTiled : public Comm {
int point_drop_tiled_recurse(double *, int, int);
int closer_subbox_edge(int, double *);
virtual void grow_send(int, int); // reallocate send buffer
virtual void grow_recv(int, int flag = 0); // free/allocate recv buffer
virtual void grow_list(int, int, int); // reallocate sendlist for one swap/proc
void allocate_swap(int); // allocate swap arrays
virtual void grow_swap_send(int, int, int); // grow swap arrays for send and recv
void grow_swap_send_multi(int, int); // grow multi swap arrays for send and recv
virtual void grow_send(int, int); // reallocate send buffer
virtual void grow_recv(int, int flag = 0); // free/allocate recv buffer
virtual void grow_list(int, int, int); // reallocate sendlist for one swap/proc
void allocate_swap(int); // allocate swap arrays
virtual void grow_swap_send(int, int, int); // grow swap arrays for send and recv
void grow_swap_send_multi(int, int); // grow multi swap arrays for send and recv
void grow_swap_recv(int, int);
void deallocate_swap(int); // deallocate swap arrays
};

View File

@ -20,7 +20,7 @@ namespace LAMMPS_NS {
class Command : protected Pointers {
public:
Command(class LAMMPS *lmp) : Pointers(lmp){};
Command(class LAMMPS *lmp) : Pointers(lmp) {};
virtual void command(int, char **) = 0;
};

View File

@ -132,7 +132,7 @@ class Compute : protected Pointers {
virtual int pack_reverse_comm(int, int, double *) { return 0; }
virtual void unpack_reverse_comm(int, int *, double *) {}
virtual void reset_grid(){};
virtual void reset_grid() {};
virtual int get_grid_by_name(const std::string &, int &) { return -1; };
virtual void *get_grid_by_index(int) { return nullptr; };

View File

@ -43,7 +43,7 @@ class ComputeChunk : public Compute {
int firstflag, massneed;
ComputeChunkAtom *cchunk;
virtual void allocate(){};
virtual void allocate() {};
};
} // namespace LAMMPS_NS
#endif

View File

@ -28,7 +28,7 @@ class ComputeDipole : public Compute {
public:
ComputeDipole(class LAMMPS *, int, char **);
~ComputeDipole() override;
void init() override{};
void init() override {};
void compute_vector() override;
double compute_scalar() override;

View File

@ -33,7 +33,7 @@ class ComputeGlobalAtom : public Compute {
double memory_usage() override;
protected:
struct value_t {
struct value_t {
int which;
int argindex;
std::string id;

View File

@ -37,7 +37,7 @@ namespace LAMMPS_NS {
class Deprecated : public Command {
public:
Deprecated(class LAMMPS *lmp) : Command(lmp){};
Deprecated(class LAMMPS *lmp) : Command(lmp) {};
void command(int, char **) override;
};

View File

@ -52,8 +52,8 @@ class Dihedral : protected Pointers {
virtual void coeff(int, char **) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual void write_restart_settings(FILE *){};
virtual void read_restart_settings(FILE *){};
virtual void write_restart_settings(FILE *) {};
virtual void read_restart_settings(FILE *) {};
virtual void write_data(FILE *) {}
virtual double memory_usage();
virtual void born_matrix(int /*dtype*/, int /*at1*/, int /*at2*/, int /*at3*/, int /*at4*/,

View File

@ -26,7 +26,7 @@ namespace LAMMPS_NS {
class DihedralWrite : public Command {
public:
DihedralWrite(class LAMMPS *lmp) : Command(lmp){};
DihedralWrite(class LAMMPS *lmp) : Command(lmp) {};
void command(int, char **) override;
};
} // namespace LAMMPS_NS

View File

@ -39,8 +39,8 @@ class Domain : protected Pointers {
// 2 = shrink-wrap non-periodic
// 3 = shrink-wrap non-per w/ min
int triclinic; // 0 = orthog box, 1 = triclinic (restricted or general)
int triclinic_general; // 1 if general <-> restricted tri mapping is stored, 0 if not
int triclinic; // 0 = orthog box, 1 = triclinic (restricted or general)
int triclinic_general; // 1 if general <-> restricted tri mapping is stored, 0 if not
// orthogonal box
@ -91,9 +91,9 @@ class Domain : protected Pointers {
// general triclinic box
// boxlo = lower left corner
double avec[3], bvec[3], cvec[3]; // ABC edge vectors of general triclinic box
double rotate_g2r[3][3]; // rotation matrix from general --> restricted tri
double rotate_r2g[3][3]; // rotation matrix from restricted --> general tri
double avec[3], bvec[3], cvec[3]; // ABC edge vectors of general triclinic box
double rotate_g2r[3][3]; // rotation matrix from general --> restricted tri
double rotate_r2g[3][3]; // rotation matrix from restricted --> general tri
// box flags
@ -145,9 +145,8 @@ class Domain : protected Pointers {
int ownatom(int, double *, imageint *, int);
void define_general_triclinic(double *, double *, double *, double *);
void general_to_restricted_rotation(double *, double *, double *,
double [3][3],
double *, double *, double *);
void general_to_restricted_rotation(double *, double *, double *, double[3][3], double *,
double *, double *);
void general_to_restricted_coords(double *);
void restricted_to_general_coords(double *);
void restricted_to_general_coords(double *, double *);

View File

@ -33,9 +33,9 @@ class DumpAtom : public Dump {
const int ENDIAN = 0x0001;
protected:
int scale_flag; // 1 if atom coords are scaled, 0 if no
int image_flag; // 1 if append box count to atom coords, 0 if no
int triclinic_general; // 1 if output box & coords for general triclinic, 0 if no
int scale_flag; // 1 if atom coords are scaled, 0 if no
int image_flag; // 1 if append box count to atom coords, 0 if no
int triclinic_general; // 1 if output box & coords for general triclinic, 0 if no
std::string columns; // column labels

View File

@ -34,9 +34,9 @@ class DumpCustom : public Dump {
const int ENDIAN = 0x0001;
protected:
int nevery; // dump frequency for output
char *idregion; // region ID, nullptr if no region
int triclinic_general; // 1 if output box & per-atom info for general triclinic
int nevery; // dump frequency for output
char *idregion; // region ID, nullptr if no region
int triclinic_general; // 1 if output box & per-atom info for general triclinic
int nthresh; // # of defined thresholds
int nthreshlast; // # of defined thresholds with value = LAST

View File

@ -79,17 +79,17 @@ class DumpImage : public DumpCustom {
double *diamtype, *diamelement, *bdiamtype; // per-type diameters
double **colortype, **colorelement, **bcolortype; // per-type colors
int gridflag; // 0/1 for draw grid cells
int gridflag; // 0/1 for draw grid cells
class Grid2d *grid2d;
class Grid3d *grid3d;
char *id_grid_compute,*id_grid_fix;
char *id_grid_compute, *id_grid_fix;
class Compute *grid_compute;
class Fix *grid_fix;
int grid_igrid,grid_idata,grid_index;
int nxgrid,nygrid,nzgrid;
int nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in;
int grid_igrid, grid_idata, grid_index;
int nxgrid, nygrid, nzgrid;
int nxlo_in, nxhi_in, nylo_in, nyhi_in, nzlo_in, nzhi_in;
double *gbuf;
int ngrid,maxgrid;
int ngrid, maxgrid;
double gcorners[8][3];
class AtomVecLine *avec_line; // ptrs to atom style (sub)classes
@ -98,10 +98,10 @@ class DumpImage : public DumpCustom {
class Fix *fixptr; // ptr to Fix that provides image data
class Image *image; // class that renders each image
class Image *image; // class that renders each image
int *chooseghost; // extended choose array for comm
double **bufcopy; // buffer for communicating bond/atom info
int *chooseghost; // extended choose array for comm
double **bufcopy; // buffer for communicating bond/atom info
int maxbufcopy;
void init_style() override;

View File

@ -61,10 +61,10 @@ class FixIndent : public Fix {
// methods for conical indenter
bool PointInsideCone(int, double *, double, double, double, double, double *);
void DistanceExteriorPoint(int, double *, double, double, double, double,
double &, double &, double &);
void DistanceInteriorPoint(int, double *, double, double, double, double,
double &, double &, double &);
void DistanceExteriorPoint(int, double *, double, double, double, double, double &, double &,
double &);
void DistanceInteriorPoint(int, double *, double, double, double, double, double &, double &,
double &);
void point_on_line_segment(double *, double *, double *, double *);
double closest(double *, double *, double *, double);
};

View File

@ -26,7 +26,7 @@ class Imbalance : protected Pointers {
// parse options. return number of arguments consumed (required)
virtual int options(int, char **) = 0;
// reinitialize internal data (needed for fix balance) (optional)
virtual void init(int){};
virtual void init(int) {};
// compute and apply weight factors to local atom array (required)
virtual void compute(double *) = 0;
// print information about the state of this imbalance compute (required)

View File

@ -37,10 +37,10 @@ class Improper : protected Pointers {
// CENTROID_AVAIL = different and implemented
// CENTROID_NOTAVAIL = different, not yet implemented
int symmatoms[4]; // symmetry atom(s) of improper style
// value of 0: interchangable atoms
// value of 1: central atom
// values >1: additional atoms of symmetry
int symmatoms[4]; // symmetry atom(s) of improper style
// value of 0: interchangable atoms
// value of 1: central atom
// values >1: additional atoms of symmetry
// KOKKOS host/device flag and data masks
@ -57,8 +57,8 @@ class Improper : protected Pointers {
virtual void coeff(int, char **) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual void write_restart_settings(FILE *){};
virtual void read_restart_settings(FILE *){};
virtual void write_restart_settings(FILE *) {};
virtual void read_restart_settings(FILE *) {};
virtual void write_data(FILE *) {}
virtual double memory_usage();
virtual void born_matrix(int /*dtype*/, int /*at1*/, int /*at2*/, int /*at3*/, int /*at4*/,

View File

@ -112,17 +112,17 @@ class KSpace : protected Pointers {
// general child-class methods
virtual void settings(int, char **){};
virtual void settings(int, char **) {};
virtual void init() = 0;
virtual void setup() = 0;
virtual void reset_grid(){};
virtual void reset_grid() {};
virtual void compute(int, int) = 0;
virtual void compute_group_group(int, int, int){};
virtual void compute_group_group(int, int, int) {};
virtual void pack_forward_grid(int, void *, int, int *){};
virtual void unpack_forward_grid(int, void *, int, int *){};
virtual void pack_reverse_grid(int, void *, int, int *){};
virtual void unpack_reverse_grid(int, void *, int, int *){};
virtual void pack_forward_grid(int, void *, int, int *) {};
virtual void unpack_forward_grid(int, void *, int, int *) {};
virtual void pack_reverse_grid(int, void *, int, int *) {};
virtual void unpack_reverse_grid(int, void *, int, int *) {};
virtual int timing(int, double &, double &) { return 0; }
virtual int timing_1d(int, double &) { return 0; }

View File

@ -66,7 +66,7 @@ class LAMMPS {
int suffix_enable; // 1 if suffixes are enabled, 0 if disabled
int pair_only_flag; // 1 if only force field pair styles are accelerated, 0 if all
const char *non_pair_suffix() const;
char *exename; // pointer to argv[0]
char *exename; // pointer to argv[0]
char ***packargs; // arguments for cmdline package commands
int num_package; // number of cmdline package commands
@ -103,9 +103,9 @@ class LAMMPS {
void init_pkg_lists();
void help();
/// Default constructor. Declared private to prohibit its use
LAMMPS(){};
LAMMPS() {};
/// Copy constructor. Declared private to prohibit its use
LAMMPS(const LAMMPS &){};
LAMMPS(const LAMMPS &) {};
};
} // namespace LAMMPS_NS

View File

@ -44,7 +44,6 @@ class RegPlane : public Region {
char *xstr, *ystr, *zstr;
void variable_check();
};
} // namespace LAMMPS_NS

View File

@ -26,7 +26,7 @@ namespace LAMMPS_NS {
class Set : public Command {
public:
Set(class LAMMPS *lmp) : Command(lmp){};
Set(class LAMMPS *lmp) : Command(lmp) {};
void command(int, char **) override;
private:

View File

@ -409,7 +409,8 @@ This functions adds the following case to :cpp:func:`utils::bounds() <LAMMPS_NS:
*
* This function has the same arguments as expand_type() but returns an integer value */
int expand_type_int(const char *file, int line, const std::string &str, int mode, LAMMPS *lmp, bool verify = false);
int expand_type_int(const char *file, int line, const std::string &str, int mode, LAMMPS *lmp,
bool verify = false);
/*! Check grid reference for valid Compute or Fix which produces per-grid data
*

View File

@ -144,8 +144,8 @@ class Variable : protected Pointers {
int math_function(char *, char *, Tree **, Tree **, int &, double *, int &, int);
int group_function(char *, char *, Tree **, Tree **, int &, double *, int &, int);
Region *region_function(char *, int);
int special_function(const std::string &, char *, Tree **, Tree **, int &, double *, int &,
int, char *, int &, char *&);
int special_function(const std::string &, char *, Tree **, Tree **, int &, double *, int &, int,
char *, int &, char *&);
int feature_function(char *, char *, Tree **, Tree **, int &, double *, int &, int);
void peratom2global(int, char *, double *, int, tagint, Tree **, Tree **, int &, double *, int &);
void custom2global(int *, double *, int, tagint, Tree **, Tree **, int &, double *, int &);

View File

@ -26,7 +26,7 @@ namespace LAMMPS_NS {
class WriteCoeff : public Command {
public:
WriteCoeff(class LAMMPS *lmp) : Command(lmp){};
WriteCoeff(class LAMMPS *lmp) : Command(lmp) {};
void command(int, char **) override;
};

View File

@ -26,7 +26,7 @@ namespace LAMMPS_NS {
class WriteDump : public Command {
public:
WriteDump(class LAMMPS *lmp) : Command(lmp){};
WriteDump(class LAMMPS *lmp) : Command(lmp) {};
void command(int, char **) override;
};