diff --git a/cmake/Modules/Documentation.cmake b/cmake/Modules/Documentation.cmake index 1381e4fef0..282253eede 100644 --- a/cmake/Modules/Documentation.cmake +++ b/cmake/Modules/Documentation.cmake @@ -29,8 +29,8 @@ if(BUILD_DOC) OUTPUT requirements.txt DEPENDS docenv COMMAND ${CMAKE_COMMAND} -E copy ${LAMMPS_DOC_DIR}/utils/requirements.txt requirements.txt - COMMAND ${DOCENV_BINARY_DIR}/pip install -r requirements.txt --upgrade COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade ${LAMMPS_DOC_DIR}/utils/converters + COMMAND ${DOCENV_BINARY_DIR}/pip install --use-feature=2020-resolver -r requirements.txt --upgrade ) # download mathjax distribution and unpack to folder "mathjax" diff --git a/doc/Makefile b/doc/Makefile index bf70e5d602..293884b17f 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -194,7 +194,7 @@ $(VENV): $(VIRTUALENV) -p $(PYTHON) $(VENV); \ . $(VENV)/bin/activate; \ pip install --upgrade pip; \ - pip install -r requirements.txt; \ + pip install --use-feature=2020-resolver -r requirements.txt; \ deactivate;\ ) diff --git a/doc/src/Build_development.rst b/doc/src/Build_development.rst index 1569723357..5af264f29d 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -159,8 +159,8 @@ A test run is then a a collection multiple individual test runs each with many comparisons to reference results based on template input files, individual command settings, relative error margins, and reference data stored in a YAML format file with ``.yaml`` -suffix. Currently the programs ``pair_style``, ``bond_style``, and -``angle_style`` are implemented. They will compare forces, energies and +suffix. Currently the programs ``test_pair_style``, ``test_bond_style``, and +``test_angle_style`` are implemented. They will compare forces, energies and (global) stress for all atoms after a ``run 0`` calculation and after a few steps of MD with :doc:`fix nve `, each in multiple variants with different settings and also for multiple accelerated styles. If a @@ -172,7 +172,7 @@ Below is an example command and output: .. parsed-literal:: - [tests]$ pair_style mol-pair-lj_cut.yaml + [tests]$ test_pair_style mol-pair-lj_cut.yaml [==========] Running 6 tests from 1 test suite. [----------] Global test environment set-up. [----------] 6 tests from PairStyle @@ -259,13 +259,61 @@ and working. of mis-compiled code (or an undesired large loss of precision due to significant reordering of operations and thus less error cancellation). +Unit tests for timestepping related fixes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A substantial subset of :doc:`fix styles ` are invoked regularly +during MD timestepping and manipulate per-atom properties like +positions, velocities, and forces. For those fix styles, testing can be +done in a very similar fashion as for force fields and thus there is a +test program `test_fix_timestep` that shares a lot of code, properties, +and command line flags with the force field style testers described in +the previous section. + +This tester will set up a small molecular system run with verlet run +style for 4 MD steps, then write a binary restart and continue for +another 4 MD steps. At this point coordinates and velocities are +recorded and compared to reference data. Then the system is cleared, +restarted and running the second 4 MD steps again and the data is +compared to the same reference. That is followed by another restart +after which per atom type masses are replaced with per-atom masses and +the second 4 MD steps are repeated again and compared to the same +reference. Also global scalar and vector data of the fix is recorded +and compared. If the fix is a thermostat and thus the internal property +``t_target`` can be extracted, then this is compared to the reference +data. The tests are repeated with the respa run style. + +If the fix has a multi-threaded version in the USER-OMP package, then +the entire set of tests is repeated for that version as well. + +For this to work, some additional conditions have to be met by the +YAML format test inputs. + +- The fix to be tested (and only this fix), should be listed in the + ``prerequisites:`` section +- The fix to be tested must be specified in the ``post_commands:`` + section with the fix-ID ``test``. This section may contain other + commands and other fixes (e.g. an instance of fix nve for testing + a thermostat or force manipulation fix) +- For fixes that can tally contributions to the global virial, the + line ``fix_modify test virial yes`` should be included in the + ``post_commands:`` section of the test input. +- For thermostat fixes the target temperature should be ramped from + an arbitrary value (e.g. 50K) to a pre-defined target temperature + entered as ``${t_target}``. +- For fixes that have thermostatting support included, but do not + have it enabled in the input (e.g. fix rigid with default settings), + the ``post_commands:`` section should contain the line + ``variable t_target delete`` to disable the target temperature ramp + check to avoid false positives. + Use custom linker for faster link times when ENABLE_TESTING is active ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When compiling LAMMPS with enabled tests, most test executables will -need to be linked against the LAMMPS library. Since this can be a -large with many C++ objects when many packages are enabled, link times -can become very long on machines that use the GNU BFD linker (e.g. +need to be linked against the LAMMPS library. Since this can be a very +large library with many C++ objects when many packages are enabled, link +times can become very long on machines that use the GNU BFD linker (e.g. Linux systems). Alternatives like the ``lld`` linker of the LLVM project or the ``gold`` linker available with GNU binutils can speed up this step substantially. CMake will by default test if any of the two can be diff --git a/doc/src/Commands_bond.rst b/doc/src/Commands_bond.rst index 0cb1b723b8..dd56938773 100644 --- a/doc/src/Commands_bond.rst +++ b/doc/src/Commands_bond.rst @@ -46,6 +46,7 @@ OPT. * :doc:`oxdna2/fene ` * :doc:`oxrna2/fene ` * :doc:`quartic (o) ` + * :doc:`special ` * :doc:`table (o) ` .. _angle: diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst new file mode 100644 index 0000000000..f7dc43a1b2 --- /dev/null +++ b/doc/src/bond_special.rst @@ -0,0 +1,106 @@ +.. index:: bond_style special + +bond_style special command +================================= + +Syntax +"""""" + + +.. code-block:: LAMMPS + + bond_style special + +Examples +"""""""" + + +.. code-block:: LAMMPS + + bond_style special + bond_coeff 0.5 0.5 + +Description +""""""""""" + +The *special* bond style can be used to create conceptual bonds which +effectively impose weightings on the pairwise Lennard Jones and/or +Coulombic interactions between selected pairs of particles in the +system. The form of the pairwise interaction will be whatever is +computed by the :doc:`pair_style ` command defined for the +system; this command defines the weightings for its two terms. + +This command can thus be useful to apply weightings that cannot be +handled by the :doc:`special_bonds ` command, such as +on 1-5 or 1-6 interactions. Or it can be used to add pairwise forces +between one or more pairs of atoms that otherwise would not be include +in the :doc:`pair_style ` computation. + +The potential for this bond style has the form + +.. math:: + + E = w_{LJ} E_{LJ} + w_{Coul} E_{Coul} + +The following coefficients must be defined for each bond type via the +:doc:`bond_coeff ` command as in the example above, or in +the data file or restart files read by the :doc:`read_data ` +or :doc:`read_restart ` commands: + +* :math:`w_{LJ}` weight (0.0 to 1.0) on pairwise Lennard-Jones interactions + +* :math:`w_{Coul}` weight (0.0 to 1.0) on pairwise Coulombic interactions + +---------- + +Normally this bond style should be used in conjunction with one (or +more) other bond styles which compute forces between atoms directly +bonded to each other in a molecule. This means the :doc:`bond_style +hybrid ` command should be used with bond_style special +as one of its sub-styles. + +Note that the same as for any other bond style, pairs of bonded atoms +must be enumerated in the data file read by the :doc:`read_data +` command. Thus if this command is used to weight all 1-5 +interactions in the system, all the 1-5 pairs of atoms must be listed +in the "Bonds" section of the data file. + +This bond style imposes strict requirements on settings made with the +:doc:`special_bonds ` command. These requirements +ensure that the new bonds created by this style do not create spurious +1-2, 1-3, or 1-4 interactions within the molecular topology. + +Specifically 1-2 interactions must have weights of zero, 1-3 +interactions must either have weights of unity or :doc:`special_bonds +angle yes ` must be used, and 1-4 interactions must +have weights of unity or :doc:`special_bonds dihedral yes ` +must be used. + +If this command is used to create bonded interactions between +particles that are further apart than usual (e.g. 1-5 or 1-6 +interactions), this style may require an increase in the communication +cutoff via the :doc:`comm_modify cutoff ` command. If +LAMMPS cannot find a partner atom in a bond, an error will be issued. + +Restrictions +"""""""""""" + +This bond style can only be used if LAMMPS was built with the +USER-MISC package. See the :doc:`Build package ` doc +page for more info. + +This bond style requires the use of a :doc:`pair_style ` which +computes a pairwise additive interaction and provides the ability to +compute interactions for individual pairs of atoms. Manybody potentials +are not compatible in general, but also some other pair styles are missing +the required functionality and thus will cause an error. + +This command is not compatible with long-range Coulombic interactions. If a +`kspace_style ` is declared, an error will be issued. + +Related commands +"""""""""""""""" + +:doc:`bond_coeff `, :doc:`special_bonds ` + +**Default:** none diff --git a/doc/src/fix_temp_berendsen.rst b/doc/src/fix_temp_berendsen.rst index 2774075827..e837a21847 100644 --- a/doc/src/fix_temp_berendsen.rst +++ b/doc/src/fix_temp_berendsen.rst @@ -119,7 +119,11 @@ thermal degrees of freedom, and the bias is added back in. **Restart, fix_modify, output, run start/stop, minimize info:** -No information about this fix is written to :doc:`binary restart files `. +This fix writes the cumulative global energy change to +:doc:`binary restart files `. See the +:doc:`read_restart ` command for info on how to +re-specify a fix in an input script that reads a restart file, +so that the fix continues in an uninterrupted fashion. The :doc:`fix_modify ` *temp* option is supported by this fix. You can use it to assign a temperature :doc:`compute ` diff --git a/doc/src/fix_temp_csvr.rst b/doc/src/fix_temp_csvr.rst index d8a8d3135a..9c3a722be1 100644 --- a/doc/src/fix_temp_csvr.rst +++ b/doc/src/fix_temp_csvr.rst @@ -127,6 +127,14 @@ thermal degrees of freedom, and the bias is added back in. **Restart, fix_modify, output, run start/stop, minimize info:** +These fixes write the cumulative global energy change and the +random number generator states to :doc:`binary restart files `. +See the :doc:`read_restart ` command for info on how to +re-specify a fix in an input script that reads a restart file, +so that the selected fix continues in an uninterrupted fashion. The +random number generator state can only be restored when the number +of processors remains unchanged from what is recorded in the restart file. + No information about these fixes are written to :doc:`binary restart files `. The :doc:`fix_modify ` *temp* option is supported by these diff --git a/doc/src/lattice.rst b/doc/src/lattice.rst index 693d0cd84a..da4e0b7e5e 100644 --- a/doc/src/lattice.rst +++ b/doc/src/lattice.rst @@ -260,25 +260,21 @@ of Aidan Thompson), with its 8 atom unit cell. variable b equal $a*sqrt(3.0) variable c equal $a*sqrt(8.0/3.0) - variable 1_3 equal 1.0/3.0 - variable 2_3 equal 2.0/3.0 - variable 1_6 equal 1.0/6.0 - variable 5_6 equal 5.0/6.0 - variable 1_12 equal 1.0/12.0 - variable 5_12 equal 5.0/12.0 + variable third equal 1.0/3.0 + variable five6 equal 5.0/6.0 lattice custom 1.0 & - a1 $a 0.0 0.0 & - a2 0.0 $b 0.0 & - a3 0.0 0.0 $c & - basis 0.0 0.0 0.0 & - basis 0.5 0.5 0.0 & - basis ${1_3} 0.0 0.5 & - basis ${5_6} 0.5 0.5 & - basis 0.0 0.0 0.625 & - basis 0.5 0.5 0.625 & - basis ${1_3} 0.0 0.125 & - basis ${5_6} 0.5 0.125 + a1 $a 0.0 0.0 & + a2 0.0 $b 0.0 & + a3 0.0 0.0 $c & + basis 0.0 0.0 0.0 & + basis 0.5 0.5 0.0 & + basis ${third} 0.0 0.5 & + basis ${five6} 0.5 0.5 & + basis 0.0 0.0 0.625 & + basis 0.5 0.5 0.625 & + basis ${third} 0.0 0.125 & + basis ${five6} 0.5 0.125 region myreg block 0 1 0 1 0 1 create_box 2 myreg diff --git a/doc/src/pair_fep_soft.rst b/doc/src/pair_fep_soft.rst index eafd6b5e9b..fb10039e44 100644 --- a/doc/src/pair_fep_soft.rst +++ b/doc/src/pair_fep_soft.rst @@ -161,11 +161,11 @@ Examples pair_style coul/long/soft 1.0 10.0 9.5 pair_coeff * * 1.0 - pair_coeff 1 1 1.0 9.5 + pair_coeff 1 1 1.0 pair_style tip4p/long/soft 1 2 7 8 0.15 2.0 0.5 10.0 9.8 pair_coeff * * 1.0 - pair_coeff 1 1 1.0 9.5 + pair_coeff 1 1 1.0 pair_style morse/soft 4 0.9 10.0 pair_coeff * * 100.0 2.0 1.5 1.0 @@ -284,7 +284,9 @@ core. Hence, if used by themselves, there will be no repulsion to keep two oppositely charged particles from overlapping each other. In this case, if :math:`\lambda = 1`, a singularity may occur. These sub-styles are suitable to represent charges embedded in the Lennard-Jones radius of another site (for -example hydrogen atoms in several water models). +example hydrogen atoms in several water models). The :math:`\lambda` must +be defined for each pair, and *coul/cut/soft* can accept an optional cutoff as +the second coefficient. .. note:: diff --git a/doc/src/pair_table.rst b/doc/src/pair_table.rst index 09e8134b96..4856bac815 100644 --- a/doc/src/pair_table.rst +++ b/doc/src/pair_table.rst @@ -60,7 +60,7 @@ For the *linear* style, the distance *R* is used to find the 2 surrounding table values from which an energy or force is computed by linear interpolation. -For the *spline* style, a cubic spline coefficients are computed and +For the *spline* style, cubic spline coefficients are computed and stored for each of the *N* values in the table, one set of splines for energy, another for force. Note that these splines are different than the ones used to pre-compute the *N* values. Those splines were fit diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index c856b8ff5f..80a121c035 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -1541,6 +1541,7 @@ int FixWallGran::pack_restart(int i, double *buf) if (!use_history) return 0; int n = 0; + // pack buf[0] this way because other fixes unpack it buf[n++] = size_history + 1; for (int m = 0; m < size_history; m++) buf[n++] = history_one[i][m]; @@ -1558,7 +1559,8 @@ void FixWallGran::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + // unpack the Nth first values this way because other fixes pack them + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 7ccd90ebf8..6953165af6 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -479,6 +479,7 @@ int FixWallGranRegion::pack_restart(int i, double *buf) for (m = 0; m < size_history; m++) buf[n++] = history_many[i][iwall][m]; } + // pack buf[0] this way because other fixes unpack it buf[0] = n; return n; } @@ -496,7 +497,8 @@ void FixWallGranRegion::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + // unpack the Nth first values this way because other fixes pack them + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 390005d80e..9ea6739c8e 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -689,7 +689,7 @@ void PairLJCharmmCoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -718,7 +718,7 @@ void PairLJCharmmCoulLong::init_style() // set & error check interior rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) { cut_respa = ((Respa *) update->integrate)->cutoff; cut_in_off = cut_respa[0]; diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index ff20dc2570..578e5be30c 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -545,10 +545,7 @@ void PairLJCutCoulLong::compute_outer(int eflag, int vflag) } } else forcecoul = 0.0; - if (rsq <= cut_in_off_sq) { - r6inv = r2inv*r2inv*r2inv; - forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); - } else if (rsq <= cut_in_on_sq) { + if (rsq < cut_ljsq[itype][jtype]) { r6inv = r2inv*r2inv*r2inv; forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); } @@ -659,7 +656,7 @@ void PairLJCutCoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -676,7 +673,7 @@ void PairLJCutCoulLong::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index 380c038e4a..ab601ae8cb 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -547,6 +547,7 @@ int FixGLD::unpack_exchange(int nlocal, double *buf) int FixGLD::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way because other fixes unpack it buf[m++] = 3*prony_terms + 1; for (int k = 0; k < 3*prony_terms; k=k+3) { @@ -566,7 +567,8 @@ void FixGLD::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to the nth set of extended variables - + // unpack the Nth first values this way because other fixes pack them + int m = 0; for (int i = 0; i< nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index e79f7616d9..529914ec34 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -656,6 +656,7 @@ void FixTTM::restart(char *buf) int FixTTM::pack_restart(int i, double *buf) { + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = flangevin[i][0]; buf[2] = flangevin[i][1]; @@ -672,7 +673,8 @@ void FixTTM::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + // unpack the Nth first values this way because other fixes pack them + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index 6fbf82e4cc..d3b071ebc6 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -1041,7 +1041,7 @@ void FixCMAP::read_data_header(char *line) sscanf(line,BIGINT_FORMAT,&ncmap); } else error->all(FLERR,"Invalid read data header line for fix cmap"); - // didn't set in constructor b/c this fix could be defined + // didn't set in constructor because this fix could be defined // before newton command newton_bond = force->newton_bond; @@ -1291,6 +1291,7 @@ int FixCMAP::pack_restart(int i, double *buf) buf[n++] = ubuf(crossterm_atom4[i][m]).d; buf[n++] = ubuf(crossterm_atom5[i][m]).d; } + // pack buf[0] this way because other fixes unpack it buf[0] = n; return n; @@ -1305,7 +1306,8 @@ void FixCMAP::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + // unpack the Nth first values this way because other fixes pack them + int n = 0; for (int i = 0; i < nth; i++) n += static_cast (extra[nlocal][n]); diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 70f46dcdc1..022eb0bab6 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -579,6 +579,7 @@ void FixPeriNeigh::restart(char *buf) int FixPeriNeigh::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way b/c other fixes unpack it if (isVES) buf[m++] = 4*npartner[i] + 4; else if (isEPS) buf[m++] = 3*npartner[i] + 5; else buf[m++] = 2*npartner[i] + 4; @@ -608,6 +609,7 @@ void FixPeriNeigh::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp index f20d351d1c..81c1599508 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp @@ -691,38 +691,20 @@ void PairLJCharmmCoulLongSoft::init_style() // request regular or rRESPA neighbor lists int irequest; + int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { - int respa = 0; - if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; - if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { + if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; + if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + } - if (respa == 0) irequest = neighbor->request(this,instance_me); - else if (respa == 1) { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } else { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respamiddle = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } + irequest = neighbor->request(this,instance_me); - } else irequest = neighbor->request(this,instance_me); + if (respa >= 1) { + neighbor->requests[irequest]->respaouter = 1; + neighbor->requests[irequest]->respainner = 1; + } + if (respa == 2) neighbor->requests[irequest]->respamiddle = 1; // require cut_lj_inner < cut_lj @@ -739,7 +721,7 @@ void PairLJCharmmCoulLongSoft::init_style() // set & error check interior rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) { cut_respa = ((Respa *) update->integrate)->cutoff; if (MIN(cut_lj,cut_coul) < cut_respa[3]) diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index cf80a3e405..c22b2ca673 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -634,44 +634,26 @@ void PairLJCutCoulLongSoft::init_style() // request regular or rRESPA neighbor lists int irequest; + int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { - int respa = 0; + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + } - if (respa == 0) irequest = neighbor->request(this,instance_me); - else if (respa == 1) { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } else { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respamiddle = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } + irequest = neighbor->request(this,instance_me); - } else irequest = neighbor->request(this,instance_me); + if (respa >= 1) { + neighbor->requests[irequest]->respaouter = 1; + neighbor->requests[irequest]->respainner = 1; + } + if (respa == 2) neighbor->requests[irequest]->respamiddle = 1; cut_coulsq = cut_coul * cut_coul; // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 9d03b4e1e2..92abdf540a 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -512,46 +512,27 @@ void PairLJCutSoft::init_style() // request regular or rRESPA neighbor lists int irequest; + int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { - int respa = 0; + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + } - if (respa == 0) irequest = neighbor->request(this,instance_me); - else if (respa == 1) { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } else { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respamiddle = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } + irequest = neighbor->request(this,instance_me); - } else irequest = neighbor->request(this,instance_me); + if (respa >= 1) { + neighbor->requests[irequest]->respaouter = 1; + neighbor->requests[irequest]->respainner = 1; + } + if (respa == 2) neighbor->requests[irequest]->respamiddle = 1; // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; - } /* ---------------------------------------------------------------------- diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index 54123bf3cd..c727ea0c2a 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -333,6 +333,37 @@ void PairMorseSoft::read_restart(FILE *fp) } } +/* ---------------------------------------------------------------------- + proc 0 writes to restart file +------------------------------------------------------------------------- */ + +void PairMorseSoft::write_restart_settings(FILE *fp) +{ + fwrite(&nlambda,sizeof(double),1,fp); + fwrite(&shift_range,sizeof(double),1,fp); + fwrite(&cut_global,sizeof(double),1,fp); + fwrite(&offset_flag,sizeof(int),1,fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads from restart file, bcasts +------------------------------------------------------------------------- */ + +void PairMorseSoft::read_restart_settings(FILE *fp) +{ + int me = comm->me; + if (me == 0) { + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&shift_range,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); + } + MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); + MPI_Bcast(&shift_range,1,MPI_DOUBLE,0,world); + MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); + MPI_Bcast(&offset_flag,1,MPI_INT,0,world); +} + /* ---------------------------------------------------------------------- proc 0 writes to data file diff --git a/src/USER-FEP/pair_morse_soft.h b/src/USER-FEP/pair_morse_soft.h index 68ce71789c..f5be4de0b0 100644 --- a/src/USER-FEP/pair_morse_soft.h +++ b/src/USER-FEP/pair_morse_soft.h @@ -38,6 +38,8 @@ class PairMorseSoft : public PairMorse { virtual double init_one(int, int); virtual void write_restart(FILE *); virtual void read_restart(FILE *); + virtual void write_restart_settings(FILE *); + virtual void read_restart_settings(FILE *); void write_data(FILE *); void write_data_all(FILE *); diff --git a/src/USER-MISC/README b/src/USER-MISC/README index e10d4c7904..e085676711 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -26,6 +26,7 @@ angle_style dipole, Mario Orsi, orsimario at gmail.com, 10 Jan 12 angle_style quartic, Loukas Peristeras, loukas.peristeras at scienomics.com, 27 Oct 12 bond_style harmonic/shift, Carsten Svaneborg, science at zqex.dk, 8 Aug 11 bond_style harmonic/shift/cut, Carsten Svaneborg, science at zqex.dk, 8 Aug 11 +bond_style special, David Nicholson, davidanich at gmail.com, 31 Jan 2020 compute ackland/atom, Gerolf Ziegenhain, gerolf at ziegenhain.com, 4 Oct 2007 compute basal/atom, Christopher Barrett, cdb333 at cavs.msstate.edu, 3 Mar 2013 compute cnp/atom, Paulo Branicio (USC), branicio at usc.edu, 31 May 2017 diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp new file mode 100644 index 0000000000..6c734d482e --- /dev/null +++ b/src/USER-MISC/bond_special.cpp @@ -0,0 +1,222 @@ +/* ---------------------------------------------------------------------- + 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. + + Contributing Author: David Nicholson (MIT) +------------------------------------------------------------------------- */ + +#include +#include +#include +#include "bond_special.h" +#include "atom.h" +#include "neighbor.h" +#include "domain.h" +#include "comm.h" +#include "force.h" +#include "pair.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +BondSpecial::BondSpecial(LAMMPS *lmp) : Bond(lmp) {} + +/* ---------------------------------------------------------------------- */ + +BondSpecial::~BondSpecial() +{ + if (allocated) { + memory->destroy(setflag); + memory->destroy(factor_lj); + memory->destroy(factor_coul); + } +} + +/* ---------------------------------------------------------------------- */ + +void BondSpecial::init_style() +{ + if (force->pair == NULL) error->all(FLERR,"No pair style defined"); + else if ((force->pair->single_enable == 0) || force->pair->manybody_flag) + error->all(FLERR,"Pair style does not support bond style special"); + + if (force->special_lj[1] != 0.0 || force->special_coul[1] != 0) + error->all(FLERR,"Invalid 1-2 setting for bond style special."); + + if (force->special_angle != 1 && (force->special_lj[2] != 1.0 || + force->special_coul[2] != 1.0)) + error->all(FLERR,"Invalid 1-3 setting for bond style special."); + + if (force->special_dihedral != 1 && (force->special_lj[3] != 1.0 || + force->special_coul[3] != 1.0)) + error->all(FLERR,"Invalid 1-4 setting for bond style special."); + + if (force->kspace != NULL) + error->all(FLERR,"Bond style special is not compatible with long range " + "Coulombic interactions"); +} + +/* ---------------------------------------------------------------------- */ + +void BondSpecial::compute(int eflag, int vflag) +{ + int i1,i2,i1type,i2type,n,type; + double delx,dely,delz,ebond,fbond; + double rsq; + + ev_init(eflag,vflag); + + double **x = atom->x; + double **f = atom->f; + int **bondlist = neighbor->bondlist; + int nbondlist = neighbor->nbondlist; + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + + for (n = 0; n < nbondlist; n++) { + i1 = bondlist[n][0]; + i2 = bondlist[n][1]; + type = bondlist[n][2]; + + i1type = atom->type[i1]; + i2type = atom->type[i2]; + + delx = x[i1][0] - x[i2][0]; + dely = x[i1][1] - x[i2][1]; + delz = x[i1][2] - x[i2][2]; + + rsq = delx*delx + dely*dely + delz*delz; + + ebond = force->pair->single(i1,i2,i1type,i2type,rsq,factor_lj[type], + factor_coul[type],fbond); + + // apply force to each of 2 atoms + + if (newton_bond || i1 < nlocal) { + f[i1][0] += delx*fbond; + f[i1][1] += dely*fbond; + f[i1][2] += delz*fbond; + } + + if (newton_bond || i2 < nlocal) { + f[i2][0] -= delx*fbond; + f[i2][1] -= dely*fbond; + f[i2][2] -= delz*fbond; + } + + if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz); + } +} + +/* ---------------------------------------------------------------------- */ + +void BondSpecial::allocate() +{ + allocated = 1; + int n = atom->nbondtypes; + + memory->create(factor_lj,n+1,"bond:factor_lj"); + memory->create(factor_coul,n+1,"bond:factor_coul"); + + memory->create(setflag,n+1,"bond:setflag"); + for (int i = 1; i <= n; i++) setflag[i] = 0; +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more types +------------------------------------------------------------------------- */ + +void BondSpecial::coeff(int narg, char **arg) +{ + if (narg != 3) error->all(FLERR,"Incorrect args for bond coefficients"); + if (!allocated) allocate(); + + int ilo,ihi; + force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + + double factor_lj_one = force->numeric(FLERR,arg[1]); + double factor_coul_one = force->numeric(FLERR,arg[2]); + + int count = 0; + for (int i = ilo; i <= ihi; i++) { + factor_lj[i] = factor_lj_one; + factor_coul[i] = factor_coul_one; + setflag[i] = 1; + count++; + } + + if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients"); +} + +/* ---------------------------------------------------------------------- + return an equilbrium bond length +------------------------------------------------------------------------- */ + +double BondSpecial::equilibrium_distance(int i) +{ + return 0.; +} + +/* ---------------------------------------------------------------------- + proc 0 writes out coeffs to restart file +------------------------------------------------------------------------- */ + +void BondSpecial::write_restart(FILE *fp) +{ + fwrite(&factor_lj[1],sizeof(double),atom->nbondtypes,fp); + fwrite(&factor_coul[1],sizeof(double),atom->nbondtypes,fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads coeffs from restart file, bcasts them +------------------------------------------------------------------------- */ + +void BondSpecial::read_restart(FILE *fp) +{ + allocate(); + + if (comm->me == 0) { + fread(&factor_lj[1],sizeof(double),atom->nbondtypes,fp); + fread(&factor_coul[1],sizeof(double),atom->nbondtypes,fp); + } + MPI_Bcast(&factor_lj[1],atom->nbondtypes,MPI_DOUBLE,0,world); + MPI_Bcast(&factor_coul[1],atom->nbondtypes,MPI_DOUBLE,0,world); + + for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; +} + +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondSpecial::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp,"%d %g %g\n",i,factor_lj[i],factor_coul[i]); +} + +/* ---------------------------------------------------------------------- */ + +double BondSpecial::single(int type, double rsq, int i, int j, + double &fforce) +{ + int itype = atom->type[i]; + int jtype = atom->type[j]; + double ebond; + ebond = force->pair->single(i,j,itype,jtype,rsq,factor_lj[type], + factor_coul[type],fforce); + return ebond; +} + + diff --git a/src/USER-MISC/bond_special.h b/src/USER-MISC/bond_special.h new file mode 100644 index 0000000000..389990b1d7 --- /dev/null +++ b/src/USER-MISC/bond_special.h @@ -0,0 +1,78 @@ +/* -*- 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. + + Contributing Author: David Nicholson (MIT) +------------------------------------------------------------------------- */ + +#ifdef BOND_CLASS + +BondStyle(special,BondSpecial) + +#else + +#ifndef LMP_BOND_SPECIAL_H +#define LMP_BOND_SPECIAL_H + +#include +#include "bond.h" + +namespace LAMMPS_NS { + +class BondSpecial: public Bond { + public: + BondSpecial(class LAMMPS *); + virtual ~BondSpecial(); + void init_style(); + void compute(int, int); + void coeff(int, char **); + double equilibrium_distance(int); + void write_restart(FILE *); + void read_restart(FILE *); + void write_data(FILE *); + double single(int, double, int, int, double &); + + protected: + double *factor_lj,*factor_coul; + + void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Incorrect args for bond coefficients + +Self-explanatory. Check the input script or data file. + +E: Invalid 1-2 setting for bond style special. + +Bond style special must be used with zero factors for 1-2 special bonds. + +E: Invalid 1-3 setting for bond style special. + +Bond style special must be used with 1.0 factors for 1-3 special bonds or the +angle keyword set to yes. + +E: Invalid 1-4 setting for bond style special. + +Bond style special must be used with 1.0 factors for 1-4 special bonds or the +dihedral keyword set to yes. + +E: Bond style special is not compatible with long range Coulombic interactions. + +Self-explanatory. + +*/ diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index a1cf1ac2e9..8459ddf29b 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -822,6 +822,7 @@ int FixGLE::unpack_exchange(int nlocal, double *buf) int FixGLE::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way because other fixes unpack it buf[m++] = 3*ns + 1; for (int k = 0; k < 3*ns; k=k+3) { @@ -841,7 +842,8 @@ void FixGLE::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to the nth set of extended variables - + // unpack the Nth first values this way because other fixes pack them + int m = 0; for (int i = 0; i< nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp index c73f802362..8de31f19b3 100644 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -794,6 +794,7 @@ int FixPIMD::pack_restart(int i, double *buf) { int offset=0; int pos = i * 3; + // pack buf[0] this way because other fixes unpack it buf[offset++] = size_peratom_cols+1; memcpy(buf+offset, nhc_eta[pos], nhc_size_one_1); offset += nhc_offset_one_1; @@ -811,6 +812,7 @@ void FixPIMD::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i=0; i (extra[nlocal][m]); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index 2a96555fd7..131fd7d27a 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -114,7 +114,7 @@ void FixSRP::init() error->all(FLERR,"Illegal bond particle type"); // this fix must come before any fix which migrates atoms in its pre_exchange() - // b/c this fix's pre_exchange() creates per-atom data structure + // because this fix's pre_exchange() creates per-atom data structure // that data must be current for atom migration to carry it along for (int i = 0; i < modify->nfix; i++) { @@ -555,6 +555,7 @@ void FixSRP::post_run() int FixSRP::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way because other fixes unpack it buf[m++] = 3; buf[m++] = array[i][0]; buf[m++] = array[i][1]; @@ -569,10 +570,12 @@ void FixSRP::unpack_restart(int nlocal, int nth) { double **extra = atom->extra; -// skip to Nth set of extra values + // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them + int m = 0; for (int i = 0; i < nth; i++){ - m += extra[nlocal][m]; + m += static_cast (extra[nlocal][m]); } m++; diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 8481b34a6b..1f7c84b746 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -315,6 +315,7 @@ int FixTISpring::unpack_exchange(int nlocal, double *buf) int FixTISpring::pack_restart(int i, double *buf) { + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; @@ -331,6 +332,7 @@ void FixTISpring::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index cd3fbaa721..aaeab5989a 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -980,6 +980,7 @@ void FixTTMMod::restart(char *buf) int FixTTMMod::pack_restart(int i, double *buf) { + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = flangevin[i][0]; buf[2] = flangevin[i][1]; @@ -996,6 +997,7 @@ void FixTTMMod::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-MISC/pair_e3b.cpp b/src/USER-MISC/pair_e3b.cpp index 46f22e714d..420e2135bd 100644 --- a/src/USER-MISC/pair_e3b.cpp +++ b/src/USER-MISC/pair_e3b.cpp @@ -382,8 +382,6 @@ void PairE3B::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); typeO=force->inumeric(FLERR,arg[0]); - if (typeO<1 || typeO>atom->ntypes) - error->all(FLERR,"Invalid Otype: out of bounds"); } /* ---------------------------------------------------------------------- @@ -477,6 +475,8 @@ void PairE3B::init_style() error->all(FLERR,"Pair style E3B requires atom IDs"); if (force->newton_pair == 0) error->all(FLERR,"Pair style E3B requires newton pair on"); + if (typeO<1 || typeO>atom->ntypes) + error->all(FLERR,"Invalid Otype: out of bounds"); // need a half neighbor list neighbor->request(this,instance_me); diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp index cfb64bb31e..288160459a 100644 --- a/src/USER-MISC/pair_edip.cpp +++ b/src/USER-MISC/pair_edip.cpp @@ -51,7 +51,13 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -PairEDIP::PairEDIP(LAMMPS *lmp) : Pair(lmp) +PairEDIP::PairEDIP(LAMMPS *lmp) : + Pair(lmp), preInvR_ij(NULL), preExp3B_ij(NULL), preExp3BDerived_ij(NULL), + preExp2B_ij(NULL), preExp2BDerived_ij(NULL), prePow2B_ij(NULL), + preForceCoord(NULL), cutoffFunction(NULL), cutoffFunctionDerived(NULL), + pow2B(NULL), exp2B(NULL), exp3B(NULL), qFunctionGrid(NULL), + expMinusBetaZeta_iZeta_iGrid(NULL), tauFunctionGrid(NULL), + tauFunctionDerivedGrid(NULL) { single_enable = 0; restartinfo = 0; @@ -503,6 +509,8 @@ void PairEDIP::allocateGrids(void) double maxArgumentExpMinusBetaZeta_iZeta_i; double const leftLimitToZero = -DBL_MIN * 1000.0; + deallocateGrids(); + // tauFunctionGrid maxArgumentTauFunctionGrid = leadDimInteractionList; @@ -561,6 +569,7 @@ void PairEDIP::allocatePreLoops(void) { int nthreads = comm->nthreads; + deallocatePreLoops(); memory->create(preInvR_ij,nthreads*leadDimInteractionList,"edip:preInvR_ij"); memory->create(preExp3B_ij,nthreads*leadDimInteractionList,"edip:preExp3B_ij"); memory->create(preExp3BDerived_ij,nthreads*leadDimInteractionList, diff --git a/src/USER-MISC/pair_lennard_mdf.cpp b/src/USER-MISC/pair_lennard_mdf.cpp index 5e7e24af67..4728527a30 100644 --- a/src/USER-MISC/pair_lennard_mdf.cpp +++ b/src/USER-MISC/pair_lennard_mdf.cpp @@ -226,8 +226,8 @@ void PairLennardMDF::coeff(int narg, char **arg) cut_inner_one = force->numeric(FLERR,arg[4]); cut_one = force->numeric(FLERR,arg[5]); } - if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) - error->all(FLERR,"Illegal pair_style command"); + if (cut_inner_one <= 0.0 || cut_inner_one > cut_one) + error->all(FLERR,"Illegal pair_coeff command"); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -328,6 +328,8 @@ void PairLennardMDF::read_restart(FILE *fp) void PairLennardMDF::write_restart_settings(FILE *fp) { fwrite(&mix_flag,sizeof(int),1,fp); + fwrite(&cut_global,sizeof(double),1,fp); + fwrite(&cut_inner_global,sizeof(double),1,fp); } /* ---------------------------------------------------------------------- @@ -339,8 +341,12 @@ void PairLennardMDF::read_restart_settings(FILE *fp) int me = comm->me; if (me == 0) { utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); + MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); + MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/pair_lj_expand_coul_long.cpp b/src/USER-MISC/pair_lj_expand_coul_long.cpp index f52e427c18..3d96a3343c 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.cpp +++ b/src/USER-MISC/pair_lj_expand_coul_long.cpp @@ -53,6 +53,7 @@ PairLJExpandCoulLong::PairLJExpandCoulLong(LAMMPS *lmp) : Pair(lmp) writedata = 1; ftable = NULL; qdist = 0.0; + cut_respa = NULL; } /* ---------------------------------------------------------------------- */ @@ -167,7 +168,7 @@ void PairLJExpandCoulLong::compute(int eflag, int vflag) rshift2inv = 1.0/rshiftsq; r6inv = rshift2inv*rshift2inv*rshift2inv; forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); - forcelj = factor_lj*forcelj/rshift/r; + forcelj *= factor_lj/rshift/r; } else forcelj = 0.0; fpair = forcecoul*r2inv + forcelj; @@ -276,7 +277,7 @@ void PairLJExpandCoulLong::compute_inner() rshift2inv = 1.0/rshiftsq; r6inv = rshift2inv*rshift2inv*rshift2inv; forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); - forcelj = factor_lj*forcelj/rshift/r; + forcelj *= factor_lj/rshift/r; } else forcelj = 0.0; fpair = forcecoul*r2inv + forcelj; @@ -371,7 +372,7 @@ void PairLJExpandCoulLong::compute_middle() rshift2inv = 1.0/rshiftsq; r6inv = rshift2inv*rshift2inv*rshift2inv; forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); - forcelj = factor_lj*forcelj/rshift/r; + forcelj *= factor_lj/rshift/r; } else forcelj = 0.0; fpair = forcecoul*r2inv + forcelj; @@ -506,7 +507,7 @@ void PairLJExpandCoulLong::compute_outer(int eflag, int vflag) rshift2inv = 1.0/rshiftsq; r6inv = rshift2inv*rshift2inv*rshift2inv; forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); - forcelj = factor_lj*forcelj/rshift/r; + forcelj *= factor_lj/rshift/r; if (rsq < cut_in_on_sq) { rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; forcelj *= rsw*rsw*(3.0 - 2.0*rsw); @@ -524,6 +525,7 @@ void PairLJExpandCoulLong::compute_outer(int eflag, int vflag) f[j][2] -= delz*fpair; } + if (evflag) ecoul = evdwl = 0.0; if (eflag) { if (rsq < cut_coulsq) { if (!ncoultablebits || rsq <= tabinnersq) { @@ -538,14 +540,18 @@ void PairLJExpandCoulLong::compute_outer(int eflag, int vflag) ecoul -= (1.0-factor_coul)*prefactor; } } - } else ecoul = 0.0; + } if (rsq < cut_ljsq[itype][jtype]) { - r6inv = r2inv*r2inv*r2inv; + r = sqrt(rsq); + rshift = r - shift[itype][jtype]; + rshiftsq = rshift*rshift; + rshift2inv = 1.0/rshiftsq; + r6inv = rshift2inv*rshift2inv*rshift2inv; evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) - offset[itype][jtype]; evdwl *= factor_lj; - } else evdwl = 0.0; + } } if (vflag) { @@ -564,15 +570,18 @@ void PairLJExpandCoulLong::compute_outer(int eflag, int vflag) } } else forcecoul = 0.0; - if (rsq <= cut_in_off_sq) { - r6inv = r2inv*r2inv*r2inv; + if (rsq < cut_ljsq[itype][jtype]) { + r = sqrt(rsq); + rshift = r - shift[itype][jtype]; + rshiftsq = rshift*rshift; + rshift2inv = 1.0/rshiftsq; + r6inv = rshift2inv*rshift2inv*rshift2inv; forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); - } else if (rsq <= cut_in_on_sq) { - r6inv = r2inv*r2inv*r2inv; - forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); - } - fpair = (forcecoul + factor_lj*forcelj) * r2inv; - } + forcelj *= factor_lj/rshift/r; + } else forcelj = 0.0; + + fpair = forcecoul*r2inv + forcelj; + } else fpair = 0.0; if (evflag) ev_tally(i,j,nlocal,newton_pair, evdwl,ecoul,fpair,delx,dely,delz); @@ -946,11 +955,16 @@ double PairLJExpandCoulLong::single(int i, int j, int itype, int jtype, } else forcecoul = 0.0; if (rsq < cut_ljsq[itype][jtype]) { - r6inv = r2inv*r2inv*r2inv; + r = sqrt(rsq); + double rshift = r - shift[itype][jtype]; + double rshiftsq = rshift*rshift; + double rshift2inv = 1.0/rshiftsq; + r6inv = rshift2inv*rshift2inv*rshift2inv; forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); + forcelj *= factor_lj/rshift/r; } else forcelj = 0.0; - fforce = (forcecoul + factor_lj*forcelj) * r2inv; + fforce = forcecoul*r2inv + forcelj; double eng = 0.0; if (rsq < cut_coulsq) { diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp index cd9b77934f..5f35070130 100644 --- a/src/USER-MISC/pair_meam_spline.cpp +++ b/src/USER-MISC/pair_meam_spline.cpp @@ -57,6 +57,7 @@ PairMEAMSpline::PairMEAMSpline(LAMMPS *lmp) : Pair(lmp) nelements = 0; elements = NULL; + map = NULL; Uprime_values = NULL; nmax = 0; @@ -65,6 +66,14 @@ PairMEAMSpline::PairMEAMSpline(LAMMPS *lmp) : Pair(lmp) comm_forward = 1; comm_reverse = 0; + + phis = NULL; + Us = NULL; + rhos = NULL; + fs = NULL; + gs = NULL; + + zero_atom_energies = NULL; } /* ---------------------------------------------------------------------- */ @@ -332,6 +341,8 @@ void PairMEAMSpline::allocate() allocated = 1; int n = nelements; + memory->destroy(setflag); + memory->destroy(cutsq); memory->create(setflag,n+1,n+1,"pair:setflag"); memory->create(cutsq,n+1,n+1,"pair:cutsq"); @@ -339,14 +350,21 @@ void PairMEAMSpline::allocate() //Change the functional form //f_ij->f_i //g_i(cos\theta_ijk)->g_jk(cos\theta_ijk) + delete[] phis; + delete[] Us; + delete[] rhos; + delete[] fs; + delete[] gs; phis = new SplineFunction[nmultichoose2]; Us = new SplineFunction[n]; rhos = new SplineFunction[n]; fs = new SplineFunction[n]; gs = new SplineFunction[nmultichoose2]; + delete[] zero_atom_energies; zero_atom_energies = new double[n]; + delete[] map; map = new int[n+1]; for (int i=0; i <= n; ++i) map[i] = -1; } @@ -470,6 +488,9 @@ void PairMEAMSpline::read_file(const char* filename) if (nelements < 1) error->one(FLERR, "Invalid number of atomic species on" " meam/spline line in potential file"); + if (elements) + for (int i = 0; i < nelements; i++) delete [] elements[i]; + delete [] elements; elements = new char*[nelements]; for (int i=0; iall(FLERR,"All pair coeffs are not set"); morse1[i][j] = 2.0*d0[i][j]*alpha[i][j]; + 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)); + der_at_cutoff[i][j] = -2.0*alpha[i][j]*d0[i][j] * (exp(2.0*alpha_dr) - exp(alpha_dr)); d0[j][i] = d0[i][j]; alpha[j][i] = alpha[i][j]; diff --git a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp index ac73344c67..f2ab417028 100644 --- a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp @@ -35,8 +35,6 @@ PairMorseSmoothLinearOMP::PairMorseSmoothLinearOMP(LAMMPS *lmp) : respa_enable = 0; } - - /* ---------------------------------------------------------------------- */ void PairMorseSmoothLinearOMP::compute(int eflag, int vflag) @@ -76,8 +74,6 @@ void PairMorseSmoothLinearOMP::compute(int eflag, int vflag) } // end of omp parallel region } - - template void PairMorseSmoothLinearOMP::eval(int iifrom, int iito, ThrData * const thr) { @@ -129,7 +125,7 @@ void PairMorseSmoothLinearOMP::eval(int iifrom, int iito, ThrData * const thr) dexp = exp(-alpha[itype][jtype] * dr); fpartial = morse1[itype][jtype] * (dexp*dexp - dexp) / r; - fpair = factor_lj * ( fpartial - der_at_cutoff[itype][jtype] / r); + fpair = factor_lj * ( fpartial + der_at_cutoff[itype][jtype] / r); fxtmp += delx*fpair; fytmp += dely*fpair; @@ -143,7 +139,7 @@ void PairMorseSmoothLinearOMP::eval(int iifrom, int iito, ThrData * const thr) if (EFLAG) { evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) - offset[itype][jtype]; - evdwl += ( r - cut[itype][jtype] ) * der_at_cutoff[itype][jtype]; + evdwl -= ( r - cut[itype][jtype] ) * der_at_cutoff[itype][jtype]; evdwl *= factor_lj; } diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index 0406b6f0a3..6db2aaa478 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -948,6 +948,7 @@ int FixMesoMove::unpack_exchange (int nlocal, double *buf) { ------------------------------------------------------------------------- */ int FixMesoMove::pack_restart (int i, double *buf) { + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; @@ -963,6 +964,7 @@ void FixMesoMove::unpack_restart (int nlocal, int nth) { double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp index 6aa23fe3b2..4ade21a6fd 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -450,6 +450,7 @@ int FixSMD_TLSPH_ReferenceConfiguration::unpack_exchange(int nlocal, double *buf int FixSMD_TLSPH_ReferenceConfiguration::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way because other fixes unpack it buf[m++] = 4 * npartner[i] + 2; buf[m++] = npartner[i]; for (int n = 0; n < npartner[i]; n++) { @@ -470,6 +471,7 @@ void FixSMD_TLSPH_ReferenceConfiguration::unpack_restart(int /*nlocal*/, int /*n // ipage = NULL if being called from granular pair style init() // skip to Nth set of extra values +// unpack the Nth first values this way because other fixes pack them // double **extra = atom->extra; // diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 3732662295..de20e15698 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -71,6 +71,20 @@ void CreateAtoms::command(int narg, char **arg) error->all(FLERR,"Cannot create_atoms after " "reading restart file with per-atom info"); + // check for compatible lattice + + int latsty = domain->lattice->style; + if (domain->dimension == 2) { + if (latsty == Lattice::SC || latsty == Lattice::BCC + || latsty == Lattice::FCC || latsty == Lattice::HCP + || latsty == Lattice::DIAMOND) + error->all(FLERR,"Lattice style incompatible with simulation dimension"); + } else { + if (latsty == Lattice::SQ ||latsty == Lattice::SQ2 + || latsty == Lattice::HEX) + error->all(FLERR,"Lattice style incompatible with simulation dimension"); + } + // parse arguments if (narg < 2) error->all(FLERR,"Illegal create_atoms command"); diff --git a/src/fix_move.cpp b/src/fix_move.cpp index 770c0fca6b..8c58146c52 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -1193,6 +1193,7 @@ int FixMove::pack_restart(int i, double *buf) buf[n++] = qoriginal[i][2]; buf[n++] = qoriginal[i][3]; } + // pack buf[0] this way because other fixes unpack it buf[0] = n; return n; } @@ -1206,6 +1207,7 @@ void FixMove::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 9b632b7ff8..933bcdc265 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -149,7 +149,7 @@ void FixNeighHistory::init() error->all(FLERR,"Neighbor history requires atoms have IDs"); // this fix must come before any fix which migrates atoms in its pre_exchange() - // b/c this fix's pre_exchange() creates per-atom data structure + // because this fix's pre_exchange() creates per-atom data structure // that data must be current for atom migration to carry it along for (int i = 0; i < modify->nfix; i++) { @@ -215,7 +215,7 @@ void FixNeighHistory::setup_post_neighbor() called during run before atom exchanges, including for restart files called at end of run via post_run() do not call during setup of run (setup_pre_exchange) - b/c there is no guarantee of a current NDS (even on continued run) + because there is no guarantee of a current NDS (even on continued run) if run command does a 2nd run with pre = no, then no neigh list will be built, but old neigh list will still have the info onesided and newton on and newton off versions @@ -242,7 +242,7 @@ void FixNeighHistory::pre_exchange_onesided() double *allvalues,*onevalues; // NOTE: all operations until very end are with nlocal_neigh <= current nlocal - // b/c previous neigh list was built with nlocal_neigh + // because previous neigh list was built with nlocal_neigh // nlocal can be larger if other fixes added atoms at this pre_exchange() // clear two paged data structures @@ -335,7 +335,7 @@ void FixNeighHistory::pre_exchange_newton() // NOTE: all operations until very end are with // nlocal_neigh <= current nlocal and nall_neigh - // b/c previous neigh list was built with nlocal_neigh & nghost_neigh + // because previous neigh list was built with nlocal_neigh & nghost_neigh // nlocal can be larger if other fixes added atoms at this pre_exchange() // clear two paged data structures @@ -430,7 +430,7 @@ void FixNeighHistory::pre_exchange_newton() // perform reverse comm to augment // owned atom partner/valuepartner with ghost info - // use variable variant b/c size of packed data can be arbitrarily large + // use variable variant because size of packed data can be arbitrarily large // if many touching neighbors for large particle commflag = PERPARTNER; @@ -463,7 +463,7 @@ void FixNeighHistory::pre_exchange_no_newton() double *allvalues,*onevalues,*jvalues; // NOTE: all operations until very end are with nlocal_neigh <= current nlocal - // b/c previous neigh list was built with nlocal_neigh + // because previous neigh list was built with nlocal_neigh // nlocal can be larger if other fixes added atoms at this pre_exchange() // clear two paged data structures @@ -708,10 +708,10 @@ void FixNeighHistory::grow_arrays(int nmax) void FixNeighHistory::copy_arrays(int i, int j, int /*delflag*/) { // just copy pointers for partner and valuepartner - // b/c can't overwrite chunk allocation inside ipage_atom,dpage_atom + // because can't overwrite chunk allocation inside ipage_atom,dpage_atom // incoming atoms in unpack_exchange just grab new chunks // so are orphaning chunks for migrating atoms - // OK, b/c will reset ipage_atom,dpage_atom on next reneighboring + // OK, because will reset ipage_atom,dpage_atom on next reneighboring npartner[j] = npartner[i]; partner[j] = partner[i]; @@ -853,6 +853,7 @@ int FixNeighHistory::pack_restart(int i, double *buf) memcpy(&buf[m],&valuepartner[i][dnum*n],dnumbytes); m += dnum; } + // pack buf[0] this way because other fixes unpack it buf[0] = m; return m; } @@ -868,6 +869,7 @@ void FixNeighHistory::unpack_restart(int nlocal, int nth) if (ipage_atom == NULL) allocate_pages(); // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them double **extra = atom->extra; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index f1262f88c7..374d0069fd 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -192,7 +192,7 @@ int FixPropertyAtom::setmask() void FixPropertyAtom::init() { // error if atom style has changed since fix was defined - // don't allow this b/c user could change to style that defines molecule,q + // don't allow this because user could change to style that defines molecule,q if (strcmp(astyle,atom->atom_style) != 0) error->all(FLERR,"Atom style was redefined after using fix property/atom"); @@ -579,6 +579,7 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf) int FixPropertyAtom::pack_restart(int i, double *buf) { + // pack buf[0] this way because other fixes unpack it buf[0] = nvalue+1; int m = 1; @@ -602,6 +603,7 @@ void FixPropertyAtom::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 77c4bfbddc..108d18afb6 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -297,8 +297,14 @@ void FixSetForce::post_force_respa(int vflag, int ilevel, int /*iloop*/) { // set force to desired value on requested level, 0.0 on other levels - if (ilevel == ilevel_respa) post_force(vflag); - else { + if (ilevel == 0) foriginal_saved[0] = foriginal_saved[1] = foriginal_saved[2] = 0.0; + + if (ilevel == ilevel_respa) { + post_force(vflag); + foriginal[0] += foriginal_saved[0]; + foriginal[1] += foriginal_saved[1]; + foriginal[2] += foriginal_saved[2]; + } else { Region *region = NULL; if (iregion >= 0) { region = domain->regions[iregion]; @@ -313,6 +319,9 @@ void FixSetForce::post_force_respa(int vflag, int ilevel, int /*iloop*/) for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { if (region && !region->match(x[i][0],x[i][1],x[i][2])) continue; + foriginal_saved[0] += f[i][0]; + foriginal_saved[1] += f[i][1]; + foriginal_saved[2] += f[i][2]; if (xstyle) f[i][0] = 0.0; if (ystyle) f[i][1] = 0.0; if (zstyle) f[i][2] = 0.0; diff --git a/src/fix_setforce.h b/src/fix_setforce.h index 54d17049f7..eefae562a3 100644 --- a/src/fix_setforce.h +++ b/src/fix_setforce.h @@ -45,7 +45,7 @@ class FixSetForce : public Fix { char *xstr,*ystr,*zstr; char *idregion; int xvar,yvar,zvar,xstyle,ystyle,zstyle; - double foriginal[3],foriginal_all[3]; + double foriginal[3],foriginal_all[3],foriginal_saved[3]; int force_flag; int nlevels_respa,ilevel_respa; diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index c94f21b492..4f8a03c8bd 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -264,6 +264,7 @@ int FixSpringSelf::unpack_exchange(int nlocal, double *buf) int FixSpringSelf::pack_restart(int i, double *buf) { + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; @@ -280,6 +281,7 @@ void FixSpringSelf::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_store.cpp b/src/fix_store.cpp index ac663a7913..3cf3125be5 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -280,7 +280,8 @@ int FixStore::pack_restart(int i, double *buf) return 1; } - buf[0] = ubuf(nvalues+1).d; + // pack buf[0] this way because other fixes unpack it + buf[0] = nvalues+1; if (vecflag) buf[1] = vstore[i]; else for (int m = 0; m < nvalues; m++) @@ -299,9 +300,10 @@ void FixStore::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; - for (int i = 0; i < nth; i++) m += (int) ubuf(extra[nlocal][m]).i; + for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; if (vecflag) vstore[nlocal] = extra[nlocal][m]; diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index 18dfa026d9..e1e2aab663 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -611,6 +611,7 @@ int FixStoreState::unpack_exchange(int nlocal, double *buf) int FixStoreState::pack_restart(int i, double *buf) { + // pack buf[0] this way because other fixes unpack it buf[0] = nvalues+1; for (int m = 0; m < nvalues; m++) buf[m+1] = values[i][m]; return nvalues+1; @@ -625,6 +626,7 @@ void FixStoreState::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index 9b385bf96c..7a1d1d06fc 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -43,6 +43,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : // Berendsen thermostat should be applied every step + restart_global = 1; dynamic_group_allow = 1; nevery = 1; scalar_flag = 1; @@ -241,6 +242,34 @@ double FixTempBerendsen::compute_scalar() return energy; } +/* ---------------------------------------------------------------------- + pack entire state of Fix into one write +------------------------------------------------------------------------- */ + +void FixTempBerendsen::write_restart(FILE *fp) +{ + int n = 0; + double list[1]; + list[n++] = energy; + + if (comm->me == 0) { + int size = n * sizeof(double); + fwrite(&size,sizeof(int),1,fp); + fwrite(list,sizeof(double),n,fp); + } +} + +/* ---------------------------------------------------------------------- + use state info from restart file to restart the Fix +------------------------------------------------------------------------- */ + +void FixTempBerendsen::restart(char *buf) +{ + double *list = (double *) buf; + + energy = list[0]; +} + /* ---------------------------------------------------------------------- extract thermostat properties ------------------------------------------------------------------------- */ diff --git a/src/fix_temp_berendsen.h b/src/fix_temp_berendsen.h index ffc0ca5def..5657b0fd97 100644 --- a/src/fix_temp_berendsen.h +++ b/src/fix_temp_berendsen.h @@ -34,6 +34,8 @@ class FixTempBerendsen : public Fix { int modify_param(int, char **); void reset_target(double); double compute_scalar(); + void write_restart(FILE *); + void restart(char *buf); virtual void *extract(const char *, int &); private: diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index f83d593c96..0a0face0ed 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -49,6 +49,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : // CSLD thermostat should be applied every step + restart_global = 1; nevery = 1; scalar_flag = 1; global_freq = nevery; @@ -297,6 +298,46 @@ double FixTempCSLD::compute_scalar() return energy; } + +/* ---------------------------------------------------------------------- + pack entire state of Fix into one write +------------------------------------------------------------------------- */ + +void FixTempCSLD::write_restart(FILE *fp) +{ + int nsize = (98+2+3)*comm->nprocs+2; // pRNG state per proc + nprocs + energy + double *list; + if (comm->me == 0) list = new double[nsize]; + list[0] = energy; + list[1] = comm->nprocs; + double state[103]; + random->get_state(state); + MPI_Gather(state,103,MPI_DOUBLE,list+2,103*comm->nprocs,MPI_DOUBLE,0,world); + + if (comm->me == 0) { + int size = nsize * sizeof(double); + fwrite(&size,sizeof(int),1,fp); + fwrite(list,sizeof(double),nsize,fp); + } + if (comm->me == 0) delete[] list; +} + +/* ---------------------------------------------------------------------- + use state info from restart file to restart the Fix +------------------------------------------------------------------------- */ + +void FixTempCSLD::restart(char *buf) +{ + double *list = (double *) buf; + + energy = list[0]; + int nprocs = (int) list[1]; + if (nprocs != comm->nprocs) { + if (comm->me == 0) + error->warning(FLERR,"Different number of procs. Cannot restore RNG state."); + } else random->set_state(list+2+comm->me*103); +} + /* ---------------------------------------------------------------------- extract thermostat properties ------------------------------------------------------------------------- */ diff --git a/src/fix_temp_csld.h b/src/fix_temp_csld.h index 2fde8537ee..8937ad43db 100644 --- a/src/fix_temp_csld.h +++ b/src/fix_temp_csld.h @@ -34,6 +34,8 @@ class FixTempCSLD : public Fix { int modify_param(int, char **); void reset_target(double); virtual double compute_scalar(); + void write_restart(FILE *); + void restart(char *buf); virtual void *extract(const char *, int &); private: diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index cca204a4b2..54fc820927 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -126,6 +126,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : // CSVR thermostat should be applied every step + restart_global = 1; nevery = 1; scalar_flag = 1; global_freq = nevery; @@ -331,6 +332,45 @@ double FixTempCSVR::compute_scalar() return energy; } +/* ---------------------------------------------------------------------- + pack entire state of Fix into one write +------------------------------------------------------------------------- */ + +void FixTempCSVR::write_restart(FILE *fp) +{ + int nsize = (98+2+3)*comm->nprocs+2; // pRNG state per proc + nprocs + energy + double *list; + if (comm->me == 0) list = new double[nsize]; + list[0] = energy; + list[1] = comm->nprocs; + double state[103]; + random->get_state(state); + MPI_Gather(state,103,MPI_DOUBLE,list+2,103*comm->nprocs,MPI_DOUBLE,0,world); + + if (comm->me == 0) { + int size = nsize * sizeof(double); + fwrite(&size,sizeof(int),1,fp); + fwrite(list,sizeof(double),nsize,fp); + } + if (comm->me == 0) delete[] list; +} + +/* ---------------------------------------------------------------------- + use state info from restart file to restart the Fix +------------------------------------------------------------------------- */ + +void FixTempCSVR::restart(char *buf) +{ + double *list = (double *) buf; + + energy = list[0]; + int nprocs = (int) list[1]; + if (nprocs != comm->nprocs) { + if (comm->me == 0) + error->warning(FLERR,"Different number of procs. Cannot restore RNG state."); + } else random->set_state(list+2+comm->me*103); +} + /* ---------------------------------------------------------------------- extract thermostat properties ------------------------------------------------------------------------- */ diff --git a/src/fix_temp_csvr.h b/src/fix_temp_csvr.h index a97a0e1fed..44d6630525 100644 --- a/src/fix_temp_csvr.h +++ b/src/fix_temp_csvr.h @@ -34,6 +34,8 @@ class FixTempCSVR : public Fix { int modify_param(int, char **); void reset_target(double); virtual double compute_scalar(); + void write_restart(FILE *); + void restart(char *buf); virtual void *extract(const char *, int &); private: diff --git a/src/lammps.cpp b/src/lammps.cpp index 890e3bcc27..ded9d93167 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -854,9 +854,6 @@ void LAMMPS::destroy() delete neighbor; neighbor = NULL; - delete comm; - comm = NULL; - delete force; force = NULL; @@ -870,6 +867,10 @@ void LAMMPS::destroy() // since they delete fixes modify = NULL; + delete comm; // comm must come after modify + // since fix destructors may access comm + comm = NULL; + delete domain; // domain must come after modify // since fix destructors access domain domain = NULL; diff --git a/src/lattice.cpp b/src/lattice.cpp index 0f9b0a7818..8ecf9fed73 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -28,8 +28,6 @@ using namespace LAMMPS_NS; #define BIG 1.0e30 -enum{NONE,SC,BCC,FCC,HCP,DIAMOND,SQ,SQ2,HEX,CUSTOM}; - /* ---------------------------------------------------------------------- */ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) diff --git a/src/lattice.h b/src/lattice.h index e76fd0507f..65cba9f3ca 100644 --- a/src/lattice.h +++ b/src/lattice.h @@ -20,6 +20,8 @@ namespace LAMMPS_NS { class Lattice : protected Pointers { public: + enum{NONE,SC,BCC,FCC,HCP,DIAMOND,SQ,SQ2,HEX,CUSTOM}; + int style; // NONE,SC,FCC,etc double xlattice,ylattice,zlattice; // lattice scale factors in 3 dims double a1[3],a2[3],a3[3]; // edge vectors of unit cell diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index e31e275a7d..60bb7bceee 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -484,7 +484,7 @@ void PairLJCut::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -499,7 +499,7 @@ void PairLJCut::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 36eced6d3f..bd2a6be654 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -458,25 +458,25 @@ void PairTable::read_table(Table *tb, char *file, char *keyword) } if (ferror) - error->warning(FLERR,fmt::format("{} of {} force values in table are " + error->warning(FLERR,fmt::format("{} of {} force values in table {} are " "inconsistent with -dE/dr.\n Should " "only be flagged at inflection points", - ferror,tb->ninput)); + ferror,tb->ninput,keyword)); // warn if re-computed distance values differ from file values if (rerror) - error->warning(FLERR,fmt::format("{} of {} distance values in table with " - "relative error\n over {} to " + error->warning(FLERR,fmt::format("{} of {} distance values in table {} " + "with relative error\n over {} to " "re-computed values", - rerror,tb->ninput,EPSILONR)); + rerror,tb->ninput,EPSILONR,keyword)); // warn if data was read incompletely, e.g. columns were missing if (cerror) - error->warning(FLERR,fmt::format("{} of {} lines in table were " + error->warning(FLERR,fmt::format("{} of {} lines in table {} were " "incomplete\n or could not be parsed " - "completely",cerror,tb->ninput)); + "completely",cerror,tb->ninput,keyword)); } /* ---------------------------------------------------------------------- diff --git a/src/random_mars.cpp b/src/random_mars.cpp index 64d6808e43..29314525a5 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -16,6 +16,7 @@ #include "random_mars.h" #include +#include #include "error.h" #include "math_const.h" @@ -36,6 +37,7 @@ RanMars::RanMars(LAMMPS *lmp, int seed) : Pointers(lmp), save = 0; u = new double[97+1]; + memset(u,0,98*sizeof(double)); ij = (seed-1)/30082; kl = (seed-1) - 30082*ij; @@ -181,7 +183,7 @@ double RanMars::besselexp(double theta, double alpha, double cp) void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) { int mode,index,oldindex,newvalue,nflip,which,niter; - int active[2],first[2],last[2]; + int active[2],first[2]; int newactive[2],newfirst[2],newlast[2]; bigint nmark,nflipall; bigint activeall[2],bsum[3],bsumall[3]; @@ -191,8 +193,6 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) active[1] = 0; first[0] = 0; first[1] = -1; - last[0] = nmine-1; - last[1] = -1; bigint bnmine = nmine; bigint bnall; @@ -266,8 +266,6 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) active[1] = newactive[1]; first[0] = newfirst[0]; first[1] = newfirst[1]; - last[0] = newlast[0]; - last[1] = newlast[1]; } // update nmark and activeall @@ -291,3 +289,31 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) // niter,nmark,nactiveall,thresh,nflipall); } } + +/* ---------------------------------------------------------------------- + store state in buffer +------------------------------------------------------------------------- */ + +void RanMars::get_state(double *state) +{ + for (int i=0; i < 98; ++i) state[i] = u[i]; + state[98] = i97; + state[99] = j97; + state[100]= c; + state[101]= cd; + state[102]= cm; +} + +/* ---------------------------------------------------------------------- + restore state from buffer +------------------------------------------------------------------------- */ + +void RanMars::set_state(double *state) +{ + for (int i=0; i < 98; ++i) u[i] = state[i]; + i97 = state[98]; + j97 = state[99]; + c = state[100]; + cd = state[101]; + cm = state[102]; +} diff --git a/src/random_mars.h b/src/random_mars.h index 03199c84e8..1bcd16b051 100644 --- a/src/random_mars.h +++ b/src/random_mars.h @@ -28,6 +28,8 @@ class RanMars : protected Pointers { double rayleigh(double sigma); double besselexp(double theta, double alpha, double cp); void select_subset(bigint, int, int *, int *); + void get_state(double *); + void set_state(double *); private: int save; diff --git a/src/velocity.cpp b/src/velocity.cpp index e5985884f8..c2776ea174 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -67,7 +67,7 @@ void Velocity::command(int narg, char **arg) // check if velocities of atoms in rigid bodies are updated - if (modify->check_rigid_group_overlap(groupbit)) + if (modify->check_rigid_group_overlap(groupbit) && (comm->me == 0)) error->warning(FLERR,"Changing velocities of atoms in rigid bodies. " "This has no effect unless rigid bodies are rebuild"); @@ -200,7 +200,7 @@ void Velocity::create(double t_desired, int seed) // initialize temperature computation(s) // warn if groups don't match - if (igroup != temperature->igroup && comm->me == 0) + if ((igroup != temperature->igroup) && (comm->me == 0)) error->warning(FLERR,"Mismatch between velocity and compute groups"); temperature->init(); temperature->setup(); @@ -596,7 +596,7 @@ void Velocity::scale(int /*narg*/, char **arg) // initialize temperature computation // warn if groups don't match - if (igroup != temperature->igroup && comm->me == 0) + if ((igroup != temperature->igroup) && (comm->me == 0)) error->warning(FLERR,"Mismatch between velocity and compute groups"); temperature->init(); temperature->setup(); diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index ab8c771dc8..9a1646126f 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -1,9 +1,9 @@ include(GTest) -add_subdirectory(force-styles) add_subdirectory(utils) add_subdirectory(formats) add_subdirectory(commands) +add_subdirectory(force-styles) find_package(ClangFormat 8.0) diff --git a/unittest/commands/CMakeLists.txt b/unittest/commands/CMakeLists.txt index f54b10dcb5..e9cdf78ab7 100644 --- a/unittest/commands/CMakeLists.txt +++ b/unittest/commands/CMakeLists.txt @@ -3,6 +3,10 @@ add_executable(test_simple_commands test_simple_commands.cpp) target_link_libraries(test_simple_commands PRIVATE lammps GTest::GMock GTest::GTest) add_test(NAME SimpleCommands COMMAND test_simple_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_executable(test_lattice_region test_lattice_region.cpp) +target_link_libraries(test_lattice_region PRIVATE lammps GTest::GMock GTest::GTest) +add_test(NAME LatticeRegion COMMAND test_lattice_region WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_executable(test_kim_commands test_kim_commands.cpp) target_link_libraries(test_kim_commands PRIVATE lammps GTest::GMock GTest::GTest) add_test(NAME KimCommands COMMAND test_kim_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/unittest/commands/test_lattice_region.cpp b/unittest/commands/test_lattice_region.cpp new file mode 100644 index 0000000000..4f1e858324 --- /dev/null +++ b/unittest/commands/test_lattice_region.cpp @@ -0,0 +1,703 @@ +/* ---------------------------------------------------------------------- + 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. +------------------------------------------------------------------------- */ + +#include "atom.h" +#include "domain.h" +#include "fmt/format.h" +#include "info.h" +#include "input.h" +#include "lammps.h" +#include "lattice.h" +#include "region.h" +#include "utils.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include +#include +#include +#include +#include + +// whether to print verbose output (i.e. not capturing LAMMPS screen output). +bool verbose = false; + +#if defined(OMPI_MAJOR_VERSION) +const bool have_openmpi = true; +#else +const bool have_openmpi = false; +#endif + +using LAMMPS_NS::utils::split_words; + +namespace LAMMPS_NS { +using ::testing::ExitedWithCode; +using ::testing::MatchesRegex; +using ::testing::StrEq; + +#define TEST_FAILURE(errmsg, ...) \ + if (Info::has_exceptions()) { \ + ::testing::internal::CaptureStdout(); \ + ASSERT_ANY_THROW({__VA_ARGS__}); \ + auto mesg = ::testing::internal::GetCapturedStdout(); \ + ASSERT_THAT(mesg, MatchesRegex(errmsg)); \ + } else { \ + if (!have_openmpi) { \ + ::testing::internal::CaptureStdout(); \ + ASSERT_DEATH({__VA_ARGS__}, ""); \ + auto mesg = ::testing::internal::GetCapturedStdout(); \ + ASSERT_THAT(mesg, MatchesRegex(errmsg)); \ + } \ + } + +class LatticeRegionTest : public ::testing::Test { +protected: + LAMMPS *lmp; + + void SetUp() override + { + const char *args[] = {"LatticeRegionTest", "-log", "none", "-echo", "screen", "-nocite"}; + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + if (!verbose) ::testing::internal::CaptureStdout(); + lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD); + lmp->input->one("units metal"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + } + + void TearDown() override + { + if (!verbose) ::testing::internal::CaptureStdout(); + delete lmp; + if (!verbose) ::testing::internal::GetCapturedStdout(); + } +}; + +TEST_F(LatticeRegionTest, lattice_none) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice none 2.0"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::NONE); + ASSERT_EQ(lattice->xlattice, 2.0); + ASSERT_EQ(lattice->ylattice, 2.0); + ASSERT_EQ(lattice->zlattice, 2.0); + ASSERT_EQ(lattice->nbasis, 0); + ASSERT_EQ(lattice->basis, nullptr); + + TEST_FAILURE(".*ERROR: Illegal lattice command.*", lmp->input->one("lattice");); + TEST_FAILURE(".*ERROR: Illegal lattice command.*", lmp->input->one("lattice xxx");); + TEST_FAILURE(".*ERROR: Illegal lattice command.*", lmp->input->one("lattice none 1.0 origin");); + TEST_FAILURE(".*ERROR: Expected floating point.*", lmp->input->one("lattice none xxx");); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("units lj"); + lmp->input->one("lattice none 1.0"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lattice->xlattice, 1.0); + ASSERT_EQ(lattice->ylattice, 1.0); + ASSERT_EQ(lattice->zlattice, 1.0); +} + +TEST_F(LatticeRegionTest, lattice_sc) +{ + ::testing::internal::CaptureStdout(); + lmp->input->one("lattice sc 1.0 spacing 1.5 2.0 3.0"); + auto output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + ASSERT_THAT(output, MatchesRegex(".*Lattice spacing in x,y,z = 1.50* 2.0* 3.0*.*")); + + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->xlattice, 1.5); + ASSERT_EQ(lattice->ylattice, 2.0); + ASSERT_EQ(lattice->zlattice, 3.0); + + ::testing::internal::CaptureStdout(); + lmp->input->one("lattice sc 2.0"); + output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + ASSERT_THAT(output, MatchesRegex(".*Lattice spacing in x,y,z = 2.0* 2.0* 2.0*.*")); + + lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::SC); + ASSERT_EQ(lattice->xlattice, 2.0); + ASSERT_EQ(lattice->ylattice, 2.0); + ASSERT_EQ(lattice->zlattice, 2.0); + ASSERT_EQ(lattice->nbasis, 1); + ASSERT_NE(lattice->basis, nullptr); + ASSERT_EQ(lattice->a1[0], 1.0); + ASSERT_EQ(lattice->a1[1], 0.0); + ASSERT_EQ(lattice->a1[2], 0.0); + ASSERT_EQ(lattice->a2[0], 0.0); + ASSERT_EQ(lattice->a2[1], 1.0); + ASSERT_EQ(lattice->a2[2], 0.0); + ASSERT_EQ(lattice->a3[0], 0.0); + ASSERT_EQ(lattice->a3[1], 0.0); + ASSERT_EQ(lattice->a3[2], 1.0); + ASSERT_EQ(lattice->basis[0][0], 0.0); + ASSERT_EQ(lattice->basis[0][1], 0.0); + ASSERT_EQ(lattice->basis[0][2], 0.0); + + TEST_FAILURE(".*ERROR: Illegal lattice command.*", + lmp->input->one("lattice sc 1.0 origin 1.0 1.0 1.0");); + TEST_FAILURE(".*ERROR: Illegal lattice command.*", + lmp->input->one("lattice sc 1.0 origin 1.0");); + TEST_FAILURE(".*ERROR: Illegal lattice command.*", + lmp->input->one("lattice sc 1.0 origin 0.0 0.0 0.0 xxx");); + TEST_FAILURE(".*ERROR: Expected floating point.*", + lmp->input->one("lattice sc 1.0 origin xxx 1.0 1.0");); + TEST_FAILURE(".*ERROR: Lattice orient vectors are not orthogonal.*", + lmp->input->one("lattice sc 1.0 orient x 2 2 0");); + TEST_FAILURE(".*ERROR: Lattice orient vectors are not right-handed.*", + lmp->input->one("lattice sc 1.0 orient y 0 -1 0");); + TEST_FAILURE(".*ERROR: Lattice spacings are invalid.*", + lmp->input->one("lattice sc 1.0 spacing 0.0 1.0 1.0");); + TEST_FAILURE(".*ERROR: Lattice spacings are invalid.*", + lmp->input->one("lattice sc 1.0 spacing 1.0 -0.1 1.0");); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("units lj"); + lmp->input->one("lattice sc 2.0"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_DOUBLE_EQ(lattice->xlattice, pow(0.5, 1.0 / 3.0)); + ASSERT_DOUBLE_EQ(lattice->ylattice, pow(0.5, 1.0 / 3.0)); + ASSERT_DOUBLE_EQ(lattice->zlattice, pow(0.5, 1.0 / 3.0)); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Lattice style incompatible with simulation dimension.*", + lmp->input->one("lattice sc 1.0");); +} + +TEST_F(LatticeRegionTest, lattice_bcc) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice bcc 4.2 orient x 1 1 0 orient y -1 1 0"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::BCC); + ASSERT_DOUBLE_EQ(lattice->xlattice, sqrt(2.0) * 4.2); + ASSERT_DOUBLE_EQ(lattice->ylattice, sqrt(2.0) * 4.2); + ASSERT_DOUBLE_EQ(lattice->zlattice, 4.2); + ASSERT_EQ(lattice->nbasis, 2); + ASSERT_EQ(lattice->basis[0][0], 0.0); + ASSERT_EQ(lattice->basis[0][1], 0.0); + ASSERT_EQ(lattice->basis[0][2], 0.0); + ASSERT_EQ(lattice->basis[1][0], 0.5); + ASSERT_EQ(lattice->basis[1][1], 0.5); + ASSERT_EQ(lattice->basis[1][2], 0.5); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Lattice style incompatible with simulation dimension.*", + lmp->input->one("lattice bcc 1.0");); +} + +TEST_F(LatticeRegionTest, lattice_fcc) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice fcc 3.5 origin 0.5 0.5 0.5"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::FCC); + ASSERT_DOUBLE_EQ(lattice->xlattice, 3.5); + ASSERT_DOUBLE_EQ(lattice->ylattice, 3.5); + ASSERT_DOUBLE_EQ(lattice->zlattice, 3.5); + ASSERT_EQ(lattice->nbasis, 4); + ASSERT_EQ(lattice->basis[0][0], 0.0); + ASSERT_EQ(lattice->basis[0][1], 0.0); + ASSERT_EQ(lattice->basis[0][2], 0.0); + ASSERT_EQ(lattice->basis[1][0], 0.5); + ASSERT_EQ(lattice->basis[1][1], 0.5); + ASSERT_EQ(lattice->basis[1][2], 0.0); + ASSERT_EQ(lattice->basis[2][0], 0.5); + ASSERT_EQ(lattice->basis[2][1], 0.0); + ASSERT_EQ(lattice->basis[2][2], 0.5); + ASSERT_EQ(lattice->basis[3][0], 0.0); + ASSERT_EQ(lattice->basis[3][1], 0.5); + ASSERT_EQ(lattice->basis[3][2], 0.5); + + TEST_FAILURE(".*ERROR: Invalid option in lattice command for non-custom style.*", + lmp->input->one("lattice fcc 1.0 basis 0.0 0.0 0.0");); + TEST_FAILURE(".*ERROR: Invalid option in lattice command for non-custom style.*", + lmp->input->one("lattice fcc 1.0 a1 0.0 1.0 0.0");); + TEST_FAILURE(".*ERROR: Illegal lattice command.*", + lmp->input->one("lattice fcc 1.0 orient w 1 0 0");); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Lattice style incompatible with simulation dimension.*", + lmp->input->one("lattice fcc 1.0");); +} + +TEST_F(LatticeRegionTest, lattice_hcp) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice hcp 3.0 orient z 0 0 1"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::HCP); + ASSERT_DOUBLE_EQ(lattice->xlattice, 3.0); + ASSERT_DOUBLE_EQ(lattice->ylattice, 3.0 * sqrt(3.0)); + ASSERT_DOUBLE_EQ(lattice->zlattice, 2.0 * sqrt(6.0)); + ASSERT_EQ(lattice->nbasis, 4); + ASSERT_EQ(lattice->basis[0][0], 0.0); + ASSERT_EQ(lattice->basis[0][1], 0.0); + ASSERT_EQ(lattice->basis[0][2], 0.0); + ASSERT_EQ(lattice->basis[1][0], 0.5); + ASSERT_EQ(lattice->basis[1][1], 0.5); + ASSERT_EQ(lattice->basis[1][2], 0.0); + ASSERT_EQ(lattice->basis[2][0], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[2][1], 5.0 / 6.0); + ASSERT_EQ(lattice->basis[2][2], 0.5); + ASSERT_EQ(lattice->basis[3][0], 0.0); + ASSERT_DOUBLE_EQ(lattice->basis[3][1], 1.0 / 3.0); + ASSERT_EQ(lattice->basis[3][2], 0.5); + ASSERT_EQ(lattice->a1[0], 1.0); + ASSERT_EQ(lattice->a1[1], 0.0); + ASSERT_EQ(lattice->a1[2], 0.0); + ASSERT_EQ(lattice->a2[0], 0.0); + ASSERT_DOUBLE_EQ(lattice->a2[1], sqrt(3.0)); + ASSERT_EQ(lattice->a2[2], 0.0); + ASSERT_EQ(lattice->a3[0], 0.0); + ASSERT_EQ(lattice->a3[1], 0.0); + ASSERT_DOUBLE_EQ(lattice->a3[2], sqrt(8.0 / 3.0)); + + TEST_FAILURE(".*ERROR: Invalid option in lattice command for non-custom style.*", + lmp->input->one("lattice hcp 1.0 a2 0.0 1.0 0.0");); + TEST_FAILURE(".*ERROR: Invalid option in lattice command for non-custom style.*", + lmp->input->one("lattice hcp 1.0 a3 0.0 1.0 0.0");); + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Lattice style incompatible with simulation dimension.*", + lmp->input->one("lattice hcp 1.0");); +} + +TEST_F(LatticeRegionTest, lattice_diamond) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice diamond 4.1 orient x 1 1 2 orient y -1 1 0 orient z -1 -1 1"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::DIAMOND); + ASSERT_DOUBLE_EQ(lattice->xlattice, 6.6952719636073539); + ASSERT_DOUBLE_EQ(lattice->ylattice, 5.7982756057296889); + ASSERT_DOUBLE_EQ(lattice->zlattice, 7.1014083110323973); + ASSERT_EQ(lattice->nbasis, 8); + ASSERT_EQ(lattice->basis[0][0], 0.0); + ASSERT_EQ(lattice->basis[0][1], 0.0); + ASSERT_EQ(lattice->basis[0][2], 0.0); + ASSERT_EQ(lattice->basis[1][0], 0.0); + ASSERT_EQ(lattice->basis[1][1], 0.5); + ASSERT_EQ(lattice->basis[1][2], 0.5); + ASSERT_EQ(lattice->basis[2][0], 0.5); + ASSERT_EQ(lattice->basis[2][1], 0.0); + ASSERT_EQ(lattice->basis[2][2], 0.5); + ASSERT_EQ(lattice->basis[3][0], 0.5); + ASSERT_EQ(lattice->basis[3][1], 0.5); + ASSERT_EQ(lattice->basis[3][2], 0.0); + ASSERT_EQ(lattice->basis[4][0], 0.25); + ASSERT_EQ(lattice->basis[4][1], 0.25); + ASSERT_EQ(lattice->basis[4][2], 0.25); + ASSERT_EQ(lattice->basis[5][0], 0.25); + ASSERT_EQ(lattice->basis[5][1], 0.75); + ASSERT_EQ(lattice->basis[5][2], 0.75); + ASSERT_EQ(lattice->basis[6][0], 0.75); + ASSERT_EQ(lattice->basis[6][1], 0.25); + ASSERT_EQ(lattice->basis[6][2], 0.75); + ASSERT_EQ(lattice->basis[7][0], 0.75); + ASSERT_EQ(lattice->basis[7][1], 0.75); + ASSERT_EQ(lattice->basis[7][2], 0.25); + ASSERT_EQ(lattice->a1[0], 1.0); + ASSERT_EQ(lattice->a1[1], 0.0); + ASSERT_EQ(lattice->a1[2], 0.0); + ASSERT_EQ(lattice->a2[0], 0.0); + ASSERT_EQ(lattice->a2[1], 1.0); + ASSERT_EQ(lattice->a2[2], 0.0); + ASSERT_EQ(lattice->a3[0], 0.0); + ASSERT_EQ(lattice->a3[1], 0.0); + ASSERT_EQ(lattice->a3[2], 1.0); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Lattice style incompatible with simulation dimension.*", + lmp->input->one("lattice diamond 1.0");); +} + +TEST_F(LatticeRegionTest, lattice_sq) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + lmp->input->one("lattice sq 3.0"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::SQ); + ASSERT_DOUBLE_EQ(lattice->xlattice, 3.0); + ASSERT_DOUBLE_EQ(lattice->ylattice, 3.0); + ASSERT_DOUBLE_EQ(lattice->zlattice, 3.0); + ASSERT_EQ(lattice->nbasis, 1); + ASSERT_EQ(lattice->basis[0][0], 0.0); + ASSERT_EQ(lattice->basis[0][1], 0.0); + ASSERT_EQ(lattice->basis[0][2], 0.0); + + TEST_FAILURE( + ".*ERROR: Lattice settings are not compatible with 2d simulation.*", + lmp->input->one("lattice sq 1.0 orient x 1 1 2 orient y -1 1 0 orient z -1 -1 1");); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 3"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Lattice style incompatible with simulation dimension.*", + lmp->input->one("lattice sq 1.0");); +} + +TEST_F(LatticeRegionTest, lattice_sq2) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + lmp->input->one("lattice sq2 2.0"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::SQ2); + ASSERT_DOUBLE_EQ(lattice->xlattice, 2.0); + ASSERT_DOUBLE_EQ(lattice->ylattice, 2.0); + ASSERT_DOUBLE_EQ(lattice->zlattice, 2.0); + ASSERT_EQ(lattice->nbasis, 2); + ASSERT_EQ(lattice->basis[0][0], 0.0); + ASSERT_EQ(lattice->basis[0][1], 0.0); + ASSERT_EQ(lattice->basis[0][2], 0.0); + ASSERT_EQ(lattice->basis[1][0], 0.5); + ASSERT_EQ(lattice->basis[1][1], 0.5); + ASSERT_EQ(lattice->basis[1][2], 0.0); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 3"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Lattice style incompatible with simulation dimension.*", + lmp->input->one("lattice sq2 1.0");); +} + +TEST_F(LatticeRegionTest, lattice_hex) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + lmp->input->one("lattice hex 2.0"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::HEX); + ASSERT_DOUBLE_EQ(lattice->xlattice, 2.0); + ASSERT_DOUBLE_EQ(lattice->ylattice, 3.4641016151377544); + ASSERT_DOUBLE_EQ(lattice->zlattice, 2.0); + ASSERT_EQ(lattice->nbasis, 2); + ASSERT_EQ(lattice->basis[0][0], 0.0); + ASSERT_EQ(lattice->basis[0][1], 0.0); + ASSERT_EQ(lattice->basis[0][2], 0.0); + ASSERT_EQ(lattice->basis[1][0], 0.5); + ASSERT_EQ(lattice->basis[1][1], 0.5); + ASSERT_EQ(lattice->basis[1][2], 0.0); + ASSERT_EQ(lattice->a1[0], 1.0); + ASSERT_EQ(lattice->a1[1], 0.0); + ASSERT_EQ(lattice->a1[2], 0.0); + ASSERT_EQ(lattice->a2[0], 0.0); + ASSERT_DOUBLE_EQ(lattice->a2[1], sqrt(3.0)); + ASSERT_EQ(lattice->a2[2], 0.0); + ASSERT_EQ(lattice->a3[0], 0.0); + ASSERT_EQ(lattice->a3[1], 0.0); + ASSERT_EQ(lattice->a3[2], 1.0); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 3"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Lattice style incompatible with simulation dimension.*", + lmp->input->one("lattice hex 1.0");); +} + +TEST_F(LatticeRegionTest, lattice_custom) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("variable a equal 4.34"); + lmp->input->one("variable b equal $a*sqrt(3.0)"); + lmp->input->one("variable c equal $a*sqrt(8.0/3.0)"); + lmp->input->one("variable t equal 1.0/3.0"); + lmp->input->one("variable f equal 5.0/6.0"); + lmp->input->one("lattice custom 1.0 " + "a1 $a 0.0 0.0 " + "a2 0.0 $b 0.0 " + "a3 0.0 0.0 $c " + "basis 0.0 0.0 0.0 " + "basis 0.5 0.5 0.0 " + "basis $t 0.0 0.5 " + "basis $f 0.5 0.5 " + "basis 0.0 0.0 0.625 " + "basis 0.5 0.5 0.625 " + "basis $t 0.0 0.125 " + "basis $f 0.5 0.125 "); + if (!verbose) ::testing::internal::GetCapturedStdout(); + auto lattice = lmp->domain->lattice; + ASSERT_EQ(lattice->style, Lattice::CUSTOM); + ASSERT_DOUBLE_EQ(lattice->xlattice, 4.34); + ASSERT_DOUBLE_EQ(lattice->ylattice, 4.34 * sqrt(3.0)); + ASSERT_DOUBLE_EQ(lattice->zlattice, 4.34 * sqrt(8.0 / 3.0)); + ASSERT_EQ(lattice->nbasis, 8); + ASSERT_DOUBLE_EQ(lattice->basis[0][0], 0.0); + ASSERT_DOUBLE_EQ(lattice->basis[0][1], 0.0); + ASSERT_DOUBLE_EQ(lattice->basis[0][2], 0.0); + ASSERT_DOUBLE_EQ(lattice->basis[1][0], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[1][1], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[1][2], 0.0); + ASSERT_NEAR(lattice->basis[2][0], 1.0 / 3.0, 1.0e-14); + ASSERT_DOUBLE_EQ(lattice->basis[2][1], 0.0); + ASSERT_DOUBLE_EQ(lattice->basis[2][2], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[3][0], 5.0 / 6.0); + ASSERT_DOUBLE_EQ(lattice->basis[3][1], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[3][2], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[4][0], 0.0); + ASSERT_DOUBLE_EQ(lattice->basis[4][1], 0.0); + ASSERT_DOUBLE_EQ(lattice->basis[4][2], 0.625); + ASSERT_DOUBLE_EQ(lattice->basis[5][0], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[5][1], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[5][2], 0.625); + ASSERT_NEAR(lattice->basis[6][0], 1.0 / 3.0, 1.0e-14); + ASSERT_DOUBLE_EQ(lattice->basis[6][1], 0.0); + ASSERT_DOUBLE_EQ(lattice->basis[6][2], 0.125); + ASSERT_DOUBLE_EQ(lattice->basis[7][0], 5.0 / 6.0); + ASSERT_DOUBLE_EQ(lattice->basis[7][1], 0.5); + ASSERT_DOUBLE_EQ(lattice->basis[7][2], 0.125); + ASSERT_DOUBLE_EQ(lattice->a1[0], 4.34); + ASSERT_DOUBLE_EQ(lattice->a1[1], 0.0); + ASSERT_DOUBLE_EQ(lattice->a1[2], 0.0); + ASSERT_DOUBLE_EQ(lattice->a2[0], 0.0); + ASSERT_DOUBLE_EQ(lattice->a2[1], 4.34 * sqrt(3.0)); + ASSERT_DOUBLE_EQ(lattice->a2[2], 0.0); + ASSERT_DOUBLE_EQ(lattice->a3[0], 0.0); + ASSERT_DOUBLE_EQ(lattice->a3[1], 0.0); + ASSERT_DOUBLE_EQ(lattice->a3[2], 4.34 * sqrt(8.0 / 3.0)); + + TEST_FAILURE(".*ERROR: Illegal lattice command.*", + lmp->input->one("lattice custom 1.0 basis -0.1 0 0");); + TEST_FAILURE(".*ERROR: Illegal lattice command.*", + lmp->input->one("lattice custom 1.0 basis 0.0 1.0 0");); + + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("dimension 2"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: No basis atoms in lattice.*", lmp->input->one("lattice custom 1.0");); + TEST_FAILURE(".*ERROR: Lattice settings are not compatible with 2d simulation.*", + lmp->input->one("lattice custom 1.0 origin 0.5 0.5 0.5 basis 0.0 0.0 0.0");); + TEST_FAILURE(".*ERROR: Lattice settings are not compatible with 2d simulation.*", + lmp->input->one("lattice custom 1.0 a1 1.0 1.0 1.0 basis 0.0 0.0 0.0");); + TEST_FAILURE(".*ERROR: Lattice settings are not compatible with 2d simulation.*", + lmp->input->one("lattice custom 1.0 a2 1.0 1.0 1.0 basis 0.0 0.0 0.0");); + TEST_FAILURE(".*ERROR: Lattice settings are not compatible with 2d simulation.*", + lmp->input->one("lattice custom 1.0 a3 1.0 1.0 1.0 basis 0.0 0.0 0.0");); +} + +TEST_F(LatticeRegionTest, region_fail) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice none 2.0"); + lmp->input->one("region box block 0 1 0 1 0 1"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + TEST_FAILURE(".*ERROR: Create_atoms command before simulation box is defined.*", + lmp->input->one("create_atoms 1 box");); + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("create_box 1 box"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + TEST_FAILURE(".*ERROR: Cannot create atoms with undefined lattice.*", + lmp->input->one("create_atoms 1 box");); +} + +TEST_F(LatticeRegionTest, region_block_lattice) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice sc 1.5"); + lmp->input->one("region box block 0 2 0 2 0 2 units lattice"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 box"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ASSERT_EQ(lmp->domain->triclinic, 0); + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 8); + ASSERT_DOUBLE_EQ(x[0][0], 0.0); + ASSERT_DOUBLE_EQ(x[0][1], 0.0); + ASSERT_DOUBLE_EQ(x[0][2], 0.0); + ASSERT_DOUBLE_EQ(x[1][0], 1.5); + ASSERT_DOUBLE_EQ(x[1][1], 0.0); + ASSERT_DOUBLE_EQ(x[1][2], 0.0); + ASSERT_DOUBLE_EQ(x[2][0], 0.0); + ASSERT_DOUBLE_EQ(x[2][1], 1.5); + ASSERT_DOUBLE_EQ(x[2][2], 0.0); + ASSERT_DOUBLE_EQ(x[3][0], 1.5); + ASSERT_DOUBLE_EQ(x[3][1], 1.5); + ASSERT_DOUBLE_EQ(x[3][2], 0.0); +} + +TEST_F(LatticeRegionTest, region_block_box) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice sc 1.5 origin 0.75 0.75 0.75"); + lmp->input->one("region box block 0 2 0 2 0 2 units box"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 box"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lmp->domain->triclinic, 0); + + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 1); + ASSERT_DOUBLE_EQ(x[0][0], 1.125); + ASSERT_DOUBLE_EQ(x[0][1], 1.125); + ASSERT_DOUBLE_EQ(x[0][2], 1.125); +} + +TEST_F(LatticeRegionTest, region_cone) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice fcc 2.5 origin 0.5 0.5 0.5"); + lmp->input->one("region box cone x 1.0 1.0 0.5 2.1 0.0 2.0"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 region box"); + lmp->input->one("write_dump all atom init.lammpstrj"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lmp->domain->triclinic, 0); + + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 42); +} + +TEST_F(LatticeRegionTest, region_cylinder) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice fcc 2.5 origin 0.5 0.5 0.5"); + lmp->input->one("region box cylinder z 1.0 1.0 2.1 0.0 2.0 "); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 region box"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lmp->domain->triclinic, 0); + + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 114); +} + +TEST_F(LatticeRegionTest, region_prism) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice bcc 2.5 origin 0.75 0.75 0.75"); + lmp->input->one("region box prism 0 2 0 2 0 2 0.5 0.0 0.0"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 box"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lmp->domain->triclinic, 1); + + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 16); +} + +TEST_F(LatticeRegionTest, region_sphere) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice fcc 2.5 origin 0.5 0.5 0.5"); + lmp->input->one("region box sphere 1.0 1.0 1.0 1.1"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 region box"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lmp->domain->triclinic, 0); + + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 14); +} + +TEST_F(LatticeRegionTest, region_union) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice fcc 2.5 origin 0.5 0.5 0.5"); + lmp->input->one("region part1 sphere 2.0 1.0 1.0 1.1"); + lmp->input->one("region part2 block 0.0 2.0 0.0 2.0 0.0 2.0"); + lmp->input->one("region box union 2 part1 part2"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 region box"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lmp->domain->triclinic, 0); + + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 67); +} + +TEST_F(LatticeRegionTest, region_intersect) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice fcc 2.5 origin 0.5 0.5 0.5"); + lmp->input->one("region part1 sphere 2.0 1.0 1.0 1.8"); + lmp->input->one("region part2 block 0.0 2.0 0.0 2.0 0.0 2.0"); + lmp->input->one("region box intersect 2 part1 part2"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 region box"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lmp->domain->triclinic, 0); + + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 21); +} + +TEST_F(LatticeRegionTest, region_plane) +{ + if (!verbose) ::testing::internal::CaptureStdout(); + lmp->input->one("lattice fcc 2.5 origin 0.5 0.5 0.5"); + lmp->input->one("region box block 0.0 2.0 0.0 2.0 0.0 2.0"); + lmp->input->one("region part1 plane 0.5 1.0 0.0 0.75 0.0 0.0"); + lmp->input->one("region part2 plane 1.5 1.0 0.0 0.75 0.0 0.0 side out"); + lmp->input->one("region atoms intersect 2 part1 part2"); + lmp->input->one("create_box 1 box"); + lmp->input->one("create_atoms 1 region atoms"); + lmp->input->one("write_dump all atom init.lammpstrj"); + if (!verbose) ::testing::internal::GetCapturedStdout(); + ASSERT_EQ(lmp->domain->triclinic, 0); + + auto x = lmp->atom->x; + ASSERT_EQ(lmp->atom->natoms, 16); +} + +} // namespace LAMMPS_NS + +int main(int argc, char **argv) +{ + MPI_Init(&argc, &argv); + ::testing::InitGoogleMock(&argc, argv); + + if (have_openmpi && !LAMMPS_NS::Info::has_exceptions()) + std::cout << "Warning: using OpenMPI without exceptions. " + "Death tests will be skipped\n"; + + // handle arguments passed via environment variable + if (const char *var = getenv("TEST_ARGS")) { + std::vector env = split_words(var); + for (auto arg : env) { + if (arg == "-v") { + verbose = true; + } + } + } + + if ((argc > 1) && (strcmp(argv[1], "-v") == 0)) verbose = true; + + int rv = RUN_ALL_TESTS(); + MPI_Finalize(); + return rv; +} diff --git a/unittest/commands/test_reset_ids.cpp b/unittest/commands/test_reset_ids.cpp index 4538aaca3f..bdd19f2bca 100644 --- a/unittest/commands/test_reset_ids.cpp +++ b/unittest/commands/test_reset_ids.cpp @@ -660,6 +660,8 @@ TEST_F(ResetIDsTest, TopologyData) TEST_F(ResetIDsTest, DeathTests) { + if (lmp->atom->natoms == 0) GTEST_SKIP(); + TEST_FAILURE(".*ERROR: Illegal reset_mol_ids command.*", lmp->input->one("reset_mol_ids");); TEST_FAILURE(".*ERROR: Illegal reset_mol_ids command.*", lmp->input->one("reset_mol_ids all offset 1 1");); diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index 9c2b93c6a9..1439b06572 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -125,3 +125,15 @@ foreach(TEST ${IMPROPER_TESTS}) add_test(NAME ${TNAME} COMMAND test_improper_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") endforeach() + +# tester for timestepping fixes +add_executable(test_fix_timestep test_fix_timestep.cpp) +target_link_libraries(test_fix_timestep PRIVATE lammps style_tests) + +# tests for timestep related fixes (time integration, thermostat, force manipulation, constraints/restraints) +file(GLOB FIX_TIMESTEP_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/fix-timestep-*.yaml) +foreach(TEST ${FIX_TIMESTEP_TESTS}) + string(REGEX REPLACE "^.*fix-timestep-(.*)\.yaml" "FixTimestep:\\1" TNAME ${TEST}) + add_test(NAME ${TNAME} COMMAND test_fix_timestep ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") +endforeach() diff --git a/unittest/force-styles/check_tests.py b/unittest/force-styles/check_tests.py index e145b867d6..a0934eabe8 100755 --- a/unittest/force-styles/check_tests.py +++ b/unittest/force-styles/check_tests.py @@ -55,6 +55,7 @@ kspace = {} pair = {} style_pattern = re.compile("(.+)Style\((.+),(.+)\)") +upper = re.compile("[A-Z]+") gpu = re.compile("(.+)/gpu$") intel = re.compile("(.+)/intel$") kokkos = re.compile("(.+)/kk$") @@ -85,7 +86,7 @@ for header in headers: for m in matches: # skip over internal styles w/o explicit documentation style = m[1] - if style.isupper(): + if upper.match(style): continue # detect, process, and flag suffix styles: @@ -131,6 +132,8 @@ for header in headers: register_style(kspace,style,info) elif m[0] == 'Pair': register_style(pair,style,info) + elif m[0] == 'Fix': + register_style(fix,style,info) @@ -179,6 +182,8 @@ counter += check_tests('improper',improper,'improper-*.yaml', '.*improper_style:\s*((\S+).*)?') counter += check_tests('kspace',kspace,'kspace-*.yaml', '.*kspace_style\s*((\S+).*)?') +counter += check_tests('fix',fix,'fix-*.yaml', + ' fix\s+((\S+)\s*)?') -total = len(pair)+len(bond)+len(angle)+len(dihedral)+len(improper)+len(kspace) +total = len(pair)+len(bond)+len(angle)+len(dihedral)+len(improper)+len(kspace)+len(fix) print(f"\nTotal tests missing: {counter} of {total}") diff --git a/unittest/force-styles/error_stats.h b/unittest/force-styles/error_stats.h index 664a987907..b9c44e4027 100644 --- a/unittest/force-styles/error_stats.h +++ b/unittest/force-styles/error_stats.h @@ -29,6 +29,7 @@ public: double dev() const; double max() const { return maxerr; } double idx() const { return maxidx; } + bool has_data() const { return num > 0; } private: double sum, sumsq, maxerr; diff --git a/unittest/force-styles/test_config.h b/unittest/force-styles/test_config.h index 3ac838f635..baf3a5f29a 100644 --- a/unittest/force-styles/test_config.h +++ b/unittest/force-styles/test_config.h @@ -58,15 +58,21 @@ public: double run_coul; stress_t init_stress; stress_t run_stress; + double global_scalar; + std::vector global_vector; std::vector init_forces; std::vector run_forces; + std::vector run_pos; + std::vector restart_pos; + std::vector run_vel; + std::vector restart_vel; TestConfig() : lammps_version(""), date_generated(""), basename(""), epsilon(1.0e-14), input_file(""), pair_style("zero"), bond_style("zero"), angle_style("zero"), dihedral_style("zero"), improper_style("zero"), kspace_style("none"), natoms(0), init_energy(0), run_energy(0), init_vdwl(0), run_vdwl(0), init_coul(0), run_coul(0), init_stress({0, 0, 0, 0, 0, 0}), - run_stress({0, 0, 0, 0, 0, 0}) + run_stress({0, 0, 0, 0, 0, 0}), global_scalar(0) { prerequisites.clear(); pre_commands.clear(); @@ -79,6 +85,11 @@ public: extract.clear(); init_forces.clear(); run_forces.clear(); + run_pos.clear(); + restart_pos.clear(); + run_vel.clear(); + restart_vel.clear(); + global_vector.clear(); } virtual ~TestConfig(){}; diff --git a/unittest/force-styles/test_config_reader.cpp b/unittest/force-styles/test_config_reader.cpp index 24b08f93e9..d885102f3e 100644 --- a/unittest/force-styles/test_config_reader.cpp +++ b/unittest/force-styles/test_config_reader.cpp @@ -40,6 +40,8 @@ TestConfigReader::TestConfigReader(TestConfig &config) : YamlReader(), config(co consumers["run_stress"] = &TestConfigReader::run_stress; consumers["init_forces"] = &TestConfigReader::init_forces; consumers["run_forces"] = &TestConfigReader::run_forces; + consumers["run_pos"] = &TestConfigReader::run_pos; + consumers["run_vel"] = &TestConfigReader::run_vel; consumers["pair_style"] = &TestConfigReader::pair_style; consumers["pair_coeff"] = &TestConfigReader::pair_coeff; @@ -48,6 +50,9 @@ TestConfigReader::TestConfigReader(TestConfig &config) : YamlReader(), config(co consumers["run_vdwl"] = &TestConfigReader::run_vdwl; consumers["run_coul"] = &TestConfigReader::run_coul; + consumers["global_scalar"] = &TestConfigReader::global_scalar; + consumers["global_vector"] = &TestConfigReader::global_vector; + consumers["bond_style"] = &TestConfigReader::bond_style; consumers["bond_coeff"] = &TestConfigReader::bond_coeff; consumers["angle_style"] = &TestConfigReader::angle_style; @@ -176,6 +181,36 @@ void TestConfigReader::run_forces(const yaml_event_t &event) } } +void TestConfigReader::run_pos(const yaml_event_t &event) +{ + config.run_pos.clear(); + config.run_pos.resize(config.natoms + 1); + std::stringstream data((char *)event.data.scalar.value); + std::string line; + + while (std::getline(data, line, '\n')) { + int tag; + coord_t xyz; + sscanf(line.c_str(), "%d %lg %lg %lg", &tag, &xyz.x, &xyz.y, &xyz.z); + config.run_pos[tag] = xyz; + } +} + +void TestConfigReader::run_vel(const yaml_event_t &event) +{ + config.run_vel.clear(); + config.run_vel.resize(config.natoms + 1); + std::stringstream data((char *)event.data.scalar.value); + std::string line; + + while (std::getline(data, line, '\n')) { + int tag; + coord_t xyz; + sscanf(line.c_str(), "%d %lg %lg %lg", &tag, &xyz.x, &xyz.y, &xyz.z); + config.run_vel[tag] = xyz; + } +} + void TestConfigReader::pair_style(const yaml_event_t &event) { config.pair_style = (char *)event.data.scalar.value; @@ -267,3 +302,21 @@ void TestConfigReader::run_energy(const yaml_event_t &event) { config.run_energy = atof((char *)event.data.scalar.value); } + +void TestConfigReader::global_scalar(const yaml_event_t &event) +{ + config.global_scalar = atof((char *)event.data.scalar.value); +} + +void TestConfigReader::global_vector(const yaml_event_t &event) +{ + std::stringstream data((char *)event.data.scalar.value); + config.global_vector.clear(); + double value; + std::size_t num; + data >> num; + for (std::size_t i = 0; i < num; ++i) { + data >> value; + config.global_vector.push_back(value); + } +} diff --git a/unittest/force-styles/test_config_reader.h b/unittest/force-styles/test_config_reader.h index f39706db90..46cf6ec87f 100644 --- a/unittest/force-styles/test_config_reader.h +++ b/unittest/force-styles/test_config_reader.h @@ -36,6 +36,8 @@ public: void run_stress(const yaml_event_t &event); void init_forces(const yaml_event_t &event); void run_forces(const yaml_event_t &event); + void run_pos(const yaml_event_t &event); + void run_vel(const yaml_event_t &event); void pair_style(const yaml_event_t &event); void pair_coeff(const yaml_event_t &event); void bond_style(const yaml_event_t &event); @@ -49,6 +51,8 @@ public: void run_coul(const yaml_event_t &event); void init_energy(const yaml_event_t &event); void run_energy(const yaml_event_t &event); + void global_scalar(const yaml_event_t &event); + void global_vector(const yaml_event_t &event); }; #endif diff --git a/unittest/force-styles/test_error_stats.cpp b/unittest/force-styles/test_error_stats.cpp index 42c185db83..0873757acd 100644 --- a/unittest/force-styles/test_error_stats.cpp +++ b/unittest/force-styles/test_error_stats.cpp @@ -29,12 +29,14 @@ TEST(ErrorStats, test) ASSERT_EQ(out.str(), "Average: 5.800e-01 StdDev: 7.305e-01 MaxErr: 2.000e+00 @ item: 3.0"); stats.reset(); + ASSERT_EQ(stats.has_data(), false); ASSERT_DOUBLE_EQ(stats.avg(), 0.0); ASSERT_DOUBLE_EQ(stats.dev(), 0.0); ASSERT_DOUBLE_EQ(stats.max(), 0.0); ASSERT_EQ(stats.idx(), -1); stats.add(1.0); + ASSERT_EQ(stats.has_data(), true); ASSERT_DOUBLE_EQ(stats.avg(), 1.0); ASSERT_DOUBLE_EQ(stats.dev(), 0.0); ASSERT_DOUBLE_EQ(stats.max(), 1.0); diff --git a/unittest/force-styles/test_fix_timestep.cpp b/unittest/force-styles/test_fix_timestep.cpp new file mode 100644 index 0000000000..0ffb197f17 --- /dev/null +++ b/unittest/force-styles/test_fix_timestep.cpp @@ -0,0 +1,1166 @@ +/* ---------------------------------------------------------------------- + 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. +------------------------------------------------------------------------- */ + +// unit tests for pair styles intended for molecular systems + +#include "error_stats.h" +#include "test_config.h" +#include "test_config_reader.h" +#include "test_main.h" +#include "yaml_reader.h" +#include "yaml_writer.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include "atom.h" +#include "compute.h" +#include "fix.h" +#include "fmt/format.h" +#include "force.h" +#include "info.h" +#include "input.h" +#include "kspace.h" +#include "lammps.h" +#include "modify.h" +#include "pair.h" +#include "universe.h" +#include "utils.h" +#include "variable.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using ::testing::HasSubstr; +using ::testing::StartsWith; + +using namespace LAMMPS_NS; + +static void delete_file(const std::string &filename) +{ + remove(filename.c_str()); +}; + +void cleanup_lammps(LAMMPS *lmp, const TestConfig &cfg) +{ + delete_file(cfg.basename + ".restart"); + delete lmp; + lmp = nullptr; +} + +LAMMPS *init_lammps(int argc, char **argv, const TestConfig &cfg, const bool use_respa = false) +{ + LAMMPS *lmp; + + lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD); + + // check if prerequisite styles are available + Info *info = new Info(lmp); + int nfail = 0; + for (auto &prerequisite : cfg.prerequisites) { + std::string style = prerequisite.second; + + // this is a test for fix styles, so if the suffixed + // version is not available, there is no reason to test. + if (prerequisite.first == "fix") { + if (lmp->suffix_enable) { + style += "/"; + style += lmp->suffix; + } + } + + if (!info->has_style(prerequisite.first, style)) ++nfail; + } + delete info; + if (nfail > 0) { + cleanup_lammps(lmp, cfg); + return nullptr; + } + + // utility lambda to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + + command("variable input_dir index " + INPUT_FOLDER); + for (auto &pre_command : cfg.pre_commands) + command(pre_command); + + std::string input_file = INPUT_FOLDER + PATH_SEP + cfg.input_file; + lmp->input->file(input_file.c_str()); + + if (use_respa) command("run_style respa 2 1 bond 1 pair 2"); + + // set up molecular system force field + + command("pair_style lj/cut 8.0"); + command("pair_coeff 1 1 0.02 2.5"); + command("pair_coeff 2 2 0.005 1.0"); + command("pair_coeff 2 4 0.005 0.5"); + command("pair_coeff 3 3 0.02 3.2"); + command("pair_coeff 4 4 0.015 3.1"); + command("pair_coeff 5 5 0.015 3.1"); + command("bond_style harmonic"); + command("bond_coeff 1 250.0 1.5"); + command("bond_coeff 2 300.0 1.1"); + command("bond_coeff 3 350.0 1.3"); + command("bond_coeff 4 650.0 1.2"); + command("bond_coeff 5 450.0 1.0"); + command("angle_style harmonic"); + command("angle_coeff 1 75.0 110.1"); + command("angle_coeff 2 45.0 111.0"); + command("angle_coeff 3 50.0 120.0"); + command("angle_coeff 4 100.0 108.5"); + command("group solute molecule 1:2"); + command("group solvent molecule 3:5"); + + for (auto &post_command : cfg.post_commands) + command(post_command); + + command("timestep 0.25"); + command("run 0 post no"); + command("thermo 2"); + command("run 4 post no start 0 stop 8"); + command("write_restart " + cfg.basename + ".restart"); + command("run 4 post no start 0 stop 8"); + return lmp; +} + +void restart_lammps(LAMMPS *lmp, const TestConfig &cfg, bool use_rmass, bool use_respa) +{ + // utility lambda to improve readability + auto command = [&](const std::string &line) { + lmp->input->one(line.c_str()); + }; + + command("clear"); + command("read_restart " + cfg.basename + ".restart"); + + if (use_rmass) { + command("fix rmass all property/atom rmass ghost yes"); + for (int i = 0; i < lmp->atom->ntypes; ++i) + command(fmt::format("set type {} mass {}", i + 1, lmp->atom->mass[i + 1])); + } + + if (use_respa) command("run_style respa 2 1 bond 1 pair 2"); + + for (auto &post_command : cfg.post_commands) + command(post_command); + + command("thermo 2"); + command("run 4 post no start 0 stop 8"); +} + +// re-generate yaml file with current settings. + +void generate_yaml_file(const char *outfile, const TestConfig &config) +{ + // initialize system geometry + const char *args[] = {"FixIntegrate", "-log", "none", "-echo", "screen", "-nocite"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + LAMMPS *lmp = init_lammps(argc, argv, config); + if (!lmp) { + std::cerr << "One or more prerequisite styles are not available " + "in this LAMMPS configuration:\n"; + for (auto prerequisite : config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + return; + } + + const int natoms = lmp->atom->natoms; + std::string block(""); + YamlWriter writer(outfile); + + // lammps_version + writer.emit("lammps_version", lmp->universe->version); + + // date_generated + std::time_t now = time(NULL); + block = ctime(&now); + block = block.substr(0, block.find("\n") - 1); + writer.emit("date_generated", block); + + // epsilon + writer.emit("epsilon", config.epsilon); + + // prerequisites + block.clear(); + for (auto &prerequisite : config.prerequisites) { + block += prerequisite.first + " " + prerequisite.second + "\n"; + } + writer.emit_block("prerequisites", block); + + // pre_commands + block.clear(); + for (auto &command : config.pre_commands) { + block += command + "\n"; + } + writer.emit_block("pre_commands", block); + + // post_commands + block.clear(); + for (auto &command : config.post_commands) { + block += command + "\n"; + } + writer.emit_block("post_commands", block); + + // input_file + writer.emit("input_file", config.input_file); + + // natoms + writer.emit("natoms", natoms); + + int ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + std::cerr << "ERROR: no fix defined with fix ID 'test'\n"; + exit(1); + } else { + Fix *fix = lmp->modify->fix[ifix]; + + // run_stress, if enabled + if (fix->thermo_virial) { + auto stress = fix->virial; + block = fmt::format("{:23.16e} {:23.16e} {:23.16e} " + "{:23.16e} {:23.16e} {:23.16e}", + stress[0], stress[1], stress[2], stress[3], stress[4], stress[5]); + writer.emit_block("run_stress", block); + } + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + writer.emit("global_scalar", value); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + block = std::to_string(num); + for (int i = 0; i < num; ++i) + block += fmt::format(" {}", fix->compute_vector(i)); + writer.emit_block("global_vector", block); + } + } + + // run_pos + block.clear(); + auto x = lmp->atom->x; + for (int i = 1; i <= natoms; ++i) { + const int j = lmp->atom->map(i); + block += fmt::format("{:3} {:23.16e} {:23.16e} {:23.16e}\n", i, x[j][0], x[j][1], x[j][2]); + } + writer.emit_block("run_pos", block); + + // run_vel + block.clear(); + auto v = lmp->atom->v; + for (int i = 1; i <= natoms; ++i) { + const int j = lmp->atom->map(i); + block += fmt::format("{:3} {:23.16e} {:23.16e} {:23.16e}\n", i, v[j][0], v[j][1], v[j][2]); + } + writer.emit_block("run_vel", block); + cleanup_lammps(lmp, config); + return; +} + +TEST(FixTimestep, plain) +{ + if (!LAMMPS::is_installed_pkg("MOLECULE")) GTEST_SKIP(); + const char *args[] = {"FixTimestep", "-log", "none", "-echo", "screen", "-nocite"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + + ::testing::internal::CaptureStdout(); + LAMMPS *lmp = init_lammps(argc, argv, test_config); + std::string output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + + if (!lmp) { + std::cerr << "One or more prerequisite styles are not available " + "in this LAMMPS configuration:\n"; + for (auto &prerequisite : test_config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + GTEST_SKIP(); + } + + EXPECT_THAT(output, StartsWith("LAMMPS (")); + EXPECT_THAT(output, HasSubstr("Loop time")); + + // abort if running in parallel and not all atoms are local + const int nlocal = lmp->atom->nlocal; + ASSERT_EQ(lmp->atom->natoms, nlocal); + + double epsilon = test_config.epsilon; + + auto tag = lmp->atom->tag; + auto x = lmp->atom->x; + auto v = lmp->atom->v; + ErrorStats stats; + stats.reset(); + const std::vector &x_ref = test_config.run_pos; + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, normal run, verlet: " << stats << std::endl; + + const std::vector &v_ref = test_config.run_vel; + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, normal run, verlet: " << stats << std::endl; + + int ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress normal run, verlet: " << stats << std::endl; + } + + stats.reset(); + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + epsilon); + } + + // check t_target for thermostats + + int dim = -1; + double *ptr = (double *)fix->extract("t_target", dim); + if ((ptr != nullptr) && (dim == 0)) { + int ivar = lmp->input->variable->find("t_target"); + if (ivar >= 0) { + double t_ref = atof(lmp->input->variable->retrieve("t_target")); + double t_target = *ptr; + EXPECT_FP_LE_WITH_EPS(t_target, t_ref, epsilon); + } + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, normal run, verlet: " << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config, false, false); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + tag = lmp->atom->tag; + x = lmp->atom->x; + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, restart, verlet: " << stats << std::endl; + + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, restart, verlet: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress restart, verlet: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, restart, verlet: " << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config, true, false); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + x = lmp->atom->x; + tag = lmp->atom->tag; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, rmass, verlet: " << stats << std::endl; + + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, rmass, verlet: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress rmass, verlet: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, rmass, verlet: " << stats << std::endl; + } + + // rigid fixes need work to test properly with r-RESPA + ifix = lmp->modify->find_fix("test"); + if (!utils::strmatch(lmp->modify->fix[ifix]->style, "^rigid")) { + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ::testing::internal::CaptureStdout(); + lmp = init_lammps(argc, argv, test_config, true); + output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + + // lower required precision by two orders of magnitude to accommodate respa + epsilon *= 100.0; + + tag = lmp->atom->tag; + x = lmp->atom->x; + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, normal run, respa: " << stats << std::endl; + + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, normal run, respa: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 1000 * epsilon); + if (print_stats) + std::cerr << "run_stress normal run, respa: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, 10 * epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + 10 * epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, normal run, respa: " << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config, false, true); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + tag = lmp->atom->tag; + x = lmp->atom->x; + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, restart, respa: " << stats << std::endl; + + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, restart, respa: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 1000 * epsilon); + if (print_stats) std::cerr << "run_stress restart, respa: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, 10 * epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + 10 * epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, restart, respa: " << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config, true, true); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + x = lmp->atom->x; + tag = lmp->atom->tag; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, rmass, respa: " << stats << std::endl; + + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, rmass, respa: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 1000 * epsilon); + if (print_stats) std::cerr << "run_stress rmass, respa: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, 10 * epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + 10 * epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, rmass, respa: " << stats << std::endl; + } + } + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); +}; + +TEST(FixTimestep, omp) +{ + if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP(); + if (!LAMMPS::is_installed_pkg("MOLECULE")) GTEST_SKIP(); + const char *args[] = {"FixTimestep", "-log", "none", "-echo", "screen", "-nocite", + "-pk", "omp", "4", "-sf", "omp"}; + + char **argv = (char **)args; + int argc = sizeof(args) / sizeof(char *); + + ::testing::internal::CaptureStdout(); + LAMMPS *lmp = init_lammps(argc, argv, test_config); + std::string output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + + if (!lmp) { + std::cerr << "One or more prerequisite styles are not available " + "in this LAMMPS configuration:\n"; + for (auto &prerequisite : test_config.prerequisites) { + std::cerr << prerequisite.first << "_style " << prerequisite.second << "\n"; + } + GTEST_SKIP(); + } + + EXPECT_THAT(output, StartsWith("LAMMPS (")); + EXPECT_THAT(output, HasSubstr("Loop time")); + + // abort if running in parallel and not all atoms are local + const int nlocal = lmp->atom->nlocal; + ASSERT_EQ(lmp->atom->natoms, nlocal); + + double epsilon = test_config.epsilon; + + auto tag = lmp->atom->tag; + auto x = lmp->atom->x; + auto v = lmp->atom->v; + ErrorStats stats; + stats.reset(); + const std::vector &x_ref = test_config.run_pos; + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, normal run, verlet: " << stats << std::endl; + + const std::vector &v_ref = test_config.run_vel; + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, normal run, verlet: " << stats << std::endl; + + int ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress normal run, verlet: " << stats << std::endl; + } + + stats.reset(); + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + epsilon); + } + + // check t_target for thermostats + + int dim = -1; + double *ptr = (double *)fix->extract("t_target", dim); + if ((ptr != nullptr) && (dim == 0)) { + int ivar = lmp->input->variable->find("t_target"); + if (ivar >= 0) { + double t_ref = atof(lmp->input->variable->retrieve("t_target")); + double t_target = *ptr; + EXPECT_FP_LE_WITH_EPS(t_target, t_ref, epsilon); + } + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, normal run, verlet: " << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config, false, false); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + tag = lmp->atom->tag; + x = lmp->atom->x; + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, restart, verlet: " << stats << std::endl; + + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, restart, verlet: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress restart, verlet: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, restart, verlet: " << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config, true, false); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + x = lmp->atom->x; + tag = lmp->atom->tag; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, rmass, verlet: " << stats << std::endl; + + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, rmass, verlet: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, epsilon); + if (print_stats) std::cerr << "run_stress rmass, verlet: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, rmass, verlet: " << stats << std::endl; + } + + // rigid fixes need work to test properly with r-RESPA + ifix = lmp->modify->find_fix("test"); + if (!utils::strmatch(lmp->modify->fix[ifix]->style, "^rigid")) { + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + ::testing::internal::CaptureStdout(); + lmp = init_lammps(argc, argv, test_config, true); + output = ::testing::internal::GetCapturedStdout(); + if (verbose) std::cout << output; + + // lower required precision by two orders of magnitude to accommodate respa + epsilon *= 100.0; + + tag = lmp->atom->tag; + x = lmp->atom->x; + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, normal run, respa: " << stats << std::endl; + + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, normal run, respa: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 1000 * epsilon); + if (print_stats) + std::cerr << "run_stress normal run, respa: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, 10 * epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + 10 * epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, normal run, respa: " << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config, false, true); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + tag = lmp->atom->tag; + x = lmp->atom->x; + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, restart, respa: " << stats << std::endl; + + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, restart, respa: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 1000 * epsilon); + if (print_stats) std::cerr << "run_stress restart, respa: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, 10 * epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + 10 * epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, restart, respa: " << stats << std::endl; + } + + if (!verbose) ::testing::internal::CaptureStdout(); + restart_lammps(lmp, test_config, true, true); + if (!verbose) ::testing::internal::GetCapturedStdout(); + + x = lmp->atom->x; + tag = lmp->atom->tag; + stats.reset(); + ASSERT_EQ(nlocal + 1, x_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(x[i][0], x_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][1], x_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(x[i][2], x_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_pos, rmass, respa: " << stats << std::endl; + + v = lmp->atom->v; + stats.reset(); + ASSERT_EQ(nlocal + 1, v_ref.size()); + for (int i = 0; i < nlocal; ++i) { + EXPECT_FP_LE_WITH_EPS(v[i][0], v_ref[tag[i]].x, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][1], v_ref[tag[i]].y, epsilon); + EXPECT_FP_LE_WITH_EPS(v[i][2], v_ref[tag[i]].z, epsilon); + } + if (print_stats) std::cerr << "run_vel, rmass, respa: " << stats << std::endl; + + ifix = lmp->modify->find_fix("test"); + if (ifix < 0) { + FAIL() << "ERROR: no fix defined with fix ID 'test'\n"; + } else { + Fix *fix = lmp->modify->fix[ifix]; + if (fix->thermo_virial) { + stats.reset(); + auto stress = fix->virial; + EXPECT_FP_LE_WITH_EPS(stress[0], test_config.run_stress.xx, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[1], test_config.run_stress.yy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[2], test_config.run_stress.zz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[3], test_config.run_stress.xy, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[4], test_config.run_stress.xz, 1000 * epsilon); + EXPECT_FP_LE_WITH_EPS(stress[5], test_config.run_stress.yz, 1000 * epsilon); + if (print_stats) std::cerr << "run_stress rmass, respa: " << stats << std::endl; + } + + stats.reset(); + + // global scalar + if (fix->scalar_flag) { + double value = fix->compute_scalar(); + EXPECT_FP_LE_WITH_EPS(test_config.global_scalar, value, 10 * epsilon); + } + + // global vector + if (fix->vector_flag) { + int num = fix->size_vector; + EXPECT_EQ(num, test_config.global_vector.size()); + + for (int i = 0; i < num; ++i) + EXPECT_FP_LE_WITH_EPS(test_config.global_vector[i], fix->compute_vector(i), + 10 * epsilon); + } + if (print_stats && stats.has_data()) + std::cerr << "global_data, rmass, respa: " << stats << std::endl; + } + } + + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); +}; diff --git a/unittest/force-styles/test_main.cpp b/unittest/force-styles/test_main.cpp index 3e991b26ad..1d206dc43e 100644 --- a/unittest/force-styles/test_main.cpp +++ b/unittest/force-styles/test_main.cpp @@ -102,13 +102,16 @@ int main(int argc, char **argv) if (strcmp(argv[iarg], "-g") == 0) { if (iarg + 1 < argc) { generate_yaml_file(argv[iarg + 1], test_config); + MPI_Finalize(); return 0; } else { usage(std::cerr, argv[0]); + MPI_Finalize(); return 1; } } else if (strcmp(argv[iarg], "-u") == 0) { generate_yaml_file(argv[1], test_config); + MPI_Finalize(); return 0; } else if (strcmp(argv[iarg], "-d") == 0) { if (iarg + 1 < argc) { @@ -116,6 +119,7 @@ int main(int argc, char **argv) iarg += 2; } else { usage(std::cerr, argv[0]); + MPI_Finalize(); return 1; } } else if (strcmp(argv[iarg], "-s") == 0) { @@ -127,6 +131,7 @@ int main(int argc, char **argv) } else { std::cerr << "unknown option: " << argv[iarg] << "\n\n"; usage(std::cerr, argv[0]); + MPI_Finalize(); return 1; } } diff --git a/unittest/force-styles/test_pair_style.cpp b/unittest/force-styles/test_pair_style.cpp index 04da054cfb..2cc39f712d 100644 --- a/unittest/force-styles/test_pair_style.cpp +++ b/unittest/force-styles/test_pair_style.cpp @@ -1107,8 +1107,7 @@ TEST(PairStyle, single) (test_config.pair_style.substr(0, 14) == "yukawa/colloid") || (test_config.pair_style.substr(0, 3) == "eam") || ((test_config.pair_style.substr(0, 6) == "hybrid") && - (test_config.pair_style.find("eam") != std::string::npos)) - ) { + (test_config.pair_style.find("eam") != std::string::npos))) { if (!verbose) ::testing::internal::CaptureStdout(); cleanup_lammps(lmp, test_config); if (!verbose) ::testing::internal::GetCapturedStdout(); diff --git a/unittest/force-styles/tests/atomic-pair-edip.yaml b/unittest/force-styles/tests/atomic-pair-edip.yaml index 324b06e967..c46742a30c 100644 --- a/unittest/force-styles/tests/atomic-pair-edip.yaml +++ b/unittest/force-styles/tests/atomic-pair-edip.yaml @@ -1,7 +1,7 @@ --- lammps_version: 21 Jul 2020 date_generated: Fri Aug 7 16:11:57 202 -epsilon: 1e-14 +epsilon: 2e-14 prerequisites: ! | pair edip pre_commands: ! | diff --git a/unittest/force-styles/tests/fix-timestep-addforce-const.yaml b/unittest/force-styles/tests/fix-timestep-addforce-const.yaml new file mode 100644 index 0000000000..99ffda3dea --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-addforce-const.yaml @@ -0,0 +1,77 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 20:56:35 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix addforce +pre_commands: ! "" +post_commands: ! | + fix move all nve + fix test solute addforce 0.0 -0.1 0.1 +input_file: in.fourmol +natoms: 29 +global_scalar: 1.48901835738129 +global_vector: ! |- + 3 0.030822392996626036 0.026014193882019754 -0.017708991389909556 +run_pos: ! |2 + 1 -2.7045575291334861e-01 2.4912098953869757e+00 -1.6695239815574214e-01 + 2 3.1004076900710170e-01 2.9612149597462425e+00 -8.5464329005027972e-01 + 3 -7.0398549308743119e-01 1.2305439518786667e+00 -6.2776812583732400e-01 + 4 -1.5818160726875390e+00 1.4837199951274893e+00 -1.2538503621778578e+00 + 5 -9.0719748669903200e-01 9.2650033697311973e-01 3.9956266031649879e-01 + 6 2.4831714249110262e-01 2.8312325631591767e-01 -1.2314165454625041e+00 + 7 3.4143527198959711e-01 -2.2651747674360529e-02 -2.5292238033565768e+00 + 8 1.1743553514271237e+00 -4.8863828453992741e-01 -6.3782817835070349e-01 + 9 1.3800522445502728e+00 -2.5276822789361231e-01 2.8356018210481976e-01 + 10 2.0510765111429961e+00 -1.4604133270429198e+00 -9.8323043580441027e-01 + 11 1.7878031588883598e+00 -1.9922071845945071e+00 -1.8890394822792633e+00 + 12 3.0063007413447411e+00 -4.9014063242955885e-01 -1.6231827019640992e+00 + 13 4.0515402229636264e+00 -8.9204090546353654e-01 -1.6399797487882732e+00 + 14 2.6066963018347171e+00 -4.1791325385826189e-01 -2.6633797762015425e+00 + 15 2.9695287113240152e+00 5.5420546275525007e-01 -1.2341814098635149e+00 + 16 2.6747030089515893e+00 -2.4124189004358674e+00 -2.3428869709464669e-02 + 17 2.2153577487661584e+00 -2.0898037210104183e+00 1.1963203850079958e+00 + 18 2.1369701704121455e+00 3.0158507413641966e+00 -3.5179348337229994e+00 + 19 1.5355837136088100e+00 2.6255292355377717e+00 -4.2353987779882338e+00 + 20 2.7727573005679371e+00 3.6923910449611110e+00 -3.9330842459134390e+00 + 21 4.9040128073204006e+00 -4.0752348172958719e+00 -3.6210314709889815e+00 + 22 4.3582355554440877e+00 -4.2126119427287128e+00 -4.4612844196313990e+00 + 23 5.7439382849307599e+00 -3.5821957939275113e+00 -3.8766361295935736e+00 + 24 2.0689243582419619e+00 3.1513346907267743e+00 3.1550389754827148e+00 + 25 1.3045351331489012e+00 3.2665125705839713e+00 2.5111855257429738e+00 + 26 2.5809237402711087e+00 4.0117602605482601e+00 3.2212060529089812e+00 + 27 -1.9611343130352876e+00 -4.3563411931356626e+00 2.1098293115521889e+00 + 28 -2.7473562684513193e+00 -4.0200819932379153e+00 1.5830052163433885e+00 + 29 -1.3126000191359226e+00 -3.5962518039482334e+00 2.2746342468737333e+00 +run_vel: ! |2 + 1 8.1702613218438691e-03 1.6510191351429417e-02 4.7964973237771503e-03 + 2 5.4511084170875343e-03 5.1590481528437813e-03 -1.4175058774793692e-03 + 3 -8.2297881733875439e-03 -1.2933678261753652e-02 -4.0910944229037285e-03 + 4 -3.7701876602396953e-03 -6.5929809185369939e-03 -1.0979051123824390e-03 + 5 -1.1021655940056645e-02 -9.9111987493572112e-03 -2.8208515585563172e-03 + 6 -3.9676769272842236e-02 4.6810118626188314e-02 3.7155184099431124e-02 + 7 9.1033245554758080e-04 -1.0133704610200299e-02 -5.1562858164992204e-02 + 8 7.9067086761695892e-03 -3.3567238353401636e-03 3.4563427326757518e-02 + 9 1.5640463507800002e-03 3.7153745906232053e-03 1.5067137863525135e-02 + 10 2.9201431684716742e-02 -2.9256524162078218e-02 -1.5011015513636336e-02 + 11 -4.7836707031183607e-03 -3.7689744526784260e-03 -2.3257693833597559e-03 + 12 2.2697215661243897e-03 -3.5503408953511771e-04 -3.0568221042131718e-03 + 13 2.7530266001101656e-03 5.7964078805919205e-03 -7.7394765650209171e-04 + 14 3.5245514557562165e-03 -5.8145427341994562e-03 -3.9275617105511392e-03 + 15 -1.8548103902428440e-03 -5.8759259808655083e-03 6.3145508812191310e-03 + 16 1.8681562217261326e-02 -1.3269471066222347e-02 -4.5631826406699355e-02 + 17 -1.2896316924809444e-02 9.7475788915801498e-03 3.7301887298077194e-02 + 18 -8.0065794732626385e-04 -8.6270472984577718e-04 -1.4483040728194251e-03 + 19 1.2452390837669909e-03 -2.5061097114590261e-03 7.2998631002926129e-03 + 20 3.5930060230919166e-03 3.6938860311325015e-03 3.2322732685912069e-03 + 21 -1.4689220371368486e-03 -2.7352129777820513e-04 7.0581624254054305e-04 + 22 -7.0694199254559926e-03 -4.2577148925067674e-03 2.8079117615819173e-04 + 23 6.0446963117369709e-03 -1.4000131614987045e-03 2.5819754847190117e-03 + 24 3.1926367840560363e-04 -9.9445664816168633e-04 1.4999996925784762e-04 + 25 1.3789754450351514e-04 -4.4335894890997355e-03 -8.1808136802931375e-04 + 26 2.0485904034793470e-03 2.7813358633281375e-03 4.3245727149043870e-03 + 27 4.5604120382313504e-04 -1.0305523020532397e-03 2.1188058344304351e-04 + 28 -6.2544520861381259e-03 1.4127711176493136e-03 -1.8429821884921316e-03 + 29 6.4110631547740983e-04 3.1273432720868841e-03 3.7253671104628787e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-addforce-variable.yaml b/unittest/force-styles/tests/fix-timestep-addforce-variable.yaml new file mode 100644 index 0000000000..ab7acf03f3 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-addforce-variable.yaml @@ -0,0 +1,82 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 20:56:35 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix addforce +pre_commands: ! "" +post_commands: ! | + fix init all store/state 0 x y z + variable xforce delete + variable xforce atom f_init[1] + variable zforce delete + variable zforce equal 0.1*step/10.0 + fix move all nve + fix test solute addforce v_xforce 0.0 v_zforce +input_file: in.fourmol +natoms: 29 +global_scalar: -66.6128081721324 +global_vector: ! |- + 3 0.030822805860552194 0.026012717110660333 -0.017710664092739137 +run_pos: ! |2 + 1 -2.7047214228789879e-01 2.4912159473897288e+00 -1.6695741351125751e-01 + 2 3.1010217675350321e-01 2.9612343643897283e+00 -8.5465678502037923e-01 + 3 -7.0403575539675045e-01 1.2305513713119018e+00 -6.2777371590783770e-01 + 4 -1.5821400298238728e+00 1.4837402879631465e+00 -1.2538644175974110e+00 + 5 -9.0738248321725767e-01 9.2652118661051119e-01 3.9954717998547740e-01 + 6 2.4833938838692704e-01 2.8312848343353764e-01 -1.2314198266861847e+00 + 7 3.4145305574459789e-01 -2.2646551615904693e-02 -2.5292277033981856e+00 + 8 1.1744251519295958e+00 -4.8863301930795239e-01 -6.3783420180106931e-01 + 9 1.3803393322923716e+00 -2.5274719088138620e-01 2.8354262280984910e-01 + 10 2.0512157806659483e+00 -1.4604034995894550e+00 -9.8323457702970984e-01 + 11 1.7881766053556223e+00 -1.9921867592459330e+00 -1.8890557966324570e+00 + 12 3.0065163851107513e+00 -4.9013454995145816e-01 -1.6231872062008903e+00 + 13 4.0523716162518593e+00 -8.9201902994109461e-01 -1.6399944550397565e+00 + 14 2.6072370808739733e+00 -4.1789116991871833e-01 -2.6633963232657543e+00 + 15 2.9701454639399292e+00 5.5422639267898544e-01 -1.2341975484787577e+00 + 16 2.6748871049483789e+00 -2.4124111330493521e+00 -2.3431784517031026e-02 + 17 2.2154747990656891e+00 -2.0897989887607591e+00 1.1963148502274976e+00 + 18 2.1369701704176829e+00 3.0158507413681335e+00 -3.5179348337252407e+00 + 19 1.5355837136089958e+00 2.6255292355383033e+00 -4.2353987779886255e+00 + 20 2.7727573005681436e+00 3.6923910449611030e+00 -3.9330842459134483e+00 + 21 4.9040128073163958e+00 -4.0752348172839117e+00 -3.6210314709779454e+00 + 22 4.3582355554441445e+00 -4.2126119427283166e+00 -4.4612844196308510e+00 + 23 5.7439382849302527e+00 -3.5821957939267821e+00 -3.8766361295928178e+00 + 24 2.0689243582437542e+00 3.1513346907275186e+00 3.1550389754841301e+00 + 25 1.3045351331496602e+00 3.2665125705847990e+00 2.5111855257446942e+00 + 26 2.5809237402712069e+00 4.0117602605483258e+00 3.2212060529090598e+00 + 27 -1.9611343130422572e+00 -4.3563411931406684e+00 2.1098293115555511e+00 + 28 -2.7473562684515755e+00 -4.0200819932380565e+00 1.5830052163434851e+00 + 29 -1.3126000191366660e+00 -3.5962518039487934e+00 2.2746342468743648e+00 +run_vel: ! |2 + 1 8.1542005804048114e-03 1.6516352657195144e-02 4.7916994861873716e-03 + 2 5.5108616996518527e-03 5.1769592855304752e-03 -1.4262044196006701e-03 + 3 -8.2819560524694975e-03 -1.2925874484803790e-02 -4.0962172584282129e-03 + 4 -4.0886380039043026e-03 -6.5733036630979845e-03 -1.1077208107759873e-03 + 5 -1.1204698339013554e-02 -9.8903762469767197e-03 -2.8335724171420786e-03 + 6 -3.9653324695987140e-02 4.6814090441761887e-02 3.7154219827738325e-02 + 7 9.2811228899244145e-04 -1.0128521447666933e-02 -5.1566014310509153e-02 + 8 7.9768414397017682e-03 -3.3521215541620886e-03 3.4557180732453542e-02 + 9 1.8506084396989573e-03 3.7365307043657862e-03 1.5049937691527137e-02 + 10 2.9339781785645530e-02 -2.9244335397845489e-02 -1.5013285041501756e-02 + 11 -4.4111732898708574e-03 -3.7490441708152595e-03 -2.3402341830182269e-03 + 12 2.4919774686993339e-03 -3.4986602016114646e-04 -3.0596868750942985e-03 + 13 3.5708757570142549e-03 5.8192695094192127e-03 -7.8509643584213180e-04 + 14 4.0624997491302594e-03 -5.7912127152414828e-03 -3.9424433676611033e-03 + 15 -1.2427000878928462e-03 -5.8549223934944352e-03 6.3005021988472203e-03 + 16 1.8865114672276220e-02 -1.3261139374878017e-02 -4.5632510336419303e-02 + 17 -1.2778996290317002e-02 9.7520044246185329e-03 3.7296098445722708e-02 + 18 -8.0065793587999099e-04 -8.6270472146121331e-04 -1.4483040775306573e-03 + 19 1.2452390841875935e-03 -2.5061097103150493e-03 7.2998630994791933e-03 + 20 3.5930060235755922e-03 3.6938860311851785e-03 3.2322732685174278e-03 + 21 -1.4689220453590402e-03 -2.7352127317486851e-04 7.0581626525379880e-04 + 22 -7.0694199252635138e-03 -4.2577148916858000e-03 2.8079117743316296e-04 + 23 6.0446963107027478e-03 -1.4000131600045436e-03 2.5819754862959378e-03 + 24 3.1926368204184148e-04 -9.9445664667548433e-04 1.4999997209784617e-04 + 25 1.3789754604908935e-04 -4.4335894874218615e-03 -8.1808136451897351e-04 + 26 2.0485904036966728e-03 2.7813358634892773e-03 4.3245727150655168e-03 + 27 4.5604118959923195e-04 -1.0305523122762120e-03 2.1188059030274769e-04 + 28 -6.2544520866959210e-03 1.4127711173635808e-03 -1.8429821883176730e-03 + 29 6.4110631389697711e-04 3.1273432708352981e-03 3.7253671117315453e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-aveforce-const.yaml b/unittest/force-styles/tests/fix-timestep-aveforce-const.yaml new file mode 100644 index 0000000000..e4da0e5953 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-aveforce-const.yaml @@ -0,0 +1,76 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 20:59:48 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix aveforce +pre_commands: ! "" +post_commands: ! | + fix move all nve + fix test solute aveforce 0.0 -0.1 0.1 +input_file: in.fourmol +natoms: 29 +global_vector: ! |- + 3 0.030693239277496787 0.026836713504508225 -0.017872771454378267 +run_pos: ! |2 + 1 -2.7837937276378577e-01 2.4738323337395633e+00 -1.7244628118937513e-01 + 2 3.0739712238693778e-01 2.9607606438663985e+00 -8.4971558628080046e-01 + 3 -6.9690101126084858e-01 1.2472621905952943e+00 -6.2300348438124675e-01 + 4 -1.5790176115308630e+00 1.4890051885382072e+00 -1.2569330199852327e+00 + 5 -8.9737740636582297e-01 9.3716922702553496e-01 4.0243602458027911e-01 + 6 2.9350792503004042e-01 2.2973704675580464e-01 -1.2827110266930783e+00 + 7 3.3997804713002810e-01 -1.0668179410931006e-02 -2.4648504997159280e+00 + 8 1.1649000306414594e+00 -4.8538782401639990e-01 -6.7628963324595071e-01 + 9 1.3802414668448064e+00 -2.5900562603021171e-01 2.7102062739419147e-01 + 10 2.0194286609797985e+00 -1.4274129376624451e+00 -9.6779510337284758e-01 + 11 1.7922388743932793e+00 -1.9901831169119615e+00 -1.8898772827854291e+00 + 12 3.0051950803427370e+00 -4.9053937459745156e-01 -1.6214531896525444e+00 + 13 4.0528786674689306e+00 -8.9433183344016831e-01 -1.6399905570763349e+00 + 14 2.6030389141568233e+00 -4.1604937323184987e-01 -2.6632873866075890e+00 + 15 2.9669715603426763e+00 5.5696161645207065e-01 -1.2373368321417231e+00 + 16 2.6515621187465719e+00 -2.3967182309150830e+00 3.5904361799912736e-02 + 17 2.2323104172823971e+00 -2.1015643262334032e+00 1.1508699165079972e+00 + 18 2.1369701683126636e+00 3.0158507352292498e+00 -3.5179348302759084e+00 + 19 1.5355837134891335e+00 2.6255292349555996e+00 -4.2353987775907820e+00 + 20 2.7727573004960764e+00 3.6923910448057331e+00 -3.9330842458523567e+00 + 21 4.9040128097611282e+00 -4.0752348192998742e+00 -3.6210314741040888e+00 + 22 4.3582355555035486e+00 -4.2126119428105140e+00 -4.4612844198387114e+00 + 23 5.7439382850855170e+00 -3.5821957939653362e+00 -3.8766361297558971e+00 + 24 2.0689243589260014e+00 3.1513346914908205e+00 3.1550389767665203e+00 + 25 1.3045351340666116e+00 3.2665125708708889e+00 2.5111855275754800e+00 + 26 2.5809237403634482e+00 4.0117602606068141e+00 3.2212060530163864e+00 + 27 -1.9611343134182779e+00 -4.3563411935660996e+00 2.1098293111593480e+00 + 28 -2.7473562684449138e+00 -4.0200819932443128e+00 1.5830052163349162e+00 + 29 -1.3126000190352287e+00 -3.5962518039727378e+00 2.2746342468394127e+00 +run_vel: ! |2 + 1 7.7878588734526198e-04 5.8382345680427130e-04 -2.1588360870901697e-04 + 2 2.7133298635754447e-03 4.6080941432587817e-03 3.6012143490662431e-03 + 3 -1.2735533433080959e-03 1.6040104178824128e-03 -3.2928787663304100e-04 + 4 -9.2790908405729388e-04 -1.2743370998098266e-03 -4.0998381156616033e-03 + 5 -1.1797079389975749e-03 7.3369545190079568e-04 8.9682557646519266e-05 + 6 -3.0901428918666851e-04 1.2686815717087763e-03 8.0263701588449308e-04 + 7 -1.1028454231743601e-04 -7.7279598321444340e-04 -7.6700101339104750e-04 + 8 3.9071065119356116e-04 -8.2032217860919109e-04 1.5725797910453806e-04 + 9 1.2479299632287711e-03 -2.6813940130008974e-03 1.1324196703928796e-03 + 10 4.5021559737281377e-04 4.8844497171634344e-04 -2.2646836122846916e-04 + 11 -3.6939982362589797e-04 -1.5494557630536987e-03 -2.8969796085021034e-03 + 12 1.0852092126307005e-03 -6.5651598379105566e-04 -1.2902212798795269e-03 + 13 4.0758327867858645e-03 3.4838016716369673e-03 -7.6258549719693985e-04 + 14 -1.3799533732466697e-04 -4.0861534316170862e-03 -3.9126867377128425e-03 + 15 -4.3297938711093853e-03 -3.2008147343211384e-03 3.2244512840176650e-03 + 16 -9.6589991406029584e-05 -5.0702273154864109e-04 1.5014598698974305e-03 + 17 6.5701621273287663e-04 3.6121026772938211e-04 8.4012943587149819e-04 + 18 -8.0066194144632968e-04 -8.6271665406919022e-04 -1.4482973852517659e-03 + 19 1.2452388413347042e-03 -2.5061108560376941e-03 7.2998638677115694e-03 + 20 3.5930058301559932e-03 3.6938856643002412e-03 3.2322734436995241e-03 + 21 -1.4689171694767468e-03 -2.7352531122827996e-04 7.0581004752321775e-04 + 22 -7.0694198156340390e-03 -4.2577150557873162e-03 2.8079073381937999e-04 + 23 6.0446966473114254e-03 -1.4000132185293601e-03 2.5819751444891522e-03 + 24 3.1926504097853274e-04 -9.9445515850083571e-04 1.5000252605154639e-04 + 25 1.3789938296094050e-04 -4.4335889216404701e-03 -8.1807768663880035e-04 + 26 2.0485906001141111e-03 2.7813359981121301e-03 4.3245729315533402e-03 + 27 4.5604045866279167e-04 -1.0305531425500631e-03 2.1187980949232823e-04 + 28 -6.2544520799773665e-03 1.4127711082282343e-03 -1.8429822100198981e-03 + 29 6.4110649930657559e-04 3.1273432105699108e-03 3.7253670414334056e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-aveforce-variable.yaml b/unittest/force-styles/tests/fix-timestep-aveforce-variable.yaml new file mode 100644 index 0000000000..6971524c1b --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-aveforce-variable.yaml @@ -0,0 +1,81 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 20:59:48 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix aveforce +pre_commands: ! "" +post_commands: ! | + fix init all store/state 0 x y z + variable xforce delete + # variable xforce atom f_init[1] + variable zforce delete + variable zforce equal 0.1*step/10.0 + fix move all nve + fix test solute aveforce 0.0 0.0 v_zforce +input_file: in.fourmol +natoms: 29 +global_vector: ! |- + 3 0.030693295891580874 0.026836837377516076 -0.017872935896505737 +run_pos: ! |2 + 1 -2.7837937276374769e-01 2.4738383080233710e+00 -1.7245068722373783e-01 + 2 3.0739712238707101e-01 2.9607815224227170e+00 -8.4973098421627558e-01 + 3 -6.9690101126080417e-01 1.2472691577163619e+00 -6.2300862263309786e-01 + 4 -1.5790176115307302e+00 1.4890260670945250e+00 -1.2569484179207073e+00 + 5 -8.9737740636568974e-01 9.3719010558185345e-01 4.0242062664480416e-01 + 6 2.9350792503008483e-01 2.2974401387687254e-01 -1.2827161649449292e+00 + 7 3.3997804713006152e-01 -1.0662949214735505e-02 -2.4648543569856689e+00 + 8 1.1649000306414976e+00 -4.8538184973259202e-01 -6.7629403928031329e-01 + 9 1.3802414668449392e+00 -2.5898474747389350e-01 2.7100522945871652e-01 + 10 2.0194286609798424e+00 -1.4274059705413773e+00 -9.6780024162469869e-01 + 11 1.7922388743934128e+00 -1.9901622383556437e+00 -1.8898926807209038e+00 + 12 3.0051950803427814e+00 -4.9053240747638371e-01 -1.6214583279043955e+00 + 13 4.0528786674690629e+00 -8.9431095488385026e-01 -1.6400059550118105e+00 + 14 2.6030389141569561e+00 -4.1602849467553166e-01 -2.6633027845430655e+00 + 15 2.9669715603428100e+00 5.5698249500838870e-01 -1.2373522300771980e+00 + 16 2.6515621187466172e+00 -2.3967112637940153e+00 3.5899223548061639e-02 + 17 2.2323104172824300e+00 -2.1015590960372079e+00 1.1508660592382556e+00 + 18 2.1369701683121547e+00 3.0158507352282142e+00 -3.5179348302744962e+00 + 19 1.5355837134890704e+00 2.6255292349554118e+00 -4.2353987775904800e+00 + 20 2.7727573004960222e+00 3.6923910448056452e+00 -3.9330842458522732e+00 + 21 4.9040128097612312e+00 -4.0752348192998804e+00 -3.6210314741043286e+00 + 22 4.3582355555035486e+00 -4.2126119428105113e+00 -4.4612844198387211e+00 + 23 5.7439382850855214e+00 -3.5821957939653308e+00 -3.8766361297559078e+00 + 24 2.0689243589262341e+00 3.1513346914910820e+00 3.1550389767665998e+00 + 25 1.3045351340668496e+00 3.2665125708711558e+00 2.5111855275757544e+00 + 26 2.5809237403634615e+00 4.0117602606068328e+00 3.2212060530163891e+00 + 27 -1.9611343134186865e+00 -4.3563411935663874e+00 2.1098293111595283e+00 + 28 -2.7473562684449337e+00 -4.0200819932443297e+00 1.5830052163349233e+00 + 29 -1.3126000190352873e+00 -3.5962518039727915e+00 2.2746342468394607e+00 +run_vel: ! |2 + 1 7.7878588741877761e-04 5.8979774068710158e-04 -2.1946817916036033e-04 + 2 2.7133298638323611e-03 4.6289726998393786e-03 3.5886872146927650e-03 + 3 -1.2735533432223637e-03 1.6109775390378514e-03 -3.3346814946816518e-04 + 4 -9.2790908380037786e-04 -1.2534585432292294e-03 -4.1123652500350801e-03 + 5 -1.1797079387406584e-03 7.5457400848139206e-04 7.7155423273043028e-05 + 6 -3.0901428910093626e-04 1.2756486928642149e-03 7.9845674304936847e-04 + 7 -1.1028454225307708e-04 -7.6756578695323120e-04 -7.7013913125426926e-04 + 8 3.9071065126707630e-04 -8.1434789472636080e-04 1.5367340865319470e-04 + 9 1.2479299634856876e-03 -2.6605154564203013e-03 1.1198925360194041e-03 + 10 4.5021559745854603e-04 4.9541209287178283e-04 -2.3064863406359372e-04 + 11 -3.6939982336898174e-04 -1.5285772064731016e-03 -2.9095067428755814e-03 + 12 1.0852092127164327e-03 -6.4954886263561627e-04 -1.2944015527146522e-03 + 13 4.0758327870427770e-03 3.5046802282175634e-03 -7.7511263157041598e-04 + 14 -1.3799533706775074e-04 -4.0652748750364892e-03 -3.9252138720863193e-03 + 15 -4.3297938708524728e-03 -3.1799361777405423e-03 3.2119241496441869e-03 + 16 -9.6589991320297327e-05 -5.0005561039320170e-04 1.4972795970623052e-03 + 17 6.5701621279723595e-04 3.6644046399059415e-04 8.3699131800827643e-04 + 18 -8.0066194243028337e-04 -8.6271665609198686e-04 -1.4482973824143013e-03 + 19 1.2452388412111663e-03 -2.5061108564126315e-03 7.2998638683177165e-03 + 20 3.5930058300387754e-03 3.6938856641123463e-03 3.2322734438806778e-03 + 21 -1.4689171692235884e-03 -2.7352531129250528e-04 7.0581004700135796e-04 + 22 -7.0694198156331864e-03 -4.2577150557810617e-03 2.8079073379265798e-04 + 23 6.0446966473247238e-03 -1.4000132185192382e-03 2.5819751444644172e-03 + 24 3.1926504141381389e-04 -9.9445515800801552e-04 1.5000252615930676e-04 + 25 1.3789938340469859e-04 -4.4335889211184667e-03 -8.1807768613931969e-04 + 26 2.0485906001419412e-03 2.7813359981542908e-03 4.3245729315573517e-03 + 27 4.5604045784400024e-04 -1.0305531431206094e-03 2.1187980985975486e-04 + 28 -6.2544520800211943e-03 1.4127711081968837e-03 -1.8429822100071731e-03 + 29 6.4110649918605221e-04 3.1273432104571073e-03 3.7253670415284034e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-nph.yaml b/unittest/force-styles/tests/fix-timestep-nph.yaml new file mode 100644 index 0000000000..51c80756ef --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-nph.yaml @@ -0,0 +1,76 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:12:15 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix nph +pre_commands: ! "" +post_commands: ! | + fix test solute nph aniso 1.0 1.0 100.0 ptemp ${t_target} fixedpoint 0.0 0.0 0.0 couple xy +input_file: in.fourmol +natoms: 29 +global_scalar: 157.324342558061 +global_vector: ! |- + 24 0.03782582730845563 0.03782582730845563 0.08149262752796986 0.028119558903421393 0.028119558903421393 0.0527171493109954 0.10922307816947409 0.0034329971508844604 -0.00019663936227634895 0.16528845193168182 0.011258118934021979 -0.0001767050030808935 0.002791882968285112 0.002791882968285112 0.002791882968285112 23.569551012162435 23.569551012162435 82.8396274600218 0.021704883273300262 0.000682207493931851 -3.9076305819928785e-05 27.145514121895616 0.12593449698077608 3.1024924904494816e-05 +run_pos: ! |2 + 1 -2.8141343498751503e-01 2.5848081694761129e+00 -1.8309382462779311e-01 + 2 3.1986473504266399e-01 3.0737731697045190e+00 -9.2489246315700946e-01 + 3 -7.2998464504762772e-01 1.2804424876519276e+00 -6.7969392967526154e-01 + 4 -1.6415656929067879e+00 1.5410659176204780e+00 -1.3589061356585619e+00 + 5 -9.4141839987945009e-01 9.6312260928622617e-01 4.3149952164063876e-01 + 6 2.6415890533356734e-01 2.8624440159113274e-01 -1.3488296480747550e+00 + 7 3.5416346111915775e-01 -2.1111661328320430e-02 -2.7296432449044277e+00 + 8 1.2182508251789601e+00 -5.0657947032688710e-01 -6.9723820755199561e-01 + 9 1.4320842738420207e+00 -2.6376432187952137e-01 3.0159790810698617e-01 + 10 2.1266127272937982e+00 -1.5127084519335181e+00 -1.0646648377240817e+00 + 11 1.8573574669265760e+00 -2.0679562921583612e+00 -2.0473049081649988e+00 + 12 3.1217679127666020e+00 -5.0914899507335143e-01 -1.7609081345676820e+00 + 13 4.2065354355755371e+00 -9.2631553760989416e-01 -1.7790012641346209e+00 + 14 2.7076396710997699e+00 -4.3370947134576809e-01 -2.8867456786331838e+00 + 15 3.0841722167219512e+00 5.7477711565023792e-01 -1.3403005465619460e+00 + 16 2.7732295651086272e+00 -2.5019412398023180e+00 -1.2531049629437518e-02 + 17 2.3039296855901945e+00 -2.1725942389075730e+00 1.2873521944332929e+00 + 18 2.2209181945709329e+00 3.1340605174203846e+00 -3.8146165368469349e+00 + 19 1.5940839053517477e+00 2.7330459203977613e+00 -4.6079026877693652e+00 + 20 2.8706743970762645e+00 3.8253359524627308e+00 -4.2724490374661599e+00 + 21 5.0955905299128617e+00 -4.2322177666629912e+00 -3.9290467495728212e+00 + 22 4.5371619238282097e+00 -4.3675476544652447e+00 -4.8442635919683950e+00 + 23 5.9586750569923712e+00 -3.7142045077898977e+00 -4.2116343033854386e+00 + 24 2.1481494772175012e+00 3.2733259597633184e+00 3.4233362567291898e+00 + 25 1.3499472953187759e+00 3.4018249446242459e+00 2.7223516002167525e+00 + 26 2.6802323872561153e+00 4.1666821913924030e+00 3.4861691609539811e+00 + 27 -2.0369691930937757e+00 -4.5235410358449322e+00 2.2893092410133740e+00 + 28 -2.8463050790215982e+00 -4.1757254084039737e+00 1.7172628242784782e+00 + 29 -1.3613559351366451e+00 -3.7380527823491150e+00 2.4606149196874831e+00 +run_vel: ! |2 + 1 7.6565961842874073e-03 1.3080850909322607e-02 1.8328859839073495e-03 + 2 1.8760112180452771e-03 2.5666078592533645e-03 2.8834568739837534e-03 + 3 -6.5747711080207339e-03 -9.4370588251179374e-03 -2.2745325502991423e-03 + 4 -1.6365708631326022e-03 -6.6432508563253638e-03 1.1218655930945432e-03 + 5 -1.0089064293266134e-02 -8.6234651250773377e-03 -6.6697198186027517e-03 + 6 -3.1528934756543614e-02 3.7022817627879213e-02 2.3911067453951655e-02 + 7 3.1550265512229187e-04 -7.1593752877010097e-03 -3.6173540781531920e-02 + 8 6.3829935675636983e-03 -2.2482453728018686e-03 2.9450232742979827e-02 + 9 -4.9925369016013505e-04 1.4791155501508453e-03 5.5387020254672173e-03 + 10 2.4586222989032260e-02 -2.3830859019713581e-02 -1.2874036642974162e-02 + 11 -3.7917501131674294e-03 -2.0254850167193911e-03 1.1948750164912784e-03 + 12 1.6115495437094157e-03 -5.9368868615678578e-04 -3.2386570228979113e-03 + 13 7.2282620116543097e-04 6.3326083256349738e-03 -4.8419465393188376e-04 + 14 4.5044534232601069e-03 -5.6181937891921357e-03 4.8663106449362627e-04 + 15 -1.7355580844387413e-03 -7.7347714440367385e-03 4.7018833249165889e-03 + 16 1.2717480374927991e-02 -8.6072327917308192e-03 -3.1454404079186371e-02 + 17 -8.8793881732904117e-03 6.9626162171521405e-03 2.5474225553719757e-02 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-npt_aniso.yaml b/unittest/force-styles/tests/fix-timestep-npt_aniso.yaml new file mode 100644 index 0000000000..7cbaae5630 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-npt_aniso.yaml @@ -0,0 +1,76 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:12:15 202 +epsilon: 2e-12 +prerequisites: ! | + atom full + fix npt +pre_commands: ! "" +post_commands: ! | + fix test solute npt temp 50.0 ${t_target} 1.0 aniso 1.0 1.0 100.0 drag 0.01 flip no +input_file: in.fourmol +natoms: 29 +global_scalar: 343.095604765377 +global_vector: ! |- + 36 1.4104106041871818 5.544125660512262 27.686084418162828 0.7043226445808922 1.523498251021069 24.83175835256217 0.059984390584387294 0.05988360800662691 0.1289951938025459 0.033166868532850516 0.032616875459535025 0.060704622622279256 0.31065873375184067 0.031231059239067528 4.6799092315332296e-05 0.38632917344330703 0.08291085151805419 0.0013258269540048562 23.54333018009125 1.1017323658211893 5.501797245253877 4.140336471802744 0.230619999607791 61.267194471795534 0.004636061307993073 0.004636061307993073 0.004636061307993073 24.59260327356766 23.7837469738805 82.38328256037414 0.061734311712517385 0.006206257016797189 9.299946980294684e-06 111.22164657602883 5.122678041400132 0.0013099297283524043 +run_pos: ! |2 + 1 -3.8261786782382412e-01 2.6468375260657648e+00 -1.1358866558857095e-01 + 2 2.3224967663088947e-01 3.1501493306692314e+00 -8.8938943152906980e-01 + 3 -8.3366821530992929e-01 1.3264564928719427e+00 -6.2955763294346134e-01 + 4 -1.7674423343775008e+00 1.5903125087550638e+00 -1.3418236316520025e+00 + 5 -1.0489074332732624e+00 1.0002052144490552e+00 5.3384648773294430e-01 + 6 1.9734054221674935e-01 2.8196998144870555e-01 -1.3563766651121183e+00 + 7 2.7036903761914299e-01 -4.1567476799251324e-03 -2.7533565699026079e+00 + 8 1.1502376941366608e+00 -5.0399607836818472e-01 -6.6654239812129035e-01 + 9 1.3718420832651086e+00 -2.5832522657100565e-01 3.9009271154782077e-01 + 10 2.0700300827708897e+00 -1.5216420281788050e+00 -1.0290437306551272e+00 + 11 1.8098806512866314e+00 -2.0999528745943206e+00 -2.0635742488483979e+00 + 12 3.0991569266597043e+00 -5.0827058508447021e-01 -1.7640639194482484e+00 + 13 4.2066420146963246e+00 -9.3856424824123064e-01 -1.7840739805923906e+00 + 14 2.6759472966061608e+00 -4.2762484336365691e-01 -2.9425522595040681e+00 + 15 3.0644364333931815e+00 6.0269974361945522e-01 -1.3287470376302002e+00 + 16 2.7346344468565036e+00 -2.5388669048484944e+00 9.1894737650898506e-02 + 17 2.2708153728006124e+00 -2.2142714421119205e+00 1.4105188628785896e+00 + 18 2.1794689204201152e+00 3.2158613383317078e+00 -3.9193829765158155e+00 + 19 1.5385898525445398e+00 2.8059029720471163e+00 -4.7512616199090179e+00 + 20 2.8437834873955286e+00 3.9225541871873801e+00 -4.3994885211210937e+00 + 21 5.1185508411243816e+00 -4.3147059611177010e+00 -4.0393800923294645e+00 + 22 4.5476101464339607e+00 -4.4530540913972452e+00 -4.9991212202659039e+00 + 23 6.0009735431459301e+00 -3.7851395291272194e+00 -4.3357152175955482e+00 + 24 2.1050697553615834e+00 3.3582327972429447e+00 3.6706882025446852e+00 + 25 1.2889831450571050e+00 3.4895976759629157e+00 2.9356014190165141e+00 + 26 2.6490744553004415e+00 4.2715134208112495e+00 3.7365778579561546e+00 + 27 -2.1738202136583933e+00 -4.6125265700961151e+00 2.4814920287454054e+00 + 28 -3.0012899885135189e+00 -4.2569536621455875e+00 1.8816161875271611e+00 + 29 -1.4830692409518882e+00 -3.8095196882276410e+00 2.6611315389212198e+00 +run_vel: ! |2 + 1 3.3240330987135813e-03 4.3348472804384443e-03 -7.7000850356568598e-04 + 2 -1.7788564989713377e-03 -1.3033340996862442e-03 3.3101416084626834e-03 + 3 -2.0736106571327740e-03 -2.9833723016999126e-03 3.0677418793886486e-06 + 4 7.7912294662807273e-04 -3.0921958393268071e-03 2.8549261268555064e-03 + 5 -4.1587002273456653e-03 -3.6518175878378690e-03 -5.8605014494220939e-03 + 6 -1.0673219518891219e-02 1.2095185080065048e-02 3.5954871446313933e-03 + 7 -1.3016092142144198e-04 -1.5438536332060906e-03 -8.6626684342265125e-03 + 8 2.0883538800072188e-03 -3.1837196665129652e-04 1.1801128542985692e-02 + 9 -1.6065275717747234e-03 1.4851083434963298e-04 -2.5301349369061935e-03 + 10 9.3031302344406246e-03 -8.6622025962185441e-03 -5.3718824903226719e-03 + 11 -1.2019843168147525e-03 4.3918657625861092e-04 3.4618217803594302e-03 + 12 1.7788144047621368e-04 -2.6878343649230967e-04 -1.5175167351688945e-03 + 13 -1.8807030955883249e-03 2.7155375226017805e-03 9.8699039446766083e-05 + 14 2.9038215261273626e-03 -1.7898438773840987e-03 3.8737544018497979e-03 + 15 1.8059365653976903e-04 -4.3808636795798338e-03 7.4140416456126444e-04 + 16 2.6156852337186408e-03 -1.2844226093444698e-03 -7.6689169374931799e-03 + 17 -2.0276918149482290e-03 1.6195218336326309e-03 5.6072249357656126e-03 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-npt_iso.yaml b/unittest/force-styles/tests/fix-timestep-npt_iso.yaml new file mode 100644 index 0000000000..7dceafc1fe --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-npt_iso.yaml @@ -0,0 +1,76 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:12:15 202 +epsilon: 5e-13 +prerequisites: ! | + atom full + fix npt +pre_commands: ! "" +post_commands: ! | + fix test solute npt temp 50.0 ${t_target} 1.0 iso 1.0 1.0 100.0 dilate solute +input_file: in.fourmol +natoms: 29 +global_scalar: 394.052580100464 +global_vector: ! |- + 28 1.4984570204083703 5.727668251607705 30.006785365785095 0.755949606916964 1.5716837282414435 27.238363703562367 0.0887726458699618 0.04948138278794819 0.29647653888194264 0.027838608034509143 -1.2684933237431522e-05 0.39157825633023396 0.07798523077702334 0.0010654320610989716 25.013048177187418 1.1382060724972116 5.962968492435009 4.7695567904527465 0.24543888024081967 73.71826005814913 0.015019759138686235 164.21033059328448 0.058916016445900686 0.005532106840485039 -2.520758431847661e-06 114.264532425479 4.532095302918083 0.000845913261377488 +run_pos: ! |2 + 1 -4.3742958268488863e-01 2.7290056618400449e+00 -1.3224678617732799e-01 + 2 1.9597325096802809e-01 3.2478554682502239e+00 -8.7784983453020882e-01 + 3 -9.0055445066945161e-01 1.3720443735149779e+00 -6.2790521499619167e-01 + 4 -1.8618082723760274e+00 1.6425859645839189e+00 -1.3123637393385525e+00 + 5 -1.1222490295586907e+00 1.0354194073199032e+00 4.9054165070391242e-01 + 6 1.6122701010775931e-01 2.9524853587990840e-01 -1.3210758103362590e+00 + 7 2.3528889757906057e-01 9.1838373111130522e-04 -2.6715530930497318e+00 + 8 1.1409063387023277e+00 -5.1378072806790342e-01 -6.6432618849456482e-01 + 9 1.3692157124421644e+00 -2.5986234125532803e-01 3.5327265979809219e-01 + 10 2.0857438747825938e+00 -1.5585215733968054e+00 -1.0112652339689152e+00 + 11 1.8196840501105118e+00 -2.1558284101161114e+00 -2.0059834257353772e+00 + 12 3.1466020472087184e+00 -5.1749319691640405e-01 -1.7173626575793977e+00 + 13 4.2857041987652043e+00 -9.6042463424053448e-01 -1.7370207501057697e+00 + 14 2.7108342037702080e+00 -4.3438782450127089e-01 -2.8506568547646909e+00 + 15 3.1109829403724394e+00 6.2580170772786126e-01 -1.2993853138717890e+00 + 16 2.7719845783501800e+00 -2.6079945840011654e+00 6.2246330315527842e-02 + 17 2.2935401732736445e+00 -2.2732303673933210e+00 1.3340886989414198e+00 + 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 + 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 + 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 + 21 4.9064454390208301e+00 -4.0751205255383196e+00 -3.6215576073601046e+00 + 22 4.3687453488627543e+00 -4.2054270536772504e+00 -4.4651491269372565e+00 + 23 5.7374928154769504e+00 -3.5763355905184966e+00 -3.8820297194230728e+00 + 24 2.0684115301174013e+00 3.1518221747664397e+00 3.1554242678474576e+00 + 25 1.2998381073113014e+00 3.2755513587518097e+00 2.5092990173114837e+00 + 26 2.5807438597688113e+00 4.0120175892854135e+00 3.2133398379059099e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 2.7344298948821458e-03 3.1581468104380935e-03 -7.1843120411167717e-04 + 2 -1.7078379474947108e-03 -1.6409070859861360e-03 2.6128987225916729e-03 + 3 -1.4420164647255642e-03 -1.7442912543734887e-03 -7.0745062575908337e-05 + 4 1.3055902518738962e-03 -3.2440606689853393e-03 2.3536117576802057e-03 + 5 -3.7768785005134814e-03 -3.4050691962219590e-03 -4.3060378047272488e-03 + 6 -9.6303105059201439e-03 1.1636424089177611e-02 8.0882426998230839e-03 + 7 -9.1197836178494661e-06 -2.0548971114176177e-03 -1.1561711720116066e-02 + 8 2.3717342384511060e-03 -1.1724667732074462e-03 9.9981918637160709e-03 + 9 -1.0596786897297246e-03 6.2180807146028599e-04 -1.9949136612792850e-04 + 10 7.6866979670994649e-03 -6.4210563260423160e-03 -4.6594157108994479e-03 + 11 -1.2201636757560200e-03 4.4492192830042360e-04 2.4485003896230857e-03 + 12 2.6440970729963017e-04 -2.5426715254078699e-04 -9.8591736348869791e-04 + 13 -2.9186187764568771e-03 2.9250796003296472e-03 -1.0409641755324341e-04 + 14 2.7357332424176799e-03 -1.8075638409764203e-03 2.3417976176845772e-03 + 15 2.7042452512660167e-04 -4.9830656916804491e-03 8.0004168431170792e-04 + 16 3.2285718415043510e-03 -1.6540417724780236e-03 -1.0034443516953472e-02 + 17 -2.5912230280785136e-03 1.9472241032175749e-03 7.5710821795849197e-03 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-npt_tri.yaml b/unittest/force-styles/tests/fix-timestep-npt_tri.yaml new file mode 100644 index 0000000000..337b3d94e1 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-npt_tri.yaml @@ -0,0 +1,77 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:12:15 202 +epsilon: 5e-12 +prerequisites: ! | + atom full + fix npt +pre_commands: ! "" +post_commands: ! | + change_box all triclinic + fix test solute npt temp 50.0 ${t_target} 1.0 tri 1.0 1.0 100.0 nreset 2 +input_file: in.fourmol +natoms: 29 +global_scalar: 354.174797856098 +global_vector: ! |- + 48 1.3901404465408471 5.463126417846173 27.522868094744837 0.6808509272696268 1.432899560678195 24.73621155835892 0.059175794171946315 0.058864829843401814 0.12700748296200176 0.02134537927441898 -0.006866713927713234 -0.03517153788806217 0.03214843910942283 0.03135716661218002 0.05847613666451851 0.010015733944968137 -0.004026286211139594 -0.020364872327366976 0.32458573874717506 0.03420953094338522 0.00010301961702814269 0.40071682483624077 0.09021935542363528 0.0016272628807846479 23.20496983817849 1.0856361420490914 5.469362788109317 3.86897924261614 0.20400675418492722 60.79661790199697 0.004555933286932949 0.004555933286932949 0.004555933286932949 0.0 0.0 0.0 23.105498800354294 21.982100664555755 76.44567329133054 2.242648057096569 0.36241390540377744 9.27169098501188 0.06450189547628359 0.006798140909455242 2.0472127318975922e-05 119.66012864844495 6.065599766319885 0.0019732846899264155 +run_pos: ! |2 + 1 -8.2271095985417642e-01 2.8289040859356991e+00 -1.1444756137720979e-01 + 2 -2.2035635832079414e-01 3.3160751622563218e+00 -8.8905665482321261e-01 + 3 -1.2238603220542110e+00 1.4989718911440786e+00 -6.2960577288309949e-01 + 4 -2.1611221536569811e+00 1.7480881759848010e+00 -1.3403837766858420e+00 + 5 -1.4356691651007525e+00 1.1969702774741524e+00 5.3174391336542293e-01 + 6 -1.5108221335914251e-01 4.4052153861184706e-01 -1.3548809313045158e+00 + 7 -5.9343459000764653e-02 1.2678140836872487e-01 -2.7489180271273321e+00 + 8 8.2373588231584893e-01 -3.3113650682317708e-01 -6.6671329415243719e-01 + 9 1.0285358664778927e+00 -6.3178215420583328e-02 3.8810870422627808e-01 + 10 1.7789213377484181e+00 -1.3532218104220428e+00 -1.0278171354490055e+00 + 11 1.5477736014686165e+00 -1.9530744276614485e+00 -2.0605735545184318e+00 + 12 2.7783142187942573e+00 -3.5681522115235254e-01 -1.7618063829238526e+00 + 13 3.8999744941062673e+00 -7.8691757348410274e-01 -1.7815725217013947e+00 + 14 2.3605564873379432e+00 -3.0049710242015149e-01 -2.9379309538662390e+00 + 15 2.7016025982848415e+00 7.6160196277114700e-01 -1.3273631127257124e+00 + 16 2.4717220178567558e+00 -2.3468671157596894e+00 9.1129832810088018e-02 + 17 1.9885567143510166e+00 -1.9964324174322527e+00 1.4061647002816908e+00 + 18 1.7437183504864624e+00 3.3191498740328864e+00 -3.9127655905861678e+00 + 19 1.1235512691983933e+00 2.8925305004060426e+00 -4.7429923420674971e+00 + 20 2.3860672377151531e+00 4.0152665693893148e+00 -4.3919177720148843e+00 + 21 4.9453770477508119e+00 -4.2062128928889155e+00 -4.0325244237288675e+00 + 22 4.3864597623851278e+00 -4.3641236143384550e+00 -4.9903597585314996e+00 + 23 5.8105852095737784e+00 -3.6832694508636497e+00 -4.3282711054755429e+00 + 24 1.6113221591166269e+00 3.6172003657621623e+00 3.6622337059457593e+00 + 25 7.9642706990481837e-01 3.7333401645409854e+00 2.9286066111857547e+00 + 26 2.1223957638352413e+00 4.5309037460235295e+00 3.7279925218535261e+00 + 27 -2.3762434607634804e+00 -4.3698568738308285e+00 2.4753989625747312e+00 + 28 -3.2113212683802930e+00 -4.0269614699099696e+00 1.8767143168008165e+00 + 29 -1.7154699038294128e+00 -3.5639796658377056e+00 2.6546817559911258e+00 +run_vel: ! |2 + 1 3.4379305599169844e-03 4.4303982887116036e-03 -6.5575090200992549e-04 + 2 -1.1857500286034856e-03 -6.4830194142741920e-04 2.8991421024851778e-03 + 3 -2.1154260546112497e-03 -3.3682136360151430e-03 -1.9294633718208677e-04 + 4 7.6092841426322790e-04 -3.2320184833153956e-03 2.7687800582063332e-03 + 5 -4.2732628342744957e-03 -4.1024661501998941e-03 -5.6627078010461117e-03 + 6 -1.0456549709936754e-02 1.1983105787743460e-02 3.6784105742361638e-03 + 7 -2.6132479696988121e-04 -1.3704375278698535e-03 -8.5781100824109287e-03 + 8 2.8751673617313503e-03 -1.2411443046752859e-03 1.1404387868407946e-02 + 9 -1.4768312187112003e-03 -7.1556281131933587e-05 -2.5861880084100675e-03 + 10 7.9726344243349050e-03 -7.6603150802256759e-03 -4.9260913574675621e-03 + 11 -1.3701886309654468e-03 5.8427841384912200e-04 3.5680693565126702e-03 + 12 3.8071638085887614e-04 -1.2274982267917827e-04 -1.6378029597235305e-03 + 13 -2.1573898217946193e-03 3.1719111017936398e-03 2.9806487190873061e-04 + 14 2.7537600422888457e-03 -1.6565936767524096e-03 3.7884151775862789e-03 + 15 5.5156122958171854e-04 -4.6689017429546913e-03 5.9598028358420622e-04 + 16 2.2455587308391760e-03 -9.7951134916580778e-04 -7.0867451131982279e-03 + 17 -1.7750442749204370e-03 1.3834451904214627e-03 5.2407088936868079e-03 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-nve.yaml b/unittest/force-styles/tests/fix-timestep-nve.yaml new file mode 100644 index 0000000000..3b564d51ff --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-nve.yaml @@ -0,0 +1,73 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:12:15 202 +epsilon: 1e-14 +prerequisites: ! | + atom full + fix nve +pre_commands: ! "" +post_commands: ! | + fix test solute nve +input_file: in.fourmol +natoms: 29 +run_pos: ! |2 + 1 -2.7045559764772636e-01 2.4912159908661540e+00 -1.6695851750890131e-01 + 2 3.1004029572800829e-01 2.9612354631162883e+00 -8.5466363035055182e-01 + 3 -7.0398551409567367e-01 1.2305509955796761e+00 -6.2777526927691529e-01 + 4 -1.5818159336524433e+00 1.4837407818931854e+00 -1.2538710836034257e+00 + 5 -9.0719763673143938e-01 9.2652103885754256e-01 3.9954210488744507e-01 + 6 2.4831720509137747e-01 2.8313021474851946e-01 -1.2314233328432578e+00 + 7 3.4143527679197477e-01 -2.2646550369995716e-02 -2.5292291416062129e+00 + 8 1.1743552228749641e+00 -4.8863228576130058e-01 -6.3783432890943681e-01 + 9 1.3800524229486879e+00 -2.5274721030864977e-01 2.8353985887494298e-01 + 10 2.0510765219972789e+00 -1.4604063739897442e+00 -9.8323745066910395e-01 + 11 1.7878031944038735e+00 -1.9921863272595286e+00 -1.8890602447323932e+00 + 12 3.0063007040474412e+00 -4.9013350497870395e-01 -1.6231898104999232e+00 + 13 4.0515402959329752e+00 -8.9202011603544384e-01 -1.6400005529743578e+00 + 14 2.6066963345551839e+00 -4.1789253964855821e-01 -2.6634003608660097e+00 + 15 2.9695287185765005e+00 5.5422613164855661e-01 -1.2342022021736101e+00 + 16 2.6747029694779090e+00 -2.4124119054031508e+00 -2.3435746001955464e-02 + 17 2.2153577785226939e+00 -2.0897985186816044e+00 1.1963150794967707e+00 + 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 + 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 + 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 + 21 4.9064454390208301e+00 -4.0751205255383196e+00 -3.6215576073601046e+00 + 22 4.3687453488627543e+00 -4.2054270536772504e+00 -4.4651491269372565e+00 + 23 5.7374928154769504e+00 -3.5763355905184966e+00 -3.8820297194230728e+00 + 24 2.0684115301174013e+00 3.1518221747664397e+00 3.1554242678474576e+00 + 25 1.2998381073113014e+00 3.2755513587518097e+00 2.5092990173114837e+00 + 26 2.5807438597688113e+00 4.0120175892854135e+00 3.2133398379059099e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 8.1705745750215355e-03 1.6516406624177568e-02 4.7902269490513868e-03 + 2 5.4501493264497653e-03 5.1791699524041815e-03 -1.4372931188098787e-03 + 3 -8.2298293869533436e-03 -1.2926551603583580e-02 -4.0984178763235155e-03 + 4 -3.7699042632974781e-03 -6.5722892095585973e-03 -1.1184640307556036e-03 + 5 -1.1021961013432620e-02 -9.8906780949598663e-03 -2.8410737767347810e-03 + 6 -3.9676663388061570e-02 4.6817061143308802e-02 3.7148492456495326e-02 + 7 9.1034010711748495e-04 -1.0128523385947431e-02 -5.1568251957150528e-02 + 8 7.9064711492041421e-03 -3.3507255912560113e-03 3.4557098774889522e-02 + 9 1.5644176103896980e-03 3.7365546026078196e-03 1.5047408831488810e-02 + 10 2.9201446724707314e-02 -2.9249578666046938e-02 -1.5018077196173912e-02 + 11 -4.7835962161678980e-03 -3.7481384556453390e-03 -2.3464103658842415e-03 + 12 2.2696453478564904e-03 -3.4774151000032896e-04 -3.0640766808544008e-03 + 13 2.7531740679274997e-03 5.8171062119749114e-03 -7.9467451203005246e-04 + 14 3.5246182394862565e-03 -5.7939995493321060e-03 -3.9478430939281998e-03 + 15 -1.8547943547235282e-03 -5.8554729996935272e-03 6.2938485237843443e-03 + 16 1.8681499891767241e-02 -1.3262466107722061e-02 -4.5638651214503466e-02 + 17 -1.2896270000483427e-02 9.7527665388161232e-03 3.7296535433762990e-02 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-nvt.yaml b/unittest/force-styles/tests/fix-timestep-nvt.yaml new file mode 100644 index 0000000000..ae16f9fbe8 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-nvt.yaml @@ -0,0 +1,76 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:12:15 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + fix nvt +pre_commands: ! "" +post_commands: ! | + fix test solute nvt temp 50.0 ${t_target} 1.0 mtk no tchain 1 +input_file: in.fourmol +natoms: 29 +global_scalar: 161.082193606418 +global_vector: ! |- + 4 6.3653490700601365 4.587389017747112 60.7164687353389 100.36572487107922 +run_pos: ! |2 + 1 -2.7696909697757566e-01 2.4783666916735787e+00 -1.7050542371974803e-01 + 2 3.0475247358534557e-01 2.9550852133930978e+00 -8.5567914575251569e-01 + 3 -6.9739816438327773e-01 1.2400856795511155e+00 -6.2409863799710530e-01 + 4 -1.5786703850642763e+00 1.4890498729340644e+00 -1.2508581595004804e+00 + 5 -8.9877759710952576e-01 9.3309797898528990e-01 4.0148904545172498e-01 + 6 2.7994521821983220e-01 2.4474061566700642e-01 -1.2668688023898995e+00 + 7 3.4059860024034672e-01 -1.3530530648175014e-02 -2.4844099316976083e+00 + 8 1.1674170384630289e+00 -4.8540349079508893e-01 -6.6471919231675081e-01 + 9 1.3785602765851699e+00 -2.5381883183281273e-01 2.7313723672550161e-01 + 10 2.0284846213605978e+00 -1.4380861607528830e+00 -9.7211494825708300e-01 + 11 1.7913946552248519e+00 -1.9888180233714230e+00 -1.8859590750369315e+00 + 12 3.0041472088806827e+00 -4.8958548297015908e-01 -1.6203323200317881e+00 + 13 4.0473595725538498e+00 -8.9804811680951135e-01 -1.6390213905369104e+00 + 14 2.6042857752267574e+00 -4.1148107203534806e-01 -2.6584020615701607e+00 + 15 2.9731795843276339e+00 5.6016006278471708e-01 -1.2404481641085223e+00 + 16 2.6589894088512205e+00 -2.4010363080271988e+00 1.5175729949308553e-02 + 17 2.2261096224365753e+00 -2.0982906145850206e+00 1.1642076197266931e+00 + 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 + 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 + 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 + 21 4.9064454390208301e+00 -4.0751205255383196e+00 -3.6215576073601046e+00 + 22 4.3687453488627543e+00 -4.2054270536772504e+00 -4.4651491269372565e+00 + 23 5.7374928154769504e+00 -3.5763355905184966e+00 -3.8820297194230728e+00 + 24 2.0684115301174013e+00 3.1518221747664397e+00 3.1554242678474576e+00 + 25 1.2998381073113014e+00 3.2755513587518097e+00 2.5092990173114837e+00 + 26 2.5807438597688113e+00 4.0120175892854135e+00 3.2133398379059099e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 7.8424070606032009e-04 1.6957423585177817e-03 5.3293987045553042e-04 + 2 2.8408938974665233e-04 6.3401186822596671e-05 -5.0702412121826309e-04 + 3 -7.1943682951293387e-04 -1.5812016081414803e-03 -4.2848459956300902e-04 + 4 -2.9398452847843030e-04 -5.5105638181201155e-04 3.0356108858991924e-04 + 5 -1.0153174695903785e-03 -1.0991397270447010e-03 -2.9745984673366986e-04 + 6 -4.2616664324255076e-03 4.9166230021219599e-03 3.9281549764140266e-03 + 7 1.2690465637066298e-04 -1.0201658940305772e-03 -5.4345368878308906e-03 + 8 8.3338080594941018e-04 -2.8041016920393470e-04 3.6768915167210169e-03 + 9 1.2557498735649483e-05 6.4724399795980240e-04 1.3767564856324000e-03 + 10 3.0640515606253464e-03 -3.1769374504099761e-03 -1.5482422096535847e-03 + 11 -4.5803506169263681e-04 -2.2647716135831678e-04 6.0288357252089534e-05 + 12 1.2114752302890638e-04 3.5392382149094706e-05 -1.8260516713062942e-04 + 13 -1.2777289076283452e-04 2.4386857088712753e-04 -2.2245290738142125e-06 + 14 3.7600485089664203e-04 -1.9387476208267205e-04 -1.5847965685025904e-05 + 15 2.5123165119885843e-04 -2.8708143347183168e-04 3.3015492480754400e-04 + 16 2.0107337298668473e-03 -1.3643226191731759e-03 -5.0826514203549545e-03 + 17 -1.4578784011733559e-03 1.0116087441418126e-03 3.9228519733530611e-03 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-press_berendsen_iso.yaml b/unittest/force-styles/tests/fix-timestep-press_berendsen_iso.yaml new file mode 100644 index 0000000000..891dc43555 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-press_berendsen_iso.yaml @@ -0,0 +1,74 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:44:09 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix press/berendsen +pre_commands: ! "" +post_commands: ! | + fix all solute nve + fix test solute press/berendsen iso 5000.0 5000.0 10000.0 +input_file: in.fourmol +natoms: 29 +run_pos: ! |2 + 1 -3.6091419640167377e-01 2.6210042442829291e+00 -1.4984543782111359e-01 + 2 2.4583442254128229e-01 3.1176398944387440e+00 -8.6300444750170513e-01 + 3 -8.1170826716459299e-01 1.3101828007635898e+00 -6.2713226307370373e-01 + 4 -1.7336960306857696e+00 1.5686697778612544e+00 -1.2852651188809725e+00 + 5 -1.0267873549947240e+00 9.8546732001318738e-01 4.4606118426580821e-01 + 6 2.0034867210734220e-01 2.9097282985659234e-01 -1.2794959682827871e+00 + 7 2.8299304139111126e-01 -9.8971366280871109e-03 -2.6079072079700492e+00 + 8 1.1567019406452035e+00 -5.0320777137791950e-01 -6.5066789277800829e-01 + 9 1.3732138945027508e+00 -2.5804705857834254e-01 3.1851554818701366e-01 + 10 2.0708419798525339e+00 -1.5132911463394798e+00 -9.9967437361937339e-01 + 11 1.8049815045625648e+00 -2.0813005716784030e+00 -1.9515807899323248e+00 + 12 3.0834039834618219e+00 -5.0557862158481992e-01 -1.6756212406218332e+00 + 13 4.1783682097723682e+00 -9.2652704672170039e-01 -1.6934491042591890e+00 + 14 2.6655292547319247e+00 -4.2915649775420750e-01 -2.7647457742559025e+00 + 15 3.0458718015659878e+00 5.8869699617545557e-01 -1.2691368849082085e+00 + 16 2.7270813732203978e+00 -2.5185818891185647e+00 2.4266264399741999e-02 + 17 2.2587656442341126e+00 -2.1904173482747842e+00 1.2714909120545990e+00 + 18 2.1722236548934637e+00 3.1811222422167020e+00 -3.6651558864447722e+00 + 19 1.5379398556770809e+00 2.7753418525421392e+00 -4.4335720571436505e+00 + 20 2.8297017791404011e+00 3.8806130275561390e+00 -4.1086350730387107e+00 + 21 5.0810595653127395e+00 -4.2726993761468854e+00 -3.7759986457351467e+00 + 22 4.5159944054286365e+00 -4.4096375699551125e+00 -4.6625229101194083e+00 + 23 5.9544012798554879e+00 -3.7485298730844976e+00 -4.0497269160892424e+00 + 24 2.0985901295728704e+00 3.3220427620224413e+00 3.3458828955531530e+00 + 25 1.2909018438727013e+00 3.4520688721361132e+00 2.6668745139627088e+00 + 26 2.6369964922780786e+00 4.2260159402561364e+00 3.4067459518439538e+00 + 27 -2.1362659018083896e+00 -4.5674848292640569e+00 2.2474082834952522e+00 + 28 -2.9552202082294778e+00 -4.2155356436588987e+00 1.6932958531971636e+00 + 29 -1.4526234281463211e+00 -3.7726615685777620e+00 2.4133434299397827e+00 +run_vel: ! |2 + 1 6.8612579444768231e-03 9.3588988693932805e-03 -2.4583492777823684e-04 + 2 -5.0360784274195033e-04 2.9726176692813336e-04 5.5601612371459462e-03 + 3 -4.7155832907463452e-03 -5.2759387113087341e-03 -1.2616380301006356e-03 + 4 9.0720438238635814e-04 -7.5770223054582126e-03 2.0478412627257941e-03 + 5 -9.5789948666970045e-03 -7.8707074219574475e-03 -7.9287843977473432e-03 + 6 -2.5864536864176637e-02 3.1782714744452420e-02 2.5357940964759636e-02 + 7 1.7503976604491542e-04 -6.5115623482965013e-03 -3.3939736089235235e-02 + 8 6.1789956534982508e-03 -3.2385611493897320e-03 2.5198707320088474e-02 + 9 -1.0477317219362496e-03 8.0710832498008555e-04 3.3332742003808645e-03 + 10 2.0007827220591145e-02 -1.7400965483689801e-02 -1.1413325470549929e-02 + 11 -3.3990745583665129e-03 -7.3619037098941514e-04 2.4449145139565686e-03 + 12 1.3760114048527200e-03 -8.1425901890779418e-04 -2.9046493957496202e-03 + 13 -2.5828376034205732e-03 7.7834697286519742e-03 -6.8243437049079190e-04 + 14 5.4336022535973862e-03 -6.1421574327034621e-03 1.3592225966609420e-03 + 15 -1.7549740615613416e-03 -1.1133323565619430e-02 4.2071260576439420e-03 + 16 1.0367443974825941e-02 -6.4589866626159186e-03 -2.8766731056347843e-02 + 17 -7.5963042220266912e-03 6.0593621716489411e-03 2.3127705683585555e-02 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-rattle_angle.yaml b/unittest/force-styles/tests/fix-timestep-rattle_angle.yaml new file mode 100644 index 0000000000..c461fdaf53 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-rattle_angle.yaml @@ -0,0 +1,77 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:30:21 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix rattle +pre_commands: ! "" +post_commands: ! | + fix move all nve + fix test solvent rattle 1.0e-5 20 4 b 5 a 1 + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |- + -6.7489444076122581e+01 -3.6466857275816793e+01 -4.1453650662488030e+01 -3.0881715538687999e+01 -2.8271646386126275e+01 1.8512924155867125e-01 +run_pos: ! |2 + 1 -2.7045559935221097e-01 2.4912159904412490e+00 -1.6695851634760922e-01 + 2 3.1004029578877490e-01 2.9612354630874571e+00 -8.5466363025011627e-01 + 3 -7.0398551512563201e-01 1.2305509950678348e+00 -6.2777526850896104e-01 + 4 -1.5818159336526965e+00 1.4837407818978032e+00 -1.2538710835933191e+00 + 5 -9.0719763671886688e-01 9.2652103888784798e-01 3.9954210492830977e-01 + 6 2.4831720377219527e-01 2.8313021315702186e-01 -1.2314233326160173e+00 + 7 3.4143527702622734e-01 -2.2646549532188382e-02 -2.5292291427264142e+00 + 8 1.1743552220275317e+00 -4.8863228684188359e-01 -6.3783432829693443e-01 + 9 1.3800524229360562e+00 -2.5274721027441394e-01 2.8353985886396749e-01 + 10 2.0510765212518995e+00 -1.4604063737408786e+00 -9.8323745028431875e-01 + 11 1.7878031941850188e+00 -1.9921863270751916e+00 -1.8890602447198563e+00 + 12 3.0063007040149974e+00 -4.9013350636226771e-01 -1.6231898103008302e+00 + 13 4.0515402958586257e+00 -8.9202011560301075e-01 -1.6400005529400123e+00 + 14 2.6066963345427290e+00 -4.1789253956770167e-01 -2.6634003609341543e+00 + 15 2.9695287185432337e+00 5.5422613169503154e-01 -1.2342022022205887e+00 + 16 2.6747029683763714e+00 -2.4124119045309693e+00 -2.3435744689915886e-02 + 17 2.2153577782070029e+00 -2.0897985186673269e+00 1.1963150798970605e+00 + 18 2.1373900776464936e+00 3.0170538457970628e+00 -3.5215797395725530e+00 + 19 1.5430025676651555e+00 2.6303296449949269e+00 -4.2266668834718990e+00 + 20 2.7636622208420851e+00 3.6827879501178424e+00 -3.9272659545237363e+00 + 21 4.9052192222681876e+00 -4.0732760101811269e+00 -3.6279255237131718e+00 + 22 4.3519818207040561e+00 -4.2184829355532472e+00 -4.4481958001084010e+00 + 23 5.7453761098416072e+00 -3.5841442260372478e+00 -3.8622042082027339e+00 + 24 2.0680414913289775e+00 3.1533722552525343e+00 3.1535500327643740e+00 + 25 1.3065720083112300e+00 3.2620808683235558e+00 2.5145299517967921e+00 + 26 2.5824112033661786e+00 4.0080581544027423e+00 3.2238053751629132e+00 + 27 -1.9611343130357310e+00 -4.3563411931359832e+00 2.1098293115523683e+00 + 28 -2.7473562684513424e+00 -4.0200819932379339e+00 1.5830052163433954e+00 + 29 -1.3126000191366676e+00 -3.5962518039489830e+00 2.2746342468733833e+00 +run_vel: ! |2 + 1 8.1705729507146642e-03 1.6516406093744641e-02 4.7902279090199888e-03 + 2 5.4501493276694407e-03 5.1791698760542655e-03 -1.4372929651720373e-03 + 3 -8.2298303446991499e-03 -1.2926552110646281e-02 -4.0984171815350119e-03 + 4 -3.7699042793691621e-03 -6.5722892086671888e-03 -1.1184640147877227e-03 + 5 -1.1021961023179821e-02 -9.8906780808723574e-03 -2.8410737186752391e-03 + 6 -3.9676664596302022e-02 4.6817059618450917e-02 3.7148492579484563e-02 + 7 9.1034031301509934e-04 -1.0128522664904629e-02 -5.1568252954671358e-02 + 8 7.9064703413713518e-03 -3.3507265483952130e-03 3.4557099321061970e-02 + 9 1.5644176069499445e-03 3.7365546445246702e-03 1.5047408832397751e-02 + 10 2.9201446099433200e-02 -2.9249578511256979e-02 -1.5018076911020584e-02 + 11 -4.7835964007472438e-03 -3.7481383012996799e-03 -2.3464103653896319e-03 + 12 2.2696453008391368e-03 -3.4774279616439630e-04 -3.0640765817961158e-03 + 13 2.7531739986205606e-03 5.8171065863360273e-03 -7.9467449090663456e-04 + 14 3.5246182341718787e-03 -5.7939994947008291e-03 -3.9478431580931327e-03 + 15 -1.8547943904014324e-03 -5.8554729842982909e-03 6.2938484741557809e-03 + 16 1.8681498891538882e-02 -1.3262465322856017e-02 -4.5638650127800932e-02 + 17 -1.2896270312366209e-02 9.7527665732632350e-03 3.7296535866542128e-02 + 18 3.6201701458125901e-04 -3.1019809770901913e-04 8.1201763681395124e-04 + 19 8.5112360015621527e-04 -1.4603353796945311e-03 1.0305254865262262e-03 + 20 -6.5417978223454955e-04 4.4256253979791337e-04 4.7856455882856112e-04 + 21 -1.3982465853051491e-03 -3.2420187158416122e-04 1.1419970014906219e-03 + 22 -1.5884120818688635e-03 -1.5258102513021705e-03 1.4829681808138718e-03 + 23 2.8156640545678882e-04 -3.9296161403347832e-03 -3.6141019321529006e-04 + 24 8.5788311101024021e-04 -9.4446252118115083e-04 5.5288135210022535e-04 + 25 1.6004033600709000e-03 -2.2093786373070566e-03 -5.4710565574674660e-04 + 26 -1.5640453234916207e-03 3.5755082486241615e-04 2.4453236849039262e-03 + 27 4.5604120291777391e-04 -1.0305523027099432e-03 2.1188058380935704e-04 + 28 -6.2544520861865490e-03 1.4127711176129324e-03 -1.8429821884795277e-03 + 29 6.4110631474916110e-04 3.1273432713407900e-03 3.7253671102111473e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-rattle_bond.yaml b/unittest/force-styles/tests/fix-timestep-rattle_bond.yaml new file mode 100644 index 0000000000..c23857f652 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-rattle_bond.yaml @@ -0,0 +1,77 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:30:21 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix rattle +pre_commands: ! "" +post_commands: ! | + fix move all nve + fix test solute rattle 1.0e-5 20 4 m 4.00794 + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |2- + 3.9891557115890999e+00 3.7983351717152480e+00 7.6152694943743228e+01 5.7163462651523300e-01 3.0839737670745507e+01 3.0066936263232019e+01 +run_pos: ! |2 + 1 -2.6863205200662160e-01 2.4924200251053037e+00 -1.6940797171640173e-01 + 2 3.0314855494325726e-01 2.9555142432096928e+00 -8.4661597718762538e-01 + 3 -7.0471630526135653e-01 1.2320076232474173e+00 -6.3059972306932599e-01 + 4 -1.5777965340711875e+00 1.4826179820456016e+00 -1.2510232575394136e+00 + 5 -9.0838614372574067e-01 9.2479324973625643e-01 4.0580653202950134e-01 + 6 2.4793967906065856e-01 2.8343287430301523e-01 -1.2316652319085841e+00 + 7 3.4143850947000237e-01 -2.2651528366236746e-02 -2.5292473574049552e+00 + 8 1.1730749609547400e+00 -4.9001540353149170e-01 -6.4332649946665266e-01 + 9 1.3845859932368008e+00 -2.4786933347311196e-01 3.0357812296279735e-01 + 10 2.0524841105948015e+00 -1.4583699771496379e+00 -9.7983952239393757e-01 + 11 1.7850840352923341e+00 -1.9987544346588606e+00 -1.8998839983899072e+00 + 12 3.0095045212033247e+00 -4.8782153578035059e-01 -1.6261252340942491e+00 + 13 4.0351185088311556e+00 -8.8522351740509708e-01 -1.6398224375630548e+00 + 14 2.6123239686628956e+00 -4.1890190267120403e-01 -2.6495985815028571e+00 + 15 2.9701534707934725e+00 5.4105345536479910e-01 -1.2389976744608262e+00 + 16 2.6747027555918970e+00 -2.4124113563394012e+00 -2.3415671532678806e-02 + 17 2.2153595673079209e+00 -2.0898013762372751e+00 1.1963177401330007e+00 + 18 2.1369701694435119e+00 3.0158507393675174e+00 -3.5179348311269880e+00 + 19 1.5355837135166919e+00 2.6255292354443638e+00 -4.2353987776659867e+00 + 20 2.7727573004750279e+00 3.6923910448253729e+00 -3.9330842457663850e+00 + 21 4.9040128074584084e+00 -4.0752348173558683e+00 -3.6210314712921452e+00 + 22 4.3582355554470675e+00 -4.2126119427230533e+00 -4.4612844196479138e+00 + 23 5.7439382849367417e+00 -3.5821957939146403e+00 -3.8766361296113812e+00 + 24 2.0689243589978767e+00 3.1513346914192564e+00 3.1550389757754025e+00 + 25 1.3045351338498816e+00 3.2665125711118623e+00 2.5111855260643079e+00 + 26 2.5809237403158591e+00 4.0117602606099725e+00 3.2212060529034496e+00 + 27 -1.9611343131186747e+00 -4.3563411932863181e+00 2.1098293116020814e+00 + 28 -2.7473562684591109e+00 -4.0200819932508631e+00 1.5830052163456609e+00 + 29 -1.3126000191565619e+00 -3.5962518039874860e+00 2.2746342468906682e+00 +run_vel: ! |2 + 1 7.7370763703885981e-03 1.5916623177089917e-02 5.0460584330822480e-03 + 2 6.5186940562006425e-03 6.0087223948100997e-03 -2.7579528931744326e-03 + 3 -7.3639039999207805e-03 -1.2783111443358818e-02 -3.3210723356919430e-03 + 4 -5.8962208660568623e-03 -5.9658659155316252e-03 -2.6327244609218236e-03 + 5 -1.0929657512764205e-02 -9.6585946726249240e-03 -3.0956201839590124e-03 + 6 -4.0123707366837992e-02 4.7187394112882822e-02 3.6871538264127757e-02 + 7 9.1133487010599461e-04 -1.0132608633652495e-02 -5.1595915280728183e-02 + 8 7.0088514431851422e-03 -4.2477252839068919e-03 3.0986345119599783e-02 + 9 4.6374036922998555e-03 7.0470301756850907e-03 2.8627719728916035e-02 + 10 3.0611231933355295e-02 -2.7617219870000733e-02 -1.2129568539940891e-02 + 11 -7.2060626580151164e-03 -9.4599495517301499e-03 -1.1803018293165211e-02 + 12 1.5103726570079637e-03 -8.6499790408050452e-04 -2.9343732292293413e-03 + 13 4.0387984545004179e-03 5.5920103447542734e-03 -9.5141435774168603e-04 + 14 3.7449566583612186e-03 -5.7205267373051458e-03 -4.1285172459609044e-03 + 15 -1.6192412735192771e-03 -4.5860921043834090e-03 6.6371157403290462e-03 + 16 1.8683716258419525e-02 -1.3263096088946387e-02 -4.5607321000772597e-02 + 17 -1.2893753425925242e-02 9.7485795481257100e-03 3.7300775385778646e-02 + 18 -8.0065894051881104e-04 -8.6270684963651997e-04 -1.4483015146944853e-03 + 19 1.2452389852680510e-03 -2.5061098313021958e-03 7.2998634573395622e-03 + 20 3.5930058838403115e-03 3.6938858373569165e-03 3.2322734729320975e-03 + 21 -1.4689219027528956e-03 -2.7352134530947029e-04 7.0581593448005339e-04 + 22 -7.0694199260273143e-03 -4.2577148857392598e-03 2.8079115157198279e-04 + 23 6.0446963222438397e-03 -1.4000131442962716e-03 2.5819754631691500e-03 + 24 3.1926442964369685e-04 -9.9445591935644600e-04 1.5000033448111914e-04 + 25 1.3789825021844792e-04 -4.4335889596263511e-03 -8.1808100227326449e-04 + 26 2.0485904735292599e-03 2.7813359659683385e-03 4.3245727170611618e-03 + 27 4.5604110580961207e-04 -1.0305524671180935e-03 2.1188063421234097e-04 + 28 -6.2544520944132998e-03 1.4127711036803850e-03 -1.8429821866102578e-03 + 29 6.4110628696208052e-04 3.1273432221612541e-03 3.7253671295737062e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-rigid-group.yaml b/unittest/force-styles/tests/fix-timestep-rigid-group.yaml new file mode 100644 index 0000000000..a252c9ae16 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-rigid-group.yaml @@ -0,0 +1,78 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:30:21 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + fix rigid +pre_commands: ! "" +post_commands: ! | + variable t_target delete + fix test all rigid group 2 solute solvent + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |- + -1.4245356937318927e+03 -1.4496493315649675e+03 -3.6144360984224963e+03 8.4840626828643849e+02 2.0318336761611764e+02 -6.0622397707969685e+02 +global_scalar: 15.7115214231781 +run_pos: ! |2 + 1 -2.7899546863891622e-01 2.4731857340328216e+00 -1.7290667740241872e-01 + 2 3.0296221610264007e-01 2.9517129916957545e+00 -8.5798904387772823e-01 + 3 -6.9368802364134852e-01 1.2445115421754183e+00 -6.2281111198650230e-01 + 4 -1.5764879647103172e+00 1.4919714415841274e+00 -1.2492069414674600e+00 + 5 -8.9434512967430013e-01 9.3651699743510730e-01 4.0191726558261431e-01 + 6 2.9454439634451690e-01 2.2724545792544065e-01 -1.2845195053960263e+00 + 7 3.4049112903270062e-01 -9.4655678322440595e-03 -2.4634480020857059e+00 + 8 1.1644354555804877e+00 -4.8367776650961369e-01 -6.7663643940735896e-01 + 9 1.3781717822696469e+00 -2.5332509530010827e-01 2.6864954436590061e-01 + 10 2.0186368606041905e+00 -1.4285861423625792e+00 -9.6712491252780297e-01 + 11 1.7929137227577470e+00 -1.9875455388407410e+00 -1.8836565352266557e+00 + 12 3.0032775230399604e+00 -4.8983022415173838e-01 -1.6190248017343647e+00 + 13 4.0448964162125947e+00 -9.0213155122390720e-01 -1.6385398399479572e+00 + 14 2.6035151245015831e+00 -4.0874995493218902e-01 -2.6555999074786611e+00 + 15 2.9761196776172314e+00 5.6287237454108840e-01 -1.2442626196083382e+00 + 16 2.6517373021566191e+00 -2.3957035508393720e+00 3.3389262100689376e-02 + 17 2.2311114924744988e+00 -2.1018393228798540e+00 1.1496088522377521e+00 + 18 2.1390642573201788e+00 3.0164773560693772e+00 -3.5143984803853874e+00 + 19 1.5353246655146275e+00 2.6305911186316124e+00 -4.2455871034737074e+00 + 20 2.7649421538938386e+00 3.6818603528430827e+00 -3.9364115785985558e+00 + 21 4.9043112657298868e+00 -4.0774268210397873e+00 -3.6200836396129810e+00 + 22 4.3665322424283302e+00 -4.2075138112953594e+00 -4.4636587264885854e+00 + 23 5.7355405581985170e+00 -3.5789558641908905e+00 -3.8805763324089964e+00 + 24 2.0692780332810123e+00 3.1504920436416004e+00 3.1571131300668775e+00 + 25 1.3007297593169085e+00 3.2745259354179486e+00 2.5110163874103657e+00 + 26 2.5819416446099748e+00 4.0104903120756585e+00 3.2150249624526013e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 4.7093289825842518e-04 2.6351122778447999e-04 -4.4905093064114991e-04 + 2 4.9594625316470484e-04 9.4561370489631939e-05 -5.4581359894047949e-04 + 3 3.3306085115756087e-04 2.3224943880673381e-04 -2.3659455671746045e-04 + 4 3.3692327392261114e-04 2.1926810694051279e-04 -2.4716631558862527e-04 + 5 3.3642542694186013e-04 4.1797578013265895e-04 -1.8011341766657651e-04 + 6 2.0926869754934733e-04 2.6449308951578761e-05 -1.0508938983871863e-04 + 7 1.4629043007907862e-04 -1.6873376665350138e-04 -6.8354048774351599e-05 + 8 1.5844101624224864e-04 3.7728761274000492e-05 -1.9162715667091517e-05 + 9 2.1299362072601976e-04 1.6917140529157604e-04 -6.3528165037846039e-05 + 10 5.4261629412254251e-05 -9.4655528376811197e-05 1.0511362869146629e-04 + 11 -3.2194160796503320e-05 -2.2025095264758748e-04 2.0300202946212385e-04 + 12 1.2640586304750342e-04 -2.9851080445665075e-04 -7.9476371818247547e-05 + 13 8.4523575162142323e-05 -4.0583135407330540e-04 -4.7551111331702706e-05 + 14 9.9954050381270240e-05 -4.2610816481298321e-04 -7.9255633594381333e-05 + 15 2.4417481119789840e-04 -2.3521002264677917e-04 -2.4875318161049140e-04 + 16 -9.0958138549664179e-06 3.7774817121227626e-06 2.4035199548835075e-04 + 17 5.7507224523612718e-05 2.2629217444843883e-04 2.0686920072684827e-04 + 18 2.9220264989359676e-04 -6.2478376436796309e-04 8.4222594596602344e-04 + 19 2.0572616567799036e-04 -5.0334424271726705e-04 8.4953929443210658e-04 + 20 4.1224811789512805e-04 -7.4115205416011576e-04 8.3678612337507888e-04 + 21 -1.0671858777656380e-03 -1.1531171045499509e-03 7.3720674900162192e-04 + 22 -1.1066511338291703e-03 -1.0433933757600456e-03 7.4544544325708616e-04 + 23 -9.7629260480941438e-04 -1.3100872491594094e-03 7.2687284219704804e-04 + 24 4.3308126651259334e-04 -6.6527658087322747e-04 8.4451298670663595e-04 + 25 4.4565811905442911e-04 -5.1298436273584274e-04 8.5878867884521559e-04 + 26 5.9865972692022798e-04 -7.6385263287080316e-04 8.4259943226842134e-04 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-rigid-molecule.yaml b/unittest/force-styles/tests/fix-timestep-rigid-molecule.yaml new file mode 100644 index 0000000000..18ac7ea4e7 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-rigid-molecule.yaml @@ -0,0 +1,78 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:30:21 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + fix rigid +pre_commands: ! "" +post_commands: ! | + variable t_target delete + fix test solvent rigid molecule + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |- + -4.9200116134790363e+01 -2.6907707565987732e+01 -6.0080860422282560e+00 -2.5620423972101747e+01 -1.3450224059984075e+01 -1.4947288487004844e+00 +global_scalar: 18.3405601674144 +run_pos: ! |2 + 1 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01 + 2 3.0197083955402204e-01 2.9515239068888608e+00 -8.5689735572907566e-01 + 3 -6.9435377880558602e-01 1.2440473127136711e+00 -6.2233801468892025e-01 + 4 -1.5771614164685133e+00 1.4915333140468066e+00 -1.2487126845040522e+00 + 5 -8.9501761359359255e-01 9.3568128743071344e-01 4.0227731871484346e-01 + 6 2.9412607937706009e-01 2.2719282656652909e-01 -1.2843094067857870e+00 + 7 3.4019871062879609e-01 -9.1277350075786561e-03 -2.4633113224304561e+00 + 8 1.1641187171852805e+00 -4.8375305955385234e-01 -6.7659823767368688e-01 + 9 1.3777459838125838e+00 -2.5366338669522998e-01 2.6877644730326306e-01 + 10 2.0185283555536988e+00 -1.4283966846517357e+00 -9.6733527271133024e-01 + 11 1.7929780509347666e+00 -1.9871047540768743e+00 -1.8840626643185674e+00 + 12 3.0030247876861225e+00 -4.8923319967572748e-01 -1.6188658531537248e+00 + 13 4.0447273787895934e+00 -9.0131998547446246e-01 -1.6384447268320836e+00 + 14 2.6033152817257075e+00 -4.0789761505963579e-01 -2.6554413538823063e+00 + 15 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00 + 16 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02 + 17 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00 + 18 2.1392027588271301e+00 3.0171068018412783e+00 -3.5144628518856349e+00 + 19 1.5366124997074573e+00 2.6286809834111744e+00 -4.2452547844370221e+00 + 20 2.7628161763455852e+00 3.6842251687634779e+00 -3.9370881219352558e+00 + 21 4.9036621347791245e+00 -4.0757648442838548e+00 -3.6192617654515908e+00 + 22 4.3655322291888483e+00 -4.2084949965552561e+00 -4.4622011117402334e+00 + 23 5.7380414793463101e+00 -3.5841969195032672e+00 -3.8827839830470219e+00 + 24 2.0701314765323930e+00 3.1499370533342330e+00 3.1565324852522938e+00 + 25 1.3030170721374783e+00 3.2711173927682244e+00 2.5081940917429759e+00 + 26 2.5776230782480041e+00 4.0127347068243884e+00 3.2182355138709284e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 7.7867804888392077e-04 5.8970331623292821e-04 -2.2179517633030531e-04 + 2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03 + 3 -1.2736791029204805e-03 1.6108674226414498e-03 -3.3618185901550799e-04 + 4 -9.2828595122009308e-04 -1.2537885319521818e-03 -4.1204974953432108e-03 + 5 -1.1800848061603740e-03 7.5424401975844038e-04 6.9023177964912290e-05 + 6 -3.0914004879905335e-04 1.2755385764678133e-03 7.9574303350202582e-04 + 7 -1.1037894966874103e-04 -7.6764845099077425e-04 -7.7217630460203659e-04 + 8 3.9060281273221989e-04 -8.1444231918053418e-04 1.5134641148324972e-04 + 9 1.2475530960659720e-03 -2.6608454451432528e-03 1.1117602907112732e-03 + 10 4.5008983776042893e-04 4.9530197647538077e-04 -2.3336234361093645e-04 + 11 -3.6977669078869707e-04 -1.5289071951960539e-03 -2.9176389881837113e-03 + 12 1.0850834530183159e-03 -6.4965897903201833e-04 -1.2971152622619948e-03 + 13 4.0754559196230639e-03 3.5043502394946119e-03 -7.8324487687854666e-04 + 14 -1.3837220448746613e-04 -4.0656048637594394e-03 -3.9333461173944500e-03 + 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 + 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 + 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 + 18 3.6149625095704870e-04 -3.1032459262908302e-04 8.1043030117346052e-04 + 19 8.5103884665345441e-04 -1.4572280596788099e-03 1.0163621287634116e-03 + 20 -6.5204659278590758e-04 4.3989037444289831e-04 4.9909839028507966e-04 + 21 -1.3888125881903919e-03 -3.1978049143082570e-04 1.1455681499836646e-03 + 22 -1.6084223477729497e-03 -1.5355394240821158e-03 1.4772010826232373e-03 + 23 2.6392672378804886e-04 -3.9375414431174760e-03 -3.6991583139728127e-04 + 24 8.6062827067890290e-04 -9.4179873474469259e-04 5.5396395550012367e-04 + 25 1.5933645477487557e-03 -2.2139156625681682e-03 -5.5078029695647412e-04 + 26 -1.5679561743998888e-03 3.5146224354725948e-04 2.4446924193334482e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-rigid-single.yaml b/unittest/force-styles/tests/fix-timestep-rigid-single.yaml new file mode 100644 index 0000000000..ab37c9ac6a --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-rigid-single.yaml @@ -0,0 +1,78 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:30:21 202 +epsilon: 2.5e-13 +prerequisites: ! | + atom full + fix rigid +pre_commands: ! "" +post_commands: ! | + variable t_target delete + fix test solute rigid single + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |- + -1.3754817466835852e+03 -1.4228425246165939e+03 -3.6087196201913630e+03 8.7407043149698166e+02 2.1665316519768876e+02 -6.0480791462031175e+02 +global_scalar: 4.53142303857031 +run_pos: ! |2 + 1 -2.7899546859693181e-01 2.4731857340428789e+00 -1.7290667720876129e-01 + 2 3.0296221616793595e-01 2.9517129917211555e+00 -8.5798904365355089e-01 + 3 -6.9368802362166315e-01 1.2445115422149753e+00 -6.2281111185285432e-01 + 4 -1.5764879646739509e+00 1.4919714416722003e+00 -1.2492069413381559e+00 + 5 -8.9434512967954460e-01 9.3651699743538708e-01 4.0191726569957620e-01 + 6 2.9454439635065854e-01 2.2724545796943085e-01 -1.2845195052894232e+00 + 7 3.4049112905311674e-01 -9.4655677385591108e-03 -2.4634480019885245e+00 + 8 1.1644354555589662e+00 -4.8367776651302741e-01 -6.7663643931660777e-01 + 9 1.3781717822376685e+00 -2.5332509534947545e-01 2.6864954447021527e-01 + 10 2.0186368605645773e+00 -1.4285861423742925e+00 -9.6712491246325638e-01 + 11 1.7929137227200924e+00 -1.9875455388074488e+00 -1.8836565351900403e+00 + 12 3.0032775230343129e+00 -4.8983022415935262e-01 -1.6190248016126150e+00 + 13 4.0448964161972292e+00 -9.0213155125606903e-01 -1.6385398398262687e+00 + 14 2.6035151245155346e+00 -4.0874995488538102e-01 -2.6555999073602141e+00 + 15 2.9761196776308703e+00 5.6287237451798355e-01 -1.2442626194416762e+00 + 16 2.6517373020764223e+00 -2.3957035509096416e+00 3.3389262134315478e-02 + 17 2.2311114923824862e+00 -2.1018393229879826e+00 1.1496088522768946e+00 + 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 + 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 + 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 + 21 4.9064454390208301e+00 -4.0751205255383196e+00 -3.6215576073601046e+00 + 22 4.3687453488627543e+00 -4.2054270536772504e+00 -4.4651491269372565e+00 + 23 5.7374928154769504e+00 -3.5763355905184966e+00 -3.8820297194230728e+00 + 24 2.0684115301174013e+00 3.1518221747664397e+00 3.1554242678474576e+00 + 25 1.2998381073113014e+00 3.2755513587518097e+00 2.5092990173114837e+00 + 26 2.5807438597688113e+00 4.0120175892854135e+00 3.2133398379059099e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 4.7093296226165759e-04 2.6351124312057328e-04 -4.4905063547614815e-04 + 2 4.9594635271877263e-04 9.4561409237138648e-05 -5.4581325723053584e-04 + 3 3.3306088119083106e-04 2.3224949911015489e-04 -2.3659435306900921e-04 + 4 3.3692332940286711e-04 2.1926824120529708e-04 -2.4716611858556546e-04 + 5 3.3642541894624088e-04 4.1797578053943778e-04 -1.8011323945929135e-04 + 6 2.0926870695908297e-04 2.6449376032441632e-05 -1.0508922741401441e-04 + 7 1.4629046128362895e-04 -1.6873362379723160e-04 -6.8353900724071678e-05 + 8 1.5844098346817962e-04 3.7728756087619151e-05 -1.9162577392849499e-05 + 9 2.1299357198253027e-04 1.6917133003966806e-04 -6.3528006071200595e-05 + 10 5.4261569071246100e-05 -9.4655546204698788e-05 1.0511372702289762e-04 + 11 -3.2194218121523160e-05 -2.2025090185602363e-04 2.0300208519292848e-04 + 12 1.2640585449263567e-04 -2.9851081600946788e-04 -7.9476186245575856e-05 + 13 8.4523551795102534e-05 -4.0583140303608248e-04 -4.7550925831931509e-05 + 14 9.9954071734163638e-05 -4.2610809338913916e-04 -7.9255453072662124e-05 + 15 2.4417483202630001e-04 -2.3521005781669064e-04 -2.4875292755152092e-04 + 16 -9.0959360838833471e-06 3.7773746063198897e-06 2.4035204669042528e-04 + 17 5.7507084250808007e-05 2.2629200960629450e-04 2.0686926033794596e-04 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-setforce-const.yaml b/unittest/force-styles/tests/fix-timestep-setforce-const.yaml new file mode 100644 index 0000000000..72379e29cb --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-setforce-const.yaml @@ -0,0 +1,76 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:12:16 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix setforce +pre_commands: ! "" +post_commands: ! | + fix move all nve + fix test solute setforce 0.0 NULL 0.1 +input_file: in.fourmol +natoms: 29 +global_vector: ! |- + 3 0.031196595768662405 0.027176378299685666 -0.018248127488959653 +run_pos: ! |2 + 1 -2.7837948059450057e-01 2.4915057595127261e+00 -1.7244621851040967e-01 + 2 3.0739674554684748e-01 2.9612812082059410e+00 -8.4971536723424157e-01 + 3 -6.9690113701142686e-01 1.2299989573015675e+00 -6.2300341128596803e-01 + 4 -1.5790179883709534e+00 1.4836808443213463e+00 -1.2569328009386738e+00 + 5 -8.9737778320591355e-01 9.2644076771112371e-01 4.0243624362683811e-01 + 6 2.9350779927946186e-01 2.9015340694208497e-01 -1.2827109535977994e+00 + 7 3.3997795272945847e-01 -2.6300572624749590e-02 -2.4648504448435284e+00 + 8 1.1648999228107455e+00 -4.8865966236488045e-01 -6.7628957056698502e-01 + 9 1.3802410900047160e+00 -2.5301023044453536e-01 2.7102084644075047e-01 + 10 2.0194285352292209e+00 -1.4622480415421317e+00 -9.6779503027756864e-01 + 11 1.7922384975531884e+00 -1.9922212161152444e+00 -1.8898770637388704e+00 + 12 3.0051949545921595e+00 -4.9025758702939209e-01 -1.6214531165572654e+00 + 13 4.0528782906288381e+00 -8.9202906696376694e-01 -1.6399903380297762e+00 + 14 2.6030385373167326e+00 -4.1792037250958114e-01 -2.6632871675610303e+00 + 15 2.9669711835025847e+00 5.5426020373538232e-01 -1.2373366130951635e+00 + 16 2.6515619929959935e+00 -2.4164580153507993e+00 3.5904434895191586e-02 + 17 2.2323103228818271e+00 -2.0866200178232570e+00 1.1508699713803967e+00 + 18 2.1369701651509190e+00 3.0158507318424936e+00 -3.5179348274555937e+00 + 19 1.5355837133081183e+00 2.6255292347922397e+00 -4.2353987772399497e+00 + 20 2.7727573004039123e+00 3.6923910447382959e+00 -3.9330842457623234e+00 + 21 4.9040128090518982e+00 -4.0752348190254066e+00 -3.6210314733741300e+00 + 22 4.3582355554811203e+00 -4.2126119427992510e+00 -4.4612844197913537e+00 + 23 5.7439382850543934e+00 -3.5821957939727862e+00 -3.8766361297296963e+00 + 24 2.0689243587550665e+00 3.1513346917712659e+00 3.1550389764758857e+00 + 25 1.3045351337111810e+00 3.2665125710954817e+00 2.5111855269473398e+00 + 26 2.5809237403311265e+00 4.0117602606155351e+00 3.2212060529773248e+00 + 27 -1.9611343135760269e+00 -4.3563411936812422e+00 2.1098293111769051e+00 + 28 -2.7473562684448014e+00 -4.0200819932539504e+00 1.5830052163387485e+00 + 29 -1.3126000190074181e+00 -3.5962518039956493e+00 2.2746342468316909e+00 +run_vel: ! |2 + 1 7.7867804888392077e-04 1.7047228530841809e-02 -2.1582089259505630e-04 + 2 2.7129529964126462e-03 5.2784482698423644e-03 3.6014335254494771e-03 + 3 -1.2736791029204805e-03 -1.3974541598892314e-02 -3.2921473803217605e-04 + 4 -9.2828595122009308e-04 -6.6991688238371011e-03 -4.0996189392783757e-03 + 5 -1.1800848061603740e-03 -1.0047153968619136e-02 8.9901734029750995e-05 + 6 -3.0914004879905335e-04 5.9226312312574469e-02 8.0271015448535863e-04 + 7 -1.1037894966874103e-04 -1.6457202942861592e-02 -7.6694610847002475e-04 + 8 3.9060281273221989e-04 -3.3092081140500625e-03 1.5732069521849873e-04 + 9 1.2475530960659720e-03 3.1932872333445845e-03 1.1326388467761117e-03 + 10 4.5008983776042893e-04 -3.2706161456987362e-02 -2.2639522262760407e-04 + 11 -3.6977669078869707e-04 -3.8208979405711181e-03 -2.8967604321188693e-03 + 12 1.0850834530183159e-03 -5.9865405325318095e-04 -1.2901481412786638e-03 + 13 4.0754559196230639e-03 5.8000556188644737e-03 -7.6236632081370817e-04 + 14 -1.3837220448746613e-04 -5.8513645592199954e-03 -3.9124675613296149e-03 + 15 -4.3301707382721859e-03 -5.7874916835632612e-03 3.2246704604008991e-03 + 16 -9.6715751018414326e-05 -2.0337180407622942e-02 1.5015330084982936e-03 + 17 6.5692180538157174e-04 1.5347761197837848e-02 8.4018434079252094e-04 + 18 -8.0066836980328829e-04 -8.6272352268198973e-04 -1.4482916287850436e-03 + 19 1.2452384523271498e-03 -2.5061112055692661e-03 7.2998645869741070e-03 + 20 3.5930056005389279e-03 3.6938854790338886e-03 3.2322736694535342e-03 + 21 -1.4689186150745120e-03 -2.7352475069894054e-04 7.0581153530664112e-04 + 22 -7.0694198605565570e-03 -4.2577150334417316e-03 2.8079083578864353e-04 + 23 6.0446965741464556e-03 -1.4000132401387128e-03 2.5819752034683392e-03 + 24 3.1926469085296537e-04 -9.9445460268275231e-04 1.5000192558511910e-04 + 25 1.3789867280959912e-04 -4.4335884662300897e-03 -8.1807894939305860e-04 + 26 2.0485905358907184e-03 2.7813360186345780e-03 4.3245728521738580e-03 + 27 4.5604013457189150e-04 -1.0305533784689190e-03 2.1187984562018490e-04 + 28 -6.2544520812349144e-03 1.4127710889363602e-03 -1.8429822031806322e-03 + 29 6.4110655335636812e-04 3.1273431604200374e-03 3.7253670254479500e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-setforce-region.yaml b/unittest/force-styles/tests/fix-timestep-setforce-region.yaml new file mode 100644 index 0000000000..e6e22e9929 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-setforce-region.yaml @@ -0,0 +1,77 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 15:15:21 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix setforce +pre_commands: ! "" +post_commands: ! | + region half block 0 EDGE EDGE EDGE EDGE EDGE + fix move all nve + fix test solute setforce 0.0 0.0 0.0 region half +input_file: in.fourmol +natoms: 29 +global_vector: ! |- + 3 30.2599905309868 33.68278530642225 -29.246531241430393 +run_pos: ! |2 + 1 -2.7049035247384523e-01 2.4911810898708389e+00 -1.6691641634960069e-01 + 2 3.0739674554684748e-01 2.9607811923110940e+00 -8.4973624579030649e-01 + 3 -7.0353916519192539e-01 1.2301035175216133e+00 -6.2811850060979157e-01 + 4 -1.5818280599335734e+00 1.4837673105082276e+00 -1.2538397846300477e+00 + 5 -9.0717031790556124e-01 9.2648976564062635e-01 3.9953566633035209e-01 + 6 2.9350779927946186e-01 2.2974390371946465e-01 -1.2827179207187822e+00 + 7 3.3997795272945847e-01 -1.0663031909560207e-02 -2.4648556750396611e+00 + 8 1.1648999228107455e+00 -4.8538194419221331e-01 -6.7629554485072030e-01 + 9 1.3802410900047160e+00 -2.5898507758551664e-01 2.7099996788468578e-01 + 10 2.0194285352292209e+00 -1.4274060806987843e+00 -9.6780199739855188e-01 + 11 1.7922384975531884e+00 -1.9901625684672659e+00 -1.8898979422949340e+00 + 12 3.0051949545921595e+00 -4.9053251763379130e-01 -1.6214600836782489e+00 + 13 4.0528782906288381e+00 -8.9431128499547308e-01 -1.6400112165858416e+00 + 14 2.6030385373167326e+00 -4.1602882478715481e-01 -2.6633080461170948e+00 + 15 2.9669711835025847e+00 5.5698216489676589e-01 -1.2373574916512289e+00 + 16 2.6515619929959935e+00 -2.3967113739514225e+00 3.5897467774208235e-02 + 17 2.2323103228818271e+00 -2.1015591787320327e+00 1.1508647411842645e+00 + 18 2.1369701686610401e+00 3.0158507356865694e+00 -3.5179348303585480e+00 + 19 1.5355837135232193e+00 2.6255292349839952e+00 -4.2353987776244075e+00 + 20 2.7727573004961963e+00 3.6923910448188275e+00 -3.9330842458397517e+00 + 21 4.9040128097611619e+00 -4.0752348192998085e+00 -3.6210314741042802e+00 + 22 4.3582355555035459e+00 -4.2126119428105069e+00 -4.4612844198387185e+00 + 23 5.7439382850855170e+00 -3.5821957939653286e+00 -3.8766361297559051e+00 + 24 2.0689243586287684e+00 3.1513346918425076e+00 3.1550389761993376e+00 + 25 1.3045351332139172e+00 3.2665125707733642e+00 2.5111855259275875e+00 + 26 2.5809237402965892e+00 4.0117602605909184e+00 3.2212060529312576e+00 + 27 -1.9611343134166486e+00 -4.3563411935496905e+00 2.1098293111410187e+00 + 28 -2.7473562684439594e+00 -4.0200819932414040e+00 1.5830052163325192e+00 + 29 -1.3126000190355391e+00 -3.5962518039701115e+00 2.2746342468355896e+00 +run_vel: ! |2 + 1 8.0968238327908306e-03 1.6439353504426914e-02 4.8774271710863440e-03 + 2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03 + 3 -7.3249068559002473e-03 -1.3819430195421816e-02 -4.7723976289498213e-03 + 4 -3.7880669939802302e-03 -6.5262112276744154e-03 -1.0623014289922296e-03 + 5 -1.0968756474139221e-02 -9.9481298518413509e-03 -2.8555668881870850e-03 + 6 -3.0914004879905335e-04 1.2755385764678133e-03 7.9574303350202582e-04 + 7 -1.1037894966874103e-04 -7.6764845099077425e-04 -7.7217630460203659e-04 + 8 3.9060281273221989e-04 -8.1444231918053418e-04 1.5134641148324972e-04 + 9 1.2475530960659720e-03 -2.6608454451432528e-03 1.1117602907112732e-03 + 10 4.5008983776042893e-04 4.9530197647538077e-04 -2.3336234361093645e-04 + 11 -3.6977669078869707e-04 -1.5289071951960539e-03 -2.9176389881837113e-03 + 12 1.0850834530183159e-03 -6.4965897903201833e-04 -1.2971152622619948e-03 + 13 4.0754559196230639e-03 3.5043502394946119e-03 -7.8324487687854666e-04 + 14 -1.3837220448746613e-04 -4.0656048637594394e-03 -3.9333461173944500e-03 + 15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 + 16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 + 17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 + 18 -8.0066124075139065e-04 -8.6271573462520822e-04 -1.4482975502198103e-03 + 19 1.2452389135116637e-03 -2.5061107963827616e-03 7.2998638022685452e-03 + 20 3.5930058351021075e-03 3.6938856958711494e-03 3.2322734653392029e-03 + 21 -1.4689171694079451e-03 -2.7352531109399892e-04 7.0581004713133645e-04 + 22 -7.0694198156406830e-03 -4.2577150557698900e-03 2.8079073380301450e-04 + 23 6.0446966473130361e-03 -1.4000132185117897e-03 2.5819751444708279e-03 + 24 3.1926444029166840e-04 -9.9445445081424041e-04 1.5000138266644348e-04 + 25 1.3789768148904548e-04 -4.4335891153916762e-03 -8.1808099807448656e-04 + 26 2.0485904659168050e-03 2.7813359700824256e-03 4.3245727588882886e-03 + 27 4.5604046194129701e-04 -1.0305531094668544e-03 2.1187977265303768e-04 + 28 -6.2544520782408771e-03 1.4127711142458772e-03 -1.8429822149784341e-03 + 29 6.4110649875996400e-04 3.1273432160629365e-03 3.7253670337420121e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-setforce-variable.yaml b/unittest/force-styles/tests/fix-timestep-setforce-variable.yaml new file mode 100644 index 0000000000..8f85b9bda5 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-setforce-variable.yaml @@ -0,0 +1,81 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:31:40 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + fix setforce +pre_commands: ! "" +post_commands: ! | + fix init all store/state 0 x y z + variable xforce delete + variable xforce atom f_init[1] + variable zforce delete + variable zforce equal 0.1*step/10.0 + fix move all nve + fix test solute setforce v_xforce NULL v_zforce +input_file: in.fourmol +natoms: 29 +global_vector: ! |- + 3 0.031197043446070438 0.027174896355546707 -0.0182497728803952 +run_pos: ! |2 + 1 -2.7839620481540395e-01 2.4915057673839494e+00 -1.7245062454466442e-01 + 2 3.0745979269788315e-01 2.9612799003321073e+00 -8.4973076516933943e-01 + 3 -6.9694951347924872e-01 1.2299993897604549e+00 -6.2300854953769325e-01 + 4 -1.5793472769015238e+00 1.4836803404053602e+00 -1.2569481988737716e+00 + 5 -8.9756464996015772e-01 9.2644083748828165e-01 4.0242084569174030e-01 + 6 2.9352829139925574e-01 2.9015145323915886e-01 -1.2827160918495246e+00 + 7 3.3999574578926306e-01 -2.6300640916517719e-02 -2.4648543021131757e+00 + 8 1.1649694705659248e+00 -4.8866051448760073e-01 -6.7629397660123991e-01 + 9 1.3805287434723772e+00 -2.5300998557235649e-01 2.7100544850565261e-01 + 10 2.0195691685418340e+00 -1.4622448609143475e+00 -9.6780016852929396e-01 + 11 1.7926128454807839e+00 -1.9922215118728828e+00 -1.8898924616739676e+00 + 12 3.0054041789622765e+00 -4.9025864489097593e-01 -1.6214582548089909e+00 + 13 4.0537227713022892e+00 -8.9202793537180580e-01 -1.6400057359648736e+00 + 14 2.6035820719573719e+00 -4.1791903022039290e-01 -2.6633025654961284e+00 + 15 2.9675924523988120e+00 5.5426053668143505e-01 -1.2373520110302618e+00 + 16 2.6517467440046008e+00 -2.4164567727480781e+00 3.5899296643466388e-02 + 17 2.2324270083733913e+00 -2.0866208488166604e+00 1.1508661141107490e+00 + 18 2.1369701651563577e+00 3.0158507318463847e+00 -3.5179348274587312e+00 + 19 1.5355837133083070e+00 2.6255292347928294e+00 -4.2353987772404720e+00 + 20 2.7727573004041375e+00 3.6923910447383275e+00 -3.9330842457623802e+00 + 21 4.9040128090474138e+00 -4.0752348190131000e+00 -3.6210314733626974e+00 + 22 4.3582355554811585e+00 -4.2126119427988371e+00 -4.4612844197907773e+00 + 23 5.7439382850538623e+00 -3.5821957939720512e+00 -3.8766361297289245e+00 + 24 2.0689243587569925e+00 3.1513346917721052e+00 3.1550389764777305e+00 + 25 1.3045351337120681e+00 3.2665125710962655e+00 2.5111855269493146e+00 + 26 2.5809237403312411e+00 4.0117602606156098e+00 3.2212060529774256e+00 + 27 -1.9611343135827304e+00 -4.3563411936860819e+00 2.1098293111801389e+00 + 28 -2.7473562684450474e+00 -4.0200819932540828e+00 1.5830052163388388e+00 + 29 -1.3126000190081526e+00 -3.5962518039961902e+00 2.2746342468323033e+00 +run_vel: ! |2 + 1 7.6195382798044376e-04 1.7047294266563661e-02 -2.1940546283620574e-04 + 2 2.7760001474483962e-03 5.2757744130340666e-03 3.5889063918105712e-03 + 3 -1.3220555707422056e-03 -1.3973728740579328e-02 -3.3339501062217507e-04 + 4 -1.2575744817904762e-03 -6.7002024022163554e-03 -4.1121460729172752e-03 + 5 -1.3669515604046946e-03 -1.0047013360250249e-02 7.7374600390847764e-05 + 6 -2.8864792900532157e-04 5.9222680386688660e-02 7.9852988189535858e-04 + 7 -9.2585889864279630e-05 -1.6457340485619719e-02 -7.7008422614923192e-04 + 8 4.6015056791200718e-04 -3.3109316498999594e-03 1.5373612497734929e-04 + 9 1.5352065637273457e-03 3.1937624988604553e-03 1.1201117131372088e-03 + 10 5.9072315037472388e-04 -3.2700043246480542e-02 -2.3057549521760353e-04 + 11 4.5712368059701517e-06 -3.8214916428847890e-03 -2.9092875657577752e-03 + 12 1.2943078231358680e-03 -6.0079494716434921e-04 -1.2943284138686624e-03 + 13 4.9199365930735345e-03 5.8023312918586692e-03 -7.7489345445261120e-04 + 14 4.0516243615214899e-04 -5.8486182036653431e-03 -3.9249946949685144e-03 + 15 -3.7089018420464036e-03 -5.7868019097368261e-03 3.2121433267619931e-03 + 16 8.8035257588441089e-05 -2.0334633672149962e-02 1.4973527359082950e-03 + 17 7.7360729694572576e-04 1.5346061058559362e-02 8.3704622311331378e-04 + 18 -8.0066835867995026e-04 -8.6272351468143541e-04 -1.4482916352603645e-03 + 19 1.2452384527498459e-03 -2.5061112043225221e-03 7.2998645858971855e-03 + 20 3.5930056010593471e-03 3.6938854791676847e-03 3.2322736692798068e-03 + 21 -1.4689186242560829e-03 -2.7352472551473247e-04 7.0581155868180371e-04 + 22 -7.0694198604028301e-03 -4.2577150325890274e-03 2.8079083711864800e-04 + 23 6.0446965730643750e-03 -1.4000132386422566e-03 2.5819752050698025e-03 + 24 3.1926469474555008e-04 -9.9445460100738717e-04 1.5000192930508560e-04 + 25 1.3789867459853888e-04 -4.4335884646610046e-03 -8.1807894538992332e-04 + 26 2.0485905361409002e-03 2.7813360188135763e-03 4.3245728523802927e-03 + 27 4.5604012089853278e-04 -1.0305533883296402e-03 2.1187985225197545e-04 + 28 -6.2544520817733613e-03 1.4127710886673889e-03 -1.8429822030169415e-03 + 29 6.4110655177640171e-04 3.1273431592077948e-03 3.7253670266864263e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-shake_angle.yaml b/unittest/force-styles/tests/fix-timestep-shake_angle.yaml new file mode 100644 index 0000000000..7b8b7d89f1 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-shake_angle.yaml @@ -0,0 +1,77 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:30:22 202 +epsilon: 2e-12 +prerequisites: ! | + atom full + fix shake +pre_commands: ! "" +post_commands: ! | + fix move all nve + fix test solvent shake 1.0e-5 20 4 b 5 a 1 + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |- + -6.7489461181454146e+01 -3.6466852749734755e+01 -4.1453635345326461e+01 -3.0881721833345594e+01 -2.8271651455044346e+01 1.8512237607314627e-01 +run_pos: ! |2 + 1 -2.7045559935221097e-01 2.4912159904412490e+00 -1.6695851634760922e-01 + 2 3.1004029578877490e-01 2.9612354630874571e+00 -8.5466363025011627e-01 + 3 -7.0398551512563190e-01 1.2305509950678348e+00 -6.2777526850896104e-01 + 4 -1.5818159336526965e+00 1.4837407818978032e+00 -1.2538710835933191e+00 + 5 -9.0719763671886688e-01 9.2652103888784798e-01 3.9954210492830977e-01 + 6 2.4831720377219527e-01 2.8313021315702191e-01 -1.2314233326160173e+00 + 7 3.4143527702622728e-01 -2.2646549532188483e-02 -2.5292291427264142e+00 + 8 1.1743552220275317e+00 -4.8863228684188353e-01 -6.3783432829693443e-01 + 9 1.3800524229360562e+00 -2.5274721027441394e-01 2.8353985886396749e-01 + 10 2.0510765212518995e+00 -1.4604063737408786e+00 -9.8323745028431875e-01 + 11 1.7878031941850188e+00 -1.9921863270751916e+00 -1.8890602447198563e+00 + 12 3.0063007040149974e+00 -4.9013350636226771e-01 -1.6231898103008302e+00 + 13 4.0515402958586257e+00 -8.9202011560301075e-01 -1.6400005529400123e+00 + 14 2.6066963345427290e+00 -4.1789253956770167e-01 -2.6634003609341543e+00 + 15 2.9695287185432337e+00 5.5422613169503154e-01 -1.2342022022205887e+00 + 16 2.6747029683763714e+00 -2.4124119045309693e+00 -2.3435744689915879e-02 + 17 2.2153577782070029e+00 -2.0897985186673269e+00 1.1963150798970605e+00 + 18 2.1373900776598025e+00 3.0170538458090777e+00 -3.5215797395691513e+00 + 19 1.5430025676356878e+00 2.6303296449526830e+00 -4.2266668834026815e+00 + 20 2.7636622208184249e+00 3.6827879501121257e+00 -3.9272659546065309e+00 + 21 4.9052192222610893e+00 -4.0732760101838785e+00 -3.6279255237118848e+00 + 22 4.3519818207211687e+00 -4.2184829355408970e+00 -4.4481958001387492e+00 + 23 5.7453761098528204e+00 -3.5841442260386134e+00 -3.8622042081775270e+00 + 24 2.0680414913305336e+00 3.1533722552494279e+00 3.1535500327659949e+00 + 25 1.3065720083048245e+00 3.2620808683257665e+00 2.5145299517926252e+00 + 26 2.5824112033663726e+00 4.0080581544129315e+00 3.2238053751606111e+00 + 27 -1.9611343130357310e+00 -4.3563411931359832e+00 2.1098293115523683e+00 + 28 -2.7473562684513424e+00 -4.0200819932379339e+00 1.5830052163433954e+00 + 29 -1.3126000191366676e+00 -3.5962518039489830e+00 2.2746342468733833e+00 +run_vel: ! |2 + 1 8.1705729507146694e-03 1.6516406093744648e-02 4.7902279090199758e-03 + 2 5.4501493276694424e-03 5.1791698760542673e-03 -1.4372929651720338e-03 + 3 -8.2298303446991464e-03 -1.2926552110646276e-02 -4.0984171815350275e-03 + 4 -3.7699042793691569e-03 -6.5722892086671888e-03 -1.1184640147877201e-03 + 5 -1.1021961023179821e-02 -9.8906780808723557e-03 -2.8410737186752395e-03 + 6 -3.9676664596302008e-02 4.6817059618450937e-02 3.7148492579484528e-02 + 7 9.1034031301506118e-04 -1.0128522664904683e-02 -5.1568252954671344e-02 + 8 7.9064703413713640e-03 -3.3507265483952125e-03 3.4557099321061942e-02 + 9 1.5644176069499448e-03 3.7365546445246702e-03 1.5047408832397751e-02 + 10 2.9201446099433169e-02 -2.9249578511256962e-02 -1.5018076911020577e-02 + 11 -4.7835964007472464e-03 -3.7481383012996786e-03 -2.3464103653896310e-03 + 12 2.2696453008391230e-03 -3.4774279616438269e-04 -3.0640765817961284e-03 + 13 2.7531739986205606e-03 5.8171065863360308e-03 -7.9467449090663456e-04 + 14 3.5246182341718778e-03 -5.7939994947008274e-03 -3.9478431580931327e-03 + 15 -1.8547943904014333e-03 -5.8554729842982909e-03 6.2938484741557809e-03 + 16 1.8681498891538875e-02 -1.3262465322856009e-02 -4.5638650127800932e-02 + 17 -1.2896270312366209e-02 9.7527665732632315e-03 3.7296535866542121e-02 + 18 3.6201702653131140e-04 -3.1019808758173800e-04 8.1201764037217537e-04 + 19 8.5112357208489992e-04 -1.4603354100514621e-03 1.0305255073350999e-03 + 20 -6.5417980186682713e-04 4.4256252972757129e-04 4.7856452381576193e-04 + 21 -1.3982466143572327e-03 -3.2420186877161783e-04 1.1419969006099733e-03 + 22 -1.5884121227847409e-03 -1.5258103137919276e-03 1.4829684065368715e-03 + 23 2.8156656234650006e-04 -3.9296160890725804e-03 -3.6141001623026133e-04 + 24 8.5788312813832768e-04 -9.4446247923316430e-04 5.5288134920163914e-04 + 25 1.6004032839658105e-03 -2.2093787045529070e-03 -5.4710568918423246e-04 + 26 -1.5640453157606073e-03 3.5755072465497545e-04 2.4453237299123754e-03 + 27 4.5604120291777391e-04 -1.0305523027099432e-03 2.1188058380935704e-04 + 28 -6.2544520861865490e-03 1.4127711176129324e-03 -1.8429821884795277e-03 + 29 6.4110631474916110e-04 3.1273432713407900e-03 3.7253671102111473e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-shake_bond.yaml b/unittest/force-styles/tests/fix-timestep-shake_bond.yaml new file mode 100644 index 0000000000..f36b1dc90e --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-shake_bond.yaml @@ -0,0 +1,77 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:30:22 202 +epsilon: 2e-12 +prerequisites: ! | + atom full + fix shake +pre_commands: ! "" +post_commands: ! | + fix move all nve + fix test solute shake 1.0e-5 20 4 m 4.00794 + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |2- + 4.1327164284089424e+00 4.1298776885725212e+00 7.7065049821613400e+01 7.3427739401911385e-01 3.1021321349896283e+01 3.0482918118325731e+01 +run_pos: ! |2 + 1 -2.6863205200661111e-01 2.4924200251053290e+00 -1.6940797171639235e-01 + 2 3.0314855494326542e-01 2.9555142432097057e+00 -8.4661597718762593e-01 + 3 -7.0471630526064610e-01 1.2320076232474950e+00 -6.3059972306981116e-01 + 4 -1.5777965340724665e+00 1.4826179820449468e+00 -1.2510232575370359e+00 + 5 -9.0838614372668147e-01 9.2479324973660515e-01 4.0580653202856448e-01 + 6 2.4793967906067266e-01 2.8343287430300662e-01 -1.2316652319085906e+00 + 7 3.4143850947000215e-01 -2.2651528366236535e-02 -2.5292473574049557e+00 + 8 1.1730749609547342e+00 -4.9001540353149414e-01 -6.4332649946665554e-01 + 9 1.3845859932367997e+00 -2.4786933347311280e-01 3.0357812296279302e-01 + 10 2.0524841105947438e+00 -1.4583699771497181e+00 -9.7983952239384009e-01 + 11 1.7850840352923725e+00 -1.9987544346588086e+00 -1.8998839983899150e+00 + 12 3.0095045212031324e+00 -4.8782153578051046e-01 -1.6261252340943422e+00 + 13 4.0351185088311912e+00 -8.8522351740468841e-01 -1.6398224375628421e+00 + 14 2.6123239686636546e+00 -4.1890190267071897e-01 -2.6495985815032790e+00 + 15 2.9701534707934574e+00 5.4105345536459837e-01 -1.2389976744606215e+00 + 16 2.6747027555918814e+00 -2.4124113563394083e+00 -2.3415671532674848e-02 + 17 2.2153595673079205e+00 -2.0898013762372747e+00 1.1963177401330016e+00 + 18 2.1369701694435119e+00 3.0158507393675174e+00 -3.5179348311269880e+00 + 19 1.5355837135166919e+00 2.6255292354443638e+00 -4.2353987776659867e+00 + 20 2.7727573004750279e+00 3.6923910448253729e+00 -3.9330842457663850e+00 + 21 4.9040128074584084e+00 -4.0752348173558683e+00 -3.6210314712921452e+00 + 22 4.3582355554470675e+00 -4.2126119427230533e+00 -4.4612844196479138e+00 + 23 5.7439382849367417e+00 -3.5821957939146403e+00 -3.8766361296113812e+00 + 24 2.0689243589978767e+00 3.1513346914192564e+00 3.1550389757754025e+00 + 25 1.3045351338498816e+00 3.2665125711118623e+00 2.5111855260643079e+00 + 26 2.5809237403158591e+00 4.0117602606099725e+00 3.2212060529034496e+00 + 27 -1.9611343131186747e+00 -4.3563411932863181e+00 2.1098293116020814e+00 + 28 -2.7473562684591109e+00 -4.0200819932508631e+00 1.5830052163456609e+00 + 29 -1.3126000191565619e+00 -3.5962518039874860e+00 2.2746342468906682e+00 +run_vel: ! |2 + 1 7.7374089697702340e-03 1.5916892554636120e-02 5.0456645075959315e-03 + 2 6.5175317085631830e-03 6.0077809909591315e-03 -2.7565762268061691e-03 + 3 -7.3639495008649726e-03 -1.2783103383496114e-02 -3.3210885167291849e-03 + 4 -5.8960928588029050e-03 -5.9659026594337371e-03 -2.6326334955469629e-03 + 5 -1.0929649166221467e-02 -9.6585820819745337e-03 -3.0956626591882317e-03 + 6 -4.0123707366825134e-02 4.7187394112873600e-02 3.6871538264118715e-02 + 7 9.1133487010605738e-04 -1.0132608633652593e-02 -5.1595915280729321e-02 + 8 7.0089143878456980e-03 -4.2476532224071028e-03 3.0986626913844219e-02 + 9 4.6371837171993438e-03 7.0467783396206997e-03 2.8626734931872490e-02 + 10 3.0610207065038343e-02 -2.7619291009667819e-02 -1.2133094808158711e-02 + 11 -7.2029914080563463e-03 -9.4537429127199805e-03 -1.1792451031601467e-02 + 12 1.5104136100256851e-03 -8.6488026266383442e-04 -2.9343726025856101e-03 + 13 4.0386002756917826e-03 5.5920871347548079e-03 -9.5141171089924864e-04 + 14 3.7450160863088276e-03 -5.7205370491546937e-03 -4.1283641103704487e-03 + 15 -1.6192252475286013e-03 -4.5865111215587151e-03 6.6369580798579545e-03 + 16 1.8683716258411448e-02 -1.3263096088951513e-02 -4.5607321000770314e-02 + 17 -1.2893753425925471e-02 9.7485795481259876e-03 3.7300775385779875e-02 + 18 -8.0065894051881148e-04 -8.6270684963651867e-04 -1.4483015146944855e-03 + 19 1.2452389852680510e-03 -2.5061098313021958e-03 7.2998634573395622e-03 + 20 3.5930058838403115e-03 3.6938858373569165e-03 3.2322734729320975e-03 + 21 -1.4689219027528956e-03 -2.7352134530947056e-04 7.0581593448005328e-04 + 22 -7.0694199260273143e-03 -4.2577148857392598e-03 2.8079115157198279e-04 + 23 6.0446963222438397e-03 -1.4000131442962716e-03 2.5819754631691500e-03 + 24 3.1926442964369691e-04 -9.9445591935644600e-04 1.5000033448111903e-04 + 25 1.3789825021844792e-04 -4.4335889596263511e-03 -8.1808100227326449e-04 + 26 2.0485904735292599e-03 2.7813359659683385e-03 4.3245727170611618e-03 + 27 4.5604110580961207e-04 -1.0305524671180935e-03 2.1188063421234097e-04 + 28 -6.2544520944132998e-03 1.4127711036803850e-03 -1.8429821866102578e-03 + 29 6.4110628696208052e-04 3.1273432221612541e-03 3.7253671295737062e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-temp_berendsen.yaml b/unittest/force-styles/tests/fix-timestep-temp_berendsen.yaml new file mode 100644 index 0000000000..d085588c4d --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-temp_berendsen.yaml @@ -0,0 +1,75 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 07:12:16 202 +epsilon: 1e-14 +prerequisites: ! | + atom full + fix temp/berendsen +pre_commands: ! "" +post_commands: ! | + fix all solute nve + fix test solute temp/berendsen 50.0 ${t_target} 1.0 +input_file: in.fourmol +natoms: 29 +global_scalar: 140.500399901528 +run_pos: ! |2 + 1 -2.7309636642471763e-01 2.4861645745691683e+00 -1.6828848361402490e-01 + 2 3.0754156828804369e-01 2.9580811430810168e+00 -8.5566344544442696e-01 + 3 -7.0122770940380430e-01 1.2339445479551032e+00 -6.2630377656128777e-01 + 4 -1.5804472514360892e+00 1.4859973441832681e+00 -1.2520124052982806e+00 + 5 -9.0374947361394331e-01 9.2892484821615950e-01 4.0028294365544248e-01 + 6 2.6054522561991372e-01 2.6809488486741462e-01 -1.2454390553490415e+00 + 7 3.4113678304929385e-01 -1.8979558589829474e-02 -2.5116522993743571e+00 + 8 1.1716199786283663e+00 -4.8725335288759802e-01 -6.4822281049325703e-01 + 9 1.3792620285766666e+00 -2.5270770981342516e-01 2.7933353973879949e-01 + 10 2.0422906283128670e+00 -1.4518843639641870e+00 -9.7890931987345720e-01 + 11 1.7892476580970549e+00 -1.9906322518767001e+00 -1.8873753918956127e+00 + 12 3.0052861385021128e+00 -4.8980879715968567e-01 -1.6218666251486527e+00 + 13 4.0492389166811398e+00 -8.9494016256557662e-01 -1.6394908431361932e+00 + 14 2.6057881176374380e+00 -4.1473486027171080e-01 -2.6608124094383205e+00 + 15 2.9716736613290236e+00 5.5705022673260141e-01 -1.2371490367526674e+00 + 16 2.6686127048309953e+00 -2.4079062466699259e+00 -8.6769783148858658e-03 + 17 2.2194270729627537e+00 -2.0931602868129722e+00 1.1836986021579625e+00 + 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 + 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 + 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 + 21 4.9064454390208301e+00 -4.0751205255383196e+00 -3.6215576073601046e+00 + 22 4.3687453488627543e+00 -4.2054270536772504e+00 -4.4651491269372565e+00 + 23 5.7374928154769504e+00 -3.5763355905184966e+00 -3.8820297194230728e+00 + 24 2.0684115301174013e+00 3.1518221747664397e+00 3.1554242678474576e+00 + 25 1.2998381073113014e+00 3.2755513587518097e+00 2.5092990173114837e+00 + 26 2.5807438597688113e+00 4.0120175892854135e+00 3.2133398379059099e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 4.4822485045367504e-03 9.2630275931323714e-03 2.7690954442220936e-03 + 2 2.5115450429997297e-03 1.9432770966180499e-03 -1.6028636434240902e-03 + 3 -4.3937474121539854e-03 -7.7137150893059059e-03 -2.2604818247973606e-03 + 4 -1.9476891076786384e-03 -3.4752865444196575e-03 2.5858331694165467e-04 + 5 -6.0140772566964372e-03 -5.8056118324908155e-03 -1.6285179811875374e-03 + 6 -2.2469338308920575e-02 2.6184066673584038e-02 2.0084128049821442e-02 + 7 5.5310241062432727e-04 -5.4895662329791485e-03 -2.8451095082690465e-02 + 8 4.3820080553155973e-03 -1.7125373775392955e-03 1.9574889525765377e-02 + 9 6.1123931362892586e-04 2.7099585868545638e-03 8.3091915039055237e-03 + 10 1.6488027562775176e-02 -1.6715055435345464e-02 -8.4916986007994542e-03 + 11 -2.6493638654309275e-03 -1.8108088716662662e-03 -7.1397665423713101e-04 + 12 1.0553014594281446e-03 -4.9095325173559483e-05 -1.4582671613828872e-03 + 13 6.8186312546743191e-04 2.5433794096564773e-03 -2.8303405188633229e-04 + 14 2.0318309992730424e-03 -2.4195214229911048e-03 -1.4031089865427190e-03 + 15 -1.0420290545722850e-04 -2.6462739410254661e-03 2.8946287413495492e-03 + 16 1.0435719112539276e-02 -7.2849035729913086e-03 -2.5728092378723793e-02 + 17 -7.3214526097835405e-03 5.3566310662169067e-03 2.0611725900352998e-02 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-temp_csld.yaml b/unittest/force-styles/tests/fix-timestep-temp_csld.yaml new file mode 100644 index 0000000000..8f37770a9f --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-temp_csld.yaml @@ -0,0 +1,75 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 14:54:04 202 +epsilon: 1e-14 +prerequisites: ! | + atom full + fix temp/csld +pre_commands: ! "" +post_commands: ! | + fix all solute nve + fix test solute temp/csld 50.0 ${t_target} 1.0 62823 +input_file: in.fourmol +natoms: 29 +global_scalar: 150.876840894722 +run_pos: ! |2 + 1 -2.7647311866382945e-01 2.4857065646723955e+00 -1.6617735618091201e-01 + 2 3.0499516303476115e-01 2.9537709384435074e+00 -8.5187606183120801e-01 + 3 -7.0089965540770716e-01 1.2370509246791983e+00 -6.2647646451254169e-01 + 4 -1.5876070862522318e+00 1.4894674416472973e+00 -1.2438382416135443e+00 + 5 -8.9863030307286906e-01 9.2993444238449641e-01 4.0139614242262101e-01 + 6 2.6366550703190161e-01 2.5947127019674543e-01 -1.2512838337828405e+00 + 7 3.4221776711736090e-01 -1.4779100592719932e-02 -2.4988762781276868e+00 + 8 1.1688893653924293e+00 -4.8751615364078732e-01 -6.5234814135314723e-01 + 9 1.3854061606109378e+00 -2.5750875741300600e-01 2.7829296074436094e-01 + 10 2.0360908951129288e+00 -1.4445619988253025e+00 -9.7534522309748062e-01 + 11 1.7825785169979784e+00 -1.9874255508702292e+00 -1.8881581493841835e+00 + 12 3.0057154639626575e+00 -4.9097688194559375e-01 -1.6180318028907086e+00 + 13 4.0485629820926592e+00 -8.9431038872519708e-01 -1.6345003838044976e+00 + 14 2.6060153448114884e+00 -4.1286533645721485e-01 -2.6584607156586810e+00 + 15 2.9703775066451663e+00 5.6063984758286523e-01 -1.2411803092256180e+00 + 16 2.6656970686950041e+00 -2.4008304027486727e+00 2.4324587822466010e-04 + 17 2.2170696923898499e+00 -2.0966249045214056e+00 1.1748374924569560e+00 + 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 + 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 + 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 + 21 4.9064454390208301e+00 -4.0751205255383196e+00 -3.6215576073601046e+00 + 22 4.3687453488627543e+00 -4.2054270536772504e+00 -4.4651491269372565e+00 + 23 5.7374928154769504e+00 -3.5763355905184966e+00 -3.8820297194230728e+00 + 24 2.0684115301174013e+00 3.1518221747664397e+00 3.1554242678474576e+00 + 25 1.2998381073113014e+00 3.2755513587518097e+00 2.5092990173114837e+00 + 26 2.5807438597688113e+00 4.0120175892854135e+00 3.2133398379059099e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 -6.1518106640055098e-04 9.8413236728091859e-03 2.6821401423517848e-03 + 2 5.7584895033439311e-03 -6.4512016069715183e-03 -4.6331491821159322e-03 + 3 -4.3045744902141230e-03 -1.1357763612046034e-03 -1.5278167433944827e-03 + 4 -7.9024210036195315e-04 8.4724079430485693e-03 8.7245281838652239e-03 + 5 2.7579652970089745e-03 -5.9025323603549475e-04 -2.5454023443268127e-03 + 6 -1.4815311727055615e-02 2.0221004909579707e-02 1.5396636244631938e-02 + 7 6.3241608228865333e-04 -1.0634159681637320e-03 -1.6769555657594071e-02 + 8 1.5893486075269094e-03 -6.1660323394415405e-04 1.3789272460195160e-02 + 9 7.4801357958314968e-03 -1.7324571377721242e-04 5.5874995558103397e-03 + 10 1.3183178250648638e-02 -7.4440255996034814e-03 -1.4024578089719738e-03 + 11 -3.6967525507180790e-03 -7.9577777641821126e-03 -2.0130547563199353e-03 + 12 1.7809421251718035e-03 -2.4228240354331847e-04 -2.9652050547483645e-03 + 13 4.3878889923020296e-04 3.8672876750012147e-03 -6.6580707926174529e-03 + 14 -5.2616323633526024e-04 -4.5860320088099964e-03 5.2733721735657773e-04 + 15 -2.1083712534527002e-03 2.9658835298400901e-03 9.1125829125389391e-04 + 16 6.3044701073886288e-03 -1.5176887611785819e-03 -1.7062686137992850e-02 + 17 -8.3474333369752789e-03 1.5146606349005583e-03 1.4823067912505096e-02 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml b/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml new file mode 100644 index 0000000000..ddd1846f43 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-temp_csvr.yaml @@ -0,0 +1,75 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 14:53:58 202 +epsilon: 1e-14 +prerequisites: ! | + atom full + fix temp/csvr +pre_commands: ! "" +post_commands: ! | + fix all solute nve + fix test solute temp/csvr 50.0 ${t_target} 1.0 82573 +input_file: in.fourmol +natoms: 29 +global_scalar: 138.691817964765 +run_pos: ! |2 + 1 -2.7280762260987462e-01 2.4866672893615482e+00 -1.6817690082511103e-01 + 2 3.0792532339926826e-01 2.9586317848907591e+00 -8.5537067987838589e-01 + 3 -7.0155509000995808e-01 1.2337201042383152e+00 -6.2645947625508680e-01 + 4 -1.5806259405926315e+00 1.4857183624992281e+00 -1.2524138927067634e+00 + 5 -9.0413749520933206e-01 9.2874389205720931e-01 4.0021691625350447e-01 + 6 2.5940135491607696e-01 2.6955443838876736e-01 -1.2440989174242931e+00 + 7 3.4115709633311569e-01 -1.9361196729511615e-02 -2.5133202867901732e+00 + 8 1.1718886190395006e+00 -4.8742160677430901e-01 -6.4725283909309406e-01 + 9 1.3794054639593258e+00 -2.5286053024356114e-01 2.7978731678256097e-01 + 10 2.0431332821795114e+00 -1.4526503498146288e+00 -9.7932641944253374e-01 + 11 1.7890934771379468e+00 -1.9908605501813910e+00 -1.8876922594986423e+00 + 12 3.0054411287235951e+00 -4.8987634219780540e-01 -1.6220627513203476e+00 + 13 4.0496794476606635e+00 -8.9447232940528654e-01 -1.6395816350351760e+00 + 14 2.6058661355197810e+00 -4.1525413418121015e-01 -2.6612700962724607e+00 + 15 2.9712318526989474e+00 5.5661112285831083e-01 -1.2366977651516922e+00 + 16 2.6691735451973395e+00 -2.4083535475815920e+00 -9.9660994024412010e-03 + 17 2.2190855332677919e+00 -2.0928268444165918e+00 1.1849187762465219e+00 + 18 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 + 19 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 + 20 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 + 21 4.9064454390208301e+00 -4.0751205255383196e+00 -3.6215576073601046e+00 + 22 4.3687453488627543e+00 -4.2054270536772504e+00 -4.4651491269372565e+00 + 23 5.7374928154769504e+00 -3.5763355905184966e+00 -3.8820297194230728e+00 + 24 2.0684115301174013e+00 3.1518221747664397e+00 3.1554242678474576e+00 + 25 1.2998381073113014e+00 3.2755513587518097e+00 2.5092990173114837e+00 + 26 2.5807438597688113e+00 4.0120175892854135e+00 3.2133398379059099e+00 + 27 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 + 28 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 + 29 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 +run_vel: ! |2 + 1 4.6937564710920216e-03 9.6555961564013804e-03 2.8708039254905881e-03 + 2 2.7267170444366185e-03 2.2058192686523290e-03 -1.5353913821082035e-03 + 3 -4.6306766915023894e-03 -7.9351414155915453e-03 -2.3497227140117419e-03 + 4 -2.0674867361574730e-03 -3.6722365151599765e-03 1.1155363952115448e-04 + 5 -6.3227892412089171e-03 -6.0246930339812061e-03 -1.6991048796308555e-03 + 6 -2.3313325205229000e-02 2.7197550589909671e-02 2.0738710039103190e-02 + 7 5.6010701530313550e-04 -5.7071338016654654e-03 -2.9476037762661333e-02 + 8 4.5357117797050145e-03 -1.7956042409071231e-03 2.0337353845153724e-02 + 9 6.9780844880996972e-04 2.7260623247486841e-03 8.7428367624614034e-03 + 10 1.7158823348639104e-02 -1.7353191765645898e-02 -8.8565471428928583e-03 + 11 -2.7754554284794915e-03 -1.9484853125617634e-03 -8.5708629159661183e-04 + 12 1.1446489442763310e-03 -8.1052477490650056e-05 -1.5736644561053304e-03 + 13 8.6708264237769490e-04 2.7906792431300104e-03 -3.2527835321513224e-04 + 14 2.1170915886558860e-03 -2.6750828934791800e-03 -1.6081787775879092e-03 + 15 -2.7969721465264459e-04 -2.8792217329085164e-03 3.1381108795769806e-03 + 16 1.0810115663068724e-02 -7.5713924362591457e-03 -2.6575629458356204e-02 + 17 -7.5547245737932044e-03 5.5628964952133871e-03 2.1384064341807719e-02 + 18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 + 19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 + 20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 + 21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 + 22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 + 23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 + 24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 + 25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 + 26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 + 27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 + 28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 + 29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-wall-harmonic_const.yaml b/unittest/force-styles/tests/fix-timestep-wall-harmonic_const.yaml new file mode 100644 index 0000000000..36ed8a8a36 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-wall-harmonic_const.yaml @@ -0,0 +1,81 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sun Aug 9 16:30:22 202 +epsilon: 1e-14 +prerequisites: ! | + atom full + fix wall/harmonic +pre_commands: ! | + boundary p f p +post_commands: ! | + fix move all nve + fix test solute wall/harmonic ylo EDGE 100.0 0.0 5.0 yhi EDGE 100.0 0.0 5.0 + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |2- + 0.0000000000000000e+00 7.2422093200265749e+02 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +global_scalar: 42.6997744353244 +global_vector: ! |- + 2 0.0 161.92409617466126 +run_pos: ! |2 + 1 -2.7051715090682593e-01 2.4891718422041942e+00 -1.6687343912524535e-01 + 2 3.1037661579862175e-01 2.9347166386691113e+00 -8.5496435221221156e-01 + 3 -7.0402515865264603e-01 1.2304739304383521e+00 -6.2777422080240730e-01 + 4 -1.5818156002522876e+00 1.4837443919066966e+00 -1.2538703954644463e+00 + 5 -9.0719963033698159e-01 9.2651871779341399e-01 3.9954137559444142e-01 + 6 2.4831695467823400e-01 2.8312974957866005e-01 -1.2314232372542311e+00 + 7 3.4143527599853957e-01 -2.2646552136496162e-02 -2.5292291409504188e+00 + 8 1.1743552256787158e+00 -4.8863229191571117e-01 -6.3783432834416876e-01 + 9 1.3800524227031346e+00 -2.5274721005121037e-01 2.8353985882456578e-01 + 10 2.0510765220197009e+00 -1.4604063740411815e+00 -9.8323745080488900e-01 + 11 1.7878031944407509e+00 -1.9921863272886073e+00 -1.8890602447598965e+00 + 12 3.0063007038317027e+00 -4.9013350489718083e-01 -1.6231898106978369e+00 + 13 4.0515402959160571e+00 -8.9202011606485654e-01 -1.6400005529914481e+00 + 14 2.6066963345462244e+00 -4.1789253964874301e-01 -2.6634003608727506e+00 + 15 2.9695287185264685e+00 5.5422613167055734e-01 -1.2342022021669503e+00 + 16 2.6747029695037297e+00 -2.4124119054292041e+00 -2.3435746152831474e-02 + 17 2.2153577785010934e+00 -2.0897985186506944e+00 1.1963150794337314e+00 + 18 2.1369701704267587e+00 3.0158507413153752e+00 -3.5179348337454122e+00 + 19 1.5355837136075348e+00 2.6255292355297897e+00 -4.2353987779858038e+00 + 20 2.7727573003201997e+00 3.6923910440705336e+00 -3.9330842459619779e+00 + 21 4.9040128073837339e+00 -4.0752348170758461e+00 -3.6210314709795299e+00 + 22 4.3582355554510048e+00 -4.2126119427061379e+00 -4.4612844196307497e+00 + 23 5.7439382849366911e+00 -3.5821957939240279e+00 -3.8766361295959513e+00 + 24 2.0689243582618388e+00 3.1513346906720905e+00 3.1550389755134005e+00 + 25 1.3045351331892774e+00 3.2665125705550957e+00 2.5111855258151388e+00 + 26 2.5809237402747862e+00 4.0117602605470681e+00 3.2212060529139430e+00 + 27 -1.9611343130344261e+00 -4.3563411931314180e+00 2.1098293115505782e+00 + 28 -2.7473562684511403e+00 -4.0200819932374339e+00 1.5830052163432258e+00 + 29 -1.3126000191357743e+00 -3.5962518039473323e+00 2.2746342468733483e+00 +run_vel: ! |2 + 1 8.0432349631399738e-03 1.4401841389211066e-02 4.9594370365889035e-03 + 2 6.1330361195047721e-03 -2.0880295268721646e-02 -2.0467529305087974e-03 + 3 -8.3074380171099336e-03 -1.3074180712034022e-02 -4.0925567431707964e-03 + 4 -3.7694367867060308e-03 -6.5650784618522641e-03 -1.1170951231990066e-03 + 5 -1.1026343955717482e-02 -9.8958287307442903e-03 -2.8423479505575383e-03 + 6 -3.9677127674597606e-02 4.6816039080495052e-02 3.7148638820894170e-02 + 7 9.1033730239907995e-04 -1.0128528243740664e-02 -5.1568250829251872e-02 + 8 7.9064772413549398e-03 -3.3507427942055237e-03 3.4557101116794005e-02 + 9 1.5644169779778431e-03 3.7365552198096001e-03 1.5047408727814703e-02 + 10 2.9201446825927659e-02 -2.9249578944835358e-02 -1.5018077412006621e-02 + 11 -4.7835961594766378e-03 -3.7481385002840358e-03 -2.3464104088049835e-03 + 12 2.2696449755579802e-03 -3.4774139663753471e-04 -3.0640769495163694e-03 + 13 2.7531740375147762e-03 5.8171061651960156e-03 -7.9467453772152246e-04 + 14 3.5246182201851949e-03 -5.7939995452846345e-03 -3.9478431035191433e-03 + 15 -1.8547944555517618e-03 -5.8554729566882438e-03 6.2938485388423782e-03 + 16 1.8681499934669346e-02 -1.3262466149576241e-02 -4.5638651461858082e-02 + 17 -1.2896270037715951e-02 9.7527666092669871e-03 3.7296535331498307e-02 + 18 -8.0065791408039360e-04 -8.6270482947906340e-04 -1.4483041230016333e-03 + 19 1.2452390812060273e-03 -2.5061097279531165e-03 7.2998631045687349e-03 + 20 3.5930057934746205e-03 3.6938851526077707e-03 3.2322732077980764e-03 + 21 -1.4689219756964986e-03 -2.7352107824531023e-04 7.0581625180910238e-04 + 22 -7.0694199165145270e-03 -4.2577148692717476e-03 2.8079117911324980e-04 + 23 6.0446963236685126e-03 -1.4000131545098867e-03 2.5819754799379689e-03 + 24 3.1926371811980247e-04 -9.9445676110986795e-04 1.5000003249577247e-04 + 25 1.3789762510432095e-04 -4.4335895501596183e-03 -8.1808122106665057e-04 + 26 2.0485904106950122e-03 2.7813358601316666e-03 4.3245727251785618e-03 + 27 4.5604120562021776e-04 -1.0305522931718021e-03 2.1188058006115626e-04 + 28 -6.2544520854975879e-03 1.4127711193315995e-03 -1.8429821890767147e-03 + 29 6.4110631581209361e-04 3.1273432740202512e-03 3.7253671096581808e-03 +... diff --git a/unittest/force-styles/tests/in.fourmol b/unittest/force-styles/tests/in.fourmol index 46715f6e78..ca605cac92 100644 --- a/unittest/force-styles/tests/in.fourmol +++ b/unittest/force-styles/tests/in.fourmol @@ -11,6 +11,7 @@ variable bond_style index zero variable angle_style index zero variable dihedral_style index zero variable improper_style index zero +variable t_target index 100.0 atom_style full atom_modify map array diff --git a/unittest/force-styles/tests/manybody-pair-extep.yaml b/unittest/force-styles/tests/manybody-pair-extep.yaml new file mode 100644 index 0000000000..2bc3ad35a7 --- /dev/null +++ b/unittest/force-styles/tests/manybody-pair-extep.yaml @@ -0,0 +1,155 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 09:00:37 202 +epsilon: 5e-13 +prerequisites: ! | + pair extep +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! "" +input_file: in.manybody +pair_style: extep +pair_coeff: ! | + * * BN.extep B B B B N N N N +extract: ! "" +natoms: 64 +init_vdwl: -8.35953889724907 +init_coul: 0 +init_stress: ! |- + -9.8115086872000575e+01 -1.0128398153031480e+02 -1.0881402935898043e+02 7.9461199572646493e+00 -3.2762787278107325e+01 -1.5641130047291398e+01 +init_forces: ! |2 + 1 2.8704246522528534e+00 -2.5158713901236069e+00 -3.1338991761348565e+00 + 2 5.4298005053637333e-01 4.7444185957547402e-01 4.9183995636810107e-01 + 3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 4 2.5616883699128561e+00 -3.0670822998764011e+00 -3.0884826352786678e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -5.4298005053637333e-01 -4.7444185957547402e-01 -4.9183995636810107e-01 + 7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 9 8.2694765567825623e-01 7.1011340139400769e-01 8.5751501772639083e-01 + 10 2.2545170485085766e+00 1.6847863215171994e+00 1.8565708900567293e+00 + 11 -4.5234940269853707e+00 3.9182006350480973e+00 -3.4116479675848894e+00 + 12 6.6477152531862824e+00 7.1028944572559709e+00 6.4735353473875401e+00 + 13 3.6965463713071136e+00 -4.6283140364421040e+00 2.5541329498584995e+00 + 14 1.6320179250288405e+00 -5.1554502462134506e+00 2.4212631244532687e+00 + 15 4.8935900575274793e+00 -5.5128922816934178e+00 6.5552331566027036e+00 + 16 -1.7285049969758148e+00 -2.8684552795856764e+00 -1.0508353838204133e+01 + 17 -4.9192102562104667e+00 -4.2344391776702928e+00 4.0348184908165940e+00 + 18 5.3641759964254165e-01 -6.7511578321065513e-01 -6.2954970072283112e-01 + 19 9.5816388404941844e-01 9.1922300449767125e-01 1.3001444620872245e+00 + 20 6.8001633035507663e+00 -2.1796222286202616e+00 -1.2946419497176596e+00 + 21 -5.7159277391001162e-01 7.0900170254617534e-01 5.9983667629456983e-01 + 22 7.5500766097307839e+00 -7.3182236336369328e+00 9.1379861332535484e+00 + 23 -9.5816388404941844e-01 -9.1922300449767125e-01 -1.3001444620872245e+00 + 24 -2.3400167850545603e+00 -2.7207935760600663e+00 -2.8092883527809223e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 -1.0649622327364825e+00 1.2571860171995985e+00 -1.0977816123430015e+00 + 28 2.5959096997075695e+00 -1.5765946517415950e+00 -6.5161213930722131e+00 + 29 1.0649622327364825e+00 -1.2571860171995985e+00 1.0977816123430015e+00 + 30 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 31 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 32 3.5175174267469946e-02 -3.3885919335520168e-02 2.9713024428261334e-02 + 33 -4.8935900575274793e+00 5.5128922816934178e+00 -6.5552331566027036e+00 + 34 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 35 -4.3251677866006188e-01 4.9796619620156712e-01 -4.4663440753000128e-01 + 36 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 37 4.3251677866006188e-01 -4.9796619620156712e-01 4.4663440753000128e-01 + 38 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 39 -2.5616883699128561e+00 3.0670822998764011e+00 3.0884826352786678e+00 + 40 -4.1630570000242368e+00 4.7701717310517679e+00 3.8285770885897943e+00 + 41 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 42 1.7508139448617936e+00 2.1291233814606501e+00 1.9253277895814989e+00 + 43 -9.6492210059402872e-01 4.0435872557440771e+00 -1.4177196542923785e+00 + 44 -3.8865349735374206e+00 3.4706639246962516e+00 -4.2778340145099989e+00 + 45 2.4062545755857512e+00 -2.8013229201486420e+00 2.9645038374798176e+00 + 46 4.0396668102814095e+00 3.2303132437225450e+00 -6.2942488324165637e+00 + 47 -1.4413324749917233e+00 -1.2422643355954339e+00 -1.5467841831874400e+00 + 48 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 49 4.4310348526491303e+00 5.2765582583484907e+00 5.9480999124653522e+00 + 50 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 51 4.1630570000242368e+00 -4.7701717310517679e+00 -3.8285770885897943e+00 + 52 -7.5500766097307839e+00 7.3182236336369328e+00 -9.1379861332535484e+00 + 53 -4.4310348526491303e+00 -5.2765582583484907e+00 -5.9480999124653522e+00 + 54 -2.8704246522528534e+00 2.5158713901236069e+00 3.1338991761348565e+00 + 55 -4.4601465184962050e+00 4.9004158046803274e+00 4.1039303024985818e+00 + 56 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 57 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 58 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 59 -5.7904807551432027e+00 -5.3594366251831946e+00 4.3689210428350647e+00 + 60 5.8791675102747618e+00 6.4393494182844400e+00 6.6208407800581917e+00 + 61 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 62 1.6194631652095164e+00 -1.8915906665160171e+00 1.5968589798885620e+00 + 63 -4.2153728649170885e+00 3.4681853182576141e+00 4.9192624131836515e+00 + 64 -5.8791675102747618e+00 -6.4393494182844400e+00 -6.6208407800581917e+00 +run_vdwl: -16.8840416364271 +run_coul: 0 +run_stress: ! |- + -1.3023969384493245e+02 -1.3580025778156107e+02 -1.4536894208589501e+02 1.0061876221810238e+01 -3.8457172367649790e+01 -3.0279819359183634e+01 +run_forces: ! |2 + 1 4.2151301161565744e+00 -3.6390534480677870e+00 -4.5749170420795036e+00 + 2 1.4028724319245680e+00 1.2394381665078047e+00 1.2957217065417752e+00 + 3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 4 3.5466355806205740e+00 -4.0990589769758170e+00 -4.2668261021806391e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 -1.4028724319245680e+00 -1.2394381665078047e+00 -1.2957217065417752e+00 + 7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 9 1.7911969250499551e+00 1.5135568001275594e+00 1.8554935096932752e+00 + 10 2.0533192773920752e+00 1.4903697888444349e+00 1.7191757609118896e+00 + 11 -5.6116842933394402e+00 4.8117752702356062e+00 -4.1259525253696001e+00 + 12 8.0711947714482761e+00 8.5602620535324299e+00 7.8785923127289550e+00 + 13 3.8204873682894860e+00 -6.3253320703631637e+00 2.2704590156763258e+00 + 14 3.4799606919465642e+00 -6.4192117933819910e+00 4.4653642624380883e+00 + 15 6.5373509230334683e+00 -7.2895694468225010e+00 8.6154194974184222e+00 + 16 -2.1885555456604120e+00 -3.4074600593373301e+00 -1.2683943186349305e+01 + 17 -5.8826392257878632e+00 -5.1528019941950971e+00 4.8053508736203465e+00 + 18 1.6217053491716626e+00 -1.9344396286372252e+00 -1.6888131264256891e+00 + 19 2.0493392554028889e+00 1.9514982177673792e+00 2.7878510593492347e+00 + 20 8.6784124790497366e+00 -2.5053128030583505e+00 -1.3162684907853857e+00 + 21 -1.6217053491716626e+00 1.9344396286372252e+00 1.6888131264256891e+00 + 22 7.6636831036306248e+00 -7.3963275970137801e+00 9.2299416767852378e+00 + 23 -2.0493392554028889e+00 -1.9514982177673792e+00 -2.7878510593492347e+00 + 24 -3.0730337640981511e+00 -3.7401994981968523e+00 -3.8854712013832811e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 -2.0046948454047069e+00 2.3551024906252911e+00 -2.0929842668896361e+00 + 28 4.6754639506958284e+00 -3.0460405146329155e+00 -9.2117664527670176e+00 + 29 2.0046948454047069e+00 -2.3551024906252911e+00 2.0929842668896361e+00 + 30 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 31 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 32 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 33 -6.5373509230334683e+00 7.2895694468225010e+00 -8.6154194974184222e+00 + 34 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 35 -6.4443853389258576e-01 7.5130814567331550e-01 -6.5995236481830388e-01 + 36 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 37 6.4443853389258576e-01 -7.5130814567331550e-01 6.5995236481830388e-01 + 38 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 39 -3.5466355806205740e+00 4.0990589769758170e+00 4.2668261021806391e+00 + 40 -6.6173330934528316e+00 7.7485901268776303e+00 6.1667071332991661e+00 + 41 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 42 2.6869907969853011e+00 3.1978611366175671e+00 2.8440560107472512e+00 + 43 -1.0349244510612601e+00 5.3165624791662962e+00 -1.6434441980918395e+00 + 44 -5.5332799693386381e+00 4.9288420045375547e+00 -6.1845400233499790e+00 + 45 3.0409089877497220e+00 -3.5877275612389248e+00 3.7505875102201349e+00 + 46 5.5606611340878409e+00 4.2750056677139590e+00 -9.0030219276983683e+00 + 47 -2.0059845366884623e+00 -1.7288349179273728e+00 -2.1071433121282954e+00 + 48 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 49 6.7165455943000545e+00 8.2672242001536667e+00 9.2130977806023040e+00 + 50 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 51 6.6173330934528316e+00 -7.7485901268776303e+00 -6.1667071332991661e+00 + 52 -7.6636831036306248e+00 7.3963275970137801e+00 -9.2299416767852378e+00 + 53 -6.7165455943000545e+00 -8.2672242001536667e+00 -9.2130977806023040e+00 + 54 -4.2151301161565744e+00 3.6390534480677870e+00 4.5749170420795036e+00 + 55 -5.6053787149515859e+00 6.2455123012552054e+00 5.2017396921686627e+00 + 56 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 57 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 58 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 59 -8.2476519310731433e+00 -7.4728668043315274e+00 6.1589659169511144e+00 + 60 7.7635109064849708e+00 8.7298107718933409e+00 8.8995529941093068e+00 + 61 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 62 1.8498915690341950e+00 -2.1904456930058798e+00 1.7641018344430419e+00 + 63 -6.5253555197300255e+00 5.2364862076387979e+00 7.4476646183239730e+00 + 64 -7.7635109064849708e+00 -8.7298107718933409e+00 -8.8995529941093068e+00 +... diff --git a/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml new file mode 100644 index 0000000000..16cf63addd --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml @@ -0,0 +1,93 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 16:44:46 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair hybrid/overlay + pair lj/cut + pair coul/cut/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: hybrid/overlay coul/cut/soft 4.0 6.0 8.0 lj/cut 8.0 +pair_coeff: ! | + 1 1 lj/cut 0.02 2.5 + 2 2 lj/cut 0.005 1.0 + 2 4 lj/cut 0.005 0.5 + 3 3 lj/cut 0.02 3.2 + 4 4 lj/cut 0.015 3.1 + 5 5 lj/cut 0.015 3.1 + * * coul/cut/soft 0.52 +extract: ! "" +natoms: 29 +init_vdwl: 8.07036960332133 +init_coul: -6.57579763044586 +init_stress: ! |2- + 3.3056188525495266e+01 3.8943881243005563e+01 2.4713892609892472e+01 -2.9521605433522784e+00 -9.1087143159719162e+00 -1.7962027131120834e+01 +init_forces: ! |2 + 1 1.5973817166587370e-02 -2.5849512574275112e-02 1.4349314975720284e-01 + 2 1.1661437893992524e-01 -5.4827445223305071e-02 -2.2601116019690834e-01 + 3 -1.0366797632080360e+01 1.0665290898811616e+01 6.9491956291296209e+00 + 4 6.3668415940203442e-04 -3.6245394302267886e-03 -2.0911289827080709e-02 + 5 -2.1975344883455643e-02 2.3185299135022673e-02 -3.9078433083915834e-03 + 6 1.0364219999013660e+01 -1.0737274883671912e+01 -6.9613703537185270e+00 + 7 1.4935880192974396e-03 1.0034674876492126e-02 8.1574702977769628e-02 + 8 -6.8663737105209011e-02 1.2722093437625731e-01 -1.6920023406097086e-02 + 9 1.0434703890749855e-01 -2.2197873426860887e-01 2.0819759336877833e-01 + 10 -2.6597352192025340e+01 -2.4907913480145822e+00 -3.1219562057993855e+00 + 11 -4.5648865767222380e-02 5.3888880600796309e-02 -2.2052443200595209e-02 + 12 1.7560373424840733e+01 1.6574415387592097e+01 -1.1455159766324989e+01 + 13 -1.3229481903479206e-02 -1.1272770895154941e-02 4.2931512148414591e-03 + 14 -5.8406838873095564e-02 1.8967139103433089e-02 -1.3020272870953819e-02 + 15 1.1532655490635991e-02 3.4979119379107081e-03 -4.3221729398660910e-02 + 16 9.2425099727407893e+00 -1.4221175369996539e+01 1.4640083796682012e+01 + 17 -1.7714181591327197e-01 3.4464928098370146e-01 -2.7542575243750161e-01 + 18 5.6848282728599160e-02 2.5572164911305872e-01 -8.9039631561204702e-02 + 19 -8.2805254180793278e-02 -1.9332226615499687e-01 2.9263577064588209e-02 + 20 -5.2300216374039869e-03 6.0834484118361530e-02 2.7379117917867110e-02 + 21 8.3403038342075228e-03 -1.2911896142827550e-01 -1.1278197160549872e-01 + 22 -5.6177026598133825e-02 7.4085260538110084e-02 5.5566396710162412e-02 + 23 1.8305992017088525e-02 -4.0514138001213541e-02 8.7071688124334870e-02 + 24 -4.1612848296087690e-02 1.1220011175255142e-01 1.6712385355709913e-01 + 25 -3.6533415983949220e-02 -6.5585589910651665e-02 -1.5441633500064449e-03 + 26 2.4752386500144913e-02 -1.0320418186961813e-01 -7.1603926797876874e-02 + 27 -9.9836895788385449e-02 1.4297838277829034e-01 -8.3166582485281443e-02 + 28 1.9219157401333040e-02 -1.2519846747100560e-01 4.0097586180285402e-02 + 29 1.2624368927628452e-01 -4.3232086807339080e-02 8.4752873604395568e-02 +run_vdwl: 7.26269331801932 +run_coul: -6.97644456126866 +run_stress: ! |2- + 3.0127651057118101e+01 3.4453839719562993e+01 2.1931283076276625e+01 -2.8900662879329531e+00 -8.5061591823548035e+00 -1.5709082735595215e+01 +run_forces: ! |2 + 1 1.6556394726179854e-02 -2.7823379429844208e-02 1.4399677662288241e-01 + 2 9.4728034633916783e-02 -9.6607229539929881e-02 -2.1057064241428827e-01 + 3 -9.5252899376491769e+00 9.7744730287893145e+00 6.3175856254776654e+00 + 4 1.3655766591042394e-03 -3.5997743625432767e-03 -2.1349661918632211e-02 + 5 -2.1731377938146137e-02 2.3431645306487836e-02 -4.6654114471729909e-03 + 6 9.5191836369739669e+00 -9.8414923421708664e+00 -6.3311607800906744e+00 + 7 2.3517013080299586e-03 6.4887395872065962e-03 8.0968146370040933e-02 + 8 -6.5838979183396623e-02 1.2723201485976468e-01 -1.4419462918936282e-02 + 9 1.0313127627543547e-01 -2.2472548628113920e-01 2.0855309453153736e-01 + 10 -2.3739961682275993e+01 -2.4021039351345070e+00 -2.5419544715889462e+00 + 11 -4.5692627637436159e-02 5.4310758581633464e-02 -2.1901108463684524e-02 + 12 1.5826336404623913e+01 1.4709948043443138e+01 -1.0255550569951657e+01 + 13 -1.3818470838464466e-02 -1.1232611873072887e-02 3.7144773555590370e-03 + 14 -5.8490465389199123e-02 1.9301559724291283e-02 -1.2702918464188331e-02 + 15 1.2275528798406529e-02 2.7004032851716945e-03 -4.4613261269571644e-02 + 16 8.1200565933619018e+00 -1.2447066846418169e+01 1.2859636395191094e+01 + 17 -1.7638808312729590e-01 3.4818610512262499e-01 -2.7525242695298618e-01 + 18 5.6517864566760591e-02 2.5743689521073448e-01 -8.2783753163049645e-02 + 19 -7.7792613266639957e-02 -1.9170617577268992e-01 3.1577861474679558e-02 + 20 -8.8034975891165858e-03 5.8710275590654226e-02 2.0464803602355808e-02 + 21 8.6237157627901892e-03 -1.3793322582438144e-01 -1.0801683428494860e-01 + 22 -5.2927593667993142e-02 7.9773787719114295e-02 5.4085134651948211e-02 + 23 1.4941691289898021e-02 -3.8796926532710010e-02 8.3574667474682035e-02 + 24 -4.2502706797988267e-02 1.0996091704567368e-01 1.6694289564006998e-01 + 25 -3.4188441462138668e-02 -6.3799095585925017e-02 3.7273979200262057e-04 + 26 2.4230764689621518e-02 -1.0154509989638259e-01 -7.2645178020573520e-02 + 27 -1.0128872753518126e-01 1.4355720870604366e-01 -7.8397657663983225e-02 + 28 3.8620989756577413e-02 -8.3428605295058175e-02 2.2781457173507890e-02 + 29 1.2579503093166530e-01 -4.3650648854632823e-02 8.1730063255268340e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml new file mode 100644 index 0000000000..fa47d9484d --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml @@ -0,0 +1,100 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 16:47:40 202 +epsilon: 3e-13 +prerequisites: ! | + atom full + pair hybrid/overlay + pair coul/long/soft + pair lj/cut + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: hybrid/overlay coul/long/soft 4.0 6.0 8.0 lj/cut 8.0 +pair_coeff: ! | + 1 1 lj/cut 0.02 2.5 + 2 2 lj/cut 0.005 1.0 + 2 4 lj/cut 0.005 0.5 + 3 3 lj/cut 0.02 3.2 + 4 4 lj/cut 0.015 3.1 + 5 5 lj/cut 0.015 3.1 + * * coul/long/soft 0.23 +extract: ! | + lambda 2 + scale 2 +natoms: 29 +init_vdwl: 8.07036960332133 +init_coul: 0.250616636637181 +init_stress: ! |2- + 3.3318331341780379e+01 4.0258582287659699e+01 2.6723566043088852e+01 -3.2839183131153762e+00 -8.9320581791877558e+00 -1.7911132107077634e+01 +init_forces: ! |2 + 1 -1.2664775714938474e-02 2.6532332250218386e-02 8.8675235967460402e-03 + 2 2.2881614624250101e-03 -3.4718325274176861e-03 -5.6923674871682400e-03 + 3 -1.0366459654154854e+01 1.0666349339503686e+01 6.9464292526455500e+00 + 4 -5.9689442718514789e-06 -2.7564986122111640e-05 -2.0090962250850290e-04 + 5 -7.8024804119438665e-04 6.4214274105036176e-04 -4.1327552517583506e-04 + 6 1.0314488630148473e+01 -1.0616776978871707e+01 -6.9580626725994152e+00 + 7 7.0613584193556572e-03 5.8490065623709271e-03 4.8384847696894906e-03 + 8 1.1781716921971410e-02 -2.4449721450384689e-02 -5.0095864748099283e-03 + 9 2.3382357298030276e-03 -4.9795743974983360e-03 4.7253558082075466e-03 + 10 -2.6590360258707150e+01 -2.4970276351674769e+00 -3.1129601743694533e+00 + 11 -7.3134792923597173e-04 1.9032215032672836e-03 -9.3256681902429458e-04 + 12 1.7392504041553195e+01 1.6614500294616306e+01 -1.1525610409038258e+01 + 13 -4.4725111516160211e-04 6.6683414109912768e-05 -3.9496633116822952e-04 + 14 -9.2661730373943922e-04 1.0140352410632476e-04 3.6534949992148079e-04 + 15 2.9024791889284857e-04 -6.6951656531770280e-04 -1.6089489608169978e-03 + 16 9.2550930968778164e+00 -1.4172764303211066e+01 1.4650722766335498e+01 + 17 -7.1372956122013505e-03 1.1866425429197226e-02 -1.0987945058536855e-02 + 18 -4.6110042616733940e-03 -3.6918674054879285e-03 3.9200722210762330e-03 + 19 -8.3531902264878861e-04 -3.4187691542251252e-03 1.1970472261388270e-03 + 20 4.8722089844996472e-05 -9.0967451046265909e-04 5.8029083649897167e-04 + 21 -1.1990806097734185e-03 2.6709175185908756e-03 -3.6321508238329304e-05 + 22 5.3880228206077779e-05 -9.1632610286722675e-04 4.5622118470204064e-04 + 23 3.2985381911583767e-04 -9.5991952060535976e-04 5.6180196557683779e-04 + 24 5.6668048368229014e-04 2.3650235314503863e-03 -8.5981331877763186e-04 + 25 -1.2694754165569323e-03 -1.2688103177448281e-03 -4.7551120820740658e-04 + 26 -7.2960242884551047e-05 -1.4230179247312527e-03 5.6686642501669303e-04 + 27 -1.4965727761262813e-03 2.5382973054268645e-03 -1.1621717469704692e-03 + 28 5.3244608348053033e-04 -1.5238550051417405e-03 6.4940813491634836e-04 + 29 1.6207581161454922e-03 -1.1057207815271884e-03 5.2719941898918515e-04 +run_vdwl: 7.26365406475285 +run_coul: 0.248568703723301 +run_stress: ! |2- + 3.0455458551527069e+01 3.6060658785946110e+01 2.3963060954014825e+01 -3.0917610764641701e+00 -8.3692413122878833e+00 -1.5762259681730853e+01 +run_forces: ! |2 + 1 -1.2241448393434258e-02 2.5678835346021285e-02 8.6551025659508465e-03 + 2 2.2141682262831661e-03 -3.4548192779372483e-03 -5.6358894590200119e-03 + 3 -9.5274258203311106e+00 9.7780244611750256e+00 6.3165209597242820e+00 + 4 -3.2811588830172249e-06 -2.6819228515587412e-05 -2.1518475973500507e-04 + 5 -7.7415759108086647e-04 6.4407102146438666e-04 -4.0525139680045488e-04 + 6 9.4737117718410655e+00 -9.7260810517073768e+00 -6.3285042083939871e+00 + 7 7.0425307253221521e-03 5.7709245539115696e-03 4.7653372189467146e-03 + 8 1.1398612415401431e-02 -2.3627301955902472e-02 -4.8618995958358531e-03 + 9 2.3359916535966785e-03 -5.0329472804706947e-03 4.7522391301401462e-03 + 10 -2.3734753080885344e+01 -2.4097202312244441e+00 -2.5316780905568450e+00 + 11 -7.2829817664630018e-04 1.9125242121991804e-03 -9.2494743303999445e-04 + 12 1.5659329657060242e+01 1.4751610959352956e+01 -1.0328793684751705e+01 + 13 -4.4580690123627005e-04 4.5558037008791715e-05 -3.8438956158700824e-04 + 14 -9.5984490482516126e-04 7.9693734429197576e-05 3.5395752765417639e-04 + 15 3.1625630081963450e-04 -6.6553770631136617e-04 -1.5826845213627427e-03 + 16 8.1343632186169703e+00 -1.2399514212841058e+01 1.2873016002623592e+01 + 17 -7.1074247952365261e-03 1.1926215502945592e-02 -1.1009929932674739e-02 + 18 -4.5970055016503111e-03 -3.6143197105911154e-03 3.9584488744033308e-03 + 19 -8.3200916550028306e-04 -3.4741972394973001e-03 1.2266616877061479e-03 + 20 7.4081426229622829e-05 -8.7350906552230933e-04 4.9764218126009034e-04 + 21 -1.1906009089604943e-03 2.5756563144885654e-03 -4.2302404729008136e-07 + 22 8.1412767645127314e-05 -8.7201669043244362e-04 4.3407541600694560e-04 + 23 3.0266704925954112e-04 -9.3347119735523009e-04 5.3885441015159310e-04 + 24 5.4003503505448407e-04 2.3414457884219351e-03 -8.7864315011120843e-04 + 25 -1.1998517807961144e-03 -1.2195798451887995e-03 -3.9268574712746714e-04 + 26 -9.4397579697665411e-05 -1.4188935351813869e-03 5.4472747495768327e-04 + 27 -1.5112178836960491e-03 2.5509163238533351e-03 -1.1115968431743000e-03 + 28 5.6209546531181933e-04 -1.5103589786084138e-03 6.2212850427396894e-04 + 29 1.5917473748970931e-03 -1.1219938783333908e-03 4.9337178773007230e-04 +... diff --git a/unittest/force-styles/tests/mol-pair-e3b.yaml b/unittest/force-styles/tests/mol-pair-e3b.yaml new file mode 100644 index 0000000000..961cd77784 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-e3b.yaml @@ -0,0 +1,103 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 08:52:27 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair lj/cut/tip4p/cut + pair e3b +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: hybrid/overlay lj/cut/tip4p/cut 5 2 5 1 0.15 10.0 e3b 5 +pair_coeff: ! | + 1 1 lj/cut/tip4p/cut 0.02 2.5 8 + 1 2 lj/cut/tip4p/cut 0.01 1.75 8 + 1 3 lj/cut/tip4p/cut 0.02 2.85 8 + 1 4 lj/cut/tip4p/cut 0.0173205 2.8 8 + 1 5 lj/cut/tip4p/cut 0.0173205 2.8 8 + 2 2 lj/cut/tip4p/cut 0.0 1 8 + 2 3 lj/cut/tip4p/cut 0.0 2.1 8 + 2 4 lj/cut/tip4p/cut 0.0 0.5 8 + 2 5 lj/cut/tip4p/cut 0.0 2.05 8 + 3 3 lj/cut/tip4p/cut 0.02 3.2 8 + 3 4 lj/cut/tip4p/cut 0.0173205 3.15 8 + 3 5 lj/cut/tip4p/cut 0.0173205 3.15 8 + 4 4 lj/cut/tip4p/cut 0.015 3.1 8 + 4 5 lj/cut/tip4p/cut 0.015 3.1 8 + 5 5 lj/cut/tip4p/cut 0.015 3.1 8 + * * e3b preset 2015 +extract: ! "" +natoms: 29 +init_vdwl: 584.671488129934 +init_coul: -128.977932168035 +init_stress: ! |2- + 1.4231803769197056e+03 1.6927616344571190e+03 3.8078398830142301e+03 -1.0764791807445065e+03 -2.0803020422504056e+02 7.2362454225684814e+02 +init_forces: ! |2 + 1 1.3685073689571539e+02 3.9938817130363043e+02 1.4670208197474381e+02 + 2 9.0831848103278351e-02 -3.3313499027414042e+00 -1.2979093715118299e+00 + 3 -1.4545924445052987e+02 -3.8860032656119461e+02 -1.3922527196173618e+02 + 4 2.0451930122273901e-01 1.9998707505206059e-01 -1.9241529187480502e-01 + 5 -4.0641917540788286e-01 6.8305809252357585e-01 -8.1657240858196867e-02 + 6 -8.3005250913688155e+02 9.6027287048535652e+02 1.1479388267952975e+03 + 7 5.7965772264279785e+01 -3.3542560545536020e+02 -1.7140602299329378e+03 + 8 2.2225177792226708e+02 -1.9967109198380381e+01 7.5267413514547968e+02 + 9 1.6389055151637297e+00 -5.6390633543953870e+00 1.5311382036446766e+00 + 10 5.2847373884574995e+02 -6.1581374406926625e+02 -1.9338541601100667e+02 + 11 -1.0650139622803310e+00 1.3236640560743722e+00 -5.2793717146291574e-01 + 12 2.5409781891966190e+01 1.5668165497794694e+01 -1.2455369958080537e+01 + 13 -3.8402453550913235e-01 1.8207125947890837e-01 -1.7705990497731289e-01 + 14 -1.2512809595558640e+00 5.7459561642481449e-01 -2.8979110225243121e-01 + 15 2.0365418860293560e-01 -1.2414160528552476e-01 -9.9240093291718068e-01 + 16 4.6129498522272758e+02 -3.2953690411160284e+02 -1.1861885601087611e+03 + 17 -4.5520701054411796e+02 3.2122601151151810e+02 1.1988318762398187e+03 + 18 1.0740180745738025e-01 4.7707032497364823e+00 -8.4412268781496813e+00 + 19 1.7141655109952687e+00 -1.6053719639650721e+00 6.5795299293212599e+00 + 20 -3.3084525007896382e+00 -5.6180547380703150e+00 4.8413072040789036e+00 + 21 9.3296734400806747e-01 3.1537166348997001e+00 -7.8569580243261550e+00 + 22 3.7050652612958657e+00 1.4003826804296502e+00 5.0400300091900805e+00 + 23 -6.8171671139915162e+00 -4.4579919295941908e+00 2.3028567081889286e+00 + 24 -8.7246666836007025e-01 7.8447869020563736e+00 -3.8113771906842273e+00 + 25 5.0290773121564376e+00 -9.4339583438843400e-01 4.1845154167803242e+00 + 26 -4.6561811432502953e+00 -7.1621093380192180e+00 -6.6864416050653208e-01 + 27 -1.0470258927690863e+00 9.2906307144144673e+00 -3.6990588127802435e+00 + 28 8.5365856050054738e+00 -2.4636423220451302e+00 4.2276358718634395e+00 + 29 -3.8831706532739356e+00 -5.2900046950811053e+00 -1.5026494435836046e+00 +run_vdwl: 102.202850692313 +run_coul: -113.74103929774 +run_stress: ! |2- + 4.0014750547554610e+02 4.7040900572683694e+02 2.6188180201410347e+02 -3.3090394877678114e+02 -8.0167848651330445e+01 1.2621115498095926e+02 +run_forces: ! |2 + 1 3.1753218849895195e+01 8.3621920552134796e+01 3.0316318454889249e+01 + 2 1.4286535205016118e-01 -2.2824035719485072e+00 -7.5551038919350355e-01 + 3 -2.3574837309870125e+02 9.7602019200417502e+01 8.4388048810067190e+01 + 4 -8.8996093986925678e-02 3.2157992415099795e-01 -2.6834893584213759e-01 + 5 -5.1176909694949801e-01 6.2243255012750509e-01 3.0305985432304289e-01 + 6 1.0988093506139059e+02 -9.6340562635087679e+01 -1.2877640891894038e+02 + 7 4.4591375102032806e+00 -1.1562280722232016e+01 -3.8449881125068998e+01 + 8 -1.8500977069146241e+00 3.2142650450768677e+01 1.0393367243164468e+02 + 9 1.6031488329434944e+00 -6.7043925776626629e+00 9.3597399196991460e-01 + 10 3.9843479450387534e+01 -6.6883719610197858e+01 -8.8591570116850775e+01 + 11 -1.2251023547936200e+00 1.4050644132057466e+00 -8.2053515811467215e-01 + 12 2.1038151487042072e+01 1.6333275200719637e+01 -1.0224098677807561e+01 + 13 -3.5460669347482632e-01 3.4985633903056490e-01 -2.8587442295445253e-01 + 14 -1.5532009179877173e+00 6.6724074348461260e-01 -4.7736430412614694e-01 + 15 1.8618152589723655e-01 -1.8742421063994502e-01 -1.0508719338896062e+00 + 16 5.0203982778403507e+01 -6.4427805216374551e+01 1.3348312651468889e+01 + 17 -1.7324433827001716e+01 1.5943398209626597e+01 3.6242072305639176e+01 + 18 -5.1244673656886619e-01 4.6503724792902705e+00 -7.5634833647837292e+00 + 19 2.1299064571460709e+00 -1.7007860994064594e+00 6.5142742813041359e+00 + 20 -3.2615898343840461e+00 -5.6090812774873386e+00 4.2429891063539174e+00 + 21 8.0741655650871391e-01 3.0937838483255220e+00 -7.2914969367797333e+00 + 22 3.9626151599754680e+00 1.5703953876725520e+00 4.8509806980792467e+00 + 23 -7.0701628159593684e+00 -4.4624515654731045e+00 2.0542173004071516e+00 + 24 -9.5064820343282552e-01 8.5254518575092533e+00 -5.0323755005400344e+00 + 25 5.5723194185180853e+00 -7.0640318784218714e-01 4.4527210593220081e+00 + 26 -4.8649543979323449e+00 -7.4562688050941262e+00 -1.0189293139994318e+00 + 27 -1.5562227560397666e+00 9.3814184738732589e+00 -3.7918644430887172e+00 + 28 8.9221127912602523e+00 -2.5727955175008117e+00 4.4191999926606860e+00 + 29 -3.6328666974943009e+00 -5.3344846333902503e+00 -1.6032273961495329e+00 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml new file mode 100644 index 0000000000..96caf3150f --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml @@ -0,0 +1,102 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 15:02:20 202 +epsilon: 7.5e-14 +prerequisites: ! | + atom full + pair lj/charmm/coul/long/soft + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/charmm/coul/long/soft 4.0 2.5 6.4 7.0 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + lj14_1 2 + lj14_2 2 + lj14_3 2 + lj14_4 2 + lambda 2 + implicit 0 + cut_coul 0 +natoms: 29 +init_vdwl: 0.0870608994865688 +init_coul: 26.4864428259304 +init_stress: ! |- + -9.1272913010153811e-01 -4.3887362745626044e+00 -3.1967462851505650e+00 1.5302397885103485e+00 -2.6618292754008194e-01 1.1864876982964698e+00 +init_forces: ! |2 + 1 2.4616388624063362e-01 -1.5947862794907725e-01 2.4158041308618994e-01 + 2 1.2587373691239814e-01 -3.1086106971524302e-01 -3.9047323576019743e-01 + 3 -3.0916873457587156e-03 3.9271403557591400e-03 9.9651765169532485e-03 + 4 -2.3426637135086047e-02 -8.1547099824937227e-05 -4.5622030716267553e-02 + 5 -8.2707462633545364e-02 6.6423051063919034e-02 1.2920676385370332e-03 + 6 1.4499840598081187e-01 -4.4588145662847867e-01 -1.8014001026677143e-01 + 7 -2.3245247449394858e-02 8.6094351032624181e-02 3.3413715969444502e-01 + 8 -2.3952197666733896e-01 5.2904463738824992e-01 1.2080573263293189e-01 + 9 2.5060076718488522e-01 -6.7492899232646697e-01 4.2045820528378786e-01 + 10 -2.3681443555748527e-02 3.2832366908848915e-02 -4.4683735351083630e-02 + 11 -1.1855803416493231e-01 1.3616148552232207e-01 -8.0559996962475205e-02 + 12 4.1600093346841371e-01 -8.3284008209525917e-02 2.1993202884144883e-01 + 13 1.6047774922041250e-02 -1.6635865133262272e-02 -2.4824905693915541e-02 + 14 -1.4256250235939441e-01 4.6257423658248351e-02 -4.3301028466927204e-02 + 15 4.7738264597211276e-02 1.9463612376800794e-03 -1.3072823943357331e-01 + 16 -3.9283332520492528e-02 -1.1040249111579925e-01 5.6699221482865637e-02 + 17 -3.9061378852029111e-01 8.5797065656962368e-01 -7.0932578105426569e-01 + 18 8.5370699463348521e-03 4.8416531014014791e-01 -3.4873314462740362e-01 + 19 -2.1142785846284939e-02 -2.8987449428038259e-01 3.3660878877871475e-01 + 20 -6.3045884150468551e-02 -1.7977882907281684e-01 2.6665421255513883e-01 + 21 3.9356840262971697e-02 3.7050595844158568e-01 -4.8103365820912036e-01 + 22 -2.6958252833899450e-03 -1.2419152556966964e-01 2.9910542263083340e-01 + 23 -1.0100240076025478e-01 -1.8246987264743492e-01 2.5970364295545934e-01 + 24 -5.8836856393461763e-02 6.0639131792384215e-01 -3.1555178088372526e-01 + 25 3.3442866778699010e-04 -2.7759222484021373e-01 9.7548995160330526e-02 + 26 -2.0747586693553980e-02 -3.6446571556836688e-01 1.3298474329213145e-01 + 27 -1.7551531704171702e-01 6.6588106276847814e-01 -2.5211663664373374e-01 + 28 1.5473142633686865e-01 -3.3070958116386345e-01 1.7192605646732770e-01 + 29 7.9295234000756817e-02 -3.3696482169090269e-01 7.7692317052364929e-02 +run_vdwl: 0.0865454802879452 +run_coul: 26.3541935677558 +run_stress: ! |- + -9.5966819495319222e-01 -4.3941446226053111e+00 -3.1568771272196665e+00 1.5037730423097684e+00 -3.0350157968660951e-01 1.1569330698181230e+00 +run_forces: ! |2 + 1 2.4521222884076485e-01 -1.6086055657684817e-01 2.3890727709466764e-01 + 2 1.1736624317717813e-01 -3.1162687225181640e-01 -3.8761965478873905e-01 + 3 -2.9397470178107211e-03 3.4449772999398404e-03 9.6382941374364185e-03 + 4 -2.1733581187266381e-02 9.5402025505375446e-05 -4.6004840657874191e-02 + 5 -8.1637509297970243e-02 6.6925993223235142e-02 8.5173732336092829e-04 + 6 1.4189875272902974e-01 -4.4079190202677654e-01 -1.7282627914331100e-01 + 7 -2.0301283658280156e-02 8.1257684149718595e-02 3.2277925765230681e-01 + 8 -2.3176063039570383e-01 5.2671226809675886e-01 1.2053172553853687e-01 + 9 2.4851502997934918e-01 -6.8279100017572170e-01 4.2797251478983028e-01 + 10 -2.4005564061921746e-02 3.2665494506592459e-02 -4.5205317615484117e-02 + 11 -1.1843268179239209e-01 1.3673113110807389e-01 -7.8855615918135114e-02 + 12 4.1597764291342687e-01 -8.1785317044642980e-02 2.1998758510599548e-01 + 13 1.4754826472231841e-02 -1.7373529526282367e-02 -2.4742116546111935e-02 + 14 -1.4296016288807473e-01 4.7016645219744843e-02 -4.1094711597367460e-02 + 15 4.9775572369939805e-02 -3.7100239286285905e-04 -1.3337003405538669e-01 + 16 -3.9452087906060015e-02 -1.1223938303599601e-01 5.6594394612351093e-02 + 17 -3.9249180413714146e-01 8.6969704042383988e-01 -7.1560967422273125e-01 + 18 -6.5582088091562969e-03 4.6994263270377179e-01 -3.2849093510825489e-01 + 19 2.9863411122556297e-03 -2.7345780466997288e-01 3.4516149872881963e-01 + 20 -7.0778225573514611e-02 -1.8121331357752646e-01 2.3808694552706999e-01 + 21 4.2611610529174039e-02 3.5416302876012218e-01 -4.7545752535460878e-01 + 22 1.1514478572165697e-02 -1.1066278566656357e-01 3.0020944221363216e-01 + 23 -1.1773373891969874e-01 -1.8142495094717720e-01 2.5204331681638553e-01 + 24 -6.8821583242620554e-02 6.0915382973282572e-01 -3.2115938333173072e-01 + 25 1.4339999292415251e-02 -2.7422591321865630e-01 1.1162318514453656e-01 + 26 -2.2422826391878561e-02 -3.6755245162965111e-01 1.2917485895331829e-01 + 27 -1.8396738355957404e-01 6.7144647923408374e-01 -2.4138764142052668e-01 + 28 1.6141740622512213e-01 -3.3248921877856086e-01 1.6748278322747401e-01 + 29 7.9626886626010862e-02 -3.4038660496515699e-01 7.0778912894540136e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml new file mode 100644 index 0000000000..8e2c0e3e54 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml @@ -0,0 +1,94 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:23:57 202 +epsilon: 5e-12 +prerequisites: ! | + atom full + pair lj/class2/coul/cut/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: lj/class2/coul/cut/soft 4.0 2.5 6.0 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 +natoms: 29 +init_vdwl: -0.0279568869346605 +init_coul: -16.9131718066612 +init_stress: ! |- + -1.2568075459723569e+00 -4.0978664443210082e+00 -5.7677732235218784e+00 7.9760147162786232e-01 -4.9732737933520765e-01 9.7164487925694876e-02 +init_forces: ! |2 + 1 1.3592997896495729e-01 -1.2424537574516284e-01 2.8998619267758802e-01 + 2 2.4127989974844666e-01 -1.7365607699712368e-01 -5.0805967704212107e-01 + 3 -5.0671136353255819e-04 -4.9025301952775602e-03 7.1229022561792137e-03 + 4 2.8810568506803316e-03 -5.6924092084610009e-03 -5.1208526545922659e-02 + 5 -5.7773611865861038e-02 7.3378609119393812e-02 -9.2291313571032790e-03 + 6 1.6802489632881523e-01 -3.7224273267992691e-01 -1.3362702831201553e-01 + 7 -2.3317680550639208e-02 3.7659493108164147e-02 2.8895703703441755e-01 + 8 -2.2027968269268816e-01 4.4360430781128279e-01 6.0414491418214755e-02 + 9 2.7991714840469500e-01 -6.4364696184668180e-01 4.8967810516939242e-01 + 10 -2.6643559786171986e-02 2.9119971025175450e-02 -2.8635709761832509e-02 + 11 -1.2681897404839046e-01 1.4726619480583428e-01 -6.3314091887318139e-02 + 12 4.4886487644161299e-01 -1.1080124308648688e-01 1.9177998321882522e-01 + 13 -3.3898693529075673e-02 -2.1053466617435276e-02 5.6467046538395647e-03 + 14 -1.6296143302208443e-01 5.5901450877572777e-02 -3.0052266145009301e-02 + 15 3.0735564824038091e-02 5.1458090359104355e-03 -1.1967953299671341e-01 + 16 -6.1099906145121612e-02 -1.0907130648341337e-01 8.7688130251292962e-02 + 17 -4.2167495078495293e-01 8.8255771134776784e-01 -8.0787827442479343e-01 + 18 1.4968990753248204e-01 7.2329581634564599e-01 -4.9024394016091583e-01 + 19 -1.3173762545916162e-01 -4.5273532022170526e-01 2.4178725430191852e-01 + 20 -9.3059619093661838e-02 3.1056361615903649e-02 2.0114149246932414e-01 + 21 9.2324620627764878e-02 -1.8071935961239033e-01 -5.5815830628615526e-01 + 22 -9.0022474258754676e-02 1.5374286810874399e-01 3.1420022857285868e-01 + 23 -7.7401546300495269e-02 -1.8850066260860709e-01 3.2100032764793507e-01 + 24 -1.5822951352824235e-01 5.4306364536733065e-01 2.2687823332715684e-01 + 25 1.3211522022163691e-02 -2.4949105163178814e-01 1.0626911089774560e-01 + 26 9.6122265473982567e-03 -4.3095392559598722e-01 -1.2833943392968106e-01 + 27 -2.8153635630686236e-01 6.4443404010992456e-01 -3.0459961833196159e-01 + 28 1.6087710176599712e-01 -4.2329027587759382e-01 1.9390264301028309e-01 + 29 2.3361353867664425e-01 -2.7922358027060867e-01 2.0657270027457103e-01 +run_vdwl: -0.0279409051337663 +run_coul: -17.8524160178072 +run_stress: ! |- + -1.4291891053500811e+00 -4.7726937336417867e+00 -5.7887863563427944e+00 4.8239023891542065e-01 -4.2708193312429249e-01 3.1857255955017738e-01 +run_forces: ! |2 + 1 1.3698045557692529e-01 -1.2653483822273043e-01 2.9204846991156019e-01 + 2 1.8899632255844270e-01 -2.7138082755827064e-01 -4.7308644826518781e-01 + 3 -5.4658571168653136e-04 -5.2433212171929255e-03 7.1525916086689310e-03 + 4 4.5093813701484742e-03 -5.6467411572141100e-03 -5.2414314790801469e-02 + 5 -5.7062361978861303e-02 7.3862111311376571e-02 -1.0864397490678114e-02 + 6 1.6405697733198579e-01 -3.6641315088054893e-01 -1.3406203920934517e-01 + 7 -2.0630213458580807e-02 3.0720287290657594e-02 2.8346481082220043e-01 + 8 -2.1052323546453777e-01 4.4082735810137930e-01 6.7289207681595853e-02 + 9 2.7654530198393618e-01 -6.5186716940524470e-01 4.9234424978060892e-01 + 10 -2.7286871885132555e-02 2.9149989879862042e-02 -3.0254912036148041e-02 + 11 -1.2705593446949909e-01 1.4860516951130073e-01 -6.2694459702265143e-02 + 12 4.5027781712835890e-01 -1.1004603422341599e-01 1.9604733869615679e-01 + 13 -3.5426864572901326e-02 -2.1365847533075039e-02 4.2996964539162956e-03 + 14 -1.6370959204290966e-01 5.7022288370350574e-02 -2.8945034317939218e-02 + 15 3.2369823106643429e-02 2.7196628107690191e-03 -1.2380653441133911e-01 + 16 -6.3417186454514385e-02 -1.0919492310531859e-01 8.1738272452588134e-02 + 17 -4.2181264882891739e-01 8.9448506895663094e-01 -8.0783672503109427e-01 + 18 1.4058089795576939e-01 7.1643723138047699e-01 -4.6383066879808843e-01 + 19 -1.1070418519442088e-01 -4.4039431386058453e-01 2.4858835314022704e-01 + 20 -1.0225717618341726e-01 2.7839100846041194e-02 1.7205514308984293e-01 + 21 9.4693223912728219e-02 -2.0663484146899153e-01 -5.4533175309275717e-01 + 22 -7.6376677283854139e-02 1.7209997110498060e-01 3.1141478757022478e-01 + 23 -9.2778477816302385e-02 -1.8428237909243911e-01 3.0991369137436953e-01 + 24 -1.6499083071028064e-01 5.3960511982550485e-01 2.2352204481494231e-01 + 25 2.5345593993470028e-02 -2.4336206855244683e-01 1.1694349525743708e-01 + 26 6.7425350744113426e-03 -4.3015751098937594e-01 -1.3335175295659357e-01 + 27 -2.9047808261004182e-01 6.4842554326535384e-01 -2.8849125540639670e-01 + 28 2.1009072477591795e-01 -3.2730215032810456e-01 1.5241918713982527e-01 + 29 2.3386786989712011e-01 -2.8197278505973034e-01 1.9572895571446983e-01 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml new file mode 100644 index 0000000000..7f0100291f --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml @@ -0,0 +1,99 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:25:25 202 +epsilon: 5e-12 +prerequisites: ! | + atom full + pair lj/class2/coul/long/soft + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/class2/coul/long/soft 4.0 2.5 6.0 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 +natoms: 29 +init_vdwl: -0.0279568869346605 +init_coul: 26.9521621832406 +init_stress: ! |- + -1.0979342688867924e+00 -4.5861640845557456e+00 -3.4258685036821017e+00 1.5698533700384376e+00 -3.0977826363822086e-01 1.2339097540506174e+00 +init_forces: ! |2 + 1 2.4854455083769370e-01 -1.7645673067862744e-01 2.3144035934888740e-01 + 2 1.2071733182670989e-01 -3.1635427470669947e-01 -3.8601058170897934e-01 + 3 3.9690644393985362e-03 -8.0795595233144335e-03 3.8957282208275669e-03 + 4 -1.6383928356971070e-02 8.5405996746991755e-04 -4.0101456759030034e-02 + 5 -8.0124665845449292e-02 7.8217141483281932e-02 -6.8932905911379752e-03 + 6 1.4543881813680898e-01 -4.4794981200921186e-01 -1.8376415910369384e-01 + 7 -1.0353905564352577e-02 8.5384067126106439e-02 3.6994690621540194e-01 + 8 -2.2326370979706600e-01 5.2991941841045509e-01 1.2153025749799547e-01 + 9 2.5331756884916778e-01 -6.8939137006819040e-01 4.1775092128267149e-01 + 10 -2.6669741302926885e-02 3.4168045229501745e-02 -3.9073358860316112e-02 + 11 -1.1990359987471731e-01 1.4247109655639389e-01 -7.5395025419480316e-02 + 12 3.9604857002737098e-01 -8.4530031123850546e-02 2.2827286251388235e-01 + 13 1.0634469508568917e-02 -1.3485622285277917e-02 -2.5474018144612913e-02 + 14 -1.4128376939902654e-01 4.6738775954182757e-02 -3.8352490424791490e-02 + 15 4.8572882034172607e-02 -5.0576168661936741e-03 -1.3446651212334287e-01 + 16 -4.9128565063490434e-02 -9.9370652777369839e-02 6.0717721877563392e-02 + 17 -3.9961640506886942e-01 8.8097371011860670e-01 -7.5010088146431109e-01 + 18 1.0310656032279845e-02 4.9594998756095682e-01 -3.7847864401306447e-01 + 19 -1.2796991707713021e-02 -2.8742123400015113e-01 3.5388587368822871e-01 + 20 -7.3304884813828797e-02 -1.9239408831583721e-01 2.7978086996999058e-01 + 21 4.8503721479407069e-02 3.8164989857466419e-01 -5.1397368605741378e-01 + 22 4.8486699895596659e-03 -1.2449604861696668e-01 3.2035050216495248e-01 + 23 -1.1731254607650360e-01 -1.9384196948964297e-01 2.7105494102433980e-01 + 24 -6.4975367446142046e-02 6.3674181716477229e-01 -3.3158049872499690e-01 + 25 1.4602100392704764e-02 -2.8571022759229037e-01 1.1186561087328276e-01 + 26 -2.8807097995783609e-02 -3.8630367744224536e-01 1.3541587823280968e-01 + 27 -1.8097814888562413e-01 6.9820913337890733e-01 -2.6340710165001457e-01 + 28 1.7042543108693975e-01 -3.4356300367399606e-01 1.8420405608797991e-01 + 29 6.8969492557682449e-02 -3.5687123235543355e-01 7.6959216046372347e-02 +run_vdwl: -0.0279418173888648 +run_coul: 26.8201360341214 +run_stress: ! |- + -1.1474158179052636e+00 -4.5913254242436174e+00 -3.3846887285760752e+00 1.5415499440939435e+00 -3.4927879486424995e-01 1.2022024524829980e+00 +run_forces: ! |2 + 1 2.4785371424044841e-01 -1.7744585501409318e-01 2.2908622448585458e-01 + 2 1.1208574586184081e-01 -3.1728948196584505e-01 -3.8331129955499721e-01 + 3 3.8672958174749885e-03 -8.4638290562189036e-03 3.6804944393340226e-03 + 4 -1.4908210107554554e-02 9.1263670694041396e-04 -4.0582807546513638e-02 + 5 -7.9010469883058737e-02 7.8655044199497925e-02 -7.3456373321684771e-03 + 6 1.4210275150117604e-01 -4.4262469999273130e-01 -1.7622693840330184e-01 + 7 -7.3671818618165526e-03 8.0461163251868140e-02 3.5812783086127464e-01 + 8 -2.1486667164805373e-01 5.2760625595983124e-01 1.2123697649482454e-01 + 9 2.5120326346302924e-01 -6.9738854073180823e-01 4.2544264553181460e-01 + 10 -2.6981423578011067e-02 3.3823491926006359e-02 -3.9727627882606691e-02 + 11 -1.1971285966868087e-01 1.4299991947654064e-01 -7.3606567838715942e-02 + 12 3.9616115191218104e-01 -8.2973575600471777e-02 2.2840969062553673e-01 + 13 9.2089010152039304e-03 -1.4357807115272092e-02 -2.5374002351636657e-02 + 14 -1.4164933289091716e-01 4.7606633868259293e-02 -3.6053447515452981e-02 + 15 5.0466515663197861e-02 -7.5407233516649854e-03 -1.3717507875786389e-01 + 16 -4.9282386378155150e-02 -1.0120792510703974e-01 6.0585078104901109e-02 + 17 -4.0162649553783158e-01 8.9288816584113617e-01 -7.5654097850534352e-01 + 18 -6.2166126605120312e-03 4.8017772312820972e-01 -3.5714456173358294e-01 + 19 1.2477034771840437e-02 -2.6997050692373975e-01 3.6280081675592402e-01 + 20 -8.0743209253462581e-02 -1.9332415162158362e-01 2.4973921501054613e-01 + 21 5.1979772871987143e-02 3.6464922171365610e-01 -5.0824928062082519e-01 + 22 1.9787748090259981e-02 -1.1037985730200084e-01 3.2157468867319638e-01 + 23 -1.3498574986299636e-01 -1.9274302053604020e-01 2.6311576355618921e-01 + 24 -7.5570051489166040e-02 6.3995557872087350e-01 -3.3757635738253905e-01 + 25 2.9520715443940637e-02 -2.8218957231969999e-01 1.2674950009258862e-01 + 26 -3.0757842125759015e-02 -3.8997146868550769e-01 1.3123703696619110e-01 + 27 -1.8994396856382390e-01 7.0415663122604488e-01 -2.5223088765765900e-01 + 28 1.7757264890985036e-01 -3.4548880985210345e-01 1.7971077337889108e-01 + 29 6.9335205947368736e-02 -3.6053264084304387e-01 6.9648738106139821e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml new file mode 100644 index 0000000000..efcd2dc1c8 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml @@ -0,0 +1,93 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:22:39 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair lj/class2/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: lj/class2/soft 4.0 2.5 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 +natoms: 29 +init_vdwl: -0.0279568869346605 +init_coul: 0 +init_stress: ! |- + -2.3558296880624573e-02 -3.1200547290628957e-02 -1.9188671794609813e-02 3.4329076865322054e-03 4.7001698327135471e-03 3.7471627607295757e-03 +init_forces: ! |2 + 1 2.9473075631550882e-03 -1.6255700663301358e-03 -5.2078154667030906e-04 + 2 4.0489030919855114e-05 -1.4269144053835934e-04 3.9025585349759400e-07 + 3 2.5758045073252263e-04 4.6086031362977455e-04 6.6773464139615278e-04 + 4 2.6422006456248031e-05 -8.0558332158881478e-05 -1.2300283965365647e-05 + 5 3.7611311413488783e-05 -8.4873441246067867e-05 -1.5530131125571422e-05 + 6 3.6095683860856084e-03 -1.7486968074908985e-03 -3.8972241885575814e-04 + 7 1.6446348563533234e-03 1.1579935219391674e-03 -7.5406936315700773e-04 + 8 -1.7878960179904802e-03 2.1084680204541484e-03 1.2022913387082842e-03 + 9 1.1463237890232251e-05 1.0167607479406362e-04 -2.8136850262040211e-05 + 10 -1.3840404917041078e-03 1.0799471876661610e-03 -1.5473762872850922e-03 + 11 -1.5156846998994986e-05 2.4510475528695519e-05 -6.4420831064977764e-05 + 12 -1.1633040841691961e-03 1.1503516490156528e-03 -3.8359142472219163e-04 + 13 -1.7021927298992298e-04 -4.4198928654632589e-05 4.6446059108627459e-05 + 14 -1.0907268128202476e-04 -1.5406433729280831e-06 1.4148437672412327e-04 + 15 -1.7099402826189602e-04 -5.1239208334626272e-05 -1.7925523292564315e-05 + 16 6.1081389200175066e-05 3.4753249449512503e-04 -6.8274711842839463e-04 + 17 -5.2609659924428840e-04 4.2588291959557925e-04 4.0287820827044176e-04 + 18 -2.1518617687082691e-03 -3.7262380141849833e-03 3.2399849104654496e-03 + 19 5.8594989715668837e-05 1.8209855098346695e-05 9.9027683554507213e-05 + 20 -8.9782508946392153e-05 -8.9301374525416910e-05 1.4413535313341869e-05 + 21 -9.0841708053557963e-04 1.0105630967097833e-03 9.8153414192552716e-04 + 22 7.2704098589308782e-05 4.9764660203691873e-05 4.6627089035048905e-05 + 23 -9.3407695705731599e-05 -2.5704944417954180e-05 -2.3730804039168847e-05 + 24 -9.4237055526872151e-04 -9.3190972590857942e-04 -1.8453045962420994e-03 + 25 2.2630691257975006e-05 -2.6796595925244310e-06 -5.4219388319802465e-05 + 26 -8.0393940672050156e-05 -4.8391396569057105e-05 -5.4841140734280125e-05 + 27 7.7740979900039434e-04 6.3935242647477069e-04 -4.2466184497333940e-04 + 28 8.3048734749811267e-05 3.1248528966866243e-05 3.0822826083793829e-05 + 29 -5.7532973042045847e-05 -2.7672412467805212e-06 -5.4275513300832731e-05 +run_vdwl: -0.0279415055756731 +run_coul: 0 +run_stress: ! |- + -2.3600292753029325e-02 -3.1234050931138665e-02 -1.9247707998720477e-02 3.4602601994415398e-03 4.7405330909736755e-03 3.7183453784611869e-03 +run_forces: ! |2 + 1 2.9461191709398626e-03 -1.6186860870491483e-03 -5.1694945479188422e-04 + 2 3.7466792722222388e-05 -1.4468218886644094e-04 1.3966909511272580e-06 + 3 2.7812682065410350e-04 4.4590913552799971e-04 6.4297819899768952e-04 + 4 2.4050654370892218e-05 -8.0122099814915152e-05 -1.4106363870070515e-05 + 5 3.7711409385897576e-05 -8.6020820506596226e-05 -1.3836806910756170e-05 + 6 3.6161040572478685e-03 -1.7641009232103740e-03 -3.9803999549915939e-04 + 7 1.6483463512744548e-03 1.1735896532072284e-03 -7.4165852183726575e-04 + 8 -1.8112412873781628e-03 2.1293568387560796e-03 1.2020232557053414e-03 + 9 1.2165248590554398e-05 1.0314413172020949e-04 -2.9748405733251166e-05 + 10 -1.3878814217341794e-03 1.0879706557175700e-03 -1.5462313770384457e-03 + 11 -1.1037554785516019e-05 2.5021131368802229e-05 -6.3131363381438603e-05 + 12 -1.1725161490596422e-03 1.1384318353601138e-03 -3.8599172950790680e-04 + 13 -1.6975841674364453e-04 -4.6039739151595695e-05 4.7451253324091769e-05 + 14 -1.1134529086303964e-04 -4.8074818305833470e-06 1.3832458683156625e-04 + 15 -1.6952425285043099e-04 -4.2877320396484933e-05 -1.4773108759162220e-05 + 16 6.7683902185082333e-05 3.4097779564949937e-04 -6.7940593957424556e-04 + 17 -5.1814120369824670e-04 4.2027922253817785e-04 4.0213091794390996e-04 + 18 -2.1575585922524914e-03 -3.7329276272613015e-03 3.2518676518168339e-03 + 19 5.0502840332106572e-05 1.1303158602344533e-05 9.8730624731965594e-05 + 20 -7.9576904730036045e-05 -8.0665940949843258e-05 1.5122535874939930e-05 + 21 -9.1010799612846591e-04 1.0159537501040340e-03 9.8400919688341072e-04 + 22 7.0646668921940504e-05 4.8270837688354870e-05 4.5452488640379622e-05 + 23 -9.1426907720905685e-05 -2.4058421983277910e-05 -2.2344225963570847e-05 + 24 -9.4400600934426814e-04 -9.3196178272884574e-04 -1.8471362495367906e-03 + 25 2.5888590079299666e-05 1.0168705295242309e-06 -5.1182885649010081e-05 + 26 -8.3683807999153389e-05 -5.1555698330583508e-05 -5.7697602296658660e-05 + 27 7.7778199020865526e-04 6.3924465276693704e-04 -4.2417803977789494e-04 + 28 8.4537818527806631e-05 3.1881437318165007e-05 3.2032875559797422e-05 + 29 -5.9326520152563993e-05 -3.8449747750497481e-06 -5.5108207133542701e-05 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml new file mode 100644 index 0000000000..bf33642d40 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml @@ -0,0 +1,94 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:15:05 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair lj/cut/coul/cut/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: lj/cut/coul/cut/soft 4.0 2.5 6.4 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 +natoms: 29 +init_vdwl: 0.0869868307797999 +init_coul: -16.721880512059 +init_stress: ! |- + -1.0613573795549203e+00 -3.8839205137835902e+00 -5.5134910841142846e+00 7.5801818987704728e-01 -4.5644823344739416e-01 4.8871441509553137e-02 +init_forces: ! |2 + 1 1.3301449452185465e-01 -1.0655197491427448e-01 3.0067616789804325e-01 + 2 2.4667817836002159e-01 -1.6790770289694051e-01 -5.1256488740868278e-01 + 3 -7.5491502745029682e-03 7.2105583284790631e-03 1.3188341267198700e-02 + 4 -4.3150767873698925e-03 -6.8536496606041407e-03 -5.6663663037660982e-02 + 5 -6.0423179280680916e-02 6.1083090087391920e-02 -1.0920315921668991e-03 + 6 1.6550266524104881e-01 -3.6904989434000041e-01 -1.2540485919012140e-01 + 7 -3.4880846593007553e-02 3.7777080088750636e-02 2.5038812099526375e-01 + 8 -2.3586022374717203e-01 4.4275889608408880e-01 5.7118091154704148e-02 + 9 2.7651364211263241e-01 -6.2867220051208328e-01 4.9240063377232079e-01 + 10 -2.3350810988213653e-02 2.7224677829616142e-02 -3.4013520354698040e-02 + 11 -1.2509208145665296e-01 1.4033844392410574e-01 -6.8104764936649645e-02 + 12 4.6777417858309556e-01 -1.0827515107210416e-01 1.8267966210204112e-01 + 13 -2.8307440290696897e-02 -2.4491430410129817e-02 6.4494114072639122e-03 + 14 -1.6375953775323787e-01 5.5064007515157123e-02 -3.5025349297420350e-02 + 15 3.0147433796891054e-02 1.2086358887115671e-02 -1.1561719947098127e-01 + 16 -4.9860240119952083e-02 -1.2140633359484271e-01 7.9673514139239524e-02 + 17 -4.1367013823156096e-01 8.6023245236899437e-01 -7.6238198162901716e-01 + 18 1.4743239696176103e-01 7.0816952411423151e-01 -4.5392462688042062e-01 + 19 -1.4060759222800723e-01 -4.5401137506458245e-01 2.2074810268978753e-01 + 20 -8.1709436622194931e-02 4.5390287460576370e-02 1.8488185099146931e-01 + 21 8.1827535546651786e-02 -1.9415330808316492e-01 -5.1885885171043933e-01 + 22 -9.7673967367890718e-02 1.5455840468962617e-01 2.8924600008297519e-01 + 23 -5.9372370218819318e-02 -1.7529518275878075e-01 3.0673265127894611e-01 + 24 -1.5065519915041178e-01 5.0634472366755789e-01 2.4586148490100962e-01 + 25 -2.5246557004812709e-03 -2.3877422496293441e-01 8.9799760942697704e-02 + 26 1.7957561632082175e-02 -4.0515259141354909e-01 -1.3173207377587212e-01 + 27 -2.7476246020103456e-01 6.0493120625631469e-01 -2.9064786520929453e-01 + 28 1.4347513760734865e-01 -4.0704325460185131e-01 1.7976862032283397e-01 + 29 2.4405118264850023e-01 -2.5553143701616343e-01 2.0641926054763102e-01 +run_vdwl: 0.0864716901746354 +run_coul: -17.6587395670533 +run_stress: ! |- + -1.2310312129721028e+00 -4.5583725028040067e+00 -5.5364023232766897e+00 4.4511499980738989e-01 -3.8421601156790053e-01 2.7245801051758678e-01 +run_forces: ! |2 + 1 1.3377812535034600e-01 -1.0924552244195854e-01 3.0239582004374232e-01 + 2 1.9460749443182726e-01 -2.6531388283407620e-01 -4.7746130828464767e-01 + 3 -7.3347251089237678e-03 6.7726180164356786e-03 1.3105788420142546e-02 + 4 -2.4720968172563737e-03 -6.6869065041733379e-03 -5.7765308408484296e-02 + 5 -5.9754628828893659e-02 6.1630076614972391e-02 -2.7107215069287413e-03 + 6 1.6177650967868279e-01 -3.6344034648305823e-01 -1.2604556810786538e-01 + 7 -3.2239571524180818e-02 3.0913302936171783e-02 2.4534996491066566e-01 + 8 -2.2676583476715423e-01 4.3995105114930455e-01 6.3973199849776202e-02 + 9 2.7319683986147475e-01 -6.3675023590992430e-01 4.9490604677475736e-01 + 10 -2.4007119482593237e-02 2.7432938158340029e-02 -3.5492353767146795e-02 + 11 -1.2539511829806502e-01 1.4171637355869635e-01 -6.7569520102284536e-02 + 12 4.6905278568502473e-01 -1.0758310955374528e-01 1.8684895409281049e-01 + 13 -2.9697664050240720e-02 -2.4665398443543356e-02 5.0886376051148818e-03 + 14 -1.6454344876677607e-01 5.6073213873294614e-02 -3.4014308973892751e-02 + 15 3.1922038230522476e-02 9.8295314721195057e-03 -1.1966470952487746e-01 + 16 -5.2189856602250576e-02 -1.2154014338234553e-01 7.3781930151778169e-02 + 17 -4.1368004335324016e-01 8.7196340075264467e-01 -7.6220547504382663e-01 + 18 1.3959047510496031e-01 7.0273728786051104e-01 -4.2880450213821364e-01 + 19 -1.2073764490270647e-01 -4.4273905993924212e-01 2.2727648381069462e-01 + 20 -9.1024270602754434e-02 4.1820961074671939e-02 1.5737208729124524e-01 + 21 8.4018567420766091e-02 -2.1919260947637767e-01 -5.0638967445418503e-01 + 22 -8.4808406581946549e-02 1.7222319120223384e-01 2.8644210773617212e-01 + 23 -7.3803722181464818e-02 -1.7123414848426477e-01 2.9603622690956416e-01 + 24 -1.5687511678945418e-01 5.0269183876489443e-01 2.4272556319363958e-01 + 25 8.7949907645514802e-03 -2.3291170111515980e-01 9.9768489166636165e-02 + 26 1.5326708047237462e-02 -4.0392869905991208e-01 -1.3631522337860857e-01 + 27 -2.8313881941350294e-01 6.0861991277426597e-01 -2.7516392301985793e-01 + 28 1.9217325598129187e-01 -3.1106027014648929e-01 1.3846948667801418e-01 + 29 2.4423029751471897e-01 -2.5808366443428632e-01 1.9606181007606516e-01 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml new file mode 100644 index 0000000000..55a6da404f --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml @@ -0,0 +1,99 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 15:56:55 202 +epsilon: 7.5e-14 +prerequisites: ! | + atom full + pair lj/cut/coul/long/soft + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/cut/coul/long/soft 4.0 2.5 6.4 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 +natoms: 29 +init_vdwl: 0.0869868307797999 +init_coul: 26.4864428259304 +init_stress: ! |- + -9.1249731153318292e-01 -4.3877814604377434e+00 -3.1965493449598563e+00 1.5303690111499872e+00 -2.6633522920029479e-01 1.1862474435756334e+00 +init_forces: ! |2 + 1 2.4618266047458193e-01 -1.5940382283204185e-01 2.4155558227003238e-01 + 2 1.2587373850932029e-01 -3.1086105734708708e-01 -3.9047324262793526e-01 + 3 -3.0916873457587156e-03 3.9271403557591400e-03 9.9651765169532485e-03 + 4 -2.3426637135086047e-02 -8.1547099824937227e-05 -4.5622030716267553e-02 + 5 -8.2707462633545364e-02 6.6423051063919034e-02 1.2920676385370332e-03 + 6 1.4499775649930524e-01 -4.4588100280615017e-01 -1.8013970031681140e-01 + 7 -2.3245247559378984e-02 8.6094350835233757e-02 3.3413715941578892e-01 + 8 -2.3952197666733896e-01 5.2904463738824992e-01 1.2080573263293189e-01 + 9 2.5060076718488522e-01 -6.7492899232646697e-01 4.2045820528378786e-01 + 10 -2.3681443555748527e-02 3.2832366908848915e-02 -4.4683735351083630e-02 + 11 -1.1855812995113742e-01 1.3615969534588498e-01 -8.0561752772585357e-02 + 12 4.1602792670751687e-01 -8.3263145109828740e-02 2.1991194176357087e-01 + 13 1.6047767336155483e-02 -1.6635876713420081e-02 -2.4824906607395784e-02 + 14 -1.4256154796361231e-01 4.6258233384598231e-02 -4.3302042420722817e-02 + 15 4.7739057339461530e-02 1.9471508707134214e-03 -1.3072877777230024e-01 + 16 -3.9283342548712775e-02 -1.1040439854455730e-01 5.6699486568109955e-02 + 17 -3.9061378850130118e-01 8.5797065624286728e-01 -7.0932578071344110e-01 + 18 8.5212146330866934e-03 4.8420593893541936e-01 -3.4873254041374008e-01 + 19 -2.1144305898188220e-02 -2.8987251174401180e-01 3.3660765973885881e-01 + 20 -6.3046427794922519e-02 -1.7978003010661606e-01 2.6665057939597281e-01 + 21 3.9374535730357089e-02 3.7046537987975325e-01 -4.8103394696804652e-01 + 22 -2.6958113185458635e-03 -1.2419152480994021e-01 2.9910542026273873e-01 + 23 -1.0100173860966864e-01 -1.8247034601884243e-01 2.5970333402276663e-01 + 24 -5.8835572288822330e-02 6.0639529336859066e-01 -3.1554602852243341e-01 + 25 3.3443695220869429e-04 -2.7759220302422605e-01 9.7548995925899690e-02 + 26 -2.0747595243037077e-02 -3.6446483968192489e-01 1.3298520952659346e-01 + 27 -1.7556081111367022e-01 6.6578706971019974e-01 -2.5207147463850749e-01 + 28 1.5472943489635349e-01 -3.3071284636771298e-01 1.7192732481352638e-01 + 29 7.9294229865242635e-02 -3.3696681975738607e-01 7.7692084065202061e-02 +run_vdwl: 0.0864714816774496 +run_coul: 26.3541936197395 +run_stress: ! |- + -9.5943500509065494e-01 -4.3931838814803301e+00 -3.1566818906460279e+00 1.5039013339900946e+00 -3.0365435646198807e-01 1.1566928612390874e+00 +run_forces: ! |2 + 1 2.4523107562386903e-01 -1.6078569028728237e-01 2.3888244638374972e-01 + 2 1.1736624438051382e-01 -3.1162685052999267e-01 -3.8761966142324977e-01 + 3 -2.9397469229226845e-03 3.4449773659216186e-03 9.6382943011141982e-03 + 4 -2.1733581870825226e-02 9.5402178044510307e-05 -4.6004841478389714e-02 + 5 -8.1637510267219243e-02 6.6925991791127043e-02 8.5173798023068827e-04 + 6 1.4189806429437651e-01 -4.4079142217864081e-01 -1.7282595371707801e-01 + 7 -2.0301280063735605e-02 8.1257685497630808e-02 3.2277925971411670e-01 + 8 -2.3176063002636704e-01 5.2671227056062875e-01 1.2053172498561873e-01 + 9 2.4851503392872357e-01 -6.8279100291337380e-01 4.2797251627008076e-01 + 10 -2.4005564262187033e-02 3.2665494018744010e-02 -4.5205317316130401e-02 + 11 -1.1843278168067750e-01 1.3672928500970477e-01 -7.8857426677346534e-02 + 12 4.1600468540510127e-01 -8.1764456207382624e-02 2.1996745968645920e-01 + 13 1.4754680963957358e-02 -1.7373619613073755e-02 -2.4742031226991913e-02 + 14 -1.4295920510708943e-01 4.7017453379342669e-02 -4.1095731310254784e-02 + 15 4.9776498137740523e-02 -3.7008089405950011e-04 -1.3337066092899458e-01 + 16 -3.9452099323863399e-02 -1.1224129478450499e-01 5.6594683739796946e-02 + 17 -3.9249180832888381e-01 8.6969704011923854e-01 -7.1560967522838825e-01 + 18 -6.5742744649267340e-03 4.6998380753213276e-01 -3.2849033116391196e-01 + 19 2.9847873425093764e-03 -2.7345575965390795e-01 3.4516019021230460e-01 + 20 -7.0778812687921133e-02 -1.8121462217481474e-01 2.3808324070557918e-01 + 21 4.2629583866925107e-02 3.5412196658243855e-01 -4.7545781642782881e-01 + 22 1.1514494215742289e-02 -1.1066279119021936e-01 3.0020943897738017e-01 + 23 -1.1773303656546849e-01 -1.8142545543954808e-01 2.5204299074099740e-01 + 24 -6.8820300407286955e-02 6.0915783855578642e-01 -3.2115334328347539e-01 + 25 1.4340007371772712e-02 -2.7422588777471385e-01 1.1162318382843600e-01 + 26 -2.2422836566002184e-02 -3.6755159816117794e-01 1.2917531556408018e-01 + 27 -1.8401296920116900e-01 6.7135246775402002e-01 -2.4134247472235965e-01 + 28 1.6141537749494994e-01 -3.3249258592595410e-01 1.6748408084762209e-01 + 29 7.9625904720364071e-02 -3.4038856261611400e-01 7.0778700966832864e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml new file mode 100644 index 0000000000..6c07651895 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml @@ -0,0 +1,92 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 15:51:49 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair lj/cut/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: lj/cut/soft 4 6.0 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 +natoms: 29 +init_vdwl: -0.0428396313094945 +init_coul: 0 +init_stress: ! |- + -3.7150294178485088e-02 -4.4269784260765020e-02 -3.3385877908707000e-02 3.9789543272128278e-03 1.2200860941829079e-02 5.0820551468292834e-03 +init_forces: ! |2 + 1 4.9224162524551477e-03 2.8291375761555464e-04 6.2921883367334115e-04 + 2 1.7272698038469888e-05 -1.1415851814696374e-03 -5.2312656177721988e-06 + 3 1.4264025019128102e-03 1.0670241246148614e-03 8.8823185996196792e-04 + 4 -1.5351582371946068e-04 -6.6464966374252938e-04 -5.2747022361288671e-04 + 5 4.2651282018340729e-04 -1.7751836672482975e-03 9.8138832433461003e-05 + 6 4.3197974448043411e-03 -1.3553385964794743e-03 -1.3373791140605681e-04 + 7 4.3589904051316976e-04 9.2466450350160115e-04 -1.6552397633194191e-03 + 8 -2.1083557855005497e-03 3.6409278802919209e-03 -9.8323436709351090e-04 + 9 -1.1703129917679830e-04 4.1134378010949257e-04 -9.7055655087463846e-04 + 10 8.6106886415306702e-04 1.4154833814180021e-03 -1.2696443501403409e-03 + 11 3.2589582731943652e-04 5.0580076521930631e-05 -1.0017587887941793e-04 + 12 -7.1123025510864578e-04 1.0007821424977271e-03 2.3552928880589524e-04 + 13 -8.4725202507300612e-04 -5.5420138607068046e-04 4.7878510903822562e-04 + 14 -1.3737975460143903e-03 -1.5855292841502049e-04 1.2088359918586715e-03 + 15 -1.3520114228393171e-03 -1.8662678991490016e-04 2.9161125371913917e-04 + 16 -4.0093144958594642e-04 8.2601667166526827e-04 -1.4339054243482222e-03 + 17 -6.6674449131672443e-04 3.0050765302101507e-04 8.3850599216460841e-04 + 18 -2.7837913646803583e-03 -5.0375159218276058e-03 4.5434665115820254e-03 + 19 4.6855856198187366e-05 -4.5245890977836599e-05 2.8737799426088435e-04 + 20 -1.5950612939602811e-04 -1.6443955238598627e-04 6.3034524618327722e-05 + 21 -1.5545638660773022e-03 1.7249552099503390e-03 1.7682539203786847e-03 + 22 3.5872282225024178e-05 7.4026897323901746e-05 -9.8287608927810396e-06 + 23 -6.1795224018303338e-05 3.0466099928041098e-05 -4.9779152596896726e-05 + 24 -1.3080854318081583e-03 -1.5329920425676952e-03 -2.6335396655026966e-03 + 25 -3.7697708475401746e-04 -1.9022048335981935e-04 -7.2640697457896264e-04 + 26 -9.2571330695605020e-05 1.3904158824119836e-06 -1.1513624972069054e-04 + 27 1.1801272518921629e-03 8.4343877491515880e-04 -6.0291518540734278e-04 + 28 5.0297112779360527e-05 9.5876022121673079e-05 -2.0039893686618438e-05 + 29 1.9742577290027754e-05 1.1615471308058326e-04 -9.4148494816978075e-05 +run_vdwl: -0.0427945069849374 +run_coul: 0 +run_stress: ! |- + -3.7077026602753520e-02 -4.4304571891824726e-02 -3.3438830487491980e-02 4.0619773242517527e-03 1.2107484872063253e-02 5.0087996826964397e-03 +run_forces: ! |2 + 1 4.8779602458416489e-03 2.4167235416423243e-04 5.8194904228117369e-04 + 2 3.8219046216389241e-06 -1.1278571464746119e-03 -5.3194108737420112e-06 + 3 1.4420451326719666e-03 1.0789598971605156e-03 8.6688922192258515e-04 + 4 -1.1974684890799616e-04 -6.3663796799752221e-04 -5.0434813898866634e-04 + 5 4.1926845981048714e-04 -1.7686339999561645e-03 1.0539619591224379e-04 + 6 4.3576972844038084e-03 -1.3882149719460883e-03 -1.3616194080329750e-04 + 7 4.5212058755108350e-04 9.3883355301563895e-04 -1.6310591540156755e-03 + 8 -2.2302146046123414e-03 3.5790324521175637e-03 -9.7121760766989782e-04 + 9 -1.0550533635039201e-04 4.0156054939886621e-04 -9.5829490460631883e-04 + 10 8.5916672576631214e-04 1.4337462634341999e-03 -1.2745681621108272e-03 + 11 3.2696648572825849e-04 6.3517034152612753e-05 -1.0047641759833470e-04 + 12 -7.4690432551832698e-04 9.7559633855103531e-04 2.3309081974175655e-04 + 13 -8.1087278313617030e-04 -5.4431538064706191e-04 4.6238493027678620e-04 + 14 -1.3616269035648270e-03 -1.6114550030841903e-04 1.1930419316555066e-03 + 15 -1.2988356048942603e-03 -1.3783875198096138e-04 2.7166385519536635e-04 + 16 -4.0216418867975449e-04 8.2820608601573767e-04 -1.4197354103451449e-03 + 17 -6.5426067848996087e-04 2.9465377932046420e-04 8.4324801540805201e-04 + 18 -2.7890073788538919e-03 -5.0435458655068259e-03 4.5580195167431404e-03 + 19 3.3464587924712261e-05 -5.7671397258467865e-05 2.9174099395921818e-04 + 20 -1.4410679478107482e-04 -1.5109108725904223e-04 6.3206967430658374e-05 + 21 -1.5562595549768990e-03 1.7392533542833746e-03 1.7660916000341450e-03 + 22 3.3036353864837681e-05 7.1080653361986140e-05 -7.6107800450805168e-06 + 23 -6.1088350185363964e-05 2.9256205868140015e-05 -4.5685106771347217e-05 + 24 -1.3147368971916822e-03 -1.5225200528371987e-03 -2.6445898558296044e-03 + 25 -3.5875110481443001e-04 -1.8006883640044865e-04 -7.0409438339007896e-04 + 26 -1.0135572040521528e-04 -9.8728435343067203e-06 -1.1820795924276317e-04 + 27 1.1809009905794216e-03 8.4667862926581135e-04 -6.0614495192442251e-04 + 28 5.4684599143430459e-05 9.5202149420063522e-05 -1.5520338657392948e-05 + 29 1.4303717454981147e-05 1.1216450257687707e-04 -9.3688567688039523e-05 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml new file mode 100644 index 0000000000..254b45b510 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml @@ -0,0 +1,106 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:19:13 202 +epsilon: 1e-13 +prerequisites: ! | + atom full + pair lj/cut/tip4p/long/soft + kspace pppm/tip4p +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style pppm/tip4p 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/cut/tip4p/long/soft 5 2 5 1 0.15 4.0 2.5 6.4 10.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.0 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 + qdist 0 + typeO 0 + typeH 0 + typeA 0 + typeB 0 +natoms: 29 +init_vdwl: 0.0532418429363291 +init_coul: 25.1120046635773 +init_stress: ! |- + -1.1823845649927931e+00 -4.2392955721273395e+00 -3.0504224276732574e+00 1.3375722516580166e+00 -4.6999744312072966e-01 1.0363313128899019e+00 +init_forces: ! |2 + 1 2.2512096861770253e-01 -1.8740688078761694e-01 2.2052104900950886e-01 + 2 1.3173879266315808e-01 -3.0359264792129725e-01 -3.7090396697507122e-01 + 3 -1.0124603249607161e-02 3.5759536187944005e-03 1.1914742158738412e-02 + 4 -1.6174724330874829e-02 5.7365694343645306e-04 -3.9211679509312800e-02 + 5 -8.0384042907259701e-02 7.5435110635929878e-02 -6.5961708013806486e-03 + 6 1.3845160760155500e-01 -4.4881943529922014e-01 -1.7623589680851853e-01 + 7 -2.0701399583871505e-02 8.6382491102116030e-02 3.3190977616586281e-01 + 8 -2.2522995294845549e-01 5.3080940562691481e-01 1.1939264212236009e-01 + 9 2.4031945302819147e-01 -6.8341582181422422e-01 4.1191614908293128e-01 + 10 -2.8862978640523868e-02 3.0952590892756097e-02 -4.7641493042652042e-02 + 11 -1.2380846128110251e-01 1.4508525874750464e-01 -7.3513647803193471e-02 + 12 4.2350540832056610e-01 -8.8245613455054633e-02 2.1714097156647225e-01 + 13 1.1089241136062949e-02 -6.7703554742952910e-03 -2.6252357900869543e-02 + 14 -1.3915725295918299e-01 4.7623575951359652e-02 -4.0720822445464842e-02 + 15 4.7691737741476760e-02 -2.8484486688170035e-03 -1.3331698904199077e-01 + 16 -6.5720839951842080e-02 -9.5720083669349740e-02 8.3404349975140860e-02 + 17 -3.6848559949347010e-01 8.6366272148906253e-01 -7.1321686785098026e-01 + 18 8.3610843147371369e-03 4.8341177598296525e-01 -3.5186167592372880e-01 + 19 -2.0989444325957580e-02 -2.8996329236732543e-01 3.3842448506500600e-01 + 20 -6.2897495577854026e-02 -1.8216250555647226e-01 2.6861492030483108e-01 + 21 2.6667761816071455e-02 2.4610772454403823e-01 -3.1483931015868893e-01 + 22 1.0695109869553227e-01 -2.8187422421879341e-02 2.4837146666322471e-01 + 23 -1.8131317693295523e-01 -1.7012181853891384e-01 1.2626515451131032e-01 + 24 -2.2408122810289834e-02 4.0182710900117258e-01 -1.9972843596474568e-01 + 25 7.2496306885383888e-02 -1.2398014854290455e-01 8.9356605678754406e-02 + 26 -1.1843155896821461e-01 -3.0524787880164289e-01 3.2179839155708233e-02 + 27 -1.2560375316578029e-01 4.3585239984075247e-01 -1.6791098393172349e-01 + 28 2.1929824730708886e-01 -1.8521499231588329e-01 1.7256183204536221e-01 + 29 -4.1398301000284597e-02 -2.4960242874190633e-01 -1.0023685346890519e-02 +run_vdwl: 0.0528000604213919 +run_coul: 25.020401368015 +run_stress: ! |- + -1.2152682106213510e+00 -4.2383992440977636e+00 -3.0137001241100956e+00 1.3161599582310535e+00 -5.0255833152626950e-01 1.0102620792386101e+00 +run_forces: ! |2 + 1 2.2521603387743647e-01 -1.8768935702268316e-01 2.1886000788395826e-01 + 2 1.2340816471539112e-01 -3.0369376464518449e-01 -3.6875522119889853e-01 + 3 -9.9864462701352245e-03 2.9690554208496008e-03 1.1524202877801546e-02 + 4 -1.4728603073137763e-02 6.2827922080486195e-04 -3.9702747729673617e-02 + 5 -7.9292408907535597e-02 7.5862894949764198e-02 -7.0207335780499598e-03 + 6 1.3538119212001773e-01 -4.4364841265574684e-01 -1.6906101357078565e-01 + 7 -1.7710564831626134e-02 8.1461218390717835e-02 3.2061074065082196e-01 + 8 -2.1733155328519646e-01 5.2862513141878864e-01 1.1907694319246311e-01 + 9 2.3839745632641282e-01 -6.9119717534365765e-01 4.1971468039517601e-01 + 10 -2.9204353950307196e-02 3.0734531326734569e-02 -4.8221384800030243e-02 + 11 -1.2363687190505000e-01 1.4559085646736353e-01 -7.1753737579386037e-02 + 12 4.2351996560435773e-01 -8.6898582839451829e-02 2.1697353561224830e-01 + 13 9.6748041071259908e-03 -7.6716592550597216e-03 -2.5991964832502584e-02 + 14 -1.3960825609450481e-01 4.8558116820824400e-02 -3.8385674416581701e-02 + 15 4.9534988628362961e-02 -5.3091041865985103e-03 -1.3593867154429479e-01 + 16 -6.5198253620668667e-02 -9.7876170924149325e-02 8.2979949003467765e-02 + 17 -3.7104646597329349e-01 8.7500032779300763e-01 -7.1960058607560573e-01 + 18 -6.6967730021862118e-03 4.6923953918731032e-01 -3.3146459455844518e-01 + 19 3.1353838600166276e-03 -2.7351794216199476e-01 3.4689711564813464e-01 + 20 -7.0674586855426783e-02 -1.8364790640371656e-01 2.3996414120374035e-01 + 21 2.7268030087815295e-02 2.3399931058463413e-01 -3.0605349636359641e-01 + 22 1.1864259704565838e-01 -1.9118895956294703e-02 2.4611128870225038e-01 + 23 -1.9316245289829134e-01 -1.6826372577694942e-01 1.1892678284838995e-01 + 24 -2.8255860984460084e-02 3.9814298046803465e-01 -2.0115633039130043e-01 + 25 7.9352259442701759e-02 -1.1812225604002058e-01 9.9162084213316751e-02 + 26 -1.1769705717312680e-01 -3.0474249942492926e-01 2.7843846870852451e-02 + 27 -1.3066130483271576e-01 4.3788740168428864e-01 -1.6027445220157291e-01 + 28 2.2238377862636136e-01 -1.8583567315176039e-01 1.6966056472713356e-01 + 29 -4.1022840783995984e-02 -2.5146651794492630e-01 -1.4925274989030790e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_expand_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_expand_coul_long.yaml new file mode 100644 index 0000000000..29a2f86c48 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_expand_coul_long.yaml @@ -0,0 +1,99 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 08:37:39 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair lj/expand/coul/long + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/expand/coul/long 8.0 +pair_coeff: ! | + 1 1 0.02 2.0 0.2 + 2 2 0.005 0.9 0.05 + 2 4 0.005 0.5 0.0 + 3 3 0.02 3.0 0.1 + 4 4 0.015 2.8 0.2 + 5 5 0.015 3.0 0.1 +extract: ! | + epsilon 2 + sigma 2 + delta 2 + cut_coul 0 +natoms: 29 +init_vdwl: 869.656344368552 +init_coul: 225.821815126925 +init_stress: ! |2- + 2.5921580595929599e+03 2.4223089648929408e+03 6.9507399765892142e+03 -7.6459626076358222e+02 -1.7918244275053834e+02 1.1183600453689403e+03 +init_forces: ! |2 + 1 -4.7163194993221921e+01 2.2834247667596466e+02 3.4399687026134501e+02 + 2 1.7562443841600245e+02 1.4182973479795353e+02 -2.0831292146068489e+02 + 3 -1.2508615422916209e+02 -3.6798478249421532e+02 -1.3720477917795262e+02 + 4 -3.9145743460634925e+00 1.0488894945820071e+00 -2.9680205263326322e+00 + 5 -1.8403216196557828e+00 -1.4631790175600645e+00 6.0818528534738743e+00 + 6 -9.2216725524164417e+02 1.2287745546964902e+03 2.2653003222879815e+03 + 7 1.0275707795039158e+02 -5.6390694232542774e+02 -2.8553236422687523e+03 + 8 1.6813921559524184e+02 -1.4215967591199117e+02 3.8455917372053079e+02 + 9 9.1633373141575092e+01 9.1135118977716260e+01 3.9972970456422297e+02 + 10 5.5213457206939290e+02 -6.1976136814234292e+02 -1.8860732888734617e+02 + 11 -2.0653675404799192e+00 -1.9067213274695838e+00 -5.3629740928473808e+00 + 12 1.0622339756587413e+01 3.7670290663605148e+00 -1.8951373230563124e+00 + 13 3.7979473912697639e+00 -1.5435840347766145e+00 -2.4862388019885942e-01 + 14 -2.6935751635250607e+00 6.8698447653665595e-01 -4.3199669038668977e+00 + 15 2.5305893336076402e-01 3.8734449064195666e+00 4.3728299263740644e-01 + 16 7.2257309643596500e+02 -5.0816302107737170e+02 -1.9004596846603879e+03 + 17 -7.2145162953831516e+02 5.0721299277434184e+02 1.9029446585766536e+03 + 18 3.5593705560721056e-01 4.7720713300386546e+00 -7.8585034601445987e+00 + 19 1.9901810484621900e+00 -7.2114077843799396e-01 5.5216952988893828e+00 + 20 -2.9133092098729327e+00 -3.9873677744238525e+00 4.1253495034041823e+00 + 21 -1.0687319925822113e+02 -1.1890793959935895e+02 3.3030668807680365e+02 + 22 -1.6028118341131955e+02 -3.9850733869417056e+01 -2.4839117366825639e+02 + 23 2.6673946632604520e+02 1.5917281492245272e+02 -8.1412460602247450e+01 + 24 5.1622158551485391e+01 -3.1012002813557126e+02 1.6256339625935138e+02 + 25 -2.1901544438381163e+02 3.2814417155094908e+01 -1.8327904773796419e+02 + 26 1.6682970445882268e+02 2.7704983777814613e+02 2.0098819799158946e+01 + 27 7.8770042564417935e+01 -3.3142512544733739e+02 1.3455926026230580e+02 + 28 -2.6908794572326946e+02 1.1327040559793579e+02 -1.8145185065043862e+02 + 29 1.9071054496393484e+02 2.1815083728566805e+02 4.6871040843718049e+01 +run_vdwl: 106.16792769211 +run_coul: 232.783864793706 +run_stress: ! |2- + 5.4033888248203050e+02 5.4892480012296539e+02 2.8955268865699099e+02 -3.1667993938546078e+02 -5.9418517757321624e+01 1.4135196526059173e+02 +run_forces: ! |2 + 1 1.5042193015751637e+01 7.0524187021246291e+01 5.3102809431837898e+01 + 2 1.6025096019454882e+01 1.0007003422930383e+01 -2.1158888230513998e+01 + 3 -2.9508462511221728e+02 1.5540065134595568e+02 1.0032166848378883e+02 + 4 -4.6990135745775357e+00 1.7664562746630565e+00 -3.4155588447655587e+00 + 5 -1.6647491427755032e+00 -7.1384505520861741e-01 5.6231908788594200e+00 + 6 1.9229113379974908e+02 -1.6879183079864617e+02 -1.5821197940587550e+02 + 7 1.3268776214088212e+00 -3.0212070504821389e+00 -1.3945917603050320e+01 + 8 -3.0767948041849035e+01 3.3774723064931294e+01 4.1455210291132609e+01 + 9 1.0981624610986977e+01 3.5815171517217190e+00 4.2835213459206827e+01 + 10 7.0651343131573768e+01 -7.5364530217274577e+01 -6.2700552936028060e+01 + 11 -4.6552674358648485e+00 -3.3640968147579642e+00 -1.0071392966729430e+01 + 12 9.6965594010440821e+00 4.5621471489456713e+00 -2.1188025874175360e+00 + 13 3.5106358717622150e+00 -1.2472767160147971e+00 -3.8580287143749975e-01 + 14 -2.8511582585326667e+00 6.3130353605272560e-01 -3.6224095602913993e+00 + 15 -2.5947961667870077e-02 3.6550638292073843e+00 4.1732465355119469e-01 + 16 3.1351531521993351e+01 -4.3039259230988741e+01 1.7506976000755010e+01 + 17 -9.2563379856300898e+00 1.1242483524947740e+01 1.2152716943210445e+01 + 18 -5.9670106666608946e-01 4.9523970836146356e+00 -6.4763569969688159e+00 + 19 2.3605537941351202e+00 -1.0192980643878549e+00 5.4296196146473630e+00 + 20 -2.7295307430735738e+00 -3.9126961062803156e+00 3.4455294221899790e+00 + 21 -6.6351053993518860e+00 -5.6936051291677838e+00 2.5340192737673494e+01 + 22 -1.2600719852052331e+01 -3.7030527797125199e+00 -1.9178428988156423e+01 + 23 1.8521698071959683e+01 1.0087220143578394e+01 -5.2549329175309047e+00 + 24 8.9245861393053083e+00 -2.1746250247417159e+01 1.5024118744729005e+01 + 25 -2.1454838578353829e+01 2.4698375849765086e+00 -1.7961262545369252e+01 + 26 1.1612405148647868e+01 1.8957323157416415e+01 1.9242901272291062e+00 + 27 8.6191024303209324e-02 -2.3639345894753781e+01 6.2652733477098339e+00 + 28 -1.5812874994926165e+01 6.0673559816231579e+00 -1.0405039947171305e+01 + 29 1.6452388975462700e+01 1.7576623833281324e+01 4.0631922647850391e+00 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_expand_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_expand_coul_table.yaml new file mode 100644 index 0000000000..b427c7229e --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_expand_coul_table.yaml @@ -0,0 +1,99 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 08:37:46 202 +epsilon: 2e-13 +prerequisites: ! | + atom full + pair lj/expand/coul/long + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 16 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/expand/coul/long 8.0 +pair_coeff: ! | + 1 1 0.02 2.0 0.2 + 2 2 0.005 0.9 0.05 + 2 4 0.005 0.5 0.0 + 3 3 0.02 3.0 0.1 + 4 4 0.015 2.8 0.2 + 5 5 0.015 3.0 0.1 +extract: ! | + epsilon 2 + sigma 2 + delta 2 + cut_coul 0 +natoms: 29 +init_vdwl: 869.656344368552 +init_coul: 225.821851347828 +init_stress: ! |2- + 2.5921580798556824e+03 2.4223089706490100e+03 6.9507399900138435e+03 -7.6459625746898860e+02 -1.7918243325539206e+02 1.1183600494596001e+03 +init_forces: ! |2 + 1 -4.7163196497192146e+01 2.2834247625360311e+02 3.4399686846972884e+02 + 2 1.7562443791586878e+02 1.4182973406537658e+02 -2.0831292012253465e+02 + 3 -1.2508615412049755e+02 -3.6798478260953948e+02 -1.3720477930247748e+02 + 4 -3.9145743494796221e+00 1.0488899572714241e+00 -2.9680203360986748e+00 + 5 -1.8403214518471285e+00 -1.4631780700724715e+00 6.0818530886023696e+00 + 6 -9.2216725569750508e+02 1.2287745556395873e+03 2.2653003204922916e+03 + 7 1.0275707715277815e+02 -5.6390694237167190e+02 -2.8553236443303790e+03 + 8 1.6813921486566832e+02 -1.4215967617670751e+02 3.8455917576207537e+02 + 9 9.1633374940159385e+01 9.1135118386813176e+01 3.9972970646304736e+02 + 10 5.5213457218623114e+02 -6.1976136770574067e+02 -1.8860732949551110e+02 + 11 -2.0653676548734623e+00 -1.9067206261734890e+00 -5.3629739888026009e+00 + 12 1.0622339925344464e+01 3.7670291242792402e+00 -1.8951382266525523e+00 + 13 3.7979474711116428e+00 -1.5435841677028326e+00 -2.4862374988427219e-01 + 14 -2.6935753079358653e+00 6.8698435600643282e-01 -4.3199667618308677e+00 + 15 2.5305888243541896e-01 3.8734446145889341e+00 4.3728358791332234e-01 + 16 7.2257309763088028e+02 -5.0816302227466247e+02 -1.9004596843358918e+03 + 17 -7.2145162977104178e+02 5.0721299303460768e+02 1.9029446585142175e+03 + 18 3.5593760651461531e-01 4.7720712851654818e+00 -7.8585043264622421e+00 + 19 1.9901790463157074e+00 -7.2114219691675963e-01 5.5216951671183532e+00 + 20 -2.9133073882620311e+00 -3.9873665785059766e+00 4.1253505922291556e+00 + 21 -1.0687319963014248e+02 -1.1890793903453265e+02 3.3030668864705302e+02 + 22 -1.6028118611248254e+02 -3.9850735525595468e+01 -2.4839117530412136e+02 + 23 2.6673946951865724e+02 1.5917281609743972e+02 -8.1412459717501179e+01 + 24 5.1622158847869976e+01 -3.1012002774355045e+02 1.6256339581267164e+02 + 25 -2.1901544635946527e+02 3.2814415857796341e+01 -1.8327904858335660e+02 + 26 1.6682970674933870e+02 2.7704983923248733e+02 2.0098821433126425e+01 + 27 7.8770042449054543e+01 -3.3142512528162013e+02 1.3455926006838362e+02 + 28 -2.6908794843481189e+02 1.1327040466303316e+02 -1.8145185186649925e+02 + 29 1.9071054758730884e+02 2.1815083779493665e+02 4.6871042349543053e+01 +run_vdwl: 106.167927306934 +run_coul: 232.783872560844 +run_stress: ! |2- + 5.4033889185122246e+02 5.4892479679809765e+02 2.8955268188032755e+02 -3.1667993134714584e+02 -5.9418514448016722e+01 1.4135196542323126e+02 +run_forces: ! |2 + 1 1.5042191731528032e+01 7.0524187035940841e+01 5.3102809100251832e+01 + 2 1.6025095744488677e+01 1.0007002564822953e+01 -2.1158887488756886e+01 + 3 -2.9508462401688416e+02 1.5540064992154834e+02 1.0032166792537170e+02 + 4 -4.6990139078806985e+00 1.7664569920998929e+00 -3.4155586861921678e+00 + 5 -1.6647490390909379e+00 -7.1384403123709927e-01 5.6231913002355691e+00 + 6 1.9229113649576860e+02 -1.6879183322567181e+02 -1.5821198229106906e+02 + 7 1.3268779483228397e+00 -3.0212055830968931e+00 -1.3945914850434395e+01 + 8 -3.0767951196938704e+01 3.3774724457681103e+01 4.1455210935792906e+01 + 9 1.0981625491800322e+01 3.5815167138957573e+00 4.2835213672255946e+01 + 10 7.0651342880628548e+01 -7.5364529395568468e+01 -6.2700552629269403e+01 + 11 -4.6552675714512306e+00 -3.3640962703239836e+00 -1.0071392993905647e+01 + 12 9.6965597982755973e+00 4.5621468027776313e+00 -2.1188034676686951e+00 + 13 3.5106360312289651e+00 -1.2472769016775080e+00 -3.8580273777294372e-01 + 14 -2.8511586869301606e+00 6.3130344465834132e-01 -3.6224094710691888e+00 + 15 -2.5948083380200986e-02 3.6550635613088232e+00 4.1732526656150110e-01 + 16 3.1351530288856495e+01 -4.3039257792019207e+01 1.7506979549615181e+01 + 17 -9.2563361597161808e+00 1.1242483077205343e+01 1.2152712647114377e+01 + 18 -5.9670063451193034e-01 4.9523968092195076e+00 -6.4763579876532082e+00 + 19 2.3605517380981142e+00 -1.0192995004118002e+00 5.4296195197490729e+00 + 20 -2.7295289246110710e+00 -3.9126947888476593e+00 3.4455303030875251e+00 + 21 -6.6351057460657072e+00 -5.6936042652828442e+00 2.5340192741066605e+01 + 22 -1.2600721158161978e+01 -3.7030538274119085e+00 -1.9178429616278798e+01 + 23 1.8521699843022176e+01 1.0087220490406569e+01 -5.2549324889294233e+00 + 24 8.9245858291795237e+00 -2.1746249717816461e+01 1.5024117239152851e+01 + 25 -2.1454839054527017e+01 2.4698362443277517e+00 -1.7961262718374137e+01 + 26 1.1612406206864165e+01 1.8957323737221003e+01 1.9242912492915349e+00 + 27 8.6190447470516060e-02 -2.3639345383014803e+01 6.2652730906494423e+00 + 28 -1.5812876277619852e+01 6.0673551856385073e+00 -1.0405040442005870e+01 + 29 1.6452389982237243e+01 1.7576623643628043e+01 4.0631933291837985e+00 +... diff --git a/unittest/force-styles/tests/mol-pair-morse_smooth_linear.yaml b/unittest/force-styles/tests/mol-pair-morse_smooth_linear.yaml new file mode 100644 index 0000000000..ed6f0501fb --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-morse_smooth_linear.yaml @@ -0,0 +1,96 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Tue Aug 11 09:15:04 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair morse/smooth/linear +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +pair_style: morse/smooth/linear 8.0 +pair_coeff: ! "1 1 0.0202798941614106 2.78203488021395 2.725417159299 \n1 2 0.0101167811264648 + 3.9793050302425 1.90749569018897 \n1 3 0.0202934330695928 2.43948720203264 3.10711749999622 + \n1 4 0.0175731334238374 2.48316585521317 3.05258880102438 \n1 5 0.0175731334238374 + 2.48316585521317 3.05258880102438 \n2 2 0.00503064360487288 6.98433077606902 1.08960295117864 + \n2 3 0.0101296013842819 3.31380153807866 2.28919067558352 \n2 4 0.00497405122588691 + 14.0508902925745 0.544416409093563 \n2 5 0.00877114211614446 3.39491256196178 2.23466262511073 + \n3 3 0.0203039874239943 2.17204344301477 3.48881895084762 \n3 4 0.0175825321440736 + 2.20660439192238 3.43428999287994 \n3 5 0.0175825321440736 2.20660439192238 3.43428999287994 + \n4 4 0.0152259201379927 2.24227873774009 3.37976131582396 \n4 5 0.0152259201379927 + 2.24227873774009 3.37976131582396 \n5 5 0.0152259201379927 2.24227873774009 3.37976131582396 + \n" +extract: ! | + d0 2 + r0 2 + alpha 2 +natoms: 29 +init_vdwl: 110.576455574558 +init_coul: 0 +init_stress: ! |2- + 2.0965672593667708e+02 2.1015032692452459e+02 3.3202360755330801e+02 -3.7942655658588343e+01 2.3588817932865467e+01 3.0835767484464419e+01 +init_forces: ! |2 + 1 -3.0480780002327008e+00 2.7921984122028618e+01 3.5405528010927227e+01 + 2 1.7192246011451811e+01 1.4143557582376275e+01 -2.0236514220183114e+01 + 3 -1.4198382794249000e+01 -3.5992270842783007e+01 -1.4439948386213564e+01 + 4 -3.5571543955166662e+00 9.2208514241020678e-01 -2.5349681982497936e+00 + 5 -1.1301072607183411e+00 -1.9175172427659009e+00 5.0830194514203129e+00 + 6 -4.9081806263588575e+01 5.2933354037517596e+01 4.4324760767644200e+01 + 7 -6.5864013709165958e-01 -1.4367994435644658e+01 -9.1085601115349490e+01 + 8 1.1150805850946377e+00 -4.4339866650423687e+00 2.5401312718266635e+01 + 9 7.4783930937568188e+00 8.0676720298458289e+00 3.3115612041353316e+01 + 10 3.3188057609406087e+01 -4.4107423530419425e+01 -1.2533250685202610e+01 + 11 -9.8644754274471402e-01 -2.5309184692840789e+00 -4.1172191247102985e+00 + 12 7.4159396774726947e+00 3.1970602905033090e+00 -3.0999793772095403e+00 + 13 3.7535455067051284e+00 -1.4897927833271114e+00 -6.7477453438214360e-02 + 14 -1.5383546569690458e+00 3.0912292765196109e-01 -3.9556251540727660e+00 + 15 -8.5848623703835225e-02 3.9007406258082198e+00 1.3813013508321210e+00 + 16 2.9105971441820422e+01 -2.3344118296546768e+01 -6.1783781738583087e+01 + 17 -2.4933886705568032e+01 1.6819227323062634e+01 6.9127586364919054e+01 + 18 -2.0463150235275587e-02 -3.1682923586303320e-02 2.7190932368002206e-02 + 19 2.4436300234190135e-04 2.0012946485199428e-04 1.5669609108697242e-04 + 20 -2.8081912468459465e-04 -2.4223792822233381e-04 -4.8875919887793612e-05 + 21 -7.8515953056435253e+00 -9.3116035968764841e+00 2.6685440056459196e+01 + 22 -1.2867736365314238e+01 -3.1182930701545755e+00 -2.0188464470088331e+01 + 23 2.0716179059819009e+01 1.2433662272735450e+01 -6.4932678015133840e+00 + 24 5.1337007408372548e+00 -2.4468533130324765e+01 1.3657847418029165e+01 + 25 -1.7989393885078467e+01 2.8952531925571088e+00 -1.5124698757200122e+01 + 26 1.2846154844554052e+01 2.1568770430924985e+01 1.4520235362983340e+00 + 27 4.7651727706625060e+00 -2.6604514922840195e+01 9.9133238206128400e+00 + 28 -2.0185283324769507e+01 8.6749457166585184e+00 -1.3657622291951469e+01 + 29 1.5422773525965512e+01 1.7931256323978314e+01 3.7433644846642018e+00 +run_vdwl: 98.417588075604 +run_coul: 0 +run_stress: ! |2- + 1.9601417183585471e+02 1.9700368853406772e+02 2.9154296827992243e+02 -3.7890872102168025e+01 2.2194690018415880e+01 2.9595931426759432e+01 +run_forces: ! |2 + 1 -1.2307305201683669e+00 2.6447509305163727e+01 3.0470800924098523e+01 + 2 1.4299083308853650e+01 1.1826264766972807e+01 -1.6429998389881643e+01 + 3 -1.4157389063933350e+01 -3.1600856808471050e+01 -1.2693607969343061e+01 + 4 -3.3658701307181786e+00 8.8274427277102663e-01 -2.4548191756434177e+00 + 5 -1.0445920630425243e+00 -1.7759542240829833e+00 4.8041006652309290e+00 + 6 -4.3663249501195480e+01 4.6750257951934081e+01 3.2568897712249886e+01 + 7 -1.1941996581070721e-01 -1.2508303885030813e+01 -7.4567467003068529e+01 + 8 -2.8365183621696771e-01 -2.4283998406502945e+00 2.4825225007617721e+01 + 9 6.4234184377526304e+00 6.6360503245786022e+00 2.7951975394615243e+01 + 10 3.0610663078987621e+01 -4.1069619835647295e+01 -1.2566492949739969e+01 + 11 -9.5038761789038062e-01 -2.2898897341045954e+00 -3.7835192708263246e+00 + 12 7.2054253435572519e+00 3.1352360891284623e+00 -3.4732368787593755e+00 + 13 3.5724626043568888e+00 -1.3512903581673283e+00 -5.3544979313710710e-02 + 14 -1.3844723456086208e+00 2.2392513651771506e-01 -3.5288110784726916e+00 + 15 -1.6704585605001740e-01 3.8585136513780287e+00 1.4472031447069291e+00 + 16 2.5395501554353512e+01 -2.1203014586738636e+01 -5.1476843446578606e+01 + 17 -2.1108999005587926e+01 1.4497424828459637e+01 5.8945089304411582e+01 + 18 -2.0407885139876018e-02 -3.1613478806902184e-02 2.7095801901916405e-02 + 19 1.8505535479816727e-04 1.5148781843684435e-04 1.4466565142221593e-04 + 20 -2.1725919415478855e-04 -1.8964914225522977e-04 -3.4850592786958239e-05 + 21 -7.1560574272745390e+00 -7.8117417587142493e+00 2.3472474332002371e+01 + 22 -1.1620561455492469e+01 -2.9918169870657452e+00 -1.7768473787797753e+01 + 23 1.8773358904345674e+01 1.0807449396958578e+01 -5.7001611321217229e+00 + 24 5.8670774694819343e+00 -2.2854064241583384e+01 1.3389367814003592e+01 + 25 -1.7841968739230779e+01 2.5813803672129412e+00 -1.5089203819513493e+01 + 26 1.1965180636297607e+01 2.0268154831625505e+01 1.6847640847945964e+00 + 27 4.4982185784244653e+00 -2.3705161804550581e+01 8.3847128455906059e+00 + 28 -1.7971511747703875e+01 7.7287341777176994e+00 -1.1947618548178538e+01 + 29 1.3475957448492176e+01 1.5978120604518875e+01 3.5619815829562675e+00 +... diff --git a/unittest/force-styles/tests/mol-pair-morse_soft.yaml b/unittest/force-styles/tests/mol-pair-morse_soft.yaml new file mode 100644 index 0000000000..2eac54623b --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-morse_soft.yaml @@ -0,0 +1,102 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 17:10:43 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair morse/soft +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +pair_style: morse/soft 4 0.1 8.0 +pair_coeff: ! | + 1 1 0.0202798941614106 2.78203488021395 2.725417159299 0.5 + 1 2 0.0101167811264648 3.9793050302425 1.90749569018897 0.6 + 1 3 0.0202934330695928 2.43948720203264 3.10711749999622 0.7 + 1 4 0.0175731334238374 2.48316585521317 3.05258880102438 0.2 + 1 5 0.0175731334238374 2.48316585521317 3.05258880102438 0.7 + 2 2 0.00503064360487288 6.98433077606902 1.08960295117864 0.56 + 2 3 0.0101296013842819 3.31380153807866 2.28919067558352 0.82 + 2 4 0.00497405122588691 14.0508902925745 0.544416409093563 0.32 + 2 5 0.00877114211614446 3.39491256196178 2.23466262511073 0.41 + 3 3 0.0203039874239943 2.17204344301477 3.48881895084762 0.24 + 3 4 0.0175825321440736 2.20660439192238 3.43428999287994 0.37 + 3 5 0.0175825321440736 2.20660439192238 3.43428999287994 0.19 + 4 4 0.0152259201379927 2.24227873774009 3.37976131582396 0.64 + 4 5 0.0152259201379927 2.24227873774009 3.37976131582396 0.92 + 5 5 0.0152259201379927 2.24227873774009 3.37976131582396 0.44 +extract: ! | + d0 2 + r0 2 + alpha 2 + lambda 2 +natoms: 29 +init_vdwl: 108.878402738492 +init_coul: 0 +init_stress: ! |2- + 2.0616314640468093e+02 2.0694552515100577e+02 3.2253755241146825e+02 -3.7303720548619488e+01 2.3916353883528416e+01 2.9242881772029893e+01 +init_forces: ! |2 + 1 -3.0944212552810693e+00 2.7528431270297691e+01 3.5084878282204052e+01 + 2 1.7072811991139108e+01 1.4045271856538758e+01 -2.0095944568992625e+01 + 3 -1.4025085996867746e+01 -3.5538505512353709e+01 -1.4266146234771622e+01 + 4 -3.5376204321278601e+00 9.1664299228139023e-01 -2.5211044377337370e+00 + 5 -1.1241238069956936e+00 -1.9082029209833646e+00 5.0529865621374874e+00 + 6 -4.8218002152189477e+01 5.1606236050098254e+01 4.1142630587317633e+01 + 7 -7.7221049787055362e-01 -1.3638968099119190e+01 -8.7287023318719548e+01 + 8 9.7922852984742914e-01 -4.3872500720308913e+00 2.4854499288733074e+01 + 9 7.4225138545971374e+00 8.0074759576987375e+00 3.2868303191766280e+01 + 10 3.2682355772669943e+01 -4.3472141673678330e+01 -1.2345188879033808e+01 + 11 -9.8053636094008834e-01 -2.5162441168715972e+00 -4.0931585953339438e+00 + 12 7.3657281005189583e+00 3.1607948180645460e+00 -3.0753318573910082e+00 + 13 3.7333166161154954e+00 -1.4817905292870637e+00 -6.7097208092423047e-02 + 14 -1.5299206485919137e+00 3.0740619539499275e-01 -3.9337502375107878e+00 + 15 -8.5307685520786741e-02 3.8795827009966617e+00 1.3737663946108636e+00 + 16 2.7996640176038614e+01 -2.2546511796719816e+01 -5.8962960790633304e+01 + 17 -2.3854830997799155e+01 1.6068557300665013e+01 6.6255398581872612e+01 + 18 -2.0467423011750863e-02 -3.1694314292297306e-02 2.7201637979790010e-02 + 19 2.4436294301118436e-04 2.0012905845191923e-04 1.5669679663754508e-04 + 20 -2.8081950070034563e-04 -2.4223821049759885e-04 -4.8875367280606917e-05 + 21 -7.6736757358715622e+00 -9.1050363082586347e+00 2.6104871834050556e+01 + 22 -1.2588927402314571e+01 -3.0507263562631728e+00 -1.9751044277393568e+01 + 23 2.0259444216784011e+01 1.2159535351531510e+01 -6.3501150852564772e+00 + 24 5.0315681710043512e+00 -2.3929675288058473e+01 1.3365378575672175e+01 + 25 -1.7603333330572937e+01 2.8331030368741521e+00 -1.4800144896063490e+01 + 26 1.2562223515891764e+01 2.1092055586422212e+01 1.4199270940493447e+00 + 27 4.6456501792718932e+00 -2.6023140263358044e+01 9.6880319377243431e+00 + 28 -1.9732921668033161e+01 8.4805413222287829e+00 -1.3351550006152580e+01 + 29 1.5089940726667313e+01 1.7544294921333940e+01 3.6625786035313128e+00 +run_vdwl: 97.3341961541961 +run_coul: 0 +run_stress: ! |2- + 1.9319979778883916e+02 1.9434741743350793e+02 2.8510713154844848e+02 -3.7239727436617017e+01 2.2388547684685680e+01 2.8444127184772217e+01 +run_forces: ! |2 + 1 -1.2861689236158784e+00 2.6124775571833457e+01 3.0238621702044544e+01 + 2 1.4224150243987660e+01 1.1766201131718656e+01 -1.6341829843443257e+01 + 3 -1.3984995579871924e+01 -3.1285028739057193e+01 -1.2575280302967942e+01 + 4 -3.3473594528059039e+00 8.7703152903671666e-01 -2.4414113598418896e+00 + 5 -1.0397415103295957e+00 -1.7686521538234090e+00 4.7774139976666676e+00 + 6 -4.2965959632773547e+01 4.5788501008332908e+01 3.0780964589104197e+01 + 7 -2.2405319643293076e-01 -1.2029536192419945e+01 -7.2313478446117216e+01 + 8 -4.0905921418197766e-01 -2.3740611048794991e+00 2.4396591699082343e+01 + 9 6.3828517076449023e+00 6.5929945550547782e+00 2.7775326860615209e+01 + 10 3.0208911016544072e+01 -4.0556055803458612e+01 -1.2389739450444475e+01 + 11 -9.4367369401912182e-01 -2.2762320136153318e+00 -3.7598184234474146e+00 + 12 7.1589233203138241e+00 3.0988532310292505e+00 -3.4462702027649317e+00 + 13 3.5539607180805932e+00 -1.3442600631983403e+00 -5.3277726703797677e-02 + 14 -1.3774167613538149e+00 2.2280711633443001e-01 -3.5107835729532928e+00 + 15 -1.6599974080859461e-01 3.8380488820831258e+00 1.4394284632993852e+00 + 16 2.4655339294769281e+01 -2.0644459521071692e+01 -4.9673945184824333e+01 + 17 -2.0408955961303882e+01 1.3999678648125169e+01 5.7082432128988373e+01 + 18 -2.0415519764652862e-02 -3.1629865924393243e-02 2.7112886381819818e-02 + 19 1.8503878045281037e-04 1.5145652856423606e-04 1.4470529045297712e-04 + 20 -2.1726034031919374e-04 -1.8965028143025351e-04 -3.4849273244762223e-05 + 21 -7.0280784818649487e+00 -7.6737317981520885e+00 2.3064455189377767e+01 + 22 -1.1422385338560913e+01 -2.9414907058328290e+00 -1.7461807267673567e+01 + 23 1.8447200134551053e+01 1.0619117977690159e+01 -5.5988073260761881e+00 + 24 5.7575692689381226e+00 -2.2441828398210717e+01 1.3144700900274648e+01 + 25 -1.7520089936062256e+01 2.5322614167293449e+00 -1.4816077823942399e+01 + 26 1.1752809396468171e+01 1.9905032096165826e+01 1.6562984436553274e+00 + 27 4.4145736295533631e+00 -2.3292454132649759e+01 8.2354615899678194e+00 + 28 -1.7657926613336663e+01 7.5915269420119964e+00 -1.1738450553275785e+01 + 29 1.3246023047795436e+01 1.5702628579900875e+01 3.5020591780011472e+00 +... diff --git a/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml new file mode 100644 index 0000000000..c55d60adf9 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml @@ -0,0 +1,105 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 17:03:53 202 +epsilon: 1e-13 +prerequisites: ! | + atom full + pair hybrid/overlay + pair tip4p/long/soft + pair lj/cut +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style pppm/tip4p 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: hybrid/overlay tip4p/long/soft 5 2 5 1 0.15 4.0 2.5 10.0 lj/cut 8.0 +pair_coeff: ! | + 1 1 lj/cut 0.02 2.5 + 2 2 lj/cut 0.005 1.0 + 2 4 lj/cut 0.005 0.5 + 3 3 lj/cut 0.02 3.2 + 4 4 lj/cut 0.015 3.1 + 5 5 lj/cut 0.015 3.1 + * * tip4p/long/soft 0.83 +extract: ! | + qdist 0 + typeO 0 + typeH 0 + typeA 0 + typeB 0 + lambda 2 +natoms: 29 +init_vdwl: 8.07036960332134 +init_coul: 100.236229731909 +init_stress: ! |2- + 2.0560777882594444e+01 2.1654965423904063e+01 1.0056493693519297e+01 -2.4240063285208659e+00 -1.3467251681546395e+01 -1.4781331319647906e+01 +init_forces: ! |2 + 1 1.1274640438568120e+00 -2.7751438713476445e-01 1.8790157920119499e-01 + 2 -8.1752474659205140e-03 -1.2699647841871851e+00 -6.6459159127307632e-01 + 3 -1.0359163487629111e+01 1.0628743132498057e+01 6.9531443122386021e+00 + 4 -3.8774507719289648e-02 6.8713592138544667e-03 -1.1229959830689475e-01 + 5 -2.5662749622784636e-01 3.0016453264313309e-01 -3.0975775200070998e-02 + 6 1.0960634574125447e+01 -1.2382387659312155e+01 -8.0618970130884442e+00 + 7 -2.2832342249723914e-02 4.0208606857513818e-01 1.6920699571811064e+00 + 8 -6.8521757840727771e-01 2.0368233934687781e+00 9.7118125999477067e-01 + 9 7.4909470156608438e-01 -2.6744666902612630e+00 7.6981273184827481e-01 + 10 -2.6708236457335047e+01 -2.3350711235384516e+00 -3.2210899693251669e+00 + 11 -4.3462661520328849e-01 4.9338265093982914e-01 -2.5789183190888032e-01 + 12 1.8728378079288682e+01 1.6353733318327308e+01 -1.0844583731336934e+01 + 13 -2.4463327596094566e-02 1.2857926819797217e-02 -8.6110469907762582e-02 + 14 -4.9151265846168884e-01 1.7025446557900215e-01 -6.2082087769697814e-02 + 15 1.6354568305672246e-01 -7.7698250077885903e-02 -4.6974575369116089e-01 + 16 8.8587570764212451e+00 -1.4378065918299963e+01 1.5533451154012512e+01 + 17 -1.0936837040746663e+00 2.9076882464810643e+00 -3.0280186326297125e+00 + 18 1.4165835835894441e-01 2.1223098841030583e+00 -3.2865754977449257e+00 + 19 7.5955373016364403e-01 -4.4338928207346051e-01 2.3485104425164778e+00 + 20 -1.1613012874078987e+00 -1.6523434765045006e+00 1.7676741920085632e+00 + 21 6.0531811555082471e-01 1.3729063968893083e+00 -2.7923868706589650e+00 + 22 1.7600151197582461e+00 3.8208254002861425e-01 2.3799251532831041e+00 + 23 -2.5067133471709186e+00 -1.6128262839507992e+00 5.9072667161630799e-01 + 24 -4.3247234229563630e-01 2.8558353857286596e+00 -1.5284257874942948e+00 + 25 1.9422682067556065e+00 -2.8471459149302958e-01 1.5547858160286778e+00 + 26 -1.7355243132931133e+00 -2.6615580136173165e+00 -2.8544328258369955e-01 + 27 -6.6046529049546032e-01 3.0880567198108069e+00 -1.1428285831811784e+00 + 28 2.5715778047995865e+00 -9.5077350547568862e-01 1.6962019769146084e+00 + 29 -1.7484754906688658e+00 -2.1330220551799459e+00 -5.7043877074333793e-01 +run_vdwl: 7.24904956330063 +run_coul: 99.911855870525 +run_stress: ! |2- + 1.7268554752664841e+01 1.7311029436658394e+01 7.4057024614157427e+00 -2.3588244888881453e+00 -1.3227628622475972e+01 -1.2896658593010248e+01 +run_forces: ! |2 + 1 1.1278716657036829e+00 -2.6258678041342415e-01 1.9538437509672252e-01 + 2 -3.9676823681212982e-02 -1.2850233836949423e+00 -6.6803498770516612e-01 + 3 -9.4760567468241792e+00 9.6957989045886777e+00 6.2944176336550850e+00 + 4 -3.3168171571644096e-02 5.7704850010495169e-03 -1.1426546444723396e-01 + 5 -2.5048894068746391e-01 3.0038236609978475e-01 -3.3751199287618265e-02 + 6 1.0055350163583444e+01 -1.1431044936813379e+01 -7.3653563187915854e+00 + 7 -4.6209803855489368e-03 3.8543231435584174e-01 1.6515226454394019e+00 + 8 -6.5234607389721311e-01 2.0255440893673859e+00 9.5127903951105719e-01 + 9 7.4452791812005681e-01 -2.7066417590171179e+00 8.1503724100149588e-01 + 10 -2.3829098729829035e+01 -2.2599021701791333e+00 -2.6314817812596623e+00 + 11 -4.3274368894391779e-01 4.9145021406791028e-01 -2.4945411427223665e-01 + 12 1.6980364542766559e+01 1.4489682516099752e+01 -9.6372227483708528e+00 + 13 -3.0499236362302704e-02 8.5704383262029168e-03 -8.4575528296466557e-02 + 14 -4.8927749265401771e-01 1.7489541546329301e-01 -5.6958241413008877e-02 + 15 1.7309877483511280e-01 -8.8541792285525320e-02 -4.8073433757675438e-01 + 16 7.7170020069871450e+00 -1.2582802138795630e+01 1.3749590325801609e+01 + 17 -1.1014220836499897e+00 2.9517040521006654e+00 -3.0758280750634763e+00 + 18 -5.3109684989899320e-02 1.9235656396790723e+00 -3.1515066237287179e+00 + 19 9.2467038597949081e-01 -3.0844991584141779e-01 2.4155443336900446e+00 + 20 -1.1282027113852207e+00 -1.5870971471270534e+00 1.5624094409756832e+00 + 21 6.2530066466767331e-01 1.3012413310446329e+00 -2.7547234320822804e+00 + 22 1.8558491629776710e+00 4.4201627758048212e-01 2.3787636307402855e+00 + 23 -2.6209180821234201e+00 -1.6054037314698315e+00 5.5158435669485273e-01 + 24 -5.0167023518445786e-01 2.8919413595177517e+00 -1.5751546389610793e+00 + 25 2.0828183410931089e+00 -2.2433373855840710e-01 1.6879138663646718e+00 + 26 -1.7999157459828961e+00 -2.7490806231475635e+00 -3.5718231595876937e-01 + 27 -7.1445352480310931e-01 3.1361391652740100e+00 -1.1076521775768413e+00 + 28 2.6447579347741770e+00 -9.6083364912278246e-01 1.7125826632673491e+00 + 29 -1.7739426085325893e+00 -2.1723928021003038e+00 -6.2214756744651156e-01 +...