fix checkstyle issues

This commit is contained in:
oywg11
2023-06-03 22:37:57 +08:00
parent a25100120b
commit 738a955c40
4 changed files with 24 additions and 33 deletions

View File

@ -18,7 +18,7 @@
[Feng and Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023).]
------------------------------------------------------------------------- */
#include "pair_ilp_water_2dm.h"
#include "pair_aip_water_2dm.h"
#include "atom.h"
#include "citeme.h"
@ -40,7 +40,7 @@ using namespace InterLayer;
#define DELTA 4
#define PGDELTA 1
static const char cite_ilp_water[] =
static const char cite_aip_water[] =
"ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464\n"
"@Article{Feng2023\n"
" author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang},\n"
@ -53,26 +53,26 @@ static const char cite_ilp_water[] =
/* ---------------------------------------------------------------------- */
PairILPWATER2DM::PairILPWATER2DM(LAMMPS *lmp) : PairILPGrapheneHBN(lmp), PairILPTMD(lmp)
PairAIPWATER2DM::PairAIPWATER2DM(LAMMPS *lmp) : PairILPGrapheneHBN(lmp), PairILPTMD(lmp)
{
variant = ILP_WATER_2DM;
variant = AIP_WATER_2DM;
single_enable = 0;
// for TMD, each atom have six neighbors
Nnei = 6;
if (lmp->citeme) lmp->citeme->add(cite_ilp_water);
if (lmp->citeme) lmp->citeme->add(cite_aip_water);
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairILPWATER2DM::settings(int narg, char **arg)
void PairAIPWATER2DM::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all(FLERR, "Illegal pair_style command");
if (!utils::strmatch(force->pair_style, "^hybrid/overlay"))
error->all(FLERR, "Pair style ilp/water/2dm must be used as sub-style with hybrid/overlay");
error->all(FLERR, "Pair style aip/water/2dm must be used as sub-style with hybrid/overlay");
cut_global = utils::numeric(FLERR, arg[0], false, lmp);
if (narg == 2) tap_flag = utils::numeric(FLERR, arg[1], false, lmp);

View File

@ -13,33 +13,24 @@
#ifdef PAIR_CLASS
// clang-format off
PairStyle(ilp/water/2dm,PairILPWATER2DM);
PairStyle(aip/water/2dm,PairAIPWATER2DM);
// clang-format on
#else
#ifndef LMP_PAIR_ILP_WATER_2DM_H
#define LMP_PAIR_ILP_WATER_2DM_H
#ifndef LMP_PAIR_AIP_WATER_2DM_H
#define LMP_PAIR_AIP_WATER_2DM_H
#include "pair_ilp_tmd.h"
namespace LAMMPS_NS {
class PairILPWATER2DM : virtual public PairILPTMD {
class PairAIPWATER2DM : virtual public PairILPTMD {
public:
PairILPWATER2DM(class LAMMPS *);
PairAIPWATER2DM(class LAMMPS *);
protected:
void settings(int, char **) override;
/**************************************************************/
/* modulo operation with cycling around range */
inline int modulo(int k, int range)
{
if (k < 0) k += range;
return k % range;
}
/**************************************************************/
};
} // namespace LAMMPS_NS

View File

@ -11,7 +11,7 @@
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
This is an optimized version of ilp/water/2dm based on the contribution of:
This is an optimized version of aip/water/2dm based on the contribution of:
author: Wengen Ouyang (Wuhan University)
e-mail: w.g.ouyang at gmail dot com
@ -30,7 +30,7 @@
Potential is described by:
[Feng and Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023).]
*/
#include "pair_ilp_water_2dm_opt.h"
#include "pair_aip_water_2dm_opt.h"
#include "atom.h"
#include "citeme.h"
@ -49,15 +49,15 @@
using namespace LAMMPS_NS;
using namespace InterLayer;
PairILPWATER2DMOpt::PairILPWATER2DMOpt(LAMMPS *lmp) :
PairILPGrapheneHBN(lmp), PairILPTMD(lmp), PairILPWATER2DM(lmp), PairILPGrapheneHBNOpt(lmp)
PairAIPWATER2DMOpt::PairAIPWATER2DMOpt(LAMMPS *lmp) :
PairILPGrapheneHBN(lmp), PairILPTMD(lmp), PairAIPWATER2DM(lmp), PairILPGrapheneHBNOpt(lmp)
{
}
void PairILPWATER2DMOpt::coeff(int narg, char **args)
void PairAIPWATER2DMOpt::coeff(int narg, char **args)
{
PairILPTMD::coeff(narg, args);
memory->create(special_type, atom->ntypes + 1, "PairILPWATER2DMOpt:check_sublayer");
memory->create(special_type, atom->ntypes + 1, "PairAIPWATER2DMOpt:check_sublayer");
for (int i = 1; i <= atom->ntypes; i++) {
int itype = map[i];
if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 ||

View File

@ -13,21 +13,21 @@
#ifdef PAIR_CLASS
// clang-format off
PairStyle(ilp/water/2dm/opt,PairILPWATER2DMOpt);
PairStyle(aip/water/2dm/opt,PairAIPWATER2DMOpt);
// clang-format on
#else
#ifndef LMP_PAIR_ILP_WATER_2DM_OPT_H
#define LMP_PAIR_ILP_WATER_2DM_OPT_H
#ifndef LMP_PAIR_AIP_WATER_2DM_OPT_H
#define LMP_PAIR_AIP_WATER_2DM_OPT_H
#include "pair_ilp_graphene_hbn_opt.h"
#include "pair_ilp_water_2dm.h"
#include "pair_aip_water_2dm.h"
namespace LAMMPS_NS {
class PairILPWATER2DMOpt : public PairILPWATER2DM, public PairILPGrapheneHBNOpt {
class PairAIPWATER2DMOpt : public PairAIPWATER2DM, public PairILPGrapheneHBNOpt {
public:
PairILPWATER2DMOpt(class LAMMPS *);
PairAIPWATER2DMOpt(class LAMMPS *);
void coeff(int narg, char **args) override;
protected: