formatting, whitespace and include file/constants cleanup

This commit is contained in:
Axel Kohlmeyer 2017-10-02 17:15:13 -04:00
parent 0c7879e902
commit 81be9b37de
13 changed files with 46 additions and 64 deletions

View File

@ -13,9 +13,9 @@
Contributing author: David Nicholson (MIT)
------------------------------------------------------------------------- */
#include "mpi.h"
#include "string.h"
#include "stdlib.h"
#include <mpi.h>
#include <string.h>
#include <stdlib.h>
#include "compute_pressure_uef.h"
#include "fix_nh_uef.h"
#include "update.h"
@ -118,7 +118,7 @@ void ComputePressureUef::compute_vector()
if (force->kspace && kspace_virial && force->kspace->scalar_pressure_flag)
error->all(FLERR,"Must use 'kspace_modify pressure/scalar no' for "
"tensor components with kspace_style msm");
"tensor components with kspace_style msm");
// invoke temperature if it hasn't been already
@ -131,7 +131,7 @@ void ComputePressureUef::compute_vector()
if (dimension == 3) {
inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd);
virial_compute(6,3);
virial_compute(6,3);
if (in_fix)
virial_rot(virial,rot);
else
@ -182,7 +182,7 @@ void ComputePressureUef::virial_rot(double *x, const double r[3][3])
// [00 10 20 ] [ 0 3 4 ] [00 01 02 ]
// [01 11 21 ] [ 3 1 5 ] [10 11 12 ]
// [02 12 22 ] [ 4 5 2 ] [20 21 22 ]
for (int k = 0; k<3; ++k)
for (int k = 0; k<3; ++k)
{
t[0][k] = x[0]*r[0][k] + x[3]*r[1][k] + x[4]*r[2][k];
t[1][k] = x[3]*r[0][k] + x[1]*r[1][k] + x[5]*r[2][k];

View File

@ -1,4 +1,4 @@
/* ----------------------------------------------------------------------
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
@ -31,11 +31,11 @@ class ComputePressureUef : public ComputePressure {
ComputePressureUef(class LAMMPS *, int, char **);
virtual ~ComputePressureUef(){}
virtual void init();
virtual void compute_vector();
virtual double compute_scalar();
virtual void compute_vector();
virtual double compute_scalar();
void update_rot();
bool in_fix; //true if this compute is used in fix/nvt/npt
protected:
bool ext_flags[3]; // true if used in average output pressure
@ -57,7 +57,7 @@ only additions are:
E: Can't use compute pressure/uef without defining a fix nvt/npt/uef
Self-explanatory.
Self-explanatory.
W: The temperature used in compute pressure/uef is not of style temp/uef

View File

@ -13,8 +13,8 @@
Contributing author: David Nicholson (MIT)
------------------------------------------------------------------------- */
#include "string.h"
#include "stdlib.h"
#include <string.h>
#include <stdlib.h>
#include "compute_temp_uef.h"
#include "fix_nh_uef.h"
#include "update.h"
@ -28,7 +28,7 @@ using namespace LAMMPS_NS;
* Base constructor initialized to use rotation matrix
* ----------------------------------------------------------------------*/
ComputeTempUef::ComputeTempUef(LAMMPS *lmp, int narg, char **arg) :
ComputeTemp(lmp, narg, arg)
ComputeTemp(lmp, narg, arg)
{
rot_flag=true;
}
@ -94,7 +94,7 @@ void ComputeTempUef::virial_rot(double *x, const double r[3][3])
// [00 10 20 ] [ 0 3 4 ] [00 01 02 ]
// [01 11 21 ] [ 3 1 5 ] [10 11 12 ]
// [02 12 22 ] [ 4 5 2 ] [20 21 22 ]
for (int k = 0; k<3; ++k)
for (int k = 0; k<3; ++k)
{
t[0][k] = x[0]*r[0][k] + x[3]*r[1][k] + x[4]*r[2][k];
t[1][k] = x[3]*r[0][k] + x[1]*r[1][k] + x[5]*r[2][k];

View File

@ -1,4 +1,4 @@
/* ----------------------------------------------------------------------
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
@ -31,10 +31,10 @@ class ComputeTempUef : public ComputeTemp {
ComputeTempUef(class LAMMPS *, int, char **);
virtual ~ComputeTempUef(){}
virtual void init();
virtual void compute_vector();
virtual void compute_vector();
void yes_rot();
void no_rot();
protected:
bool rot_flag;
@ -55,6 +55,6 @@ only addition is:
E: Can't use compute temp/uef without defining a fix nvt/npt/uef
Self-explanatory.
Self-explanatory.
*/

View File

@ -36,8 +36,8 @@ enum{INT,DOUBLE,STRING,BIGINT}; // same as in DumpCustom
#define ONEFIELD 32
#define DELTA 1048576
/* ----------------------------------------------------------------------
* base method is mostly fine, just need to find the FixNHUef
/* ----------------------------------------------------------------------
* base method is mostly fine, just need to find the FixNHUef
* ----------------------------------------------------------------------*/
void DumpCFGUef::init_style()
{
@ -58,7 +58,7 @@ void DumpCFGUef::init_style()
ifix_uef=i;
}
/* ----------------------------------------------------------------------
/* ----------------------------------------------------------------------
* this is really the only difference between the base class and this one.
* since the output is in scaled coordinates, changing the simulation box
* edges to the flow frame will put coordinates in the flow frame too.

View File

@ -43,7 +43,7 @@ class DumpCFGUef : public DumpCFG {
#endif
/* ERROR/WARNING messages:
E: Can't use dump cfg/uef without defining a fix nvt/npt/uef
Self-explanatory.

View File

@ -13,9 +13,9 @@
Contributing author: David Nicholson (MIT)
------------------------------------------------------------------------- */
#include "string.h"
#include "stdlib.h"
#include "math.h"
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "fix_nh_uef.h"
#include "atom.h"
#include "force.h"

View File

@ -13,14 +13,10 @@
Contributing author: David Nicholson (MIT)
------------------------------------------------------------------------- */
#include "string.h"
#include "fix_npt_uef.h"
#include "modify.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
FixNPTUef::FixNPTUef(LAMMPS *lmp, int narg, char **arg) :
FixNHUef(lmp, narg, arg)
@ -29,5 +25,4 @@ FixNPTUef::FixNPTUef(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Temperature control must be used with fix npt/uef");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/uef");
}

View File

@ -1,4 +1,4 @@
/* ----------------------------------------------------------------------
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov

View File

@ -13,14 +13,10 @@
Contributing author: David Nicholson (MIT)
------------------------------------------------------------------------- */
#include "string.h"
#include "fix_nvt_uef.h"
#include "modify.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
FixNVTUef::FixNVTUef(LAMMPS *lmp, int narg, char **arg) :
FixNHUef(lmp, narg, arg)
@ -29,7 +25,6 @@ FixNVTUef::FixNVTUef(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Temperature control must be used with fix nvt/uef");
if (pstat_flag)
error->all(FLERR,"Pressure control can't be used with fix nvt/uef");
}

View File

@ -1,4 +1,4 @@
/* ----------------------------------------------------------------------
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov

View File

@ -11,20 +11,22 @@
See the README file in the top-level LAMMPS directory.
Contributing author: David Nicholson (MIT)
-------------------------------------------------------------------------
-------------------------------------------------------------------------
This class contains functions to calculate the evolution of the periodic
This class contains functions to calculate the evolution of the periodic
simulation box under elongational flow as described by Matthew Dobson
in the arXiv preprint at http://arxiv.org/abs/1408.7078
Additionally, there are methods to do a lattice reduction to further
reduce the simulation box using the method of Igor Semaev at
http://link.springer.com/chapter/10.1007%2F3-540-44670-2_13
*/
#include <math.h>
#include "uef_utils.h"
namespace LAMMPS_NS{ namespace UEF_utils{
namespace LAMMPS_NS {
namespace UEF_utils{
UEFBox::UEFBox()
{
@ -46,7 +48,7 @@ UEFBox::UEFBox()
// strain = w1 * theta1 + w2 * theta2
theta[0]=theta[1]=0;
//set up the initial box l and change of basis matrix r
for (int k=0;k<3;k++)
for (int j=0;j<3;j++)
@ -124,8 +126,8 @@ void UEFBox::step_deform(const double ex, const double ey)
theta[0] +=winv[0][0]*ex + winv[0][1]*ey;
theta[1] +=winv[1][0]*ex + winv[1][1]*ey;
// deformation of the box. reduce() needs to
// be called regularly or calculation will become
// deformation of the box. reduce() needs to
// be called regularly or calculation will become
// unstable
double eps[3];
eps[0]=ex; eps[1] = ey; eps[2] = -ex-ey;
@ -148,7 +150,7 @@ bool UEFBox::reduce()
theta[0] -= f1;
theta[1] -= f2;
// store old change or basis matrix to determine if it
// store old change or basis matrix to determine if it
// changes
int r0[3][3];
for (int k=0;k<3;k++)
@ -157,7 +159,7 @@ bool UEFBox::reduce()
// this modifies the old change basis matrix to
// handle the case where the automorphism transforms
// the box but the reduced basis doesn't change
// the box but the reduced basis doesn't change
// (r0 should still equal r at the end)
if (f1 > 0) for (int k=0;k<f1;k++) mul_m2 (a1,r0);
if (f1 < 0) for (int k=0;k<-f1;k++) mul_m2 (a1i,r0);
@ -336,7 +338,7 @@ void greedy_recurse(double b[3][3], int r[3][3])
red3(b,r); // recursive caller
}
// set r (change of basis) to be identity then reduce basis and make it unique
// set r (change of basis) to be identity then reduce basis and make it unique
void greedy(double b[3][3],int r[3][3])
{
r[0][1]=r[0][2]=r[1][0]=r[1][2]=r[2][0]=r[2][1]=0;
@ -345,7 +347,7 @@ void greedy(double b[3][3],int r[3][3])
make_unique(b,r);
}
// A reduced basis isn't unique. This procedure will make it
// A reduced basis isn't unique. This procedure will make it
// "more" unique. Degenerate cases are possible, but unlikely
// with floating point math.
void make_unique(double b[3][3], int r[3][3])

View File

@ -1,5 +1,4 @@
/* ----------------------------------------------------------------------
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
@ -12,21 +11,12 @@
See the README file in the top-level LAMMPS directory.
Contributing author: David Nicholson (MIT)
-------------------------------------------------------------------------
------------------------------------------------------------------------- */
This class contains functions to calculate the evolution of the periodic
simulation box under elongational flow as described by Matthew Dobson
in the arXiv preprint at http://arxiv.org/abs/1408.7078
Additionally, there are methods to do a lattice reduction to further
reduce the simulation box using the method of Igor Semaev at
http://link.springer.com/chapter/10.1007%2F3-540-44670-2_13
*/
#ifndef LMP_UEF_UTILS_H
#define LMP_UEF_UTILS_H
#ifndef UEF_UTILS_H
#define UEF_UTILS_H
namespace LAMMPS_NS{ namespace UEF_utils{
namespace LAMMPS_NS{ namespace UEF_utils {
class UEFBox
{