add USER-OMP version of pair style coul/cut/global

This commit is contained in:
Axel Kohlmeyer
2021-04-12 10:00:52 -04:00
parent d88cf587b2
commit 0c2fc07cc5
2 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,44 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "pair_coul_cut_global_omp.h"
#include "error.h"
#include <cstring>
using namespace LAMMPS_NS;
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairCoulCutGlobalOMP::coeff(int narg, char **arg)
{
if (narg != 2)
error->all(FLERR,"Incorrect args for pair coefficients");
PairCoulCut::coeff(narg,arg);
}
/* ---------------------------------------------------------------------- */
void *PairCoulCutGlobalOMP::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_global;
dim = 2;
if (strcmp(str,"scale") == 0) return (void *) scale;
return nullptr;
}

View File

@ -0,0 +1,55 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(coul/cut/global/omp,PairCoulCutGlobalOMP)
#else
#ifndef LMP_PAIR_COUL_CUT_GLOBAL_OMP_H
#define LMP_PAIR_COUL_CUT_GLOBAL_OMP_H
#include "pair_coul_cut_omp.h"
namespace LAMMPS_NS {
class PairCoulCutGlobalOMP : public PairCoulCutOMP {
public:
PairCoulCutGlobalOMP(class LAMMPS *lmp) : PairCoulCutOMP(lmp) {}
void coeff(int, char **);
void *extract(const char *, int &);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair style coul/cut requires atom attribute q
The atom style defined does not have these attributes.
*/