Merge pull request #2762 from akohlmey/prepare-clang-format

Prepare LAMMPS to support updating the coding style with clang-format
This commit is contained in:
Axel Kohlmeyer
2021-05-14 23:23:35 -04:00
committed by GitHub
3300 changed files with 23204 additions and 22291 deletions

View File

@ -10,15 +10,15 @@ Tutorial <Howto_github>` for a demonstration on how to do that. An
alternative is to contact the LAMMPS developers or the indicated
developer of a package or feature directly and send in your contribution
via e-mail, but that can add a significant delay on getting your
contribution included, depending on how busy the developer is you
contact, how complex a task it would be to integrate that code, and how
contribution included, depending on how busy the respective developer
is, how complex a task it would be to integrate that code, and how
many - if any - changes are required before the code can be included.
For any larger modifications or programming project, you are encouraged
to contact the LAMMPS developers ahead of time, in order to discuss
implementation strategies and coding guidelines, that will make it
easier to integrate your contribution and result in less work for
everybody involved. You are also encouraged to search through the list
to contact the LAMMPS developers ahead of time in order to discuss
implementation strategies and coding guidelines. That will make it
easier to integrate your contribution and results in less work for
everybody involved. You are also encouraged to search through the list
of `open issues on GitHub <https://github.com/lammps/lammps/issues>`_
and submit a new issue for a planned feature, so you would not duplicate
the work of others (and possibly get scooped by them) or have your work
@ -34,18 +34,19 @@ installing, or using LAMMPS. Please contact the `lammps-users mailing
list <https://lammps.sandia.gov/mail.html>`_ for those purposes instead.
How quickly your contribution will be integrated depends largely on how
much effort it will cause to integrate and test it, how much it requires
changes to the core codebase, and of how much interest it is to the
larger LAMMPS community. Please see below for a checklist of typical
requirements. Once you have prepared everything, see the :doc:`LAMMPS GitHub
Tutorial <Howto_github>` page for instructions on
how to submit your changes or new files through a GitHub pull
request. If you prefer to submit patches or full files, you should first
make certain, that your code works correctly with the latest patch-level
version of LAMMPS and contains all bug fixes from it. Then create a
gzipped tar file of all changed or added files or a corresponding patch
file using 'diff -u' or 'diff -c' and compress it with gzip. Please only
use gzip compression, as this works well on all platforms.
much effort it will cause to integrate and test it, how many and what
kind of changes it requires to the core codebase, and of how much
interest it is to the larger LAMMPS community. Please see below for a
checklist of typical requirements. Once you have prepared everything,
see the :doc:`LAMMPS GitHub Tutorial <Howto_github>` page for
instructions on how to submit your changes or new files through a GitHub
pull request. If you prefer to submit patches or full files, you should
first make certain, that your code works correctly with the latest
patch-level version of LAMMPS and contains all bug fixes from it. Then
create a gzipped tar file of all changed or added files or a
corresponding patch file using 'diff -u' or 'diff -c' and compress it
with gzip. Please only use gzip compression, as this works well and is
available on all platforms.
If the new features/files are broadly useful we may add them as core
files to LAMMPS or as part of a :doc:`standard package <Packages_standard>`. Else we will add them as a
@ -57,9 +58,12 @@ added to the LAMMPS distribution. All the standard and user packages
are listed and described on the :doc:`Packages details <Packages_details>` doc page.
Note that by providing us files to release, you are agreeing to make
them open-source, i.e. we can release them under the terms of the GPL,
used as a license for the rest of LAMMPS. See the :doc:`LAMMPS license
<Intro_opensource>` doc page for details.
them open-source, i.e. we can release them under the terms of the GPL
(version 2), used as a license for the rest of LAMMPS. And as part of
a LGPL (version 2.1) distribution that we make available to developers
on request only and with files that are authorized for that kind of
distribution removed (e.g. interface to FFTW). See the
:doc:`LAMMPS license <Intro_opensource>` doc page for details.
With user packages and files, all we are really providing (aside from
the fame and fortune that accompanies having your name in the source
@ -112,7 +116,7 @@ packages in the src directory for examples. If you are uncertain, please ask.
your contribution(s) to be added to main LAMMPS code or one of its
standard packages, it needs to be written in a style compatible with
other LAMMPS source files. This means: 2-character indentation per
level, **no tabs**\ , no lines over 80 characters. I/O is done via
level, **no tabs**\ , no lines over 100 characters. I/O is done via
the C-style stdio library (mixing of stdio and iostreams is generally
discouraged), class header files should not import any system headers
outside of <cstdio>, STL containers should be avoided in headers,
@ -131,6 +135,31 @@ packages in the src directory for examples. If you are uncertain, please ask.
LAMMPS source files, including the use of the error class for error
and warning messages.
* To simplify reformatting contributed code in a way that is compatible
with the LAMMPS formatting styles, you can use clang-format (version 8
or later). The LAMMPS distribution includes a suitable ``.clang-format``
file which will be applied if you run ``clang-format -i some_file.cpp``
on your files inside the LAMMPS src tree. Please only reformat files
that you have contributed. For header files containing a
``SomeStyle(keyword, ClassName)`` macros it is required to have this
macro embedded with a pair of ``// clang-format off``, ``// clang-format on``
commends and the line must be terminated with a semi-colon (;).
Example:
.. code-block:: c++
#ifdef COMMAND_CLASS
// clang-format off
CommandStyle(run,Run);
// clang-format on
#else
#ifndef LMP_RUN_H
[...]
You may also use ``// clang-format on/off`` throughout your file
to protect sections of the file from being reformatted.
* If you want your contribution to be added as a user-contributed
feature, and it's a single file (actually a \*.cpp and \*.h file) it can
rapidly be added to the USER-MISC directory. Send us the one-line

View File

@ -0,0 +1,32 @@
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -1
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: false
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: true
BraceWrapping:
AfterFunction: true
BreakBeforeBraces: Custom
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 100
IndentCaseLabels: true
IndentWidth: 2
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 2
PenaltyBreakAssignment: 4
ReflowComments: false
SpaceAfterCStyleCast: true
SpacesBeforeTrailingComments: 4
SpacesInContainerLiterals: false
Standard: Cpp11
TabWidth: 2
UseTab: Never
...

View File

@ -19,9 +19,9 @@
#include "atom.h"
#include "comm.h"
#include "error.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include <cstring>
@ -46,19 +46,20 @@ AngleZero2::~AngleZero2()
void AngleZero2::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
ev_init(eflag, vflag);
}
/* ---------------------------------------------------------------------- */
void AngleZero2::settings(int narg, char **arg)
{
if ((narg != 0) && (narg != 1))
error->all(FLERR,"Illegal angle_style command");
if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal angle_style command");
if (narg == 1) {
if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0;
else error->all(FLERR,"Illegal angle_style command");
if (strcmp("nocoeff", arg[0]) == 0)
coeffflag = 0;
else
error->all(FLERR, "Illegal angle_style command");
}
}
@ -69,8 +70,8 @@ void AngleZero2::allocate()
allocated = 1;
int n = atom->nangletypes;
memory->create(theta0,n+1,"angle:theta0");
memory->create(setflag,n+1,"angle:setflag");
memory->create(theta0, n + 1, "angle:theta0");
memory->create(setflag, n + 1, "angle:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
}
@ -81,27 +82,26 @@ void AngleZero2::allocate()
void AngleZero2::coeff(int narg, char **arg)
{
if ((narg < 1) || (coeffflag && narg > 2))
error->all(FLERR,"Incorrect args for angle coefficients");
error->all(FLERR, "Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nangletypes, ilo, ihi, error);
double theta0_one = 0.0;
if (coeffflag && (narg == 2))
theta0_one = utils::numeric(FLERR,arg[1],false,lmp);
if (coeffflag && (narg == 2)) theta0_one = utils::numeric(FLERR, arg[1], false, lmp);
// convert theta0 from degrees to radians
int count = 0;
for (int i = ilo; i <= ihi; i++) {
setflag[i] = 1;
theta0[i] = theta0_one/180.0 * MY_PI;
theta0[i] = theta0_one / 180.0 * MY_PI;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */
@ -115,8 +115,9 @@ double AngleZero2::equilibrium_angle(int i)
proc 0 writes out coeffs to restart file
------------------------------------------------------------------------- */
void AngleZero2::write_restart(FILE *fp) {
fwrite(&theta0[1],sizeof(double),atom->nangletypes,fp);
void AngleZero2::write_restart(FILE *fp)
{
fwrite(&theta0[1], sizeof(double), atom->nangletypes, fp);
}
/* ----------------------------------------------------------------------
@ -128,9 +129,9 @@ void AngleZero2::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR, &theta0[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
}
MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&theta0[1], atom->nangletypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1;
}
@ -140,8 +141,7 @@ void AngleZero2::read_restart(FILE *fp)
void AngleZero2::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nangletypes; i++)
fprintf(fp,"%d %g\n",i,theta0[i]/MY_PI*180.0);
for (int i = 1; i <= atom->nangletypes; i++) fprintf(fp, "%d %g\n", i, theta0[i] / MY_PI * 180.0);
}
/* ---------------------------------------------------------------------- */

View File

@ -40,7 +40,7 @@ class AngleZero2 : public Angle {
void allocate();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -44,19 +44,20 @@ BondZero2::~BondZero2()
void BondZero2::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
ev_init(eflag, vflag);
}
/* ---------------------------------------------------------------------- */
void BondZero2::settings(int narg, char **arg)
{
if ((narg != 0) && (narg != 1))
error->all(FLERR,"Illegal bond_style command");
if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal bond_style command");
if (narg == 1) {
if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0;
else error->all(FLERR,"Illegal bond_style command");
if (strcmp("nocoeff", arg[0]) == 0)
coeffflag = 0;
else
error->all(FLERR, "Illegal bond_style command");
}
}
@ -67,8 +68,8 @@ void BondZero2::allocate()
allocated = 1;
int n = atom->nbondtypes;
memory->create(r0,n+1,"bond:r0");
memory->create(setflag,n+1,"bond:setflag");
memory->create(r0, n + 1, "bond:r0");
memory->create(setflag, n + 1, "bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
}
@ -79,16 +80,15 @@ void BondZero2::allocate()
void BondZero2::coeff(int narg, char **arg)
{
if ((narg < 1) || (coeffflag && narg > 2))
error->all(FLERR,"Incorrect args for bond coefficients");
error->all(FLERR, "Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
double r0_one = 0.0;
if (coeffflag && (narg == 2))
r0_one = utils::numeric(FLERR,arg[1],false,lmp);
if (coeffflag && (narg == 2)) r0_one = utils::numeric(FLERR, arg[1], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -97,7 +97,7 @@ void BondZero2::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -113,8 +113,9 @@ double BondZero2::equilibrium_distance(int i)
proc 0 writes out coeffs to restart file
------------------------------------------------------------------------- */
void BondZero2::write_restart(FILE *fp) {
fwrite(&r0[1],sizeof(double),atom->nbondtypes,fp);
void BondZero2::write_restart(FILE *fp)
{
fwrite(&r0[1], sizeof(double), atom->nbondtypes, fp);
}
/* ----------------------------------------------------------------------
@ -126,9 +127,9 @@ void BondZero2::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
}
MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&r0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
}
@ -139,14 +140,12 @@ void BondZero2::read_restart(FILE *fp)
void BondZero2::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g\n",i,r0[i]);
for (int i = 1; i <= atom->nbondtypes; i++) fprintf(fp, "%d %g\n", i, r0[i]);
}
/* ---------------------------------------------------------------------- */
double BondZero2::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/,
double & /*fforce*/)
double BondZero2::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/, double & /*fforce*/)
{
return 0.0;
}
@ -156,6 +155,6 @@ double BondZero2::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/,
void *BondZero2::extract(const char *str, int &dim)
{
dim = 1;
if (strcmp(str,"r0")==0) return (void*) r0;
if (strcmp(str, "r0") == 0) return (void *) r0;
return nullptr;
}

View File

@ -41,7 +41,7 @@ class BondZero2 : public Bond {
virtual void allocate();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -36,28 +36,27 @@ DihedralZero2::DihedralZero2(LAMMPS *lmp) : Dihedral(lmp), coeffflag(1)
DihedralZero2::~DihedralZero2()
{
if (allocated && !copymode) {
memory->destroy(setflag);
}
if (allocated && !copymode) { memory->destroy(setflag); }
}
/* ---------------------------------------------------------------------- */
void DihedralZero2::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
ev_init(eflag, vflag);
}
/* ---------------------------------------------------------------------- */
void DihedralZero2::settings(int narg, char **arg)
{
if ((narg != 0) && (narg != 1))
error->all(FLERR,"Illegal dihedral_style command");
if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal dihedral_style command");
if (narg == 1) {
if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0;
else error->all(FLERR,"Illegal dihedral_style command");
if (strcmp("nocoeff", arg[0]) == 0)
coeffflag = 0;
else
error->all(FLERR, "Illegal dihedral_style command");
}
}
@ -68,7 +67,7 @@ void DihedralZero2::allocate()
allocated = 1;
int n = atom->ndihedraltypes;
memory->create(setflag,n+1,"dihedral:setflag");
memory->create(setflag, n + 1, "dihedral:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
}
@ -79,12 +78,12 @@ void DihedralZero2::allocate()
void DihedralZero2::coeff(int narg, char **arg)
{
if ((narg < 1) || (coeffflag && narg > 1))
error->all(FLERR,"Incorrect args for dihedral coefficients");
error->all(FLERR, "Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->ndihedraltypes, ilo, ihi, error);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -92,7 +91,7 @@ void DihedralZero2::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------
@ -115,7 +114,7 @@ void DihedralZero2::read_restart(FILE * /*fp*/)
proc 0 writes to data file
------------------------------------------------------------------------- */
void DihedralZero2::write_data(FILE *fp) {
for (int i = 1; i <= atom->ndihedraltypes; i++)
fprintf(fp,"%d\n",i);
void DihedralZero2::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ndihedraltypes; i++) fprintf(fp, "%d\n", i);
}

View File

@ -40,7 +40,7 @@ class DihedralZero2 : public Dihedral {
virtual void allocate();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -12,23 +12,21 @@
------------------------------------------------------------------------- */
#include "fix_nve2.h"
#include <cstring>
#include "atom.h"
#include "force.h"
#include "update.h"
#include "respa.h"
#include "error.h"
#include "force.h"
#include "respa.h"
#include "update.h"
#include <cstring>
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVE2::FixNVE2(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
FixNVE2::FixNVE2(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
{
if (strcmp(style,"nve/sphere") != 0 && narg < 3)
error->all(FLERR,"Illegal fix nve command");
if (strcmp(style, "nve/sphere") != 0 && narg < 3) error->all(FLERR, "Illegal fix nve command");
dynamic_group_allow = 1;
time_integrate = 1;
@ -53,8 +51,7 @@ void FixNVE2::init()
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;
if (strstr(update->integrate_style,"respa"))
step_respa = ((Respa *) update->integrate)->step;
if (strstr(update->integrate_style, "respa")) step_respa = ((Respa *) update->integrate)->step;
}
/* ----------------------------------------------------------------------
@ -150,8 +147,10 @@ void FixNVE2::initial_integrate_respa(int vflag, int ilevel, int /*iloop*/)
// innermost level - NVE update of v and x
// all other levels - NVE update of v
if (ilevel == 0) initial_integrate(vflag);
else final_integrate();
if (ilevel == 0)
initial_integrate(vflag);
else
final_integrate();
}
/* ---------------------------------------------------------------------- */

View File

@ -13,7 +13,7 @@
#ifdef FIX_CLASS
FixStyle(nve2,FixNVE2)
FixStyle(nve2, FixNVE2)
#else
@ -37,17 +37,17 @@ class FixNVE2 : public Fix {
virtual void reset_dt();
protected:
double dtv,dtf;
double dtv, dtf;
double *step_respa;
int mass_require;
};
}
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
/* ERROR/WARNING messages:
E: Illegal ... command

View File

@ -9,25 +9,24 @@
#include <cstring>
namespace LAMMPS_NS {
class Hello : public Command {
public:
Hello(class LAMMPS *lmp) : Command(lmp) {};
void command(int, char **);
};
}
class Hello : public Command {
public:
Hello(class LAMMPS *lmp) : Command(lmp){};
void command(int, char **);
};
} // namespace LAMMPS_NS
using namespace LAMMPS_NS;
void Hello::command(int argc, char **argv)
{
if (argc != 1) error->all(FLERR,"Illegal hello command");
if (comm->me == 0)
utils::logmesg(lmp,fmt::format("Hello, {}!\n",argv[0]));
if (argc != 1) error->all(FLERR, "Illegal hello command");
if (comm->me == 0) utils::logmesg(lmp, fmt::format("Hello, {}!\n", argv[0]));
}
static Command *hellocreator(LAMMPS *lmp)
{
return new Hello(lmp);
return new Hello(lmp);
}
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
@ -36,11 +35,11 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
plugin.version = LAMMPS_VERSION;
plugin.style = "command";
plugin.name = "hello";
plugin.info = "Hello world command v1.1";
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
plugin.style = "command";
plugin.name = "hello";
plugin.info = "Hello world command v1.1";
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
plugin.creator.v1 = (lammpsplugin_factory1 *) &hellocreator;
plugin.handle = handle;
(*register_plugin)(&plugin,lmp);
plugin.handle = handle;
(*register_plugin)(&plugin, lmp);
}

View File

@ -36,28 +36,27 @@ ImproperZero2::ImproperZero2(LAMMPS *lmp) : Improper(lmp), coeffflag(1)
ImproperZero2::~ImproperZero2()
{
if (allocated && !copymode) {
memory->destroy(setflag);
}
if (allocated && !copymode) { memory->destroy(setflag); }
}
/* ---------------------------------------------------------------------- */
void ImproperZero2::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
ev_init(eflag, vflag);
}
/* ---------------------------------------------------------------------- */
void ImproperZero2::settings(int narg, char **arg)
{
if ((narg != 0) && (narg != 1))
error->all(FLERR,"Illegal improper_style command");
if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal improper_style command");
if (narg == 1) {
if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0;
else error->all(FLERR,"Illegal improper_style command");
if (strcmp("nocoeff", arg[0]) == 0)
coeffflag = 0;
else
error->all(FLERR, "Illegal improper_style command");
}
}
@ -68,7 +67,7 @@ void ImproperZero2::allocate()
allocated = 1;
int n = atom->nimpropertypes;
memory->create(setflag,n+1,"improper:setflag");
memory->create(setflag, n + 1, "improper:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
}
@ -79,12 +78,12 @@ void ImproperZero2::allocate()
void ImproperZero2::coeff(int narg, char **arg)
{
if ((narg < 1) || (coeffflag && narg > 1))
error->all(FLERR,"Incorrect args for improper coefficients");
error->all(FLERR, "Incorrect args for improper coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nimpropertypes, ilo, ihi, error);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -92,7 +91,7 @@ void ImproperZero2::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for improper coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for improper coefficients");
}
/* ----------------------------------------------------------------------
@ -115,8 +114,7 @@ void ImproperZero2::read_restart(FILE * /*fp*/)
proc 0 writes to data file
------------------------------------------------------------------------- */
void ImproperZero2::write_data(FILE *fp) {
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d\n",i);
void ImproperZero2::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nimpropertypes; i++) fprintf(fp, "%d\n", i);
}

View File

@ -36,7 +36,7 @@ class ImproperZero2 : public Improper {
virtual void allocate();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -12,12 +12,12 @@ using namespace LAMMPS_NS;
static Pair *morse2creator(LAMMPS *lmp)
{
return new PairMorse2(lmp);
return new PairMorse2(lmp);
}
static Pair *morse2ompcreator(LAMMPS *lmp)
{
return new PairMorse2OMP(lmp);
return new PairMorse2OMP(lmp);
}
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
@ -27,17 +27,17 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
// register plain morse2 pair style
plugin.version = LAMMPS_VERSION;
plugin.style = "pair";
plugin.name = "morse2";
plugin.info = "Morse2 variant pair style v1.0";
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
plugin.style = "pair";
plugin.name = "morse2";
plugin.info = "Morse2 variant pair style v1.0";
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
plugin.creator.v1 = (lammpsplugin_factory1 *) &morse2creator;
plugin.handle = handle;
(*register_plugin)(&plugin,lmp);
plugin.handle = handle;
(*register_plugin)(&plugin, lmp);
// also register morse2/omp pair style. only need to update changed fields
plugin.name = "morse2/omp";
plugin.info = "Morse2 variant pair style for OpenMP v1.0";
plugin.name = "morse2/omp";
plugin.info = "Morse2 variant pair style for OpenMP v1.0";
plugin.creator.v1 = (lammpsplugin_factory1 *) &morse2ompcreator;
(*register_plugin)(&plugin,lmp);
(*register_plugin)(&plugin, lmp);
}

View File

@ -11,7 +11,7 @@ using namespace LAMMPS_NS;
static Fix *nve2creator(LAMMPS *lmp, int argc, char **argv)
{
return new FixNVE2(lmp, argc, argv);
return new FixNVE2(lmp, argc, argv);
}
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
@ -20,11 +20,11 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
plugin.version = LAMMPS_VERSION;
plugin.style = "fix";
plugin.name = "nve2";
plugin.info = "NVE2 variant fix style v1.0";
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
plugin.style = "fix";
plugin.name = "nve2";
plugin.info = "NVE2 variant fix style v1.0";
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
plugin.creator.v2 = (lammpsplugin_factory2 *) &nve2creator;
plugin.handle = handle;
(*register_plugin)(&plugin,lmp);
plugin.handle = handle;
(*register_plugin)(&plugin, lmp);
}

View File

@ -13,14 +13,14 @@
#include "pair_morse2.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "neigh_list.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
@ -52,13 +52,13 @@ PairMorse2::~PairMorse2()
void PairMorse2::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r,dr,dexp,factor_lj;
int *ilist,*jlist,*numneigh,**firstneigh;
int i, j, ii, jj, inum, jnum, itype, jtype;
double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair;
double rsq, r, dr, dexp, factor_lj;
int *ilist, *jlist, *numneigh, **firstneigh;
evdwl = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -91,32 +91,30 @@ void PairMorse2::compute(int eflag, int vflag)
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
jtype = type[j];
if (rsq < cutsq[itype][jtype]) {
r = sqrt(rsq);
dr = r - r0[itype][jtype];
dexp = exp(-alpha[itype][jtype] * dr);
fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
fpair = factor_lj * morse1[itype][jtype] * (dexp * dexp - dexp) / r;
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[i][0] += delx * fpair;
f[i][1] += dely * fpair;
f[i][2] += delz * fpair;
if (newton_pair || j < nlocal) {
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
f[j][0] -= delx * fpair;
f[j][1] -= dely * fpair;
f[j][2] -= delz * fpair;
}
if (eflag) {
evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
offset[itype][jtype];
evdwl = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) - offset[itype][jtype];
evdwl *= factor_lj;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
if (evflag) ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely, delz);
}
}
}
@ -133,19 +131,18 @@ void PairMorse2::allocate()
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(setflag, n + 1, n + 1, "pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
for (int j = i; j <= n; j++) setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cutsq, n + 1, n + 1, "pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(d0,n+1,n+1,"pair:d0");
memory->create(alpha,n+1,n+1,"pair:alpha");
memory->create(r0,n+1,n+1,"pair:r0");
memory->create(morse1,n+1,n+1,"pair:morse1");
memory->create(offset,n+1,n+1,"pair:offset");
memory->create(cut, n + 1, n + 1, "pair:cut");
memory->create(d0, n + 1, n + 1, "pair:d0");
memory->create(alpha, n + 1, n + 1, "pair:alpha");
memory->create(r0, n + 1, n + 1, "pair:r0");
memory->create(morse1, n + 1, n + 1, "pair:morse1");
memory->create(offset, n + 1, n + 1, "pair:offset");
}
/* ----------------------------------------------------------------------
@ -154,14 +151,14 @@ void PairMorse2::allocate()
void PairMorse2::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
if (narg != 1) error->all(FLERR, "Illegal pair_style command");
cut_global = utils::numeric(FLERR,arg[0],false,lmp);
cut_global = utils::numeric(FLERR, arg[0], false, lmp);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
int i, j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
@ -174,24 +171,23 @@ void PairMorse2::settings(int narg, char **arg)
void PairMorse2::coeff(int narg, char **arg)
{
if (narg < 5 || narg > 6)
error->all(FLERR,"Incorrect args for pair coefficients");
if (narg < 5 || narg > 6) error->all(FLERR, "Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error);
utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error);
int ilo, ihi, jlo, jhi;
utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi, error);
utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error);
double d0_one = utils::numeric(FLERR,arg[2],false,lmp);
double alpha_one = utils::numeric(FLERR,arg[3],false,lmp);
double r0_one = utils::numeric(FLERR,arg[4],false,lmp);
double d0_one = utils::numeric(FLERR, arg[2], false, lmp);
double alpha_one = utils::numeric(FLERR, arg[3], false, lmp);
double r0_one = utils::numeric(FLERR, arg[4], false, lmp);
double cut_one = cut_global;
if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp);
if (narg == 6) cut_one = utils::numeric(FLERR, arg[5], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
for (int j = MAX(jlo, i); j <= jhi; j++) {
d0[i][j] = d0_one;
alpha[i][j] = alpha_one;
r0[i][j] = r0_one;
@ -201,24 +197,24 @@ void PairMorse2::coeff(int narg, char **arg)
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairMorse2::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR, "All pair coeffs are not set");
morse1[i][j] = 2.0*d0[i][j]*alpha[i][j];
morse1[i][j] = 2.0 * d0[i][j] * alpha[i][j];
if (offset_flag) {
double alpha_dr = -alpha[i][j] * (cut[i][j] - r0[i][j]);
offset[i][j] = d0[i][j] * (exp(2.0*alpha_dr) - 2.0*exp(alpha_dr));
} else offset[i][j] = 0.0;
offset[i][j] = d0[i][j] * (exp(2.0 * alpha_dr) - 2.0 * exp(alpha_dr));
} else
offset[i][j] = 0.0;
d0[j][i] = d0[i][j];
alpha[j][i] = alpha[i][j];
@ -237,15 +233,15 @@ void PairMorse2::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
int i, j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
fwrite(&setflag[i][j], sizeof(int), 1, fp);
if (setflag[i][j]) {
fwrite(&d0[i][j],sizeof(double),1,fp);
fwrite(&alpha[i][j],sizeof(double),1,fp);
fwrite(&r0[i][j],sizeof(double),1,fp);
fwrite(&cut[i][j],sizeof(double),1,fp);
fwrite(&d0[i][j], sizeof(double), 1, fp);
fwrite(&alpha[i][j], sizeof(double), 1, fp);
fwrite(&r0[i][j], sizeof(double), 1, fp);
fwrite(&cut[i][j], sizeof(double), 1, fp);
}
}
}
@ -260,23 +256,23 @@ void PairMorse2::read_restart(FILE *fp)
allocate();
int i,j;
int i, j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (me == 0) utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr, error);
MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world);
if (setflag[i][j]) {
if (me == 0) {
utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR, &d0[i][j], sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &alpha[i][j], sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &r0[i][j], sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr, error);
}
MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&d0[i][j], 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&alpha[i][j], 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&r0[i][j], 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&cut[i][j], 1, MPI_DOUBLE, 0, world);
}
}
}
@ -287,9 +283,9 @@ void PairMorse2::read_restart(FILE *fp)
void PairMorse2::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
fwrite(&cut_global, sizeof(double), 1, fp);
fwrite(&offset_flag, sizeof(int), 1, fp);
fwrite(&mix_flag, sizeof(int), 1, fp);
}
/* ----------------------------------------------------------------------
@ -299,13 +295,13 @@ void PairMorse2::write_restart_settings(FILE *fp)
void PairMorse2::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR, &cut_global, sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &offset_flag, sizeof(int), 1, fp, nullptr, error);
utils::sfread(FLERR, &mix_flag, sizeof(int), 1, fp, nullptr, error);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
MPI_Bcast(&cut_global, 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&offset_flag, 1, MPI_INT, 0, world);
MPI_Bcast(&mix_flag, 1, MPI_INT, 0, world);
}
/* ----------------------------------------------------------------------
@ -315,7 +311,7 @@ void PairMorse2::read_restart_settings(FILE *fp)
void PairMorse2::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
fprintf(fp,"%d %g %g %g\n",i,d0[i][i],alpha[i][i],r0[i][i]);
fprintf(fp, "%d %g %g %g\n", i, d0[i][i], alpha[i][i], r0[i][i]);
}
/* ----------------------------------------------------------------------
@ -326,25 +322,23 @@ void PairMorse2::write_data_all(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
for (int j = i; j <= atom->ntypes; j++)
fprintf(fp,"%d %d %g %g %g %g\n",
i,j,d0[i][j],alpha[i][j],r0[i][j],cut[i][j]);
fprintf(fp, "%d %d %g %g %g %g\n", i, j, d0[i][j], alpha[i][j], r0[i][j], cut[i][j]);
}
/* ---------------------------------------------------------------------- */
double PairMorse2::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq,
double /*factor_coul*/, double factor_lj,
double &fforce)
double /*factor_coul*/, double factor_lj, double &fforce)
{
double r,dr,dexp,phi;
double r, dr, dexp, phi;
r = sqrt(rsq);
dr = r - r0[itype][jtype];
dexp = exp(-alpha[itype][jtype] * dr);
fforce = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
fforce = factor_lj * morse1[itype][jtype] * (dexp * dexp - dexp) / r;
phi = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) - offset[itype][jtype];
return factor_lj*phi;
phi = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) - offset[itype][jtype];
return factor_lj * phi;
}
/* ---------------------------------------------------------------------- */
@ -352,8 +346,8 @@ double PairMorse2::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq
void *PairMorse2::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"d0") == 0) return (void *) d0;
if (strcmp(str,"r0") == 0) return (void *) r0;
if (strcmp(str,"alpha") == 0) return (void *) alpha;
if (strcmp(str, "d0") == 0) return (void *) d0;
if (strcmp(str, "r0") == 0) return (void *) r0;
if (strcmp(str, "alpha") == 0) return (void *) alpha;
return nullptr;
}

View File

@ -39,14 +39,14 @@ class PairMorse2 : public Pair {
protected:
double cut_global;
double **cut;
double **d0,**alpha,**r0;
double **d0, **alpha, **r0;
double **morse1;
double **offset;
virtual void allocate();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -27,8 +27,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairMorse2OMP::PairMorse2OMP(LAMMPS *lmp) :
PairMorse2(lmp), ThrOMP(lmp, THR_PAIR)
PairMorse2OMP::PairMorse2OMP(LAMMPS *lmp) : PairMorse2(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
@ -38,14 +37,14 @@ PairMorse2OMP::PairMorse2OMP(LAMMPS *lmp) :
void PairMorse2OMP::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
ev_init(eflag, vflag);
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = list->inum;
#if defined(_OPENMP)
#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag,vflag)
#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag, vflag)
#endif
{
int ifrom, ito, tid;
@ -57,38 +56,44 @@ void PairMorse2OMP::compute(int eflag, int vflag)
if (evflag) {
if (eflag) {
if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
else eval<1,1,0>(ifrom, ito, thr);
if (force->newton_pair)
eval<1, 1, 1>(ifrom, ito, thr);
else
eval<1, 1, 0>(ifrom, ito, thr);
} else {
if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
else eval<1,0,0>(ifrom, ito, thr);
if (force->newton_pair)
eval<1, 0, 1>(ifrom, ito, thr);
else
eval<1, 0, 0>(ifrom, ito, thr);
}
} else {
if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
else eval<0,0,0>(ifrom, ito, thr);
if (force->newton_pair)
eval<0, 0, 1>(ifrom, ito, thr);
else
eval<0, 0, 0>(ifrom, ito, thr);
}
thr->timer(Timer::PAIR);
reduce_thr(this, eflag, vflag, thr);
} // end of omp parallel region
} // end of omp parallel region
}
template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
void PairMorse2OMP::eval(int iifrom, int iito, ThrData * const thr)
void PairMorse2OMP::eval(int iifrom, int iito, ThrData *const thr)
{
int i,j,ii,jj,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r,dr,dexp,factor_lj;
int *ilist,*jlist,*numneigh,**firstneigh;
int i, j, ii, jj, jnum, itype, jtype;
double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair;
double rsq, r, dr, dexp, factor_lj;
int *ilist, *jlist, *numneigh, **firstneigh;
evdwl = 0.0;
const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int * _noalias const type = atom->type;
const dbl3_t *_noalias const x = (dbl3_t *) atom->x[0];
dbl3_t *_noalias const f = (dbl3_t *) thr->get_f()[0];
const int *_noalias const type = atom->type;
const int nlocal = atom->nlocal;
const double * _noalias const special_lj = force->special_lj;
double fxtmp,fytmp,fztmp;
const double *_noalias const special_lj = force->special_lj;
double fxtmp, fytmp, fztmp;
ilist = list->ilist;
numneigh = list->numneigh;
@ -105,7 +110,7 @@ void PairMorse2OMP::eval(int iifrom, int iito, ThrData * const thr)
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
fxtmp=fytmp=fztmp=0.0;
fxtmp = fytmp = fztmp = 0.0;
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
@ -115,32 +120,31 @@ void PairMorse2OMP::eval(int iifrom, int iito, ThrData * const thr)
delx = xtmp - x[j].x;
dely = ytmp - x[j].y;
delz = ztmp - x[j].z;
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
jtype = type[j];
if (rsq < cutsq[itype][jtype]) {
r = sqrt(rsq);
dr = r - r0[itype][jtype];
dexp = exp(-alpha[itype][jtype] * dr);
fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
fpair = factor_lj * morse1[itype][jtype] * (dexp * dexp - dexp) / r;
fxtmp += delx*fpair;
fytmp += dely*fpair;
fztmp += delz*fpair;
fxtmp += delx * fpair;
fytmp += dely * fpair;
fztmp += delz * fpair;
if (NEWTON_PAIR || j < nlocal) {
f[j].x -= delx*fpair;
f[j].y -= dely*fpair;
f[j].z -= delz*fpair;
f[j].x -= delx * fpair;
f[j].y -= dely * fpair;
f[j].z -= delz * fpair;
}
if (EFLAG) {
evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
offset[itype][jtype];
evdwl = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) - offset[itype][jtype];
evdwl *= factor_lj;
}
if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
evdwl,0.0,fpair,delx,dely,delz,thr);
if (EVFLAG)
ev_tally_thr(this, i, j, nlocal, NEWTON_PAIR, evdwl, 0.0, fpair, delx, dely, delz, thr);
}
}
f[i].x += fxtmp;

View File

@ -33,9 +33,9 @@ class PairMorse2OMP : public PairMorse2, public ThrOMP {
private:
template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
void eval(int ifrom, int ito, ThrData * const thr);
void eval(int ifrom, int ito, ThrData *const thr);
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -19,8 +19,8 @@
#include "atom.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "memory.h"
#include <cstring>
@ -28,11 +28,12 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairZero2::PairZero2(LAMMPS *lmp) : Pair(lmp) {
coeffflag=1;
writedata=1;
single_enable=1;
respa_enable=1;
PairZero2::PairZero2(LAMMPS *lmp) : Pair(lmp)
{
coeffflag = 1;
writedata = 1;
single_enable = 1;
respa_enable = 1;
}
/* ---------------------------------------------------------------------- */
@ -50,15 +51,15 @@ PairZero2::~PairZero2()
void PairZero2::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
if (vflag_fdotr) virial_fdotr_compute();
ev_init(eflag, vflag);
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairZero2::compute_outer(int eflag, int vflag)
{
ev_init(eflag,vflag);
ev_init(eflag, vflag);
}
/* ----------------------------------------------------------------------
@ -70,13 +71,12 @@ void PairZero2::allocate()
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(setflag, n + 1, n + 1, "pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
for (int j = i; j <= n; j++) setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(cutsq, n + 1, n + 1, "pair:cutsq");
memory->create(cut, n + 1, n + 1, "pair:cut");
}
/* ----------------------------------------------------------------------
@ -85,22 +85,22 @@ void PairZero2::allocate()
void PairZero2::settings(int narg, char **arg)
{
if ((narg != 1) && (narg != 2))
error->all(FLERR,"Illegal pair_style command");
if ((narg != 1) && (narg != 2)) error->all(FLERR, "Illegal pair_style command");
cut_global = utils::numeric(FLERR,arg[0],false,lmp);
cut_global = utils::numeric(FLERR, arg[0], false, lmp);
if (narg == 2) {
if (strcmp("nocoeff",arg[1]) == 0) coeffflag=0;
else error->all(FLERR,"Illegal pair_style command");
if (strcmp("nocoeff", arg[1]) == 0)
coeffflag = 0;
else
error->all(FLERR, "Illegal pair_style command");
}
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
int i, j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
cut[i][j] = cut_global;
for (j = i + 1; j <= atom->ntypes; j++) cut[i][j] = cut_global;
}
}
@ -111,27 +111,27 @@ void PairZero2::settings(int narg, char **arg)
void PairZero2::coeff(int narg, char **arg)
{
if ((narg < 2) || (coeffflag && narg > 3))
error->all(FLERR,"Incorrect args for pair coefficients");
error->all(FLERR, "Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error);
utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error);
int ilo, ihi, jlo, jhi;
utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi, error);
utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error);
double cut_one = cut_global;
if (coeffflag && (narg == 3)) cut_one = utils::numeric(FLERR,arg[2],false,lmp);
if (coeffflag && (narg == 3)) cut_one = utils::numeric(FLERR, arg[2], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
for (int j = MAX(jlo, i); j <= jhi; j++) {
cut[i][j] = cut_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -140,9 +140,7 @@ void PairZero2::coeff(int narg, char **arg)
double PairZero2::init_one(int i, int j)
{
if (setflag[i][j] == 0) {
cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
}
if (setflag[i][j] == 0) { cut[i][j] = mix_distance(cut[i][i], cut[j][j]); }
return cut[i][j];
}
@ -155,13 +153,11 @@ void PairZero2::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
int i, j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) {
fwrite(&cut[i][j],sizeof(double),1,fp);
}
fwrite(&setflag[i][j], sizeof(int), 1, fp);
if (setflag[i][j]) { fwrite(&cut[i][j], sizeof(double), 1, fp); }
}
}
@ -174,17 +170,15 @@ void PairZero2::read_restart(FILE *fp)
read_restart_settings(fp);
allocate();
int i,j;
int i, j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (me == 0) utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr, error);
MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world);
if (setflag[i][j]) {
if (me == 0) {
utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error);
}
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
if (me == 0) { utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr, error); }
MPI_Bcast(&cut[i][j], 1, MPI_DOUBLE, 0, world);
}
}
}
@ -195,8 +189,8 @@ void PairZero2::read_restart(FILE *fp)
void PairZero2::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&coeffflag,sizeof(int),1,fp);
fwrite(&cut_global, sizeof(double), 1, fp);
fwrite(&coeffflag, sizeof(int), 1, fp);
}
/* ----------------------------------------------------------------------
@ -207,11 +201,11 @@ void PairZero2::read_restart_settings(FILE *fp)
{
int me = comm->me;
if (me == 0) {
utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&coeffflag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR, &cut_global, sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &coeffflag, sizeof(int), 1, fp, nullptr, error);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&coeffflag,1,MPI_INT,0,world);
MPI_Bcast(&cut_global, 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&coeffflag, 1, MPI_INT, 0, world);
}
/* ----------------------------------------------------------------------
@ -220,8 +214,7 @@ void PairZero2::read_restart_settings(FILE *fp)
void PairZero2::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
fprintf(fp,"%d\n",i);
for (int i = 1; i <= atom->ntypes; i++) fprintf(fp, "%d\n", i);
}
/* ----------------------------------------------------------------------
@ -231,17 +224,14 @@ void PairZero2::write_data(FILE *fp)
void PairZero2::write_data_all(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
for (int j = i; j <= atom->ntypes; j++)
fprintf(fp,"%d %d %g\n",i,j,cut[i][j]);
for (int j = i; j <= atom->ntypes; j++) fprintf(fp, "%d %d %g\n", i, j, cut[i][j]);
}
/* ---------------------------------------------------------------------- */
double PairZero2::single(int /*i*/, int /*j*/, int /* itype */, int /* jtype */,
double /* rsq */, double /*factor_coul*/,
double /* factor_lj */, double &fforce)
double PairZero2::single(int /*i*/, int /*j*/, int /* itype */, int /* jtype */, double /* rsq */,
double /*factor_coul*/, double /* factor_lj */, double &fforce)
{
fforce = 0.0;
return 0.0;
}

View File

@ -53,7 +53,7 @@ class PairZero2 : public Pair {
virtual void allocate();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -4,37 +4,37 @@
#include <cstring>
#include "pair_zero2.h"
#include "bond_zero2.h"
#include "angle_zero2.h"
#include "bond_zero2.h"
#include "dihedral_zero2.h"
#include "improper_zero2.h"
#include "pair_zero2.h"
using namespace LAMMPS_NS;
static Pair *pairzerocreator(LAMMPS *lmp)
{
return new PairZero2(lmp);
return new PairZero2(lmp);
}
static Bond *bondzerocreator(LAMMPS *lmp)
{
return new BondZero2(lmp);
return new BondZero2(lmp);
}
static Angle *anglezerocreator(LAMMPS *lmp)
{
return new AngleZero2(lmp);
return new AngleZero2(lmp);
}
static Dihedral *dihedralzerocreator(LAMMPS *lmp)
{
return new DihedralZero2(lmp);
return new DihedralZero2(lmp);
}
static Improper *improperzerocreator(LAMMPS *lmp)
{
return new ImproperZero2(lmp);
return new ImproperZero2(lmp);
}
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
@ -44,35 +44,35 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
// register zero2 pair style
plugin.version = LAMMPS_VERSION;
plugin.style = "pair";
plugin.name = "zero2";
plugin.info = "Zero2 variant pair style v1.0";
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
plugin.style = "pair";
plugin.name = "zero2";
plugin.info = "Zero2 variant pair style v1.0";
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
plugin.creator.v1 = (lammpsplugin_factory1 *) &pairzerocreator;
plugin.handle = handle;
(*register_plugin)(&plugin,lmp);
plugin.handle = handle;
(*register_plugin)(&plugin, lmp);
// register zero2 bond style
plugin.style = "bond";
plugin.info = "Zero2 variant bond style v1.0";
plugin.style = "bond";
plugin.info = "Zero2 variant bond style v1.0";
plugin.creator.v1 = (lammpsplugin_factory1 *) &bondzerocreator;
(*register_plugin)(&plugin,lmp);
(*register_plugin)(&plugin, lmp);
// register zero2 angle style
plugin.style = "angle";
plugin.info = "Zero2 variant angle style v1.0";
plugin.style = "angle";
plugin.info = "Zero2 variant angle style v1.0";
plugin.creator.v1 = (lammpsplugin_factory1 *) &anglezerocreator;
(*register_plugin)(&plugin,lmp);
(*register_plugin)(&plugin, lmp);
// register zero2 dihedral style
plugin.style = "dihedral";
plugin.info = "Zero2 variant dihedral style v1.0";
plugin.style = "dihedral";
plugin.info = "Zero2 variant dihedral style v1.0";
plugin.creator.v1 = (lammpsplugin_factory1 *) &dihedralzerocreator;
(*register_plugin)(&plugin,lmp);
(*register_plugin)(&plugin, lmp);
// register zero2 improper style
plugin.style = "improper";
plugin.info = "Zero2 variant improper style v1.0";
plugin.style = "improper";
plugin.info = "Zero2 variant improper style v1.0";
plugin.creator.v1 = (lammpsplugin_factory1 *) &improperzerocreator;
(*register_plugin)(&plugin,lmp);
(*register_plugin)(&plugin, lmp);
}

32
src/.clang-format Normal file
View File

@ -0,0 +1,32 @@
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -1
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: false
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: true
BraceWrapping:
AfterFunction: true
BreakBeforeBraces: Custom
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 100
IndentCaseLabels: true
IndentWidth: 2
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 2
PenaltyBreakAssignment: 4
ReflowComments: false
SpaceAfterCStyleCast: true
SpacesBeforeTrailingComments: 4
SpacesInContainerLiterals: false
Standard: Cpp11
TabWidth: 2
UseTab: Never
...

9
src/.gitignore vendored
View File

@ -556,6 +556,8 @@
/fix_bond_react.h
/fix_bond_swap.cpp
/fix_bond_swap.h
/fix_charge_regulation.cpp
/fix_charge_regulation.h
/fix_client_md.cpp
/fix_client_md.h
/fix_cmap.cpp
@ -814,6 +816,8 @@
/gridcomm.h
/group_ndx.cpp
/group_ndx.h
/gz_file_writer.cpp
/gz_file_writer.h
/ndx_group.cpp
/ndx_group.h
/hyper.cpp
@ -1186,6 +1190,7 @@
/python_impl.cpp
/python_impl.h
/python_compat.h
/python_utils.h
/fix_python_move.cpp
/fix_python_move.h
/fix_python_invoke.cpp
@ -1277,6 +1282,8 @@
/write_dump.h
/xdr_compat.cpp
/xdr_compat.h
/zstd_file_writer.cpp
/zstd_file_writer.h
/atom_vec_smd.cpp
/atom_vec_smd.h
@ -1432,5 +1439,3 @@
/pair_smtbq.h
/pair_vashishta*.cpp
/pair_vashishta*.h
/zstd_file_writer.cpp
/zstd_file_writer.h

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(erotate/asphere,ComputeERotateAsphere)
// clang-format off
ComputeStyle(erotate/asphere,ComputeERotateAsphere);
// clang-format on
#else
#ifndef LMP_COMPUTE_EROTATE_ASPHERE_H
@ -37,7 +37,7 @@ class ComputeERotateAsphere : public Compute {
class AtomVecTri *avec_tri;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(temp/asphere,ComputeTempAsphere)
// clang-format off
ComputeStyle(temp/asphere,ComputeTempAsphere);
// clang-format on
#else
#ifndef LMP_COMPUTE_TEMP_ASPHERE_H
@ -42,13 +42,13 @@ class ComputeTempAsphere : public Compute {
int mode;
double tfactor;
char *id_bias;
class Compute *tbias; // ptr to additional bias compute
class Compute *tbias; // ptr to additional bias compute
class AtomVecEllipsoid *avec;
void dof_compute();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -33,7 +33,7 @@ class FixNHAsphere : public FixNH {
void nh_v_temp();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nph/asphere,FixNPHAsphere)
// clang-format off
FixStyle(nph/asphere,FixNPHAsphere);
// clang-format on
#else
#ifndef LMP_FIX_NPH_ASPHERE_H
@ -30,7 +30,7 @@ class FixNPHAsphere : public FixNHAsphere {
~FixNPHAsphere() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(npt/asphere,FixNPTAsphere)
// clang-format off
FixStyle(npt/asphere,FixNPTAsphere);
// clang-format on
#else
#ifndef LMP_FIX_NPT_ASPHERE_H
@ -30,7 +30,7 @@ class FixNPTAsphere : public FixNHAsphere {
~FixNPTAsphere() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/asphere,FixNVEAsphere)
// clang-format off
FixStyle(nve/asphere,FixNVEAsphere);
// clang-format on
#else
#ifndef LMP_FIX_NVE_ASPHERE_H
@ -36,7 +36,7 @@ class FixNVEAsphere : public FixNVE {
class AtomVecEllipsoid *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/asphere/noforce,FixNVEAsphereNoforce)
// clang-format off
FixStyle(nve/asphere/noforce,FixNVEAsphereNoforce);
// clang-format on
#else
#ifndef LMP_FIX_NVE_ASPHERE_NOFORCE_H
@ -35,7 +35,7 @@ class FixNVEAsphereNoforce : public FixNVENoforce {
class AtomVecEllipsoid *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/line,FixNVELine)
// clang-format off
FixStyle(nve/line,FixNVELine);
// clang-format on
#else
#ifndef LMP_FIX_NVE_LINE_H
@ -34,11 +34,11 @@ class FixNVELine : public FixNVE {
void final_integrate();
private:
double MINUSPI,TWOPI;
double MINUSPI, TWOPI;
class AtomVecLine *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/tri,FixNVETri)
// clang-format off
FixStyle(nve/tri,FixNVETri);
// clang-format on
#else
#ifndef LMP_FIX_NVE_TRI_H
@ -38,7 +38,7 @@ class FixNVETri : public FixNVE {
class AtomVecTri *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nvt/asphere,FixNVTAsphere)
// clang-format off
FixStyle(nvt/asphere,FixNVTAsphere);
// clang-format on
#else
#ifndef LMP_FIX_NVT_ASPHERE_H
@ -30,7 +30,7 @@ class FixNVTAsphere : public FixNHAsphere {
~FixNVTAsphere() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(gayberne,PairGayBerne)
// clang-format off
PairStyle(gayberne,PairGayBerne);
// clang-format on
#else
#ifndef LMP_PAIR_GAYBERNE_H
@ -41,38 +41,35 @@ class PairGayBerne : public Pair {
void write_data_all(FILE *);
protected:
enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE };
double cut_global;
double **cut;
double gamma,upsilon,mu; // Gay-Berne parameters
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // precalculation based on the shape
double **well; // well depth scaling along each axis ^ -1.0/mu
double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs
double gamma, upsilon, mu; // Gay-Berne parameters
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // precalculation based on the shape
double **well; // well depth scaling along each axis ^ -1.0/mu
double **epsilon, **sigma; // epsilon and sigma values for atom-type pairs
int **form;
double **lj1,**lj2,**lj3,**lj4;
double **lj1, **lj2, **lj3, **lj4;
double **offset;
int *setwell;
class AtomVecEllipsoid *avec;
void allocate();
double gayberne_analytic(const int i, const int j, double a1[3][3],
double a2[3][3], double b1[3][3], double b2[3][3],
double g1[3][3], double g2[3][3], double *r12,
const double rsq, double *fforce, double *ttor,
double gayberne_analytic(const int i, const int j, double a1[3][3], double a2[3][3],
double b1[3][3], double b2[3][3], double g1[3][3], double g2[3][3],
double *r12, const double rsq, double *fforce, double *ttor,
double *rtor);
double gayberne_lj(const int i, const int j, double a1[3][3],
double b1[3][3],double g1[3][3],double *r12,
const double rsq, double *fforce, double *ttor);
void compute_eta_torque(double m[3][3], double m2[3][3],
double *s, double ans[3][3]);
double gayberne_lj(const int i, const int j, double a1[3][3], double b1[3][3], double g1[3][3],
double *r12, const double rsq, double *fforce, double *ttor);
void compute_eta_torque(double m[3][3], double m2[3][3], double *s, double ans[3][3]);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(line/lj,PairLineLJ)
// clang-format off
PairStyle(line/lj,PairLineLJ);
// clang-format on
#else
#ifndef LMP_PAIR_LINE_LJ_H
@ -37,28 +37,28 @@ class PairLineLJ : public Pair {
protected:
double cut_global;
double *subsize;
double **epsilon,**sigma,**cutsub,**cutsubsq;
double **epsilon, **sigma, **cutsub, **cutsubsq;
double **cut;
double **lj1,**lj2,**lj3,**lj4; // for sphere/sphere interactions
double **lj1, **lj2, **lj3, **lj4; // for sphere/sphere interactions
class AtomVecLine *avec;
double *size; // per-type size of sub-particles to tile line segment
double *size; // per-type size of sub-particles to tile line segment
struct Discrete {
double dx,dy;
double dx, dy;
};
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void discretize(int, double);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(resquared,PairRESquared)
// clang-format off
PairStyle(resquared,PairRESquared);
// clang-format on
#else
#ifndef LMP_PAIR_RESQUARED_H
@ -39,19 +39,19 @@ class PairRESquared : public Pair {
void read_restart_settings(FILE *);
protected:
enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE };
double cut_global;
double **cut;
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // product of the radii
double **well; // well depth scaling along each axis
double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // product of the radii
double **well; // well depth scaling along each axis
double **epsilon, **sigma; // epsilon and sigma values for atom-type pairs
int **form;
double **lj1,**lj2,**lj3,**lj4;
double **lj1, **lj2, **lj3, **lj4;
double **offset;
int *setwell;
class AtomVecEllipsoid *avec;
@ -61,38 +61,35 @@ class PairRESquared : public Pair {
struct RE2Vars {
// per particle precomputations for energy, force, torque
double A[3][3]; // Rotation matrix (lab->body)
double aTe[3][3]; // A'*E
double gamma[3][3]; // A'*S^2*A
double A[3][3]; // Rotation matrix (lab->body)
double aTe[3][3]; // A'*E
double gamma[3][3]; // A'*S^2*A
// per particle precomputations for torque
double sa[3][3]; // S^2*A;
double lA[3][3][3]; // -A*rotation generator (x,y, or z)
double lAtwo[3][3][3]; // A'*S^2*lA
double lAsa[3][3][3]; // lAtwo+lA'*sa
double sa[3][3]; // S^2*A;
double lA[3][3][3]; // -A*rotation generator (x,y, or z)
double lAtwo[3][3][3]; // A'*S^2*lA
double lAsa[3][3][3]; // lAtwo+lA'*sa
};
void allocate();
void precompute_i(const int i,RE2Vars &ws);
void precompute_i(const int i, RE2Vars &ws);
double det_prime(const double m[3][3], const double m2[3][3]);
double resquared_analytic(const int i, const int j,
const RE2Vars &wi, const RE2Vars &wj,
const double *r, const double rsq,
double *fforce, double *ttor,
double resquared_analytic(const int i, const int j, const RE2Vars &wi, const RE2Vars &wj,
const double *r, const double rsq, double *fforce, double *ttor,
double *rtor);
double resquared_lj(const int i, const int j, const RE2Vars &wi,
const double *r, const double rsq, double *fforce,
double *ttor, bool calc_torque);
double resquared_lj(const int i, const int j, const RE2Vars &wi, const double *r,
const double rsq, double *fforce, double *ttor, bool calc_torque);
double cr60; // 60^1/3
double b_alpha; // 45/56
double solv_f_a; // 3.0/(4.0*PI*-36)
double solv_f_r; // 3.0/(4.0*PI*2025)
double cr60; // 60^1/3
double b_alpha; // 45/56
double solv_f_a; // 3.0/(4.0*PI*-36)
double solv_f_r; // 3.0/(4.0*PI*2025)
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(tri/lj,PairTriLJ)
// clang-format off
PairStyle(tri/lj,PairTriLJ);
// clang-format on
#else
#ifndef LMP_PAIR_TRI_LJ_H
@ -37,26 +37,26 @@ class PairTriLJ : public Pair {
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
double **epsilon, **sigma;
double **lj1, **lj2, **lj3, **lj4;
class AtomVecTri *avec;
struct Discrete {
double dx,dy,dz;
double dx, dy, dz;
double sigma;
};
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void discretize(int, double, double *, double *, double *);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,16 +12,16 @@
------------------------------------------------------------------------- */
#ifdef BODY_CLASS
BodyStyle(nparticle,BodyNparticle)
// clang-format off
BodyStyle(nparticle,BodyNparticle);
// clang-format on
#else
#ifndef LMP_BODY_NPARTICLE_H
#define LMP_BODY_NPARTICLE_H
#include "body.h"
#include "atom_vec_body.h"
#include "body.h"
namespace LAMMPS_NS {
@ -49,7 +49,7 @@ class BodyNparticle : public Body {
double **imdata;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,16 +12,16 @@
------------------------------------------------------------------------- */
#ifdef BODY_CLASS
BodyStyle(rounded/polygon,BodyRoundedPolygon)
// clang-format off
BodyStyle(rounded/polygon,BodyRoundedPolygon);
// clang-format on
#else
#ifndef LMP_BODY_ROUNDED_POLYGON_H
#define LMP_BODY_ROUNDED_POLYGON_H
#include "body.h"
#include "atom_vec_body.h"
#include "body.h"
namespace LAMMPS_NS {
@ -53,7 +53,7 @@ class BodyRoundedPolygon : public Body {
double **imdata;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,16 +12,16 @@
------------------------------------------------------------------------- */
#ifdef BODY_CLASS
BodyStyle(rounded/polyhedron,BodyRoundedPolyhedron)
// clang-format off
BodyStyle(rounded/polyhedron,BodyRoundedPolyhedron);
// clang-format on
#else
#ifndef LMP_BODY_ROUNDED_POLYHEDRON_H
#define LMP_BODY_ROUNDED_POLYHEDRON_H
#include "body.h"
#include "atom_vec_body.h"
#include "body.h"
namespace LAMMPS_NS {
@ -55,7 +55,7 @@ class BodyRoundedPolyhedron : public Body {
double **imdata;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(body/local,ComputeBodyLocal)
// clang-format off
ComputeStyle(body/local,ComputeBodyLocal);
// clang-format on
#else
#ifndef LMP_COMPUTE_BODY_LOCAL_H
@ -34,7 +34,7 @@ class ComputeBodyLocal : public Compute {
private:
int nvalues;
int *which,*index;
int *which, *index;
int nmax;
@ -45,7 +45,7 @@ class ComputeBodyLocal : public Compute {
void reallocate(int);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(temp/body,ComputeTempBody)
// clang-format off
ComputeStyle(temp/body,ComputeTempBody);
// clang-format on
#else
#ifndef LMP_COMPUTE_TEMP_BODY_H
@ -40,13 +40,13 @@ class ComputeTempBody : public Compute {
int mode;
double tfactor;
char *id_bias;
class Compute *tbias; // ptr to additional bias compute
class Compute *tbias; // ptr to additional bias compute
class AtomVecBody *avec;
void dof_compute();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -33,7 +33,7 @@ class FixNHBody : public FixNH {
void nh_v_temp();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nph/body,FixNPHBody)
// clang-format off
FixStyle(nph/body,FixNPHBody);
// clang-format on
#else
#ifndef LMP_FIX_NPH_BODY_H
@ -30,7 +30,7 @@ class FixNPHBody : public FixNHBody {
~FixNPHBody() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(npt/body,FixNPTBody)
// clang-format off
FixStyle(npt/body,FixNPTBody);
// clang-format on
#else
#ifndef LMP_FIX_NPT_BODY_H
@ -30,7 +30,7 @@ class FixNPTBody : public FixNHBody {
~FixNPTBody() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/body,FixNVEBody)
// clang-format off
FixStyle(nve/body,FixNVEBody);
// clang-format on
#else
#ifndef LMP_FIX_NVE_BODY_H
@ -36,7 +36,7 @@ class FixNVEBody : public FixNVE {
class AtomVecBody *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nvt/body,FixNVTBody)
// clang-format off
FixStyle(nvt/body,FixNVTBody);
// clang-format on
#else
#ifndef LMP_FIX_NVT_BODY_H
@ -30,7 +30,7 @@ class FixNVTBody : public FixNHBody {
~FixNVTBody() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(wall/body/polygon,FixWallBodyPolygon)
// clang-format off
FixStyle(wall/body/polygon,FixWallBodyPolygon);
// clang-format on
#else
#ifndef LMP_FIX_WALL_BODY_POLYGON_H
@ -35,66 +35,61 @@ class FixWallBodyPolygon : public Fix {
void reset_dt();
struct Contact {
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation;// separation at contact
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation; // separation at contact
};
protected:
int wallstyle,pairstyle,wiggle,axis;
double kn; // normal repulsion strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double lo,hi,cylradius;
double amplitude,period,omega;
int wallstyle, pairstyle, wiggle, axis;
double kn; // normal repulsion strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double lo, hi, cylradius;
double amplitude, period, omega;
double dt;
int time_origin;
class AtomVecBody *avec;
class BodyRoundedPolygon *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
void body2space(int);
int vertex_against_wall(int ibody, double wall_pos, double** x,
double** f, double** torque, int side,
Contact* contact_list, int &num_contacts,
double* facc);
int compute_distance_to_wall(double* x0, double rradi, double wall_pos,
int side, double &d, double hi[3], int &contact);
double contact_separation(const Contact& c1, const Contact& c2);
void contact_forces(Contact& contact, double j_a, double** x,
double** v, double** angmom, double** f, double** torque,
double* vwall, double* facc);
void sum_torque(double* xm, double *x, double fx,
double fy, double fz, double* torque);
void total_velocity(double* p, double *xcm, double* vcm, double *angmom,
double *inertia, double *quat, double* vi);
void distance(const double* x2, const double* x1, double& r);
int vertex_against_wall(int ibody, double wall_pos, double **x, double **f, double **torque,
int side, Contact *contact_list, int &num_contacts, double *facc);
int compute_distance_to_wall(double *x0, double rradi, double wall_pos, int side, double &d,
double hi[3], int &contact);
double contact_separation(const Contact &c1, const Contact &c2);
void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom,
double **f, double **torque, double *vwall, double *facc);
void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque);
void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia,
double *quat, double *vi);
void distance(const double *x2, const double *x1, double &r);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(wall/body/polyhedron,FixWallBodyPolyhedron)
// clang-format off
FixStyle(wall/body/polyhedron,FixWallBodyPolyhedron);
// clang-format on
#else
#ifndef LMP_FIX_WALL_BODY_POLYHERON_H
@ -35,78 +35,72 @@ class FixWallBodyPolyhedron : public Fix {
void reset_dt();
struct Contact {
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation;// separation at contact
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation; // separation at contact
};
protected:
int wallstyle,pairstyle,wiggle,axis;
double kn,c_n,c_t;
double lo,hi,cylradius;
double amplitude,period,omega;
int wallstyle, pairstyle, wiggle, axis;
double kn, c_n, c_t;
double lo, hi, cylradius;
double amplitude, period, omega;
double dt;
int time_origin;
class AtomVecBody *avec;
class BodyRoundedPolyhedron *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **face; // list of all edge for all bodies
int nface; // number of faces in list
int facmax; // allocated size of face list
int *facnum; // number of faces per line, 0 if uninit
int *facfirst; // index of first face per each line
int facnummax; // allocated size of facnum,facfirst vectors
double **face; // list of all edge for all bodies
int nface; // number of faces in list
int facmax; // allocated size of face list
int *facnum; // number of faces per line, 0 if uninit
int *facfirst; // index of first face per each line
int facnummax; // allocated size of facnum,facfirst vectors
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
void body2space(int);
int edge_against_wall(int ibody, double wall_pos, int side, double* vwall,
double** x, double** f, double** torque, Contact* contact_list,
int &num_contacts, double* facc);
int sphere_against_wall(int i, double wall_pos, int side, double* vwall,
double** x, double** v, double** f, double** angmom, double** torque);
int edge_against_wall(int ibody, double wall_pos, int side, double *vwall, double **x, double **f,
double **torque, Contact *contact_list, int &num_contacts, double *facc);
int sphere_against_wall(int i, double wall_pos, int side, double *vwall, double **x, double **v,
double **f, double **angmom, double **torque);
int compute_distance_to_wall(int ibody, int edge_index, double *xmi,
double rounded_radius_i, double wall_pos, int side,
double* vwall, int &contact);
double contact_separation(const Contact& c1, const Contact& c2);
void contact_forces(int ibody, double j_a, double *xi, double *xj,
double delx, double dely, double delz,
double fx, double fy, double fz, double** x, double** v,
double** angmom, double** f, double** torque, double* vwall);
void contact_forces(Contact& contact, double j_a, double** x,
double** v, double** angmom, double** f, double** torque,
double* vwall, double* facc);
void sum_torque(double* xm, double *x, double fx,
double fy, double fz, double* torque);
void total_velocity(double* p, double *xcm, double* vcm, double *angmom,
double *inertia, double *quat, double* vi);
void distance(const double* x2, const double* x1, double& r);
int compute_distance_to_wall(int ibody, int edge_index, double *xmi, double rounded_radius_i,
double wall_pos, int side, double *vwall, int &contact);
double contact_separation(const Contact &c1, const Contact &c2);
void contact_forces(int ibody, double j_a, double *xi, double *xj, double delx, double dely,
double delz, double fx, double fy, double fz, double **x, double **v,
double **angmom, double **f, double **torque, double *vwall);
void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom,
double **f, double **torque, double *vwall, double *facc);
void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque);
void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia,
double *quat, double *vi);
void distance(const double *x2, const double *x1, double &r);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(body/nparticle,PairBodyNparticle)
// clang-format off
PairStyle(body/nparticle,PairBodyNparticle);
// clang-format on
#else
#ifndef LMP_PAIR_BODY_NPARTICLE_H
@ -37,24 +37,24 @@ class PairBodyNparticle : public Pair {
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
double **epsilon, **sigma;
double **lj1, **lj2, **lj3, **lj4;
class AtomVecBody *avec;
class BodyNparticle *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void body2space(int);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(body/rounded/polygon,PairBodyRoundedPolygon)
// clang-format off
PairStyle(body/rounded/polygon,PairBodyRoundedPolygon);
// clang-format on
#else
#ifndef LMP_PAIR_BODY_ROUNDED_POLYGON_H
@ -35,81 +35,76 @@ class PairBodyRoundedPolygon : public Pair {
double init_one(int, int);
struct Contact {
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation;// separation at contact
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation; // separation at contact
};
protected:
double **k_n; // normal repulsion strength
double **k_na; // normal attraction strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double mu; // normal friction coefficient during gross sliding
double delta_ua; // contact line (area for 3D models) modification factor
double cut_inner; // cutoff for interaction between vertex-edge surfaces
double **k_n; // normal repulsion strength
double **k_na; // normal attraction strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double mu; // normal friction coefficient during gross sliding
double delta_ua; // contact line (area for 3D models) modification factor
double cut_inner; // cutoff for interaction between vertex-edge surfaces
class AtomVecBody *avec;
class BodyRoundedPolygon *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *maxerad; // per-type maximum enclosing radius
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *maxerad; // per-type maximum enclosing radius
void allocate();
void body2space(int);
// sphere-sphere interaction
void sphere_against_sphere(int i, int j, double delx, double dely, double delz,
double rsq, double k_n, double k_na,
double** x, double** v, double** f, int evflag);
void sphere_against_sphere(int i, int j, double delx, double dely, double delz, double rsq,
double k_n, double k_na, double **x, double **v, double **f,
int evflag);
// vertex-edge interaction
int vertex_against_edge(int i, int j, double k_n, double k_na,
double** x, double** f, double** torque,
tagint* tag, Contact* contact_list,
int &num_contacts, double &evdwl, double* facc);
int vertex_against_edge(int i, int j, double k_n, double k_na, double **x, double **f,
double **torque, tagint *tag, Contact *contact_list, int &num_contacts,
double &evdwl, double *facc);
// compute distance between a point and an edge from another body
int compute_distance_to_vertex(int ibody, int edge_index, double* xmi,
double rounded_radius, double* x0,
double x0_rounded_radius, double cut_inner,
double &d, double hi[3], double &t,
int &contact);
int compute_distance_to_vertex(int ibody, int edge_index, double *xmi, double rounded_radius,
double *x0, double x0_rounded_radius, double cut_inner, double &d,
double hi[3], double &t, int &contact);
// compute contact forces if contact points are detected
void contact_forces(Contact& contact, double j_a,
double** x, double** v, double** angmom, double** f,
double** torque, double &evdwl, double* facc);
void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom,
double **f, double **torque, double &evdwl, double *facc);
// compute the separation between two contacts
double contact_separation(const Contact& c1, const Contact& c2);
double contact_separation(const Contact &c1, const Contact &c2);
// accumulate torque to a body given a force at a given point
void sum_torque(double* xm, double *x, double fx,
double fy, double fz, double* torque);
void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque);
// helper functions
int opposite_sides(double* x1, double* x2, double* a, double* b);
void total_velocity(double* p, double *xcm, double* vcm, double *angmom,
double *inertia, double *quat, double* vi);
inline void distance(const double* x2, const double* x1, double& r);
int opposite_sides(double *x1, double *x2, double *a, double *b);
void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia,
double *quat, double *vi);
inline void distance(const double *x2, const double *x1, double &r);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(body/rounded/polyhedron,PairBodyRoundedPolyhedron)
// clang-format off
PairStyle(body/rounded/polyhedron,PairBodyRoundedPolyhedron);
// clang-format on
#else
#ifndef LMP_PAIR_BODY_ROUNDED_POLYHEDRON_H
@ -34,145 +34,131 @@ class PairBodyRoundedPolyhedron : public Pair {
void init_style();
double init_one(int, int);
virtual void kernel_force(double R, int itype, int jtype,
double& energy, double& fpair);
virtual void kernel_force(double R, int itype, int jtype, double &energy, double &fpair);
struct Contact {
int ibody, jbody; // body (i.e. atom) indices (not tags)
int type; // 0 = VERTEX-FACE; 1 = EDGE-EDGE
double fx,fy,fz; // unscaled cohesive forces at contact
double xi[3]; // coordinates of the contact point on ibody
double xj[3]; // coordinates of the contact point on jbody
double separation; // contact surface separation
int ibody, jbody; // body (i.e. atom) indices (not tags)
int type; // 0 = VERTEX-FACE; 1 = EDGE-EDGE
double fx, fy, fz; // unscaled cohesive forces at contact
double xi[3]; // coordinates of the contact point on ibody
double xj[3]; // coordinates of the contact point on jbody
double separation; // contact surface separation
int unique;
};
protected:
double **k_n; // normal repulsion strength
double **k_na; // normal attraction strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double mu; // normal friction coefficient during gross sliding
double A_ua; // characteristic contact area
double cut_inner; // cutoff for interaction between vertex-edge surfaces
double **k_n; // normal repulsion strength
double **k_na; // normal attraction strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double mu; // normal friction coefficient during gross sliding
double A_ua; // characteristic contact area
double cut_inner; // cutoff for interaction between vertex-edge surfaces
class AtomVecBody *avec;
class BodyRoundedPolyhedron *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **face; // list of all edge for all bodies
int nface; // number of faces in list
int facmax; // allocated size of face list
int *facnum; // number of faces per line, 0 if uninit
int *facfirst; // index of first face per each line
int facnummax; // allocated size of facnum,facfirst vectors
double **face; // list of all edge for all bodies
int nface; // number of faces in list
int facmax; // allocated size of face list
int *facnum; // number of faces per line, 0 if uninit
int *facfirst; // index of first face per each line
int facnummax; // allocated size of facnum,facfirst vectors
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *maxerad; // per-type maximum enclosing radius
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *maxerad; // per-type maximum enclosing radius
void allocate();
void body2space(int);
// sphere-sphere interaction
void sphere_against_sphere(int ibody, int jbody, int itype, int jtype,
double delx, double dely, double delz, double rsq,
double** v, double** f, int evflag);
void sphere_against_sphere(int ibody, int jbody, int itype, int jtype, double delx, double dely,
double delz, double rsq, double **v, double **f, int evflag);
// sphere-edge interaction
void sphere_against_edge(int ibody, int jbody, int itype, int jtype,
double** x, double** v, double** f, double** torque,
double** angmom, int evflag);
void sphere_against_edge(int ibody, int jbody, int itype, int jtype, double **x, double **v,
double **f, double **torque, double **angmom, int evflag);
// sphere-face interaction
void sphere_against_face(int ibody, int jbody, int itype, int jtype,
double** x, double** v, double** f, double** torque,
double** angmom, int evflag);
void sphere_against_face(int ibody, int jbody, int itype, int jtype, double **x, double **v,
double **f, double **torque, double **angmom, int evflag);
// edge-edge interactions
int edge_against_edge(int ibody, int jbody, int itype, int jtype,
double** x,Contact* contact_list, int &num_contacts,
double &evdwl, double* facc);
int edge_against_edge(int ibody, int jbody, int itype, int jtype, double **x,
Contact *contact_list, int &num_contacts, double &evdwl, double *facc);
// edge-face interactions
int edge_against_face(int ibody, int jbody, int itype, int jtype,
double** x, Contact* contact_list, int &num_contacts,
double &evdwl, double* facc);
int edge_against_face(int ibody, int jbody, int itype, int jtype, double **x,
Contact *contact_list, int &num_contacts, double &evdwl, double *facc);
// a face vs. a single edge
int interaction_face_to_edge(int ibody, int face_index, double* xmi,
double rounded_radius_i, int jbody, int edge_index,
double* xmj, double rounded_radius_j,
int itype, int jtype, double cut_inner,
Contact* contact_list, int &num_contacts,
double& energy, double* facc);
int interaction_face_to_edge(int ibody, int face_index, double *xmi, double rounded_radius_i,
int jbody, int edge_index, double *xmj, double rounded_radius_j,
int itype, int jtype, double cut_inner, Contact *contact_list,
int &num_contacts, double &energy, double *facc);
// an edge vs. an edge from another body
int interaction_edge_to_edge(int ibody, int edge_index_i, double* xmi,
double rounded_radius_i, int jbody, int edge_index_j,
double* xmj, double rounded_radius_j,
int itype, int jtype, double cut_inner,
Contact* contact_list, int &num_contacts,
double& energy, double* facc);
int interaction_edge_to_edge(int ibody, int edge_index_i, double *xmi, double rounded_radius_i,
int jbody, int edge_index_j, double *xmj, double rounded_radius_j,
int itype, int jtype, double cut_inner, Contact *contact_list,
int &num_contacts, double &energy, double *facc);
// compute contact forces if contact points are detected
void contact_forces(int ibody, int jbody, double *xi, double *xj,
double delx, double dely, double delz, double fx, double fy, double fz,
double** x, double** v, double** angmom, double** f, double** torque,
double* facc);
void contact_forces(int ibody, int jbody, double *xi, double *xj, double delx, double dely,
double delz, double fx, double fy, double fz, double **x, double **v,
double **angmom, double **f, double **torque, double *facc);
// compute force and torque between two bodies given a pair of interacting points
void pair_force_and_torque(int ibody, int jbody, double* pi, double* pj,
double r, double contact_dist, int itype, int jtype,
double** x, double** v, double** f, double** torque,
double** angmom, int jflag, double& energy, double* facc);
void pair_force_and_torque(int ibody, int jbody, double *pi, double *pj, double r,
double contact_dist, int itype, int jtype, double **x, double **v,
double **f, double **torque, double **angmom, int jflag,
double &energy, double *facc);
// rescale the cohesive forces if a contact area is detected
void rescale_cohesive_forces(double** x, double** f, double** torque,
Contact* contact_list, int &num_contacts,
int itype, int jtype, double* facc);
void rescale_cohesive_forces(double **x, double **f, double **torque, Contact *contact_list,
int &num_contacts, int itype, int jtype, double *facc);
// compute the separation between two contacts
double contact_separation(const Contact& c1, const Contact& c2);
double contact_separation(const Contact &c1, const Contact &c2);
// detect the unique contact points (as there may be double counts)
void find_unique_contacts(Contact* contact_list, int& num_contacts);
void find_unique_contacts(Contact *contact_list, int &num_contacts);
// accumulate torque to a body given a force at a given point
void sum_torque(double* xm, double *x, double fx, double fy, double fz, double* torque);
void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque);
// find the intersection point (if any) between an edge and a face
int edge_face_intersect(double* x1, double* x2, double* x3, double* a, double* b,
double* hi1, double* hi2, double& d1, double& d2,
int& inside_a, int& inside_b);
int edge_face_intersect(double *x1, double *x2, double *x3, double *a, double *b, double *hi1,
double *hi2, double &d1, double &d2, int &inside_a, int &inside_b);
// helper functions
int opposite_sides(double* n, double* x0, double* a, double* b);
void project_pt_plane(const double* q, const double* p,
const double* n, double* q_proj, double &d);
void project_pt_plane(const double* q, const double* x1, const double* x2,
const double* x3, double* q_proj, double &d, int& inside);
void project_pt_line(const double* q, const double* xi1, const double* xi2,
double* h, double& d, double& t);
void inside_polygon(int ibody, int face_index, double* xmi,
const double* q1, const double* q2, int& inside1, int& inside2);
int opposite_sides(double *n, double *x0, double *a, double *b);
void project_pt_plane(const double *q, const double *p, const double *n, double *q_proj,
double &d);
void project_pt_plane(const double *q, const double *x1, const double *x2, const double *x3,
double *q_proj, double &d, int &inside);
void project_pt_line(const double *q, const double *xi1, const double *xi2, double *h, double &d,
double &t);
void inside_polygon(int ibody, int face_index, double *xmi, const double *q1, const double *q2,
int &inside1, int &inside2);
void distance_bt_edges(const double* x1, const double* x2,
const double* x3, const double* x4,
double* h1, double* h2, double& t1, double& t2, double& r);
void total_velocity(double* p, double *xcm, double* vcm, double *angmom,
double *inertia, double *quat, double* vi);
void distance_bt_edges(const double *x1, const double *x2, const double *x3, const double *x4,
double *h1, double *h2, double &t1, double &t2, double &r);
void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia,
double *quat, double *vi);
void sanity_check();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef ANGLE_CLASS
AngleStyle(class2,AngleClass2)
// clang-format off
AngleStyle(class2,AngleClass2);
// clang-format on
#else
#ifndef LMP_ANGLE_CLASS2_H
@ -37,15 +37,15 @@ class AngleClass2 : public Angle {
double single(int, int, int, int);
protected:
double *theta0,*k2,*k3,*k4;
double *bb_k,*bb_r1,*bb_r2;
double *ba_k1,*ba_k2,*ba_r1,*ba_r2;
int *setflag_a,*setflag_bb,*setflag_ba;
double *theta0, *k2, *k3, *k4;
double *bb_k, *bb_r1, *bb_r2;
double *ba_k1, *ba_k2, *ba_r1, *ba_r2;
int *setflag_a, *setflag_bb, *setflag_ba;
void allocate();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef BOND_CLASS
BondStyle(class2,BondClass2)
// clang-format off
BondStyle(class2,BondClass2);
// clang-format on
#else
#ifndef LMP_BOND_CLASS2_H
@ -38,12 +38,12 @@ class BondClass2 : public Bond {
virtual void *extract(const char *, int &);
protected:
double *r0,*k2,*k3,*k4;
double *r0, *k2, *k3, *k4;
void allocate();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef DIHEDRAL_CLASS
DihedralStyle(class2,DihedralClass2)
// clang-format off
DihedralStyle(class2,DihedralClass2);
// clang-format on
#else
#ifndef LMP_DIHEDRAL_CLASS2_H
@ -35,22 +35,22 @@ class DihedralClass2 : public Dihedral {
void write_data(FILE *);
protected:
double *k1,*k2,*k3;
double *phi1,*phi2,*phi3;
double *mbt_f1,*mbt_f2,*mbt_f3,*mbt_r0;
double *ebt_f1_1,*ebt_f2_1,*ebt_f3_1,*ebt_r0_1;
double *ebt_f1_2,*ebt_f2_2,*ebt_f3_2,*ebt_r0_2;
double *at_f1_1,*at_f2_1,*at_f3_1,*at_theta0_1;
double *at_f1_2,*at_f2_2,*at_f3_2,*at_theta0_2;
double *aat_k,*aat_theta0_1,*aat_theta0_2;
double *bb13t_k,*bb13t_r10,*bb13t_r30;
int *setflag_d,*setflag_mbt,*setflag_ebt;
int *setflag_at,*setflag_aat,*setflag_bb13t;
double *k1, *k2, *k3;
double *phi1, *phi2, *phi3;
double *mbt_f1, *mbt_f2, *mbt_f3, *mbt_r0;
double *ebt_f1_1, *ebt_f2_1, *ebt_f3_1, *ebt_r0_1;
double *ebt_f1_2, *ebt_f2_2, *ebt_f3_2, *ebt_r0_2;
double *at_f1_1, *at_f2_1, *at_f3_1, *at_theta0_1;
double *at_f1_2, *at_f2_2, *at_f3_2, *at_theta0_2;
double *aat_k, *aat_theta0_1, *aat_theta0_2;
double *bb13t_k, *bb13t_r10, *bb13t_r30;
int *setflag_d, *setflag_mbt, *setflag_ebt;
int *setflag_at, *setflag_aat, *setflag_bb13t;
void allocate();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef IMPROPER_CLASS
ImproperStyle(class2,ImproperClass2)
// clang-format off
ImproperStyle(class2,ImproperClass2);
// clang-format on
#else
#ifndef LMP_IMPROPER_CLASS2_H
@ -35,9 +35,9 @@ class ImproperClass2 : public Improper {
void write_data(FILE *);
protected:
double *k0,*chi0;
double *aa_k1,*aa_k2,*aa_k3,*aa_theta0_1,*aa_theta0_2,*aa_theta0_3;
int *setflag_i,*setflag_aa;
double *k0, *chi0;
double *aa_k1, *aa_k2, *aa_k3, *aa_theta0_1, *aa_theta0_2, *aa_theta0_3;
int *setflag_i, *setflag_aa;
void allocate();
void angleangle(int, int);
@ -45,7 +45,7 @@ class ImproperClass2 : public Improper {
double dot(double *, double *);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -10,9 +10,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(lj/class2,PairLJClass2)
// clang-format off
PairStyle(lj/class2,PairLJClass2);
// clang-format on
#else
#ifndef LMP_PAIR_LJ_CLASS2_H
@ -47,14 +47,14 @@ class PairLJClass2 : public Pair {
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
double **epsilon, **sigma;
double **lj1, **lj2, **lj3, **lj4, **offset;
double *cut_respa;
virtual void allocate();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(lj/class2/coul/cut,PairLJClass2CoulCut)
// clang-format off
PairStyle(lj/class2/coul/cut,PairLJClass2CoulCut);
// clang-format on
#else
#ifndef LMP_PAIR_LJ_CLASS2_COUL_CUT_H
@ -43,16 +43,16 @@ class PairLJClass2CoulCut : public Pair {
void *extract(const char *, int &);
protected:
double cut_lj_global,cut_coul_global;
double **cut_lj,**cut_ljsq;
double **cut_coul,**cut_coulsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
double cut_lj_global, cut_coul_global;
double **cut_lj, **cut_ljsq;
double **cut_coul, **cut_coulsq;
double **epsilon, **sigma;
double **lj1, **lj2, **lj3, **lj4, **offset;
virtual void allocate();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(lj/class2/coul/long,PairLJClass2CoulLong)
// clang-format off
PairStyle(lj/class2/coul/long,PairLJClass2CoulLong);
// clang-format on
#else
#ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_H
@ -48,17 +48,17 @@ class PairLJClass2CoulLong : public Pair {
protected:
double cut_lj_global;
double **cut_lj,**cut_ljsq;
double cut_coul,cut_coulsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
double **cut_lj, **cut_ljsq;
double cut_coul, cut_coulsq;
double **epsilon, **sigma;
double **lj1, **lj2, **lj3, **lj4, **offset;
double g_ewald;
double *cut_respa;
virtual void allocate();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(wall/colloid,FixWallColloid)
// clang-format off
FixStyle(wall/colloid,FixWallColloid);
// clang-format on
#else
#ifndef LMP_FIX_WALL_COLLOID_H
@ -32,10 +32,10 @@ class FixWallColloid : public FixWall {
void wall_particle(int, int, double);
private:
double coeff1[6],coeff2[6],coeff3[6],coeff4[6];
double coeff1[6], coeff2[6], coeff3[6], coeff4[6];
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,3 +1,4 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories

View File

@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(brownian,PairBrownian)
// clang-format off
PairStyle(brownian,PairBrownian);
// clang-format on
#else
#ifndef LMP_PAIR_BROWNIAN_H
@ -39,9 +39,9 @@ class PairBrownian : public Pair {
void read_restart_settings(FILE *);
protected:
double cut_inner_global,cut_global;
double t_target,mu;
int flaglog,flagfld;
double cut_inner_global, cut_global;
double t_target, mu;
int flaglog, flagfld;
int flagHI, flagVF;
int flagdeform, flagwall;
double vol_P;
@ -49,16 +49,16 @@ class PairBrownian : public Pair {
class FixWall *wallfix;
int seed;
double **cut_inner,**cut;
double R0,RT0;
double **cut_inner, **cut;
double R0, RT0;
class RanMars *random;
void set_3_orthogonal_vectors(double*,double*,double*);
void set_3_orthogonal_vectors(double *, double *, double *);
void allocate();
};
}
} // namespace LAMMPS_NS
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More