Merge pull request #3020 from akohlmey/collected-small-changes

Collected small changes and fixes
This commit is contained in:
Axel Kohlmeyer
2021-11-17 14:00:13 -05:00
committed by GitHub
22 changed files with 121 additions and 77 deletions

View File

@ -48,7 +48,6 @@ set(ALL_PACKAGES
PHONON PHONON
PLUGIN PLUGIN
POEMS POEMS
PYTHON
QEQ QEQ
REACTION REACTION
REAXFF REAXFF

View File

@ -141,7 +141,8 @@ unrelated feature, you should switch branches!
Committing changes to the *develop*, *release*, or *stable* branches Committing changes to the *develop*, *release*, or *stable* branches
is strongly discouraged. While it may be convenient initially, it is strongly discouraged. While it may be convenient initially, it
will create more work in the long run. Various texts and tutorials will create more work in the long run. Various texts and tutorials
on using git effectively discuss the motivation for this. on using git effectively discuss the motivation for using feature
branches instead.
**After changes are made** **After changes are made**

View File

@ -28,8 +28,9 @@ provides `limited support for subversion clients <svn_>`_.
You can follow the LAMMPS development on 3 different git branches: You can follow the LAMMPS development on 3 different git branches:
* **stable** : this branch is updated with every stable release; * **stable** : this branch is updated from the *release* branch with
updates are always "fast forward" merges from *develop* every stable release version and also has selected bug fixes and updates
back-ported from the *develop* branch
* **release** : this branch is updated with every patch release; * **release** : this branch is updated with every patch release;
updates are always "fast forward" merges from *develop* updates are always "fast forward" merges from *develop*
* **develop** : this branch follows the ongoing development and * **develop** : this branch follows the ongoing development and
@ -47,20 +48,22 @@ your machine and "release" is one of the 3 branches listed above.
(Note that you actually download all 3 branches; you can switch (Note that you actually download all 3 branches; you can switch
between them at any time using "git checkout <branch name>".) between them at any time using "git checkout <branch name>".)
.. note:: .. admonition:: Saving time and disk space when using ``git clone``
The complete git history of the LAMMPS project is quite large because The complete git history of the LAMMPS project is quite large because
it contains the entire commit history of the project since fall 2006, it contains the entire commit history of the project since fall 2006,
which includes the time when LAMMPS was managed with subversion. This which includes the time when LAMMPS was managed with subversion.
also includes commits that have added and removed some large files This includes a few commits that have added and removed some large
(mostly by accident). If you do not need access to the entire commit files (mostly by accident). If you do not need access to the entire
history, you can speed up the "cloning" process and reduce local disk commit history (most people don't), you can speed up the "cloning"
space requirements by using the *--depth* git command line flag thus process and reduce local disk space requirements by using the
create a "shallow clone" of the repository that contains only a *--depth* git command line flag. That will create a "shallow clone"
subset of the git history. Using a depth of 1000 is usually sufficient of the repository containing only a subset of the git history. Using
to include the head commits of the *develop* and the *release* branches. a depth of 1000 is usually sufficient to include the head commits of
To include the head commit of the *stable* branch you may need a depth the *develop* and the *release* branches. To include the head commit
of up to 10000. of the *stable* branch you may need a depth of up to 10000. If you
later need more of the git history, you can always convert the
shallow clone into a "full clone".
Once the command completes, your directory will contain the same files Once the command completes, your directory will contain the same files
as if you unpacked a current LAMMPS tarball, with the exception, that as if you unpacked a current LAMMPS tarball, with the exception, that

View File

@ -10,23 +10,31 @@ Whenever we fix a bug or update or add a feature, it will be merged into
the *develop* branch of the git repository. When a sufficient number of the *develop* branch of the git repository. When a sufficient number of
changes have accumulated *and* the software passes a set of automated changes have accumulated *and* the software passes a set of automated
tests, we release it in the next *patch* release, which are made every tests, we release it in the next *patch* release, which are made every
few weeks. Info on patch releases are on `this website page few weeks. The *release* branch of the git repository is updated with
every such release. Info on patch releases are on `this website page
<https://www.lammps.org/bug.html>`_. <https://www.lammps.org/bug.html>`_.
Once or twice a year, only bug fixes and small, non-intrusive changes are Once or twice a year, we apply only bug fixes and small, non-intrusive
included for a period of time, and the code is subjected to more detailed changes to the *develop* branch and the code is subjected to more detailed
and thorough testing than the default automated testing. The latest and thorough testing than the default automated testing. The latest
patch release after such a period is then labeled as a *stable* version. patch release after such a period is then also labeled as a *stable* version
and the *stable* branch is updated with it. Between stable releases
we occasionally release some updates to the stable release containing
only bug fixes and updates back-ported from *develop* but no new features
and update the *stable* branch accordingly.
Each version of LAMMPS contains all the features and bug-fixes up to Each version of LAMMPS contains all the documented features up to and
and including its version date. including its version date.
The version date is printed to the screen and logfile every time you The version date is printed to the screen and logfile every time you
run LAMMPS. It is also in the file src/version.h and in the LAMMPS run LAMMPS. It is also in the file src/version.h and in the LAMMPS
directory name created when you unpack a tarball. And it is on the directory name created when you unpack a tarball. And it is on the
first page of the :doc:`manual <Manual>`. first page of the :doc:`manual <Manual>`.
* If you browse the HTML pages on the LAMMPS WWW site, they always * If you browse the HTML pages on the LAMMPS WWW site, they will by
describe the most current patch release of LAMMPS. default describe the most current patch release version of LAMMPS.
In the navigation bar on the bottom left, there is the option to
view instead the documentation for the most recent *stable* version
or the latest version from the current development branch.
* If you browse the HTML pages included in your tarball, they * If you browse the HTML pages included in your tarball, they
describe the version you have, which may be older. describe the version you have, which may be older.

View File

@ -710,7 +710,9 @@ default and it can be disabled with the :code:`checksum` keyword.
Restrictions Restrictions
"""""""""""" """"""""""""
none
Not all *dump_modify* options can be applied to all dump styles.
Details are in the discussions of the individual options.
Related commands Related commands
"""""""""""""""" """"""""""""""""

View File

@ -205,7 +205,7 @@ For *damping mass_velocity*, the normal damping is given by:
\eta_n = \eta_{n0} m_{eff} \eta_n = \eta_{n0} m_{eff}
Here, :math:`\eta_{n0}` is the damping coefficient specified for the normal Here, :math:`\eta_{n0}` is the damping coefficient specified for the normal
contact model, in units of *mass*\ /\ *time* and contact model, in units of 1/\ *time* and
:math:`m_{eff} = m_i m_j/(m_i + m_j)` is the effective mass. :math:`m_{eff} = m_i m_j/(m_i + m_j)` is the effective mass.
Use *damping mass_velocity* to reproduce the damping behavior of Use *damping mass_velocity* to reproduce the damping behavior of
*pair gran/hooke/\**. *pair gran/hooke/\**.

View File

@ -26,15 +26,29 @@ Examples
Description Description
""""""""""" """""""""""
The *lebedeva/z* style computes the Lebedeva interaction The *lebedeva/z* pair style computes the Lebedeva interaction potential
potential as described in :ref:`(Lebedeva et al.) <Leb01>`. An important simplification is made, as described in :ref:`(Lebedeva1) <Leb01>` and :ref:`(Lebedeva2)
which is to take all normals along the z-axis. <Leb02>`. An important simplification is made, which is to take all
normals along the z-axis.
The Lebedeva potential is intended for the description of the interlayer
interaction between graphene layers. To perform a realistic simulation,
this potential must be used in combination with an intralayer potential
such as :doc:`AIREBO <pair_airebo>` or :doc:`Tersoff <pair_tersoff>`
facilitated by using pair style :doc:`hybrid/overlay <pair_hybrid>`. To
keep the intralayer properties unaffected, the interlayer interaction
within the same layers should be avoided. This can be achieved by
assigning different atom types to atoms of different layers (e.g. 1 and
2 in the examples above).
Other interactions can be set to zero using pair_style *none*\ .
.. math:: .. math::
E = & \frac{1}{2} \sum_i \sum_{i \neq j} V_{ij}\\ E = & \frac{1}{2} \sum_i \sum_{j \neq i} V_{ij}\\
V_{ij} = & B e^{-\alpha(r_{ij} - z_0)} \\ V_{ij} = & B e^{-\alpha(r_{ij} - z_0)} \\
& + C(1 + D_1\rho^2_{ij} + D_2\rho^4_{ij} e^{-\lambda_1\rho^2_{ij}} e^{-\lambda_2 (z^2_{ij} - z^2_0)} \\ & + C(1 + D_1\rho^2_{ij} + D_2\rho^4_{ij}) e^{-\lambda_1\rho^2_{ij}} e^{-\lambda_2 (z^2_{ij} - z^2_0)} \\
& - A \left(\frac{z_0}{r_ij}\right)^6 + A \left( \frac{z_0}{r_c} \right)^6 \\ & - A \left(\frac{z_0}{r_ij}\right)^6 + A \left( \frac{z_0}{r_c} \right)^6 \\
\rho^2_{ij} = & x^2_{ij} + y^2_{ij} \qquad (\mathbf{n_i} \equiv \mathbf{\hat{z}}) \rho^2_{ij} = & x^2_{ij} + y^2_{ij} \qquad (\mathbf{n_i} \equiv \mathbf{\hat{z}})
@ -43,12 +57,15 @@ Energies are shifted so that they go continuously to zero at the cutoff assuming
that the exponential part of :math:`V_{ij}` (first term) decays sufficiently fast. that the exponential part of :math:`V_{ij}` (first term) decays sufficiently fast.
This shift is achieved by the last term in the equation for :math:`V_{ij}` above. This shift is achieved by the last term in the equation for :math:`V_{ij}` above.
The parameter file (e.g. CC.Lebedeva), is intended for use with metal The provided parameter file (CC.Lebedeva) contains two sets of parameters.
:doc:`units <units>`, with energies in meV. An additional parameter, *S*,
is available to facilitate scaling of energies.
This potential must be used in combination with hybrid/overlay. - The first set (element name "C") is suitable for normal conditions and
Other interactions can be set to zero using pair_style *none*\ . is taken from :ref:`(Popov1) <Popov>`
- The second set (element name "C1") is suitable for high-pressure
conditions and is taken from :ref:`(Koziol1) <Koziol>`
Both sets contain an additional parameter, *S*, that can be used to
facilitate scaling of energies and is set to 1.0 by default.
Restrictions Restrictions
"""""""""""" """"""""""""
@ -77,4 +94,16 @@ none
.. _Leb01: .. _Leb01:
**(Lebedeva et al.)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Phys. Rev. B, 84, 245437 (2011) **(Lebedeva1)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Phys. Rev. B, 84, 245437 (2011)
.. _Leb02:
**(Lebedeva2)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Physica E: 44, 949-954 (2012)
.. _Popov:
**(Popov1)** A.M. Popov, I. V. Lebedeva, A. A. Knizhnik, Y. E. Lozovik and B. V. Potapkin, Chem. Phys. Lett. 536, 82-86 (2012).
.. _Koziol:
**(Koziol1)** Z. Koziol, G. Gawlik and J. Jagielski, Chinese Phys. B 28, 096101 (2019).

View File

@ -1125,6 +1125,7 @@ gaussian
gaussians gaussians
Gaussians Gaussians
Gavhane Gavhane
Gawlik
gayberne gayberne
gcc gcc
gcmc gcmc
@ -1483,6 +1484,7 @@ Izz
Jacobsen Jacobsen
Jadhao Jadhao
Jadhav Jadhav
Jagielski
jagreat jagreat
Jahn Jahn
Jalalvand Jalalvand
@ -1609,6 +1611,7 @@ Koslowski
Kosovan Kosovan
Koster Koster
Kosztin Kosztin
Koziol
Kp Kp
kradius kradius
Kraker Kraker

View File

@ -1,12 +1,13 @@
# DATE: 2018-11-28 UNITS: metal CONTRIBUTOR: Zbigniew Koziol softquake@gmail.com CITATION: Z. Koziol et al.: https://arxiv.org/abs/1803.05162 # DATE: 2021-11-04 UNITS: metal CONTRIBUTOR: Zbigniew Koziol softquake@gmail.com CITATION: Z. Koziol et al.: https://arxiv.org/abs/1803.05162
# #
# Lebedeva Potential. https://doi.org/10.1016/j.physe.2011.07.018 # Lebedeva potential: https://doi.org/10.1039/C0CP02614J and https://doi.org/10.1016/j.physe.2011.07.018
# Parameters must be in this order as here, otherwise their values may be changed. # Parameters must be in this order as here, otherwise their values may be changed.
# Energies here are given in meV.
# The last one, S, is convenient for scaling the potential amplitude. S is a multiplication factor for A, B, C # The last one, S, is convenient for scaling the potential amplitude. S is a multiplication factor for A, B, C
# A B C z0 alpha D1 D2 lambda1 lambda2 S # A B C z0 alpha D1 D2 lambda1 lambda2 S
# These are values according to Levedeva et al # These are values according to Lebedeva et al.: https://doi.org/10.1016/j.cplett.2012.03.082
#C C 10.510 11.6523.34 35.883 3.34 4.16 -0.86232 0.10049 0.48703 0.46445 1.0 C C 10.510 11.652 29.5 3.34 4.16 -0.86232 0.10049 0.48703 0.46445 1.0
# #
# These are values by Z. Koziol et al.: https://arxiv.org/abs/1803.05162 # These are values by Z. Koziol et al.: https://arxiv.org/abs/1803.05162
C C 14.558 21.204 1.8 3.198 4.16 -0.862 0.10049 0.6 0.4 1.0 C1 C1 14.558 21.204 1.8 3.198 4.16 -0.862 0.10049 0.6 0.4 1.0

View File

@ -89,9 +89,7 @@ void ComputeTempDrude::dof_compute()
int dim = domain->dimension; int dim = domain->dimension;
int *drudetype = fix_drude->drudetype; int *drudetype = fix_drude->drudetype;
fix_dof = 0; adjust_dof_fix();
for (int i = 0; i < modify->nfix; i++)
fix_dof += modify->fix[i]->dof(igroup);
bigint dof_core_loc = 0, dof_drude_loc = 0; bigint dof_core_loc = 0, dof_drude_loc = 0;
for (int i = 0; i < nlocal; i++) { for (int i = 0; i < nlocal; i++) {

View File

@ -35,7 +35,6 @@ class ComputeTempDrude : public Compute {
int modify_param(int, char **); int modify_param(int, char **);
private: private:
int fix_dof;
class FixDrude *fix_drude; class FixDrude *fix_drude;
char *id_temp; char *id_temp;
class Compute *temperature; class Compute *temperature;

View File

@ -43,7 +43,6 @@ class ComputeTempRotate : public Compute {
double memory_usage(); double memory_usage();
private: private:
int fix_dof;
double tfactor, masstotal; double tfactor, masstotal;
double **vbiasall; // stored velocity bias for all atoms double **vbiasall; // stored velocity bias for all atoms
int maxbias; // size of vbiasall array int maxbias; // size of vbiasall array

View File

@ -115,6 +115,7 @@ void AtomVecSMD::grow_pointers()
vfrac = atom->vfrac; vfrac = atom->vfrac;
rmass = atom->rmass; rmass = atom->rmass;
x0 = atom->x0; x0 = atom->x0;
x = atom->x;
radius = atom->radius; radius = atom->radius;
contact_radius = atom->contact_radius; contact_radius = atom->contact_radius;
molecule = atom->molecule; molecule = atom->molecule;
@ -129,13 +130,11 @@ void AtomVecSMD::grow_pointers()
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
clear extra forces starting at atom N clear extra forces starting at atom N
nbytes = # of bytes to clear for a per-atom vector nbytes = # of bytes to clear for a per-atom vector
NOTE: does f need to be re-cleared?
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void AtomVecSMD::force_clear(int n, size_t nbytes) void AtomVecSMD::force_clear(int n, size_t nbytes)
{ {
memset(&desph[n],0,nbytes); memset(&desph[n],0,nbytes);
memset(&f[n][0],0,3*nbytes);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -53,7 +53,7 @@ ComputeSMDTriangleVertices::ComputeSMDTriangleVertices(LAMMPS *lmp, int narg, ch
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
ComputeSMDTriangleVertices::~ComputeSMDTriangleVertices() { ComputeSMDTriangleVertices::~ComputeSMDTriangleVertices() {
memory->sfree(outputVector); memory->destroy(outputVector);
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -85,7 +85,8 @@ PairULSPH::PairULSPH(LAMMPS *lmp) :
PairULSPH::~PairULSPH() { PairULSPH::~PairULSPH() {
if (allocated) { if (allocated) {
//printf("... deallocating\n"); memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(Q1); memory->destroy(Q1);
memory->destroy(rho0); memory->destroy(rho0);
memory->destroy(eos); memory->destroy(eos);

View File

@ -569,10 +569,12 @@ void FixDeposit::pre_exchange()
// coord is new position of geometric center of mol, not COM // coord is new position of geometric center of mol, not COM
// FixShake::set_molecule stores shake info for molecule // FixShake::set_molecule stores shake info for molecule
if (rigidflag) if (mode == MOLECULE) {
fixrigid->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat); if (rigidflag)
else if (shakeflag) fixrigid->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);
fixshake->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat); else if (shakeflag)
fixshake->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);
}
success = 1; success = 1;
break; break;

View File

@ -54,7 +54,7 @@ void Verlet::init()
bool do_time_integrate = false; bool do_time_integrate = false;
for (const auto &fix : modify->get_fix_list()) for (const auto &fix : modify->get_fix_list())
if (fix->time_integrate) do_time_integrate; if (fix->time_integrate) do_time_integrate = true;
if (!do_time_integrate && (comm->me == 0)) if (!do_time_integrate && (comm->me == 0))
error->warning(FLERR,"No fixes with time integration, atoms won't move"); error->warning(FLERR,"No fixes with time integration, atoms won't move");

View File

@ -0,0 +1 @@
../../unittest/.clang-format

View File

@ -10,8 +10,8 @@
#include "utils.h" #include "utils.h"
#include <cstring> #include <cstring>
#include <iostream>
#include <fstream> #include <fstream>
#include <iostream>
#include <string> #include <string>
#include <vector> #include <vector>
@ -33,9 +33,9 @@
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
void *lmp = nullptr; void *lmp = nullptr;
char *omp_threads = nullptr; char *omp_threads = nullptr;
constexpr int BUFLEN = 512; constexpr int BUFLEN = 512;
char buf[BUFLEN]; char buf[BUFLEN];
enum { enum {
@ -342,14 +342,13 @@ static char *plugin_generator(const char *text, int state)
{ {
const char *subcmd[] = {"load", "unload", "list", "clear", nullptr}; const char *subcmd[] = {"load", "unload", "list", "clear", nullptr};
const char *sub; const char *sub;
static std::size_t idx=0, len; static std::size_t idx = 0, len;
if (!state) idx = 0; if (!state) idx = 0;
len = strlen(text); len = strlen(text);
while ((sub = subcmd[idx]) != nullptr) { while ((sub = subcmd[idx]) != nullptr) {
++idx; ++idx;
if (strncmp(text,sub,len) == 0) if (strncmp(text, sub, len) == 0) return dupstring(sub);
return dupstring(sub);
} }
return nullptr; return nullptr;
} }
@ -358,13 +357,12 @@ static char *plugin_style_generator(const char *text, int state)
{ {
const char *styles[] = {"pair", "fix", "command", nullptr}; const char *styles[] = {"pair", "fix", "command", nullptr};
const char *s; const char *s;
static std::size_t idx=0, len; static std::size_t idx = 0, len;
if (!state) idx = 0; if (!state) idx = 0;
len = strlen(text); len = strlen(text);
while ((s = styles[idx]) != nullptr) { while ((s = styles[idx]) != nullptr) {
++idx; ++idx;
if (strncmp(text,s,len) == 0) if (strncmp(text, s, len) == 0) return dupstring(s);
return dupstring(s);
} }
return nullptr; return nullptr;
} }
@ -376,7 +374,7 @@ static char *plugin_name_generator(const char *text, int state)
static std::size_t idx, len, nmax; static std::size_t idx, len, nmax;
if (!state) idx = 0; if (!state) idx = 0;
len = words[3].size(); len = words[3].size();
nmax = lammps_plugin_count(); nmax = lammps_plugin_count();
while (idx < nmax) { while (idx < nmax) {
@ -384,8 +382,7 @@ static char *plugin_name_generator(const char *text, int state)
lammps_plugin_name(idx, style, name, BUFLEN); lammps_plugin_name(idx, style, name, BUFLEN);
++idx; ++idx;
if (words[2] == style) { if (words[2] == style) {
if (strncmp(name, words[3].c_str(), len) == 0) if (strncmp(name, words[3].c_str(), len) == 0) return dupstring(name);
return dupstring(name);
} }
} }
return nullptr; return nullptr;
@ -527,13 +524,11 @@ static char **cmd_completion(const char *text, int start, int)
} else if (words.size() == 2) { // expand third word } else if (words.size() == 2) { // expand third word
// these commands have a group name as 3rd word // these commands have a group name as 3rd word
if ((words[0] == "fix") if ((words[0] == "fix") || (words[0] == "compute") || (words[0] == "dump")) {
|| (words[0] == "compute")
|| (words[0] == "dump")) {
matches = rl_completion_matches(text, group_generator); matches = rl_completion_matches(text, group_generator);
} else if (words[0] == "region") { } else if (words[0] == "region") {
matches = rl_completion_matches(text, region_generator); matches = rl_completion_matches(text, region_generator);
// plugin style is the third word // plugin style is the third word
} else if ((words[0] == "plugin") && (words[1] == "unload")) { } else if ((words[0] == "plugin") && (words[1] == "unload")) {
matches = rl_completion_matches(text, plugin_style_generator); matches = rl_completion_matches(text, plugin_style_generator);
} }
@ -546,7 +541,7 @@ static char **cmd_completion(const char *text, int start, int)
matches = rl_completion_matches(text, compute_generator); matches = rl_completion_matches(text, compute_generator);
} else if (words[0] == "dump") { } else if (words[0] == "dump") {
matches = rl_completion_matches(text, dump_generator); matches = rl_completion_matches(text, dump_generator);
// plugin name is the fourth word // plugin name is the fourth word
} else if ((words[0] == "plugin") && (words[1] == "unload")) { } else if ((words[0] == "plugin") && (words[1] == "unload")) {
matches = rl_completion_matches(rl_line_buffer, plugin_name_generator); matches = rl_completion_matches(rl_line_buffer, plugin_name_generator);
} }
@ -599,7 +594,7 @@ static void init_commands()
// read saved history, but not in test mode. // read saved history, but not in test mode.
if (!test_mode) read_history(".lammps_history"); if (!test_mode) read_history(".lammps_history");
// intercept CTRL-C // intercept CTRL-C
#if defined(_WIN32) #if defined(_WIN32)
SetConsoleCtrlHandler(ctrl_c_handler, TRUE); SetConsoleCtrlHandler(ctrl_c_handler, TRUE);
#else #else
@ -736,7 +731,7 @@ int main(int argc, char **argv)
// switch to the user's documents directory. // switch to the user's documents directory.
auto curdir = platform::current_directory(); auto curdir = platform::current_directory();
if (utils::strmatch(curdir,"[Ss]ystem32")) { if (utils::strmatch(curdir, "[Ss]ystem32")) {
std::string docdir = getenv("HOMEDRIVE"); std::string docdir = getenv("HOMEDRIVE");
docdir += getenv("HOMEPATH"); docdir += getenv("HOMEPATH");
docdir += "\\Documents"; docdir += "\\Documents";

View File

@ -54,6 +54,10 @@ if(BUILD_MPI)
set(MPI_TEST_NUM_PROCS 1) set(MPI_TEST_NUM_PROCS 1)
set(MPI_TEST_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set(MPI_TEST_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
cmake_parse_arguments(MPI_TEST "" "NAME;NUM_PROCS;WORKING_DIRECTORY" "COMMAND" ${ARGN}) cmake_parse_arguments(MPI_TEST "" "NAME;NUM_PROCS;WORKING_DIRECTORY" "COMMAND" ${ARGN})
# Do not add test when oversubscribing
if(MPI_TEST_NUMPROCS GREATER MPIEXEC_MAX_NUMPROCS)
return()
endif()
list(GET MPI_TEST_COMMAND 0 EXECUTABLE) list(GET MPI_TEST_COMMAND 0 EXECUTABLE)
list(REMOVE_AT MPI_TEST_COMMAND 0) list(REMOVE_AT MPI_TEST_COMMAND 0)
set(ARGS ${MPI_TEST_COMMAND}) set(ARGS ${MPI_TEST_COMMAND})

View File

@ -246,7 +246,7 @@ TEST_F(GroupTest, Molecular)
ASSERT_DOUBLE_EQ(group->mass(group->find("half")), 40); ASSERT_DOUBLE_EQ(group->mass(group->find("half")), 40);
ASSERT_DOUBLE_EQ(group->mass(group->find("half"), domain->find_region("top")), 10); ASSERT_DOUBLE_EQ(group->mass(group->find("half"), domain->find_region("top")), 10);
ASSERT_NEAR(group->charge(group->find("top")), 0, 1.0e-14); ASSERT_NEAR(group->charge(group->find("top")), 0, 1.0e-14);
ASSERT_DOUBLE_EQ(group->charge(group->find("right"), domain->find_region("top")), 0); ASSERT_NEAR(group->charge(group->find("right"), domain->find_region("top")), 0, 1.0e-14);
TEST_FAILURE(".*ERROR: Illegal group command.*", command("group three include xxx");); TEST_FAILURE(".*ERROR: Illegal group command.*", command("group three include xxx"););
} }

View File

@ -14,7 +14,7 @@ post_commands: ! ""
input_file: in.bilayer input_file: in.bilayer
pair_style: hybrid/overlay lebedeva/z 16.0 pair_style: hybrid/overlay lebedeva/z 16.0
pair_coeff: ! | pair_coeff: ! |
* * lebedeva/z CC.Lebedeva C C C * * lebedeva/z CC.Lebedeva C1 C1 C1
extract: ! "" extract: ! ""
natoms: 48 natoms: 48
init_vdwl: 2360.887727742073 init_vdwl: 2360.887727742073