apply clang-format
This commit is contained in:
@ -258,6 +258,6 @@ void FixUpdateSpecialBonds::write_restart(FILE *fp)
|
|||||||
pre_exchange();
|
pre_exchange();
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
int size = 0;
|
int size = 0;
|
||||||
fwrite(&size,sizeof(int),1,fp);
|
fwrite(&size, sizeof(int), 1, fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -346,7 +346,7 @@ Bond *Force::new_bond(const std::string &style, int trysuffix, int &sflag)
|
|||||||
{
|
{
|
||||||
if (trysuffix && lmp->suffix_enable) {
|
if (trysuffix && lmp->suffix_enable) {
|
||||||
if (lmp->non_pair_suffix()) {
|
if (lmp->non_pair_suffix()) {
|
||||||
sflag = 1 + 2*lmp->pair_only_flag;
|
sflag = 1 + 2 * lmp->pair_only_flag;
|
||||||
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
||||||
if (bond_map->find(estyle) != bond_map->end()) {
|
if (bond_map->find(estyle) != bond_map->end()) {
|
||||||
BondCreator &bond_creator = (*bond_map)[estyle];
|
BondCreator &bond_creator = (*bond_map)[estyle];
|
||||||
@ -414,7 +414,7 @@ Angle *Force::new_angle(const std::string &style, int trysuffix, int &sflag)
|
|||||||
{
|
{
|
||||||
if (trysuffix && lmp->suffix_enable) {
|
if (trysuffix && lmp->suffix_enable) {
|
||||||
if (lmp->non_pair_suffix()) {
|
if (lmp->non_pair_suffix()) {
|
||||||
sflag = 1 + 2*lmp->pair_only_flag;
|
sflag = 1 + 2 * lmp->pair_only_flag;
|
||||||
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
||||||
if (angle_map->find(estyle) != angle_map->end()) {
|
if (angle_map->find(estyle) != angle_map->end()) {
|
||||||
AngleCreator &angle_creator = (*angle_map)[estyle];
|
AngleCreator &angle_creator = (*angle_map)[estyle];
|
||||||
@ -482,7 +482,7 @@ Dihedral *Force::new_dihedral(const std::string &style, int trysuffix, int &sfla
|
|||||||
{
|
{
|
||||||
if (trysuffix && lmp->suffix_enable) {
|
if (trysuffix && lmp->suffix_enable) {
|
||||||
if (lmp->non_pair_suffix()) {
|
if (lmp->non_pair_suffix()) {
|
||||||
sflag = 1 + 2*lmp->pair_only_flag;
|
sflag = 1 + 2 * lmp->pair_only_flag;
|
||||||
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
||||||
if (dihedral_map->find(estyle) != dihedral_map->end()) {
|
if (dihedral_map->find(estyle) != dihedral_map->end()) {
|
||||||
DihedralCreator &dihedral_creator = (*dihedral_map)[estyle];
|
DihedralCreator &dihedral_creator = (*dihedral_map)[estyle];
|
||||||
@ -550,7 +550,7 @@ Improper *Force::new_improper(const std::string &style, int trysuffix, int &sfla
|
|||||||
{
|
{
|
||||||
if (trysuffix && lmp->suffix_enable) {
|
if (trysuffix && lmp->suffix_enable) {
|
||||||
if (lmp->non_pair_suffix()) {
|
if (lmp->non_pair_suffix()) {
|
||||||
sflag = 1 + 2*lmp->pair_only_flag;
|
sflag = 1 + 2 * lmp->pair_only_flag;
|
||||||
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
||||||
if (improper_map->find(estyle) != improper_map->end()) {
|
if (improper_map->find(estyle) != improper_map->end()) {
|
||||||
ImproperCreator &improper_creator = (*improper_map)[estyle];
|
ImproperCreator &improper_creator = (*improper_map)[estyle];
|
||||||
@ -618,7 +618,7 @@ KSpace *Force::new_kspace(const std::string &style, int trysuffix, int &sflag)
|
|||||||
{
|
{
|
||||||
if (trysuffix && lmp->suffix_enable) {
|
if (trysuffix && lmp->suffix_enable) {
|
||||||
if (lmp->non_pair_suffix()) {
|
if (lmp->non_pair_suffix()) {
|
||||||
sflag = 1 + 2*lmp->pair_only_flag;
|
sflag = 1 + 2 * lmp->pair_only_flag;
|
||||||
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
std::string estyle = style + "/" + lmp->non_pair_suffix();
|
||||||
if (kspace_map->find(estyle) != kspace_map->end()) {
|
if (kspace_map->find(estyle) != kspace_map->end()) {
|
||||||
KSpaceCreator &kspace_creator = (*kspace_map)[estyle];
|
KSpaceCreator &kspace_creator = (*kspace_map)[estyle];
|
||||||
|
|||||||
@ -477,8 +477,8 @@ double PairBuckCoulCut::single(int i, int j, int itype, int jtype, double rsq, d
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairBuckCoulCut::born_matrix(int i, int j, int itype, int jtype, double rsq,
|
void PairBuckCoulCut::born_matrix(int i, int j, int itype, int jtype, double rsq,
|
||||||
double factor_coul, double factor_lj, double &dupair,
|
double factor_coul, double factor_lj, double &dupair,
|
||||||
double &du2pair)
|
double &du2pair)
|
||||||
{
|
{
|
||||||
double rinv, r2inv, r3inv, r6inv, r7inv, r8inv, r, rexp;
|
double rinv, r2inv, r3inv, r6inv, r7inv, r8inv, r, rexp;
|
||||||
double du_lj, du2_lj, du_coul, du2_coul;
|
double du_lj, du2_lj, du_coul, du2_coul;
|
||||||
@ -487,7 +487,7 @@ void PairBuckCoulCut::born_matrix(int i, int j, int itype, int jtype, double rsq
|
|||||||
double qqrd2e = force->qqrd2e;
|
double qqrd2e = force->qqrd2e;
|
||||||
|
|
||||||
r = sqrt(rsq);
|
r = sqrt(rsq);
|
||||||
rexp = exp(-r*rhoinv[itype][jtype]);
|
rexp = exp(-r * rhoinv[itype][jtype]);
|
||||||
|
|
||||||
r2inv = 1.0 / rsq;
|
r2inv = 1.0 / rsq;
|
||||||
rinv = sqrt(r2inv);
|
rinv = sqrt(r2inv);
|
||||||
|
|||||||
@ -331,8 +331,8 @@ double PairCoulCut::single(int i, int j, int /*itype*/, int /*jtype*/, double rs
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairCoulCut::born_matrix(int i, int j, int /*itype*/, int /*jtype*/, double rsq,
|
void PairCoulCut::born_matrix(int i, int j, int /*itype*/, int /*jtype*/, double rsq,
|
||||||
double factor_coul, double /*factor_lj*/, double &dupair,
|
double factor_coul, double /*factor_lj*/, double &dupair,
|
||||||
double &du2pair)
|
double &du2pair)
|
||||||
{
|
{
|
||||||
double rinv, r2inv, r3inv;
|
double rinv, r2inv, r3inv;
|
||||||
double du_coul, du2_coul;
|
double du_coul, du2_coul;
|
||||||
|
|||||||
@ -462,8 +462,8 @@ double PairLJCutCoulCut::single(int i, int j, int itype, int jtype, double rsq,
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairLJCutCoulCut::born_matrix(int i, int j, int itype, int jtype, double rsq,
|
void PairLJCutCoulCut::born_matrix(int i, int j, int itype, int jtype, double rsq,
|
||||||
double factor_coul, double factor_lj, double &dupair,
|
double factor_coul, double factor_lj, double &dupair,
|
||||||
double &du2pair)
|
double &du2pair)
|
||||||
{
|
{
|
||||||
double rinv, r2inv, r3inv, r6inv;
|
double rinv, r2inv, r3inv, r6inv;
|
||||||
double du_lj, du2_lj, du_coul, du2_coul;
|
double du_lj, du2_lj, du_coul, du2_coul;
|
||||||
|
|||||||
@ -2021,7 +2021,7 @@ void ReadData::pairIJcoeffs()
|
|||||||
if (eof) error->all(FLERR, "Unexpected end of data file");
|
if (eof) error->all(FLERR, "Unexpected end of data file");
|
||||||
|
|
||||||
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
|
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
|
||||||
error->all(FLERR,"Label map is incomplete: all types must be assigned a unique type label");
|
error->all(FLERR, "Label map is incomplete: all types must be assigned a unique type label");
|
||||||
|
|
||||||
char *original = buf;
|
char *original = buf;
|
||||||
for (i = 0; i < ntypes; i++)
|
for (i = 0; i < ntypes; i++)
|
||||||
|
|||||||
@ -43,7 +43,8 @@ static int compare_coords(const int, const int, void *);
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ResetAtomsID::ResetAtomsID(LAMMPS *lmp) : Command(lmp) {
|
ResetAtomsID::ResetAtomsID(LAMMPS *lmp) : Command(lmp)
|
||||||
|
{
|
||||||
binlo = binhi = -1;
|
binlo = binhi = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -691,11 +691,12 @@ void Thermo::modify_params(int narg, char **arg)
|
|||||||
utils::bounds(FLERR, arg[iarg + 1], 1, nfield_initial, nlo, nhi, error);
|
utils::bounds(FLERR, arg[iarg + 1], 1, nfield_initial, nlo, nhi, error);
|
||||||
int icol = -1;
|
int icol = -1;
|
||||||
for (int i = nlo - 1; i < nhi; i++) {
|
for (int i = nlo - 1; i < nhi; i++) {
|
||||||
if (i < 0) icol = nfield_initial + i + 1; // doesn't happen currently
|
if (i < 0)
|
||||||
else icol = i;
|
icol = nfield_initial + i + 1; // doesn't happen currently
|
||||||
|
else
|
||||||
|
icol = i;
|
||||||
if (icol < 0 || (icol >= nfield_initial))
|
if (icol < 0 || (icol >= nfield_initial))
|
||||||
error->all(FLERR, "Invalid thermo_modify format argument: {}",
|
error->all(FLERR, "Invalid thermo_modify format argument: {}", arg[iarg + 1]);
|
||||||
arg[iarg + 1]);
|
|
||||||
format_column_user[icol] = arg[iarg + 2];
|
format_column_user[icol] = arg[iarg + 2];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1135,7 +1136,8 @@ void Thermo::check_temp(const std::string &keyword)
|
|||||||
error->all(FLERR, "Thermo keyword {} in variable requires thermo to use/init temperature",
|
error->all(FLERR, "Thermo keyword {} in variable requires thermo to use/init temperature",
|
||||||
keyword);
|
keyword);
|
||||||
if (!temperature->is_initialized())
|
if (!temperature->is_initialized())
|
||||||
error->all(FLERR,"Thermo keyword {} cannot be invoked before initialization by a run",keyword);
|
error->all(FLERR, "Thermo keyword {} cannot be invoked before initialization by a run",
|
||||||
|
keyword);
|
||||||
if (!(temperature->invoked_flag & Compute::INVOKED_SCALAR)) {
|
if (!(temperature->invoked_flag & Compute::INVOKED_SCALAR)) {
|
||||||
temperature->compute_scalar();
|
temperature->compute_scalar();
|
||||||
temperature->invoked_flag |= Compute::INVOKED_SCALAR;
|
temperature->invoked_flag |= Compute::INVOKED_SCALAR;
|
||||||
@ -1154,7 +1156,8 @@ void Thermo::check_pe(const std::string &keyword)
|
|||||||
error->all(FLERR, "Thermo keyword {} in variable requires thermo to use/init potential energy",
|
error->all(FLERR, "Thermo keyword {} in variable requires thermo to use/init potential energy",
|
||||||
keyword);
|
keyword);
|
||||||
if (!pe->is_initialized())
|
if (!pe->is_initialized())
|
||||||
error->all(FLERR,"Thermo keyword {} cannot be invoked before initialization by a run",keyword);
|
error->all(FLERR, "Thermo keyword {} cannot be invoked before initialization by a run",
|
||||||
|
keyword);
|
||||||
if (!(pe->invoked_flag & Compute::INVOKED_SCALAR)) {
|
if (!(pe->invoked_flag & Compute::INVOKED_SCALAR)) {
|
||||||
pe->compute_scalar();
|
pe->compute_scalar();
|
||||||
pe->invoked_flag |= Compute::INVOKED_SCALAR;
|
pe->invoked_flag |= Compute::INVOKED_SCALAR;
|
||||||
@ -1170,7 +1173,8 @@ void Thermo::check_press_scalar(const std::string &keyword)
|
|||||||
if (!pressure)
|
if (!pressure)
|
||||||
error->all(FLERR, "Thermo keyword {} in variable requires thermo to use/init press", keyword);
|
error->all(FLERR, "Thermo keyword {} in variable requires thermo to use/init press", keyword);
|
||||||
if (!pressure->is_initialized())
|
if (!pressure->is_initialized())
|
||||||
error->all(FLERR,"Thermo keyword {} cannot be invoked before initialization by a run",keyword);
|
error->all(FLERR, "Thermo keyword {} cannot be invoked before initialization by a run",
|
||||||
|
keyword);
|
||||||
if (!(pressure->invoked_flag & Compute::INVOKED_SCALAR)) {
|
if (!(pressure->invoked_flag & Compute::INVOKED_SCALAR)) {
|
||||||
pressure->compute_scalar();
|
pressure->compute_scalar();
|
||||||
pressure->invoked_flag |= Compute::INVOKED_SCALAR;
|
pressure->invoked_flag |= Compute::INVOKED_SCALAR;
|
||||||
@ -1186,7 +1190,8 @@ void Thermo::check_press_vector(const std::string &keyword)
|
|||||||
if (!pressure)
|
if (!pressure)
|
||||||
error->all(FLERR, "Thermo keyword {} in variable requires thermo to use/init press", keyword);
|
error->all(FLERR, "Thermo keyword {} in variable requires thermo to use/init press", keyword);
|
||||||
if (!pressure->is_initialized())
|
if (!pressure->is_initialized())
|
||||||
error->all(FLERR,"Thermo keyword {} cannot be invoked before initialization by a run",keyword);
|
error->all(FLERR, "Thermo keyword {} cannot be invoked before initialization by a run",
|
||||||
|
keyword);
|
||||||
if (!(pressure->invoked_flag & Compute::INVOKED_VECTOR)) {
|
if (!(pressure->invoked_flag & Compute::INVOKED_VECTOR)) {
|
||||||
pressure->compute_vector();
|
pressure->compute_vector();
|
||||||
pressure->invoked_flag |= Compute::INVOKED_VECTOR;
|
pressure->invoked_flag |= Compute::INVOKED_VECTOR;
|
||||||
|
|||||||
@ -362,7 +362,7 @@ void Update::new_integrate(char *style, int narg, char **arg, int trysuffix, int
|
|||||||
{
|
{
|
||||||
if (trysuffix && lmp->suffix_enable) {
|
if (trysuffix && lmp->suffix_enable) {
|
||||||
if (lmp->non_pair_suffix()) {
|
if (lmp->non_pair_suffix()) {
|
||||||
sflag = 1 + 2*lmp->pair_only_flag;
|
sflag = 1 + 2 * lmp->pair_only_flag;
|
||||||
std::string estyle = style + std::string("/") + lmp->non_pair_suffix();
|
std::string estyle = style + std::string("/") + lmp->non_pair_suffix();
|
||||||
if (integrate_map->find(estyle) != integrate_map->end()) {
|
if (integrate_map->find(estyle) != integrate_map->end()) {
|
||||||
IntegrateCreator &integrate_creator = (*integrate_map)[estyle];
|
IntegrateCreator &integrate_creator = (*integrate_map)[estyle];
|
||||||
@ -428,7 +428,7 @@ void Update::new_minimize(char *style, int /* narg */, char ** /* arg */, int tr
|
|||||||
{
|
{
|
||||||
if (trysuffix && lmp->suffix_enable) {
|
if (trysuffix && lmp->suffix_enable) {
|
||||||
if (lmp->non_pair_suffix()) {
|
if (lmp->non_pair_suffix()) {
|
||||||
sflag = 1 + 2*lmp->pair_only_flag;
|
sflag = 1 + 2 * lmp->pair_only_flag;
|
||||||
std::string estyle = style + std::string("/") + lmp->non_pair_suffix();
|
std::string estyle = style + std::string("/") + lmp->non_pair_suffix();
|
||||||
if (minimize_map->find(estyle) != minimize_map->end()) {
|
if (minimize_map->find(estyle) != minimize_map->end()) {
|
||||||
MinimizeCreator &minimize_creator = (*minimize_map)[estyle];
|
MinimizeCreator &minimize_creator = (*minimize_map)[estyle];
|
||||||
|
|||||||
Reference in New Issue
Block a user