Unverified Commit 284b1618 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2227 from akohlmey/collected-small-fixes

Collected small updates and bugfixes
parents e2e4305f 83291fdd
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ minimize = {}
pair = {}
reader = {}
region = {}
total = 0

upper = re.compile("[A-Z]+")
gpu = re.compile("(.+)/gpu$")
@@ -60,7 +61,7 @@ kokkos = re.compile("(.+)/kk$")
kokkos_skip = re.compile("(.+)/kk/(host|device)$")
omp = re.compile("(.+)/omp$")
opt = re.compile("(.+)/opt$")
removed = re.compile("(.+)Deprecated$")
removed = re.compile("(.*)Deprecated$")

def register_style(list,style,info):
    if style in list.keys():
@@ -119,6 +120,7 @@ for h in headers:

        # skip over internal styles w/o explicit documentation
        style = m[1]
        total += 1
        if upper.match(style):
            continue

@@ -197,12 +199,13 @@ print("""Parsed style names w/o suffixes from C++ tree in %s:
   Fix styles:       %3d    Improper styles:  %3d
   Integrate styles: %3d    Kspace styles:    %3d
   Minimize styles:  %3d    Pair styles:      %3d
   Reader styles:    %3d    Region styles:    %3d""" \
   Reader styles:    %3d    Region styles:    %3d
----------------------------------------------------
Total number of styles (including suffixes): %d""" \
      % (src, len(angle), len(atom), len(body), len(bond),   \
       len(command), len(compute), len(dihedral), len(dump), \
       len(fix), len(improper), len(integrate), len(kspace), \
       len(minimize), len(pair), len(reader), len(region)))

       len(minimize), len(pair), len(reader), len(region), total))

counter = 0

+1 −0
Original line number Diff line number Diff line
../../potentials/CdTeZnSeHgS0.sw
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -204,6 +204,12 @@ class lammps(object):
    self.lib.lammps_neighlist_element_neighbors.argtypes = [c_void_p, c_int, c_int, POINTER(c_int), POINTER(c_int), POINTER(POINTER(c_int))]
    self.lib.lammps_neighlist_element_neighbors.restype  = None

    self.lib.lammps_has_error.argtypes = [c_void_p]
    self.lib.lammps_has_error.restype = c_bool

    self.lib.lammps_get_last_error_message.argtypes = [c_void_p, c_char_p, c_int]
    self.lib.lammps_get_last_error_message.restype = c_int

    # if no ptr provided, create an instance of LAMMPS
    #   don't know how to pass an MPI communicator from PyPar
    #   but we can pass an MPI communicator from mpi4py v2.0.0 and later
+7 −0
Original line number Diff line number Diff line
@@ -285,6 +285,13 @@ void PairKIM::allocate()

void PairKIM::settings(int narg, char **arg)
{
  // some of the code below needs to know the number of atom types,
  // but that is not set until the simulation box is created.

  if (domain->box_exist == 0)
    error->all(FLERR,"May not use 'pair_style kim' command before "
               "simulation box is defined");

  // This is called when "pair_style kim ..." is read from input
  // may be called multiple times
  ++settings_call_count;
+8 −3
Original line number Diff line number Diff line
@@ -139,14 +139,16 @@ void EwaldDisp::init()
      nsums += n[k];
    }

  if (!gewaldflag) g_ewald = g_ewald_6 = 1.0;
  if (!gewaldflag) g_ewald = 1.0;
  if (!gewaldflag_6) g_ewald_6 = 1.0;
  pair->init();  // so B is defined
  init_coeffs();
  init_coeff_sums();
  if (function[0]) qsum_qsq();
  else qsqsum = qsum = 0.0;
  natoms_original = atom->natoms;
  if (!gewaldflag) g_ewald = g_ewald_6 = 0.0;
  if (!gewaldflag) g_ewald = 0.0;
  if (!gewaldflag_6) g_ewald_6 = 0.0;

  // turn off coulombic if no charge

@@ -231,7 +233,9 @@ void EwaldDisp::init()
    utils::logmesg(lmp,fmt::format("  G vector = {:.8g},   accuracy = {:.8g}\n",
                                   g_ewald,accuracy));

  g_ewald_6 = g_ewald;
  // apply coulomb g_ewald to dispersion unless it is explicitly set

  if (!gewaldflag_6) g_ewald_6 = g_ewald;
  deallocate_peratom();
  peratom_allocate_flag = 0;
}
@@ -507,6 +511,7 @@ void EwaldDisp::init_coeffs()
  if (function[2]) {                                        // arithmetic 1/r^6
    double **epsilon = (double **) force->pair->extract("epsilon",tmp);
    double **sigma = (double **) force->pair->extract("sigma",tmp);
    delete [] B;
    double eps_i, sigma_i, sigma_n, *bi = B = new double[7*n+7];
    double c[7] = {
      1.0, sqrt(6.0), sqrt(15.0), sqrt(20.0), sqrt(15.0), sqrt(6.0), 1.0};
Loading