Skip to content

Commit

Permalink
apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
akohlmey committed Jul 31, 2024
1 parent c540252 commit 5dff36a
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 111 deletions.
14 changes: 7 additions & 7 deletions src/AMOEBA/amoeba_convolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#ifndef LMP_AMOEBA_CONVOLUTION_H
#define LMP_AMOEBA_CONVOLUTION_H

#include "pointers.h"
#include "lmpfftsettings.h"
#include "pointers.h"

namespace LAMMPS_NS {

Expand All @@ -27,7 +27,7 @@ class AmoebaConvolution : protected Pointers {
int nxlo_in, nxhi_in, nylo_in, nyhi_in, nzlo_in, nzhi_in;
int nxlo_out, nxhi_out, nylo_out, nyhi_out, nzlo_out, nzhi_out;
int nxlo_fft, nxhi_fft, nylo_fft, nyhi_fft, nzlo_fft, nzhi_fft;
bigint nfft_global; // nx * ny * nz
bigint nfft_global; // nx * ny * nz
FFT_SCALAR *grid_brick_start; // lower left corner of (c)grid_brick data

AmoebaConvolution(class LAMMPS *, class Pair *, int, int, int, int, int);
Expand All @@ -40,11 +40,11 @@ class AmoebaConvolution : protected Pointers {
double time_fft;

protected:
int which; // caller name for convolution being performed
int flag3d; // 1 if using 3d grid_brick, 0 for 4d cgrid_brick
int nbrick_owned; // owned grid points in brick decomp
int nbrick_ghosts; // owned + ghost brick grid points
int ngrid_either; // max of nbrick_owned or nfft_owned
int which; // caller name for convolution being performed
int flag3d; // 1 if using 3d grid_brick, 0 for 4d cgrid_brick
int nbrick_owned; // owned grid points in brick decomp
int nbrick_ghosts; // owned + ghost brick grid points
int ngrid_either; // max of nbrick_owned or nfft_owned

class Pair *amoeba;
class FFT3d *fft1, *fft2;
Expand Down
3 changes: 1 addition & 2 deletions src/ELECTRODE/electrode_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ using namespace LAMMPS_NS;
using namespace MathConst;

ElectrodeVector::ElectrodeVector(LAMMPS *lmp, int sensor_group, int source_group, double eta,
bool invert_source) :
Pointers(lmp)
bool invert_source) : Pointers(lmp)
{
igroup = sensor_group; // group of all atoms at which we calculate potential
this->source_group = source_group; // group of all atoms influencing potential
Expand Down
3 changes: 2 additions & 1 deletion src/ELECTRODE/fix_electrode_conp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,8 @@ void FixElectrodeConp::update_charges()
dot_old = dot_new;
}
recompute_potential(std::move(b), q_local);
if ((delta > cg_threshold) && (comm->me == 0)) error->warning(FLERR, "CG threshold not reached");
if ((delta > cg_threshold) && (comm->me == 0))
error->warning(FLERR, "CG threshold not reached");
} else {
error->all(FLERR, "This algorithm is not implemented, yet");
}
Expand Down
1 change: 0 additions & 1 deletion src/neighbor.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ class Neighbor : protected Pointers {
int npair_perpetual; // # of perpetual NeighPair classes
int *slist; // indices of them in neigh_stencil
int *plist; // indices of them in neigh_pair

int npair_occasional; // # of occasional NeighPair classes
int *olist; // indices of them in neigh_pair

Expand Down
47 changes: 23 additions & 24 deletions src/read_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ void ReadData::command(int narg, char **arg)
if (domain->dimension == 2) {
if (triclinic_general == 0) {
if (boxlo[2] >= 0.0 || boxhi[2] <= 0.0)
error->all(FLERR,"Read_data zlo/zhi for 2d simulation must straddle 0.0");
error->all(FLERR, "Read_data zlo/zhi for 2d simulation must straddle 0.0");
} else if (triclinic_general == 1) {
if (cvec[0] != 0.0 || cvec[1] != 0.0 || cvec[2] != 1.0 || abc_origin[2] != -0.5)
error->all(FLERR,"Read_data cvec and/or abc_origin is invalid for "
Expand Down Expand Up @@ -594,12 +594,12 @@ void ReadData::command(int narg, char **arg)
domain->yz = yz;
}

// general triclinic box
// define_general_triclinic() converts
// ABC edge vectors + abc_origin to restricted triclinic
// general triclinic box
// define_general_triclinic() converts
// ABC edge vectors + abc_origin to restricted triclinic

} else if (triclinic_general) {
domain->define_general_triclinic(avec,bvec,cvec,abc_origin);
domain->define_general_triclinic(avec, bvec, cvec, abc_origin);
}
}

Expand All @@ -615,7 +615,7 @@ void ReadData::command(int narg, char **arg)

if (triclinic_general) {
if (!domain->triclinic_general)
error->all(FLERR,"Read_data subsequent file cannot switch to general triclinic");
error->all(FLERR, "Read_data subsequent file cannot switch to general triclinic");
int errflag = 0;
if (avec[0] != domain->avec[0] || avec[1] != domain->avec[1] || avec[2] != domain->avec[2])
errflag = 1;
Expand All @@ -627,22 +627,22 @@ void ReadData::command(int narg, char **arg)
abc_origin[2] != domain->boxlo[2])
errflag = 1;
if (errflag)
error->all(FLERR,"Read_data subsequent file ABC vectors must be same as first file");
error->all(FLERR, "Read_data subsequent file ABC vectors must be same as first file");
if (shift[0] != 0.0 || shift[1] != 0.0 || shift[2] != 0.0)
error->all(FLERR,"Read_data subsequent file with ABC vectors cannot define shift");
error->all(FLERR, "Read_data subsequent file with ABC vectors cannot define shift");

// restricted triclinic
// tilt factors must match first data file
// restricted triclinic
// tilt factors must match first data file

} else if (triclinic) {
if (!domain->triclinic || domain->triclinic_general)
error->all(FLERR,"Read_data subsequent file cannot switch to restricted triclinic");
error->all(FLERR, "Read_data subsequent file cannot switch to restricted triclinic");
if (xy != domain->xy || xz != domain->xz || yz != domain->yz)
error->all(FLERR,"Read_data subsequent file tilt factors must be same as first file");
error->all(FLERR, "Read_data subsequent file tilt factors must be same as first file");

} else {
if (domain->triclinic)
error->all(FLERR,"Read_data subsequent file cannot switch to orthogonal");
error->all(FLERR, "Read_data subsequent file cannot switch to orthogonal");
}

double oldboxlo[3] = {domain->boxlo[0], domain->boxlo[1], domain->boxlo[2]};
Expand Down Expand Up @@ -1068,8 +1068,7 @@ void ReadData::command(int narg, char **arg)
// if general triclinic, perform general to restricted rotation operation
// on any quantities read from data file which require it

if (triclinic_general)
atom->avec->read_data_general_to_restricted(nlocal_previous, atom->nlocal);
if (triclinic_general) atom->avec->read_data_general_to_restricted(nlocal_previous, atom->nlocal);

// init per-atom fix/compute/variable values for created atoms

Expand Down Expand Up @@ -1371,7 +1370,7 @@ void ReadData::header(int firstpass)
else if (firstpass)
atom->nimpropers += nimpropers;

// Atom class type settings are only set by first data file
// Atom class type settings are only set by first data file

} else if (utils::strmatch(line, "^\\s*\\d+\\s+atom\\s+types\\s")) {
ntypes = utils::inumeric(FLERR, words[0], false, lmp);
Expand All @@ -1393,10 +1392,10 @@ void ReadData::header(int firstpass)
nimpropertypes = utils::inumeric(FLERR, words[0], false, lmp);
if (addflag == NONE) atom->nimpropertypes = nimpropertypes + extra_improper_types;

// these settings only used by first data file
// NOTE: these are now obsolete, we parse them to maintain backward compatibility
// the recommended way is to set them via command keywords in the input script
// if these flags are set both ways, the larger of the two values is used
// these settings only used by first data file
// NOTE: these are now obsolete, we parse them to maintain backward compatibility
// the recommended way is to set them via command keywords in the input script
// if these flags are set both ways, the larger of the two values is used

} else if (strstr(line, "extra bond per atom")) {
if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp);
Expand All @@ -1414,8 +1413,8 @@ void ReadData::header(int firstpass)
if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp);
force->special_extra = MAX(force->special_extra, extra_flag_value);

// local copy of box info
// so can treat differently for first vs subsequent data files
// local copy of box info
// so can treat differently for first vs subsequent data files

} else if (utils::strmatch(line, "^\\s*\\f+\\s+\\f+\\s+xlo\\s+xhi\\s")) {
xloxhi_flag = 1;
Expand Down Expand Up @@ -1527,8 +1526,8 @@ void ReadData::atoms()
if (eof) error->all(FLERR, "Unexpected end of data file");
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
error->all(FLERR, "Label map is incomplete: all types must be assigned a unique type label");
atom->data_atoms(nchunk, buffer, id_offset, mol_offset, toffset,
shiftflag, shift, tlabelflag, lmap->lmap2lmap.atom, triclinic_general);
atom->data_atoms(nchunk, buffer, id_offset, mol_offset, toffset, shiftflag, shift, tlabelflag,
lmap->lmap2lmap.atom, triclinic_general);
nread += nchunk;
}

Expand Down
3 changes: 1 addition & 2 deletions src/region_cone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,7 @@ void RegCone::shape_update()
if (lostyle == VARIABLE) lo = input->variable->compute_equal(lovar);
if (histyle == VARIABLE) hi = input->variable->compute_equal(hivar);

if (radiuslo == 0.0 && radiushi == 0.0)
error->all(FLERR, "dtion in region gave bad value");
if (radiuslo == 0.0 && radiushi == 0.0) error->all(FLERR, "dtion in region gave bad value");

if (axis == 'x') {
if (c1style == VARIABLE) c1 *= yscale;
Expand Down
Loading

0 comments on commit 5dff36a

Please sign in to comment.