diff --git a/doc/src/Fortran.rst b/doc/src/Fortran.rst index 98e6194861..c40382bd1a 100644 --- a/doc/src/Fortran.rst +++ b/doc/src/Fortran.rst @@ -5,46 +5,58 @@ The :f:mod:`LIBLAMMPS` module provides an interface to call LAMMPS from Fortran. It is based on the LAMMPS C library interface and requires a fully Fortran 2003-compatible compiler to be compiled. It is designed to be self-contained and not require any support functions written in C, -C++, or Fortran other than those in the C library interface and the module -itself. +C++, or Fortran other than those in the C library interface and the +LAMMPS Fortran module itself. While C libraries have a defined binary interface (ABI) and can thus be -used from multiple compiler versions from different vendors as long -as they are compatible with the hosting operating system, the same is -not true for Fortran programs. Thus, the LAMMPS Fortran module needs to be +used from multiple compiler versions from different vendors as long as +they are compatible with the hosting operating system, the same is not +true for Fortran programs. Thus, the LAMMPS Fortran module needs to be compiled alongside the code using it from the source code in -``fortran/lammps.f90``. When linking, you also need to -:doc:`link to the LAMMPS library `. A typical command line -for a simple program using the Fortran interface would be: +``fortran/lammps.f90`` *and* with the same compiler used to build the +rest of the Fortran code that interfaces to LAMMPS. When linking, you +also need to :doc:`link to the LAMMPS library `. A typical +command line for a simple program using the Fortran interface would be: .. code-block:: bash mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps Please note that the MPI compiler wrapper is only required when the -calling the library from an MPI-parallelized program. Otherwise, using -the plain Fortran compiler (gfortran, ifort, flang, etc.) will suffice. -It may be necessary to link to additional libraries, depending on how -LAMMPS was configured and whether the LAMMPS library :doc:`was compiled -as a static or dynamic library `. +calling the library *from* an MPI-parallelized program. Otherwise, +using the plain Fortran compiler (gfortran, ifort, flang, etc.) will +suffice, since there are no direct references to MPI library features, +definitions and subroutine calls; MPI communicators are referred to by +their integer index representation as required by the Fortran MPI +interface. It may be necessary to link to additional libraries, +depending on how LAMMPS was configured and whether the LAMMPS library +:doc:`was compiled as a static or dynamic library `. If the LAMMPS library itself has been compiled with MPI support, the -resulting executable will still be able to run LAMMPS in parallel with -``mpirun``, ``mpiexec``, or equivalent. Please also note that the order -of the source files matters: the ``lammps.f90`` file needs to be -compiled first, since it provides the :f:mod:`LIBLAMMPS` module that is -imported by the Fortran code that uses the interface. A working example -can be found together with equivalent examples in C and C++ in the -``examples/COUPLE/simple`` folder of the LAMMPS distribution. +resulting executable will be able to run LAMMPS in parallel with +``mpirun``, ``mpiexec``, or equivalent. This may be either on the +"world" communicator or a sub-communicator created by the calling +Fortran code. If, on the other hand, the LAMMPS library has been +compiled **without** MPI support, each LAMMPS instance will run +independently using just one processor. -.. versionadded:: 9Oct2020 +Please also note that the order of the source files matters: the +``lammps.f90`` file needs to be compiled first, since it provides the +:f:mod:`LIBLAMMPS` module that would need to be imported by the calling +Fortran code in order to uses the Fortran interface. +A working example can be found together with equivalent examples in C and +C++ in the ``examples/COUPLE/simple`` folder of the LAMMPS distribution. + +.. versionchanged:: TBD .. note:: - A contributed Fortran interface that more closely resembles the C library - interface is available in the ``examples/COUPLE/fortran2`` folder. Please - see the ``README`` file in that folder for more information about it and how - to contact its author and maintainer. + A contributed Fortran interface interface is available in the + ``examples/COUPLE/fortran2`` folder. However, since the completion + of the :f:mod:`LIBLAMMPS` module, this interface is now deprecated, + no longer actively maintained and will likely be removed in the + future. Please see the ``README`` file in that folder for more + information about it and how to contact its author and maintainer. ---------- diff --git a/doc/src/fix_sgcmc.rst b/doc/src/fix_sgcmc.rst index 4a9c4b16e3..fd6f8beab4 100644 --- a/doc/src/fix_sgcmc.rst +++ b/doc/src/fix_sgcmc.rst @@ -131,7 +131,7 @@ the parameter *window_moves* (see Sect. III.B in :ref:`Sadigh1 ------------ Restart, fix_modify, output, run start/stop, minimize info -========================================================== +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to restart files. @@ -149,7 +149,7 @@ components of the vector represent the following quantities: * N+2: The current global concentration of species *X* (= number of atoms of type *N* / total number of atoms) Restrictions -============ +"""""""""""" This fix is part of the MC package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` @@ -169,7 +169,7 @@ execution i.e. it only works with a single MPI process. ------------ Default -======= +""""""" The optional parameters default to the following values: diff --git a/examples/COUPLE/README b/examples/COUPLE/README index d1e8f01c60..6dd3ddf100 100644 --- a/examples/COUPLE/README +++ b/examples/COUPLE/README @@ -37,8 +37,6 @@ lammps_quest MD with quantum forces, coupling to Quest DFT code lammps_spparks grain-growth Monte Carlo with strain via MD, coupling to SPPARKS kinetic MC code library collection of useful inter-code communication routines -fortran a simple wrapper on the LAMMPS library API that - can be called from Fortran fortran2 a more sophisticated wrapper on the LAMMPS library API that can be called from Fortran fortran_dftb wrapper written by Nir Goldman (LLNL), as an diff --git a/examples/COUPLE/fortran/README b/examples/COUPLE/fortran/README deleted file mode 100644 index f5a1dd873a..0000000000 --- a/examples/COUPLE/fortran/README +++ /dev/null @@ -1,11 +0,0 @@ -libfwrapper.c is a C file that wraps a few functions of the LAMMPS -library API in src/library.h so that it can be called from Fortran. - -See the couple/simple/simple_f77.f90 program for an example of a Fortran -code that does this. - -See the README file in that dir for instructions on how to build a -Fortran code that uses this wrapper and links to the LAMMPS library. - -This legacy wrapper is deprecated and will be removed in a future -release of LAMMPS. Please use the Fortran 90 module instead. diff --git a/examples/COUPLE/fortran/libfwrapper.c b/examples/COUPLE/fortran/libfwrapper.c deleted file mode 100644 index 6c44906a59..0000000000 --- a/examples/COUPLE/fortran/libfwrapper.c +++ /dev/null @@ -1,102 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org - - 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. -------------------------------------------------------------------------- */ - -/* libwrapper = fortran wrappers for LAMMPS library functions. - See README for compilation instructions */ - -#include "mpi.h" -#include "stdio.h" -#include "stdlib.h" -#include "string.h" -#include "stdint.h" -#include "library.h" /* this is a LAMMPS include file */ - -/* wrapper for creating a lammps instance from fortran. - since fortran has no simple way to emit a C-compatible - argument array, we don't support it. for simplicity, - the address of the pointer to the lammps object is - stored in a 64-bit integer on all platforms. */ - -void lammps_open_(MPI_Fint *comm, int64_t *ptr) -{ - *ptr = (int64_t) lammps_open_fortran(0,NULL,*comm); -} - -/* no-MPI version of the wrapper from above. */ - -void lammps_open_no_mpi_(int64_t *ptr) -{ - void *obj; - - lammps_open_no_mpi(0,NULL,&obj); - *ptr = (int64_t) obj; -} - -/* wrapper for shutting down a lammps instance from fortran. */ - -void lammps_close_(int64_t *ptr) -{ - void *obj; - obj = (void *) *ptr; - - lammps_close(obj); -} - -/* wrapper for passing an input file to lammps from fortran. - since fortran strings are not zero terminated, we have - to pass the length explicitly and make a copy that is. */ - -void lammps_file_(int64_t *ptr, char *fname, MPI_Fint *len) -{ - void *obj; - char *cpy; - - obj = (void *) *ptr; - - cpy = (char *)calloc(*len + 1,sizeof(char)); - memcpy(cpy,fname,*len); - - lammps_file(obj,cpy); - free(cpy); -} - -/* wrapper for passing a line input to lammps from fortran. - since fortran strings are not zero terminated, we have - to pass the length explicitly and make a copy that is. */ - -void lammps_command_(int64_t *ptr, char *line, MPI_Fint *len) -{ - void *obj; - char *cpy; - - obj = (void *) *ptr; - - cpy = (char *)calloc(*len + 1,sizeof(char)); - memcpy(cpy,line,*len); - - lammps_command(obj,cpy); - free(cpy); -} - -/* fortran wrapper to get the number of atoms from lammps. - return values require an interface in fortran, so we - make the wrapper into a procedure. */ - -void lammps_get_natoms_(int64_t *ptr, MPI_Fint *natoms) -{ - void *obj; - obj = (void *) *ptr; - - *natoms = lammps_get_natoms(obj); -} - diff --git a/examples/COUPLE/fortran2/LAMMPS.F90 b/examples/COUPLE/fortran2/LAMMPS.F90 index 86e5a4ba2d..2f4ae2c95e 100644 --- a/examples/COUPLE/fortran2/LAMMPS.F90 +++ b/examples/COUPLE/fortran2/LAMMPS.F90 @@ -1,7 +1,7 @@ !! ----------------------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! www.cs.sandia.gov/~sjplimp/lammps.html -! Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories +! LAMMPS Development team: developers@lammps.org ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract ! DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -17,6 +17,15 @@ ! Updated October 2020 by the author (now at the University of Missouri). !-------------------------------------------------------------------------- +!! NOTE ------------------------------------------------------------------- +! This interface is obsolete and may be removed in a future release of +! LAMMPS. The interface in fortran/lammps.f90 replaces this one. That API +! is maintained by the LAMMPS developers and has documentation written for +! it; it is based loosely on this one, but binds all procedures to a lammps +! derived type. That interface was written in large +! part by the same author, but is also supported by other developers. +!-------------------------------------------------------------------------- + !! LAMMPS, a Fortran 2003 module containing an interface between Fortran !! programs and the C-style functions in library.cpp that ship with LAMMPS. !! This file should be accompanied by LAMMPS-wrapper.cpp and LAMMPS-wrapper.h, diff --git a/examples/COUPLE/fortran2/Makefile b/examples/COUPLE/fortran2/Makefile index f8a2126233..8ac957a4c1 100644 --- a/examples/COUPLE/fortran2/Makefile +++ b/examples/COUPLE/fortran2/Makefile @@ -17,6 +17,10 @@ CXXFLAGS = -O2 -fPIC CPPFLAGS = -DOMPI_SKIP_MPICXX=1 -DMPICH_SKIP_MPICXX all : liblammps_fortran.a liblammps_fortran.so + @echo "WARNING: this Fortran interface is obsolete and is no longer +maintained. See $(LAMMPS_ROOT)/fortran for the new, maintained interface +(largely written by the same author). You may continue to use this interface if +desired, but it may eventually be removed from LAMMPS." liblammps_fortran.so : LAMMPS.o LAMMPS-wrapper.o $(FC) $(FFLAGS) -shared -o $@ $^ $(CXXLIB) diff --git a/examples/COUPLE/fortran2/README b/examples/COUPLE/fortran2/README index 3f88d60750..b36cb43746 100644 --- a/examples/COUPLE/fortran2/README +++ b/examples/COUPLE/fortran2/README @@ -1,3 +1,12 @@ +!! NOTE ------------------------------------------------------------------- +! This interface is obsolete and may be removed in a future release of +! LAMMPS. The interface in fortran/lammps.f90 replaces this one. That API +! is maintained by the LAMMPS developers and has documentation written for +! it; it is based loosely on this one, but binds all procedures to a lammps +! derived type. That interface was written in large +! part by the same author, but is also supported by other developers. +!-------------------------------------------------------------------------- + LAMMPS.F90 defines a Fortran 2003 module, LAMMPS, which wraps all functions in src/library.h so they can be used directly from Fortran-encoded programs. diff --git a/examples/COUPLE/simple/README b/examples/COUPLE/simple/README index 61ee0c324e..2ab0407dea 100644 --- a/examples/COUPLE/simple/README +++ b/examples/COUPLE/simple/README @@ -8,9 +8,8 @@ code to perform a coupled calculation. simple.cpp is the C++ driver simple.c is the C driver simple.f90 is the Fortran driver using the new Fortran module -simple_f77.f90 is the Fortran driver using the legacy Fortran wrapper -The 4 codes do the same thing, so you can compare them to see how to +The 3 codes do the same thing, so you can compare them to see how to drive LAMMPS from each language. See python/example/simple.py to do something similar from Python. The new Fortran driver requires a Fortran module that uses the Fortran 03 ISO_C_BINDING module to @@ -45,12 +44,7 @@ the fortran directory: mpifort -L${HOME}/lammps/src ../../../fortran/lammps.f90 simple.f90 -llammps -o simpleF -This builds the legacy Fortran wrapper and driver with the LAMMPS library -using the mpifort (Fortran) MPI compiler wrapper (assuming GNU gfortran). - -mpifort -std=legacy -L${HOME}/lammps/src ../fortran/libfwrapper.c simple.f90 -llammps -o simpleF77 - -You then run simpleCC, simpleC, simpleF, or simpleF77 on a parallel machine +You then run simpleCC, simpleC, or simpleF on a parallel machine on some number of processors Q with 2 arguments: % mpirun -np Q simpleCC P in.lj @@ -72,8 +66,7 @@ of LAMMPS. You could add any functions you wish to this file to manipulate LAMMPS data however you wish. The Fortran driver is using the Fortran 03 module which uses a derived -type with type bound subroutines. Only a small subset of the C library -functions are currently accessible through the Fortran module. +type with type bound subroutines. The C++ driver does the same thing, except that it instantiates LAMMPS as an object first. Some of the functions in src/library.cpp can be diff --git a/examples/COUPLE/simple/simple_f77.f90 b/examples/COUPLE/simple/simple_f77.f90 deleted file mode 100644 index ac1c03f061..0000000000 --- a/examples/COUPLE/simple/simple_f77.f90 +++ /dev/null @@ -1,125 +0,0 @@ -! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! https://www.lammps.org/, Sandia National Laboratories -! LAMMPS development team: developers@lammps.org -! -! 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. - -! f_driver = simple example of how an umbrella program -! can invoke LAMMPS as a library on some subset of procs -! Syntax: simpleF P in.lammps -! P = # of procs to run LAMMPS on -! must be <= # of procs the driver code itself runs on -! in.lammps = LAMMPS input script -! See README for compilation instructions - -PROGRAM f_driver - IMPLICIT NONE - INCLUDE 'mpif.h' - - INTEGER, PARAMETER :: fp=20 - INTEGER :: n, narg, ierr, me, nprocs, natoms - INTEGER :: lammps, nprocs_lammps, comm_lammps - INTEGER (kind=8) :: ptr - - REAL (kind=8), ALLOCATABLE :: x(:) - REAL (kind=8), PARAMETER :: epsilon=0.1 - - CHARACTER (len=64) :: arg - CHARACTER (len=1024) :: line - - ! setup MPI and various communicators - ! driver runs on all procs in MPI_COMM_WORLD - ! comm_lammps only has 1st P procs (could be all or any subset) - - CALL mpi_init(ierr) - - narg = command_argument_count() - - IF (narg /= 2) THEN - PRINT *, 'Syntax: simpleF P in.lammps' - CALL mpi_abort(MPI_COMM_WORLD,1,ierr) - END IF - - CALL mpi_comm_rank(MPI_COMM_WORLD,me,ierr); - CALL mpi_comm_size(MPI_COMM_WORLD,nprocs,ierr); - - CALL get_command_argument(1,arg) - READ (arg,'(I10)') nprocs_lammps - - IF (nprocs_lammps > nprocs) THEN - IF (me == 0) THEN - PRINT *, 'ERROR: LAMMPS cannot use more procs than available' - CALL mpi_abort(MPI_COMM_WORLD,2,ierr) - END IF - END IF - - lammps = 0 - IF (me < nprocs_lammps) THEN - lammps = 1 - ELSE - lammps = MPI_UNDEFINED - END IF - - CALL mpi_comm_split(MPI_COMM_WORLD,lammps,0,comm_lammps,ierr) - - ! open LAMMPS input script on rank zero - - CALL get_command_argument(2,arg) - OPEN(UNIT=fp, FILE=arg, ACTION='READ', STATUS='OLD', IOSTAT=ierr) - IF (ierr /= 0) THEN - PRINT *, 'ERROR: Could not open LAMMPS input script' - CALL mpi_abort(MPI_COMM_WORLD,3,ierr); - END IF - - ! run the input script thru LAMMPS one line at a time until end-of-file - ! driver proc 0 reads a line, Bcasts it to all procs - ! (could just send it to proc 0 of comm_lammps and let it Bcast) - ! all LAMMPS procs call lammps_command() on the line */ - - IF (lammps == 1) CALL lammps_open(comm_lammps,ptr) - - n = 0 - DO - IF (me == 0) THEN - READ (UNIT=fp, FMT='(A)', IOSTAT=ierr) line - n = 0 - IF (ierr == 0) THEN - n = LEN(TRIM(line)) - IF (n == 0 ) THEN - line = ' ' - n = 1 - END IF - END IF - END IF - CALL mpi_bcast(n,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr) - IF (n == 0) EXIT - CALL mpi_bcast(line,n,MPI_CHARACTER,0,MPI_COMM_WORLD,ierr) - IF (lammps == 1) CALL lammps_command(ptr,line,n) - END DO - CLOSE(UNIT=fp) - - ! run 10 more steps followed by a single step */ - - IF (lammps == 1) THEN - CALL lammps_command(ptr,'run 10',6) - - CALL lammps_get_natoms(ptr,natoms) - print*,'natoms=',natoms - - CALL lammps_command(ptr,'run 1',5); - END IF - - ! free LAMMPS object - - IF (lammps == 1) CALL lammps_close(ptr); - - ! close down MPI - - CALL mpi_finalize(ierr) - -END PROGRAM f_driver diff --git a/fortran/lammps.f90 b/fortran/lammps.f90 index e25b5ec206..de25200d87 100644 --- a/fortran/lammps.f90 +++ b/fortran/lammps.f90 @@ -333,6 +333,10 @@ MODULE LIBLAMMPS CLASS(*), POINTER :: caller => NULL() CLASS(lammps), POINTER :: lammps_instance => NULL() END TYPE fix_external_data + ! constructor to make Fortran 2003 compilers happy (F2008 should be OK) + INTERFACE fix_external_data + MODULE PROCEDURE construct_fix_external_data + END INTERFACE fix_external_data ! Array used to store Fortran-facing callback functions for fix external TYPE(fix_external_data), DIMENSION(:), ALLOCATABLE, TARGET, SAVE :: ext_data @@ -1250,9 +1254,9 @@ CONTAINS CALL C_F_POINTER(Catomptr(1), peratom_data%r64_mat, [nrows,ncols]) CASE (-1) CALL lmp_error(self, LMP_ERROR_ALL + LMP_ERROR_WORLD, & - 'per-atom property ' // name // 'not found in extract_setting') + 'per-atom property ' // name // ' not found in extract_setting') CASE DEFAULT - error_msg = '' + error_msg = ' ' WRITE(error_msg,'(A,I0,A)') 'return value ', datatype, & ' from lammps_extract_atom_datatype not known [Fortran/extract_atom]' CALL lmp_error(self, LMP_ERROR_ALL + LMP_ERROR_WORLD, error_msg) @@ -2428,7 +2432,7 @@ CONTAINS CHARACTER(LEN=1, KIND=c_char), DIMENSION(LEN(buffer)+1), TARGET :: Cbuffer TYPE(c_ptr) :: ptr - buffer = '' + buffer = ' ' buf_size = LEN(buffer, KIND=c_int) + 1_c_int ptr = C_LOC(Cbuffer(1)) CALL lammps_get_os_info(ptr, INT(buf_size, KIND=c_int)) @@ -2507,7 +2511,7 @@ CONTAINS Cidx = idx - 1 Cptr = C_LOC(Cbuffer(1)) Csuccess = lammps_config_package_name(Cidx, Cptr, LEN(buffer)+1) - buffer = '' + buffer = ' ' IF (Csuccess /= 0_c_int) THEN buffer = array2string(Cbuffer) ELSE @@ -2566,7 +2570,7 @@ CONTAINS CHARACTER(LEN=1, KIND=c_char), DIMENSION(LEN(buffer)+1), TARGET :: Cbuffer TYPE(c_ptr) :: Cptr - buffer = '' + buffer = ' ' buf_size = LEN(buffer) + 1 Cptr = C_LOC(Cbuffer) CALL lammps_get_gpu_device_info(Cptr, buf_size) @@ -2609,7 +2613,7 @@ CONTAINS CHARACTER(LEN=1, KIND=c_char), DIMENSION(LEN(buffer)+1), TARGET :: Cbuffer TYPE(c_ptr) :: Ccategory, Cptr - buffer = '' + buffer = ' ' buf_size = LEN(buffer, KIND=c_int) + 1_c_int Ccategory = f2c_string(category) Cptr = C_LOC(Cbuffer) @@ -2660,7 +2664,7 @@ CONTAINS TYPE(c_ptr) :: Ccategory, Cptr CHARACTER(LEN=1, KIND=c_char), DIMENSION(LEN(buffer)+1), TARGET :: Cbuffer - buffer = '' + buffer = ' ' Ccategory = f2c_string(category) buf_size = LEN(buffer, KIND=c_int) Cptr = C_LOC(Cbuffer(1)) @@ -2690,8 +2694,8 @@ CONTAINS stylebuf = c2f_string(Cstylebuf) namebuf = c2f_string(Cnamebuf) ELSE - stylebuf = '' - namebuf = '' + stylebuf = ' ' + namebuf = ' ' CALL lmp_error(self, LMP_ERROR_WARNING + LMP_ERROR_WORLD, & 'call to lammps_plugin_name failed [Fortran/plugin_name]') END IF @@ -2786,6 +2790,12 @@ CONTAINS END IF END SUBROUTINE lmp_decode_image_flags_bigbig + ! constructor for fix_external_data that avoids a warning with Fortran 2003 + ! compilers + TYPE(fix_external_data) FUNCTION construct_fix_external_data() + construct_fix_external_data%id = ' ' + END FUNCTION construct_fix_external_data + ! equivalent function to lammps_set_fix_external_callback for -DSMALLSMALL ! note that "caller" is wrapped into a fix_external_data derived type along ! with the fix id and the Fortran calling function. @@ -3033,7 +3043,7 @@ CONTAINS &[Fortran/fix_external_set_energy_peratom]') END IF Cid = f2c_string(id) - Ceng = C_LOC(eng) + Ceng = C_LOC(eng(1)) CALL lammps_fix_external_set_energy_peratom(self%handle, Cid, Ceng) CALL lammps_free(Cid) END SUBROUTINE lmp_fix_external_set_energy_peratom @@ -3125,7 +3135,7 @@ CONTAINS CHARACTER(LEN=1, KIND=c_char), DIMENSION(LEN(buffer)+1), TARGET :: Cbuffer TYPE(c_ptr) :: Cptr - buffer = '' + buffer = ' ' IF (lmp_has_error(self)) THEN buflen = LEN(buffer, KIND=c_int) + 1_c_int Cptr = C_LOC(Cbuffer(1)) @@ -3135,7 +3145,7 @@ CONTAINS status = Cstatus END IF ELSE - buffer = '' + buffer = ' ' IF (PRESENT(status)) THEN status = 0 END IF @@ -3401,7 +3411,7 @@ CONTAINS INTEGER :: n IF (.NOT. C_ASSOCIATED(ptr)) THEN - f_string = '' + f_string = ' ' ELSE n = INT(c_strlen(ptr), KIND=KIND(n)) CALL C_F_POINTER(ptr, c_string, [n+1]) diff --git a/lib/gpu/lal_dpd.cpp b/lib/gpu/lal_dpd.cpp index f890fb53a3..1f5209852b 100644 --- a/lib/gpu/lal_dpd.cpp +++ b/lib/gpu/lal_dpd.cpp @@ -99,16 +99,25 @@ int DPDT::init(const int ntypes, cutsq.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY); this->atom->type_pack1(ntypes,lj_types,cutsq,host_rsq,host_cutsq); + double special_sqrt[4]; + special_sqrt[0] = sqrt(host_special_lj[0]); + special_sqrt[1] = sqrt(host_special_lj[1]); + special_sqrt[2] = sqrt(host_special_lj[2]); + special_sqrt[3] = sqrt(host_special_lj[3]); + UCL_H_Vec dview; sp_lj.alloc(4,*(this->ucl_device),UCL_READ_ONLY); dview.view(host_special_lj,4,*(this->ucl_device)); ucl_copy(sp_lj,dview,false); + sp_sqrt.alloc(4,*(this->ucl_device),UCL_READ_ONLY); + dview.view(special_sqrt,4,*(this->ucl_device)); + ucl_copy(sp_sqrt,dview,false); _tstat_only = 0; if (tstat_only) _tstat_only=1; _allocated=true; - this->_max_bytes=coeff.row_bytes()+cutsq.row_bytes()+sp_lj.row_bytes(); + this->_max_bytes=coeff.row_bytes()+cutsq.row_bytes()+sp_lj.row_bytes()+sp_sqrt.row_bytes(); return 0; } @@ -121,6 +130,7 @@ void DPDT::clear() { coeff.clear(); cutsq.clear(); sp_lj.clear(); + sp_sqrt.clear(); this->clear_atomic(); } @@ -144,7 +154,7 @@ int DPDT::loop(const int eflag, const int vflag) { this->time_pair.start(); if (shared_types) { this->k_pair_sel->set_size(GX,BX); - this->k_pair_sel->run(&this->atom->x, &coeff, &sp_lj, + this->k_pair_sel->run(&this->atom->x, &coeff, &sp_lj, &sp_sqrt, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->v, &cutsq, @@ -152,7 +162,7 @@ int DPDT::loop(const int eflag, const int vflag) { &this->_tstat_only, &this->_threads_per_atom); } else { this->k_pair.set_size(GX,BX); - this->k_pair.run(&this->atom->x, &coeff, &_lj_types, &sp_lj, + this->k_pair.run(&this->atom->x, &coeff, &_lj_types, &sp_lj, &sp_sqrt, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->atom->v, &cutsq, &this->_dtinvsqrt, diff --git a/lib/gpu/lal_dpd.cu b/lib/gpu/lal_dpd.cu index 2794110a92..0c861f51de 100644 --- a/lib/gpu/lal_dpd.cu +++ b/lib/gpu/lal_dpd.cu @@ -165,6 +165,7 @@ __kernel void k_dpd(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict coeff, const int lj_types, const __global numtyp *restrict sp_lj, + const __global numtyp *restrict sp_sqrt, const __global int * dev_nbor, const __global int * dev_packed, __global acctyp4 *restrict ans, @@ -200,11 +201,12 @@ __kernel void k_dpd(const __global numtyp4 *restrict x_, numtyp4 iv; fetch4(iv,i,vel_tex); //v_[i]; int itag=iv.w; - numtyp factor_dpd; + numtyp factor_dpd, factor_sqrt; for ( ; nbor { UCL_D_Vec cutsq; /// Special LJ values - UCL_D_Vec sp_lj; + UCL_D_Vec sp_lj, sp_sqrt; /// If atom type constants fit in shared memory, use fast kernels bool shared_types; diff --git a/src/DPD-BASIC/pair_dpd.cpp b/src/DPD-BASIC/pair_dpd.cpp index ef7b87d8c9..5771831e02 100644 --- a/src/DPD-BASIC/pair_dpd.cpp +++ b/src/DPD-BASIC/pair_dpd.cpp @@ -68,7 +68,7 @@ void PairDPD::compute(int eflag, int vflag) int i,j,ii,jj,inum,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; double vxtmp,vytmp,vztmp,delvx,delvy,delvz; - double rsq,r,rinv,dot,wd,randnum,factor_dpd; + double rsq,r,rinv,dot,wd,randnum,factor_dpd,factor_sqrt; int *ilist,*jlist,*numneigh,**firstneigh; evdwl = 0.0; @@ -105,6 +105,7 @@ void PairDPD::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_sqrt[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x[j][0]; @@ -127,11 +128,13 @@ void PairDPD::compute(int eflag, int vflag) // conservative force = a0 * wd // drag force = -gamma * wd^2 * (delx dot delv) / r // random force = sigma * wd * rnd * dtinvsqrt; + // random force must be scaled by sqrt(factor_dpd) fpair = a0[itype][jtype]*wd; fpair -= gamma[itype][jtype]*wd*wd*dot*rinv; - fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt; - fpair *= factor_dpd*rinv; + fpair *= factor_dpd; + fpair += factor_sqrt*sigma[itype][jtype]*wd*randnum*dtinvsqrt; + fpair *= rinv; f[i][0] += delx*fpair; f[i][1] += dely*fpair; @@ -263,6 +266,10 @@ void PairDPD::init_style() error->warning(FLERR, "Pair dpd needs newton pair on for momentum conservation"); neighbor->add_request(this); + + // precompute random force scaling factors + + for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]); } /* ---------------------------------------------------------------------- diff --git a/src/DPD-BASIC/pair_dpd.h b/src/DPD-BASIC/pair_dpd.h index 7d99726c7b..08427d780e 100644 --- a/src/DPD-BASIC/pair_dpd.h +++ b/src/DPD-BASIC/pair_dpd.h @@ -43,6 +43,7 @@ class PairDPD : public Pair { protected: double cut_global, temperature; + double special_sqrt[4]; int seed; double **cut; double **a0, **gamma; diff --git a/src/DPD-BASIC/pair_dpd_ext.cpp b/src/DPD-BASIC/pair_dpd_ext.cpp index de66ab2a9a..623b16774c 100644 --- a/src/DPD-BASIC/pair_dpd_ext.cpp +++ b/src/DPD-BASIC/pair_dpd_ext.cpp @@ -73,7 +73,8 @@ void PairDPDExt::compute(int eflag, int vflag) int i,j,ii,jj,inum,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpairx,fpairy,fpairz,fpair; double vxtmp,vytmp,vztmp,delvx,delvy,delvz; - double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz,factor_dpd; + double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz; + double prefactor_g,prefactor_s,factor_dpd,factor_sqrt; double P[3][3]; int *ilist,*jlist,*numneigh,**firstneigh; @@ -111,6 +112,7 @@ void PairDPDExt::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_sqrt[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x[j][0]; @@ -154,33 +156,26 @@ void PairDPDExt::compute(int eflag, int vflag) // drag force - parallel fpair -= gamma[itype][jtype]*wdPar*wdPar*dot*rinv; + fpair *= factor_dpd; // random force - parallel - fpair += sigma[itype][jtype]*wdPar*randnum*dtinvsqrt; + fpair += factor_sqrt*sigma[itype][jtype]*wdPar*randnum*dtinvsqrt; fpairx = fpair*rinv*delx; fpairy = fpair*rinv*dely; fpairz = fpair*rinv*delz; // drag force - perpendicular - fpairx -= gammaT[itype][jtype]*wdPerp*wdPerp* - (P[0][0]*delvx + P[0][1]*delvy + P[0][2]*delvz); - fpairy -= gammaT[itype][jtype]*wdPerp*wdPerp* - (P[1][0]*delvx + P[1][1]*delvy + P[1][2]*delvz); - fpairz -= gammaT[itype][jtype]*wdPerp*wdPerp* - (P[2][0]*delvx + P[2][1]*delvy + P[2][2]*delvz); + prefactor_g = factor_dpd*gammaT[itype][jtype]*wdPerp*wdPerp; + fpairx -= prefactor_g * (P[0][0]*delvx + P[0][1]*delvy + P[0][2]*delvz); + fpairy -= prefactor_g * (P[1][0]*delvx + P[1][1]*delvy + P[1][2]*delvz); + fpairz -= prefactor_g * (P[2][0]*delvx + P[2][1]*delvy + P[2][2]*delvz); // random force - perpendicular - fpairx += sigmaT[itype][jtype]*wdPerp* - (P[0][0]*randnumx + P[0][1]*randnumy + P[0][2]*randnumz)*dtinvsqrt; - fpairy += sigmaT[itype][jtype]*wdPerp* - (P[1][0]*randnumx + P[1][1]*randnumy + P[1][2]*randnumz)*dtinvsqrt; - fpairz += sigmaT[itype][jtype]*wdPerp* - (P[2][0]*randnumx + P[2][1]*randnumy + P[2][2]*randnumz)*dtinvsqrt; - - fpairx *= factor_dpd; - fpairy *= factor_dpd; - fpairz *= factor_dpd; + prefactor_s = factor_sqrt * sigmaT[itype][jtype]*wdPerp * dtinvsqrt; + fpairx += prefactor_s * (P[0][0]*randnumx + P[0][1]*randnumy + P[0][2]*randnumz); + fpairy += prefactor_s * (P[1][0]*randnumx + P[1][1]*randnumy + P[1][2]*randnumz); + fpairz += prefactor_s * (P[2][0]*randnumx + P[2][1]*randnumy + P[2][2]*randnumz); f[i][0] += fpairx; f[i][1] += fpairy; @@ -198,10 +193,8 @@ void PairDPDExt::compute(int eflag, int vflag) evdwl = 0.5*a0[itype][jtype]*cut[itype][jtype] * wd*wd; evdwl *= factor_dpd; } - if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair, - evdwl,0.0, - fpairx, fpairy, fpairz, - delx,dely,delz); + if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,evdwl,0.0,fpairx,fpairy,fpairz, + delx,dely,delz); } } } @@ -332,6 +325,10 @@ void PairDPDExt::init_style() error->warning(FLERR, "Pair dpd needs newton pair on for momentum conservation"); neighbor->add_request(this); + + // precompute random force scaling factors + + for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]); } /* ---------------------------------------------------------------------- diff --git a/src/DPD-BASIC/pair_dpd_ext.h b/src/DPD-BASIC/pair_dpd_ext.h index e7d86ef3bf..1d025d74c0 100644 --- a/src/DPD-BASIC/pair_dpd_ext.h +++ b/src/DPD-BASIC/pair_dpd_ext.h @@ -43,6 +43,7 @@ class PairDPDExt : public Pair { protected: double cut_global, temperature; + double special_sqrt[4]; int seed; double **cut; double **a0, **gamma, **gammaT; diff --git a/src/DPD-BASIC/pair_dpd_ext_tstat.cpp b/src/DPD-BASIC/pair_dpd_ext_tstat.cpp index c205a08c4a..433bc54063 100644 --- a/src/DPD-BASIC/pair_dpd_ext_tstat.cpp +++ b/src/DPD-BASIC/pair_dpd_ext_tstat.cpp @@ -47,7 +47,8 @@ void PairDPDExtTstat::compute(int eflag, int vflag) int i,j,ii,jj,inum,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpairx,fpairy,fpairz,fpair; double vxtmp,vytmp,vztmp,delvx,delvy,delvz; - double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz,factor_dpd; + double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz; + double prefactor_g,prefactor_s,factor_dpd,factor_sqrt; double P[3][3]; int *ilist,*jlist,*numneigh,**firstneigh; @@ -99,6 +100,7 @@ void PairDPDExtTstat::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_sqrt[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x[j][0]; @@ -138,34 +140,26 @@ void PairDPDExtTstat::compute(int eflag, int vflag) randnumz = random->gaussian(); // drag force - parallel - fpair = -gamma[itype][jtype]*wdPar*wdPar*dot*rinv; + fpair = -factor_dpd * gamma[itype][jtype]*wdPar*wdPar*dot*rinv; // random force - parallel - fpair += sigma[itype][jtype]*wdPar*randnum*dtinvsqrt; + fpair += factor_sqrt*sigma[itype][jtype]*wdPar*randnum*dtinvsqrt; fpairx = fpair*rinv*delx; fpairy = fpair*rinv*dely; fpairz = fpair*rinv*delz; // drag force - perpendicular - fpairx -= gammaT[itype][jtype]*wdPerp*wdPerp* - (P[0][0]*delvx + P[0][1]*delvy + P[0][2]*delvz); - fpairy -= gammaT[itype][jtype]*wdPerp*wdPerp* - (P[1][0]*delvx + P[1][1]*delvy + P[1][2]*delvz); - fpairz -= gammaT[itype][jtype]*wdPerp*wdPerp* - (P[2][0]*delvx + P[2][1]*delvy + P[2][2]*delvz); + prefactor_g = factor_dpd*gammaT[itype][jtype]*wdPerp*wdPerp; + fpairx -= prefactor_g * (P[0][0]*delvx + P[0][1]*delvy + P[0][2]*delvz); + fpairy -= prefactor_g * (P[1][0]*delvx + P[1][1]*delvy + P[1][2]*delvz); + fpairz -= prefactor_g * (P[2][0]*delvx + P[2][1]*delvy + P[2][2]*delvz); // random force - perpendicular - fpairx += sigmaT[itype][jtype]*wdPerp* - (P[0][0]*randnumx + P[0][1]*randnumy + P[0][2]*randnumz)*dtinvsqrt; - fpairy += sigmaT[itype][jtype]*wdPerp* - (P[1][0]*randnumx + P[1][1]*randnumy + P[1][2]*randnumz)*dtinvsqrt; - fpairz += sigmaT[itype][jtype]*wdPerp* - (P[2][0]*randnumx + P[2][1]*randnumy + P[2][2]*randnumz)*dtinvsqrt; - - fpairx *= factor_dpd; - fpairy *= factor_dpd; - fpairz *= factor_dpd; + prefactor_s = factor_sqrt * sigmaT[itype][jtype]*wdPerp * dtinvsqrt; + fpairx += prefactor_s * (P[0][0]*randnumx + P[0][1]*randnumy + P[0][2]*randnumz); + fpairy += prefactor_s * (P[1][0]*randnumx + P[1][1]*randnumy + P[1][2]*randnumz); + fpairz += prefactor_s * (P[2][0]*randnumx + P[2][1]*randnumy + P[2][2]*randnumz); f[i][0] += fpairx; f[i][1] += fpairy; diff --git a/src/DPD-BASIC/pair_dpd_tstat.cpp b/src/DPD-BASIC/pair_dpd_tstat.cpp index fdc43de8de..ed659e7cc3 100644 --- a/src/DPD-BASIC/pair_dpd_tstat.cpp +++ b/src/DPD-BASIC/pair_dpd_tstat.cpp @@ -43,7 +43,7 @@ void PairDPDTstat::compute(int eflag, int vflag) int i,j,ii,jj,inum,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpair; double vxtmp,vytmp,vztmp,delvx,delvy,delvz; - double rsq,r,rinv,dot,wd,randnum,factor_dpd; + double rsq,r,rinv,dot,wd,randnum,factor_dpd,factor_sqrt; int *ilist,*jlist,*numneigh,**firstneigh; ev_init(eflag,vflag); @@ -91,6 +91,7 @@ void PairDPDTstat::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_sqrt[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x[j][0]; @@ -113,9 +114,9 @@ void PairDPDTstat::compute(int eflag, int vflag) // drag force = -gamma * wd^2 * (delx dot delv) / r // random force = sigma * wd * rnd * dtinvsqrt; - fpair = -gamma[itype][jtype]*wd*wd*dot*rinv; - fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt; - fpair *= factor_dpd*rinv; + fpair = -factor_dpd*gamma[itype][jtype]*wd*wd*dot*rinv; + fpair += factor_sqrt*sigma[itype][jtype]*wd*randnum*dtinvsqrt; + fpair *= rinv; f[i][0] += delx*fpair; f[i][1] += dely*fpair; diff --git a/src/GPU/pair_dpd_gpu.cpp b/src/GPU/pair_dpd_gpu.cpp index 79fd3f1345..716978deac 100644 --- a/src/GPU/pair_dpd_gpu.cpp +++ b/src/GPU/pair_dpd_gpu.cpp @@ -313,7 +313,7 @@ void PairDPDGPU::cpu_compute(int start, int inum, int eflag, int /* vflag */, in int i, j, ii, jj, jnum, itype, jtype; double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair; double vxtmp, vytmp, vztmp, delvx, delvy, delvz; - double rsq, r, rinv, dot, wd, randnum, factor_dpd; + double rsq, r, rinv, dot, wd, randnum, factor_dpd, factor_sqrt; int *jlist; tagint itag, jtag; @@ -344,6 +344,7 @@ void PairDPDGPU::cpu_compute(int start, int inum, int eflag, int /* vflag */, in for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_sqrt[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x[j][0]; @@ -376,10 +377,11 @@ void PairDPDGPU::cpu_compute(int start, int inum, int eflag, int /* vflag */, in // drag force = -gamma * wd^2 * (delx dot delv) / r // random force = sigma * wd * rnd * dtinvsqrt; - fpair = a0[itype][jtype] * wd; - fpair -= gamma[itype][jtype] * wd * wd * dot * rinv; - fpair += sigma[itype][jtype] * wd * randnum * dtinvsqrt; - fpair *= factor_dpd * rinv; + fpair = a0[itype][jtype]*wd; + fpair -= gamma[itype][jtype]*wd*wd*dot*rinv; + fpair *= factor_dpd; + fpair += factor_sqrt*sigma[itype][jtype]*wd*randnum*dtinvsqrt; + fpair *= rinv; f[i][0] += delx * fpair; f[i][1] += dely * fpair; diff --git a/src/GPU/pair_dpd_tstat_gpu.cpp b/src/GPU/pair_dpd_tstat_gpu.cpp index 49dacf3f1e..029bf7245e 100644 --- a/src/GPU/pair_dpd_tstat_gpu.cpp +++ b/src/GPU/pair_dpd_tstat_gpu.cpp @@ -329,7 +329,7 @@ void PairDPDTstatGPU::cpu_compute(int start, int inum, int /* eflag */, int /* v int i, j, ii, jj, jnum, itype, jtype; double xtmp, ytmp, ztmp, delx, dely, delz, fpair; double vxtmp, vytmp, vztmp, delvx, delvy, delvz; - double rsq, r, rinv, dot, wd, randnum, factor_dpd; + double rsq, r, rinv, dot, wd, randnum, factor_dpd, factor_sqrt; int *jlist; tagint itag, jtag; @@ -360,6 +360,7 @@ void PairDPDTstatGPU::cpu_compute(int start, int inum, int /* eflag */, int /* v for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_sqrt[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x[j][0]; @@ -392,9 +393,9 @@ void PairDPDTstatGPU::cpu_compute(int start, int inum, int /* eflag */, int /* v // drag force = -gamma * wd^2 * (delx dot delv) / r // random force = sigma * wd * rnd * dtinvsqrt; - fpair = -gamma[itype][jtype] * wd * wd * dot * rinv; - fpair += sigma[itype][jtype] * wd * randnum * dtinvsqrt; - fpair *= factor_dpd * rinv; + fpair = -factor_dpd * gamma[itype][jtype] * wd * wd * dot * rinv; + fpair += factor_sqrt * sigma[itype][jtype] * wd * randnum * dtinvsqrt; + fpair *= rinv; f[i][0] += delx * fpair; f[i][1] += dely * fpair; diff --git a/src/INTEL/pair_dpd_intel.cpp b/src/INTEL/pair_dpd_intel.cpp index 5ed50e54ba..011979223e 100644 --- a/src/INTEL/pair_dpd_intel.cpp +++ b/src/INTEL/pair_dpd_intel.cpp @@ -325,8 +325,11 @@ void PairDPDIntel::eval(const int offload, const int vflag, const flt_t rinv = (flt_t)1.0/sqrt(rsq); if (rinv > icut) { - flt_t factor_dpd; - if (!ONETYPE) factor_dpd = special_lj[sbindex]; + flt_t factor_dpd, factor_sqrt; + if (!ONETYPE) { + factor_dpd = special_lj[sbindex]; + factor_sqrt = special_lj[sbindex]; + } flt_t delvx = vxtmp - v[j].x; flt_t delvy = vytmp - v[j].y; @@ -342,8 +345,11 @@ void PairDPDIntel::eval(const int offload, const int vflag, gamma = parami[jtype].gamma; sigma = parami[jtype].sigma; } - flt_t fpair = a0 - iwd * gamma * dot + sigma * randnum * dtinvsqrt; - if (!ONETYPE) fpair *= factor_dpd; + flt_t fpair = a0 - iwd * gamma * dot; + if (!ONETYPE) { + fpair *= factor_dpd; + fpair += factor_sqrt * sigma * randnum * dtinvsqrt; + } else fpair += sigma * randnum * dtinvsqrt; fpair *= iwd; const flt_t fpx = fpair * delx; @@ -493,8 +499,7 @@ void PairDPDIntel::init_style() fix->pair_init_check(); #ifdef _LMP_INTEL_OFFLOAD if (fix->offload_balance() != 0.0) - error->all(FLERR, - "Offload for dpd/intel is not yet available. Set balance to 0."); + error->all(FLERR, "Offload for dpd/intel is not yet available. Set balance to 0."); #endif if (fix->precision() == FixIntel::PREC_MODE_MIXED) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index 42fcff0596..9b0dd23ad6 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -41,10 +41,10 @@ using namespace LAMMPS_NS; template -PairDPDExtKokkos::PairDPDExtKokkos(class LAMMPS *lmp) : - PairDPDExt(lmp) , +PairDPDExtKokkos::PairDPDExtKokkos(class LAMMPS *_lmp) : + PairDPDExt(_lmp) , #ifdef DPD_USE_RAN_MARS - rand_pool(0 /* unused */, lmp) + rand_pool(0 /* unused */, _lmp) #else rand_pool() #endif @@ -134,6 +134,10 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) special_lj[1] = force->special_lj[1]; special_lj[2] = force->special_lj[2]; special_lj[3] = force->special_lj[3]; + special_rf[0] = sqrt(force->special_lj[0]); + special_rf[1] = sqrt(force->special_lj[1]); + special_rf[2] = sqrt(force->special_lj[2]); + special_rf[3] = sqrt(force->special_lj[3]); nlocal = atom->nlocal; dtinvsqrt = 1.0/sqrt(update->dt); @@ -232,7 +236,8 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkos int i,j,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpairx,fpairy,fpairz,fpair; double vxtmp,vytmp,vztmp,delvx,delvy,delvz; - double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz,factor_dpd; + double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz; + double prefactor_g,prefactor_s,factor_dpd,factor_sqrt; double fx = 0,fy = 0,fz = 0; double evdwl = 0; i = d_ilist[ii]; @@ -249,6 +254,7 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkos double P[3][3]; j = d_neighbors(i,jj); factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_rf[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x(j,0); @@ -291,33 +297,26 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkos // drag force - parallel fpair -= params(itype,jtype).gamma*wdPar*wdPar*dot*rinv; + fpair *= factor_dpd; // random force - parallel - fpair += params(itype,jtype).sigma*wdPar*randnum*dtinvsqrt; + fpair += factor_sqrt*params(itype,jtype).sigma*wdPar*randnum*dtinvsqrt; fpairx = fpair*rinv*delx; fpairy = fpair*rinv*dely; fpairz = fpair*rinv*delz; // drag force - perpendicular - fpairx -= params(itype,jtype).gammaT*wdPerp*wdPerp* - (P[0][0]*delvx + P[0][1]*delvy + P[0][2]*delvz); - fpairy -= params(itype,jtype).gammaT*wdPerp*wdPerp* - (P[1][0]*delvx + P[1][1]*delvy + P[1][2]*delvz); - fpairz -= params(itype,jtype).gammaT*wdPerp*wdPerp* - (P[2][0]*delvx + P[2][1]*delvy + P[2][2]*delvz); + prefactor_g = factor_dpd*params(itype,jtype).gammaT*wdPerp*wdPerp; + fpairx -= prefactor_g * (P[0][0]*delvx + P[0][1]*delvy + P[0][2]*delvz); + fpairy -= prefactor_g * (P[1][0]*delvx + P[1][1]*delvy + P[1][2]*delvz); + fpairz -= prefactor_g * (P[2][0]*delvx + P[2][1]*delvy + P[2][2]*delvz); // random force - perpendicular - fpairx += params(itype,jtype).sigmaT*wdPerp* - (P[0][0]*randnumx + P[0][1]*randnumy + P[0][2]*randnumz)*dtinvsqrt; - fpairy += params(itype,jtype).sigmaT*wdPerp* - (P[1][0]*randnumx + P[1][1]*randnumy + P[1][2]*randnumz)*dtinvsqrt; - fpairz += params(itype,jtype).sigmaT*wdPerp* - (P[2][0]*randnumx + P[2][1]*randnumy + P[2][2]*randnumz)*dtinvsqrt; - - fpairx *= factor_dpd; - fpairy *= factor_dpd; - fpairz *= factor_dpd; + prefactor_s = factor_sqrt*params(itype,jtype).sigmaT*wdPerp; + fpairx += prefactor_s * (P[0][0]*randnumx + P[0][1]*randnumy + P[0][2]*randnumz)*dtinvsqrt; + fpairy += prefactor_s * (P[1][0]*randnumx + P[1][1]*randnumy + P[1][2]*randnumz)*dtinvsqrt; + fpairz += prefactor_s * (P[2][0]*randnumx + P[2][1]*randnumy + P[2][2]*randnumz)*dtinvsqrt; fx += fpairx; fy += fpairy; diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.h b/src/KOKKOS/pair_dpd_ext_kokkos.h index 8df218f82c..28965fcb17 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_kokkos.h @@ -80,7 +80,7 @@ class PairDPDExtKokkos : public PairDPDExt { const F_FLOAT &fx, const F_FLOAT &fy, const F_FLOAT &fz, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; private: - double special_lj[4]; + double special_lj[4], special_rf[4]; int eflag,vflag; int neighflag,nlocal; double dtinvsqrt; diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp index a6c5da37fa..3d832e13f1 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -41,10 +41,10 @@ using namespace LAMMPS_NS; template -PairDPDExtTstatKokkos::PairDPDExtTstatKokkos(class LAMMPS *lmp) : - PairDPDExtTstat(lmp) , +PairDPDExtTstatKokkos::PairDPDExtTstatKokkos(class LAMMPS *_lmp) : + PairDPDExtTstat(_lmp) , #ifdef DPD_USE_RAN_MARS - rand_pool(0 /* unused */, lmp) + rand_pool(0 /* unused */, _lmp) #else rand_pool() #endif @@ -149,6 +149,10 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) special_lj[1] = force->special_lj[1]; special_lj[2] = force->special_lj[2]; special_lj[3] = force->special_lj[3]; + special_rf[0] = sqrt(force->special_lj[0]); + special_rf[1] = sqrt(force->special_lj[1]); + special_rf[2] = sqrt(force->special_lj[2]); + special_rf[3] = sqrt(force->special_lj[3]); nlocal = atom->nlocal; dtinvsqrt = 1.0/sqrt(update->dt); @@ -233,11 +237,11 @@ void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); auto a_f = v_f.template access>(); - int i,j,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpairx,fpairy,fpairz,fpair; double vxtmp,vytmp,vztmp,delvx,delvy,delvz; - double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz,factor_dpd; + double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz; + double prefactor_g,prefactor_s,factor_dpd,factor_sqrt; double fx = 0,fy = 0,fz = 0; i = d_ilist[ii]; @@ -254,6 +258,7 @@ void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos -PairDPDKokkos::PairDPDKokkos(class LAMMPS *lmp) : - PairDPD(lmp) , +PairDPDKokkos::PairDPDKokkos(class LAMMPS *_lmp) : + PairDPD(_lmp) , #ifdef DPD_USE_RAN_MARS - rand_pool(0 /* unused */, lmp) + rand_pool(0 /* unused */, _lmp) #else rand_pool() #endif @@ -134,6 +134,10 @@ void PairDPDKokkos::compute(int eflagin, int vflagin) special_lj[1] = force->special_lj[1]; special_lj[2] = force->special_lj[2]; special_lj[3] = force->special_lj[3]; + special_rf[0] = sqrt(force->special_lj[0]); + special_rf[1] = sqrt(force->special_lj[1]); + special_rf[2] = sqrt(force->special_lj[2]); + special_rf[3] = sqrt(force->special_lj[3]); nlocal = atom->nlocal; dtinvsqrt = 1.0/sqrt(update->dt); @@ -232,7 +236,7 @@ void PairDPDKokkos::operator() (TagDPDKokkos, cons int i,j,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpair; double vxtmp,vytmp,vztmp,delvx,delvy,delvz; - double rsq,r,rinv,dot,wd,randnum,factor_dpd; + double rsq,r,rinv,dot,wd,randnum,factor_dpd,factor_sqrt; double fx = 0,fy = 0,fz = 0; double evdwl = 0; i = d_ilist[ii]; @@ -248,6 +252,7 @@ void PairDPDKokkos::operator() (TagDPDKokkos, cons for (jj = 0; jj < jnum; jj++) { j = d_neighbors(i,jj); factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_rf[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x(j,0); @@ -273,10 +278,11 @@ void PairDPDKokkos::operator() (TagDPDKokkos, cons // drag force - parallel fpair -= params(itype,jtype).gamma*wd*wd*dot*rinv; + fpair *= factor_dpd; // random force - parallel - fpair += params(itype,jtype).sigma*wd*randnum*dtinvsqrt; - fpair *= factor_dpd*rinv; + fpair += factor_sqrt*params(itype,jtype).sigma*wd*randnum*dtinvsqrt; + fpair *= rinv; fx += fpair*delx; fy += fpair*dely; diff --git a/src/KOKKOS/pair_dpd_kokkos.h b/src/KOKKOS/pair_dpd_kokkos.h index 4fce75db80..b9f24e3e5f 100644 --- a/src/KOKKOS/pair_dpd_kokkos.h +++ b/src/KOKKOS/pair_dpd_kokkos.h @@ -76,10 +76,10 @@ class PairDPDKokkos : public PairDPD { template KOKKOS_INLINE_FUNCTION void ev_tally(EV_FLOAT &ev, const int &i, const int &j, - const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, - const F_FLOAT &dely, const F_FLOAT &delz) const; + const F_FLOAT &epair, const F_FLOAT &fpair, + const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; private: - double special_lj[4]; + double special_lj[4], special_rf[4]; int eflag,vflag; int neighflag,nlocal; double dtinvsqrt; diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index 9f835fde56..746e13a4ba 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -41,10 +41,10 @@ using namespace LAMMPS_NS; template -PairDPDTstatKokkos::PairDPDTstatKokkos(class LAMMPS *lmp) : - PairDPDTstat(lmp) , +PairDPDTstatKokkos::PairDPDTstatKokkos(class LAMMPS *_lmp) : + PairDPDTstat(_lmp) , #ifdef DPD_USE_RAN_MARS - rand_pool(0 /* unused */, lmp) + rand_pool(0 /* unused */, _lmp) #else rand_pool() #endif @@ -128,7 +128,6 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) memory->create(eatom,maxeatom,"pair:eatom"); memset(&eatom[0], 0, maxeatom * sizeof(double)); } - if (vflag_atom) { memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); @@ -149,6 +148,10 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) special_lj[1] = force->special_lj[1]; special_lj[2] = force->special_lj[2]; special_lj[3] = force->special_lj[3]; + special_rf[0] = sqrt(force->special_lj[0]); + special_rf[1] = sqrt(force->special_lj[1]); + special_rf[2] = sqrt(force->special_lj[2]); + special_rf[3] = sqrt(force->special_lj[3]); nlocal = atom->nlocal; dtinvsqrt = 1.0/sqrt(update->dt); @@ -236,7 +239,7 @@ void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos::operator() (TagDPDTstatKokkos::operator() (TagDPDTstatKokkosx[0]; @@ -170,6 +170,7 @@ void PairDPDTstatOMP::eval(int iifrom, int iito, ThrData * const thr) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_dpd = special_lj[sbmask(j)]; + factor_sqrt = special_sqrt[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x[j].x; @@ -192,9 +193,9 @@ void PairDPDTstatOMP::eval(int iifrom, int iito, ThrData * const thr) // drag force = -gamma * wd^2 * (delx dot delv) / r // random force = sigma * wd * rnd * dtinvsqrt; - fpair = -gamma[itype][jtype]*wd*wd*dot*rinv; - fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt; - fpair *= factor_dpd*rinv; + fpair = -factor_dpd*gamma[itype][jtype]*wd*wd*dot*rinv; + fpair += factor_sqrt*sigma[itype][jtype]*wd*randnum*dtinvsqrt; + fpair *= rinv; fxtmp += delx*fpair; fytmp += dely*fpair; diff --git a/unittest/force-styles/tests/mol-pair-dpd.yaml b/unittest/force-styles/tests/mol-pair-dpd.yaml index 9fab36f51a..26a8fff32a 100644 --- a/unittest/force-styles/tests/mol-pair-dpd.yaml +++ b/unittest/force-styles/tests/mol-pair-dpd.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 17 Feb 2022 -date_generated: Fri Mar 18 22:17:29 2022 +lammps_version: 3 Nov 2022 +date_generated: Sat Dec 17 13:40:39 2022 epsilon: 5e-14 skip_tests: gpu intel kokkos_omp single prerequisites: ! | @@ -26,69 +26,69 @@ natoms: 29 init_vdwl: 50.81607024833933 init_coul: 0 init_stress: ! |2- - 3.6892707387868946e+01 6.7100128759684480e+01 2.4650529885588522e+01 -1.5957061281779284e+01 -1.8149194861854802e+01 -5.8188961718178627e+00 + 3.0629831000023774e+01 6.1744463539522620e+01 2.0491764061347197e+01 -9.3827731001361023e+00 -1.8557186892224781e+01 -5.5009195596421465e+00 init_forces: ! |2 - 1 -6.1811945724710027e-01 2.3173883571664340e+00 -5.7927743070743345e+00 - 2 2.8929655050793355e+00 -4.2032369049876186e+00 -4.5732102302996736e-01 - 3 1.2111415459590413e+00 1.6558234808322891e+00 -2.2961228671122371e+00 - 4 3.5394004143194646e+00 -2.3035015829595218e+00 -1.3641987601371781e+00 - 5 -1.8832502792421750e+00 5.0906425469293781e+00 -2.2057512109247330e+00 - 6 -2.2333912801170257e+00 2.2657582324664594e+00 -3.0734510518473508e+00 - 7 2.2298272918462989e+00 3.7138822465230423e+00 2.5183334318922919e+00 - 8 -6.3492168885446878e+00 -1.8828521215298335e+00 5.2030707083876209e+00 - 9 4.0929931591392581e+00 -7.4054775241769404e+00 7.4915838856534567e+00 - 10 -3.5586310254099738e+00 5.3603421342951407e-01 3.7197577264422352e+00 - 11 1.0545983888793937e+00 2.2487334905601659e+00 -3.8191671705714930e-01 - 12 -1.5652344136101608e+00 2.2541934214449273e+00 -4.5220008905007409e+00 - 13 2.9243943649558548e+00 -4.9866441037279090e+00 -1.8565392165406420e+00 - 14 -2.8069161382250161e+00 3.7027724692593043e+00 -4.2624825734854405e-01 - 15 7.7052459866296241e-01 5.3708815883671424e-01 2.9059187282982779e+00 - 16 3.0575856982307155e+00 4.9924530450306781e-01 -2.6653711669894414e-01 - 17 2.6495080101004591e+00 1.2978224993899932e+00 -2.5632209407738165e+00 - 18 -2.1683893991964789e+00 3.7691362947665716e+00 -1.1918735044626905e+00 - 19 -5.8713827717704992e-01 1.7228164810783004e+00 4.4129286219489205e-01 - 20 -2.4088777177527940e+00 -3.5847907968828845e+00 3.4285635166590178e+00 - 21 4.0089795873488763e+00 -4.1418472837398728e+00 -3.4518728418911024e+00 - 22 3.0846056053219562e-01 4.3785944212578609e-01 -9.9181014238192505e-02 - 23 2.3617912754383887e+00 -1.5720129064982027e+00 -1.3546495408095991e+00 - 24 -1.3523740060071268e+00 -4.3697535216990699e+00 -7.7979874182561053e+00 - 25 -5.6710838477103620e-01 6.3846221568324069e+00 5.8112107624113110e+00 - 26 1.1594567498693216e+00 2.5148956294408302e+00 2.5279988363479085e+00 - 27 -1.2551354817636557e+00 -2.4343811771905930e+00 2.9640832530850625e-01 - 28 -4.6829625062261160e-01 -1.4739473222403159e+00 1.4861524185706241e+00 - 29 -4.4395481506746695e+00 -2.5902691799524233e+00 3.2713554765371877e+00 -run_vdwl: 50.80967410228065 + 1 7.3075805028228613e-01 9.1584410186753085e-01 -4.6722447602257153e+00 + 2 3.4766993686779535e+00 -3.6763199736661596e+00 -1.0186610739730952e+00 + 3 -3.2572874653578954e-01 1.5030077810939442e+00 -2.9729162119457597e+00 + 4 5.0956169609964235e+00 -4.8680700203505713e+00 -1.6091423970149989e+00 + 5 -1.1242239401144138e+00 5.3907964015731418e+00 -3.5253538782416860e+00 + 6 -4.0287938165776156e+00 4.7603958917839817e+00 -2.8272438707435037e+00 + 7 2.2588628316388468e+00 4.0007843686962872e+00 4.0903524510442200e+00 + 8 -6.6975614224003834e+00 -1.9422948681467465e+00 4.9744619897691642e+00 + 9 4.4351617140501789e+00 -7.9029160475741582e+00 8.3486545837005757e+00 + 10 -4.0807684122254546e+00 2.3201550318334729e-01 3.6555211305169730e+00 + 11 1.3481823088592249e+00 2.4930034027260817e+00 4.5092355891051733e-01 + 12 -2.6974959720471823e+00 1.4112711269282290e+00 -4.3450080370396371e+00 + 13 3.2101040750219512e+00 -5.6398471877950103e+00 -2.6423924475815297e+00 + 14 -1.5975565953368469e+00 2.9342810925550209e+00 -1.2140275865298065e+00 + 15 2.4935036970858537e-01 2.6277960221730532e+00 3.8350672296198041e+00 + 16 2.2983881227012040e+00 1.9756217936415919e+00 -2.9858853762440069e-01 + 17 2.8571845980776760e+00 1.1223027952699007e+00 -3.5968200210128787e+00 + 18 -2.5588071203219336e+00 3.5108104465300860e+00 -1.6268013233322405e+00 + 19 3.3520450825724146e-01 2.4320717032393699e+00 1.0287083364839147e+00 + 20 -2.9408027820616316e+00 -4.0357201708074690e+00 3.2760758612395446e+00 + 21 3.8981096722540656e+00 -4.2828276034738719e+00 -3.0255747104582387e+00 + 22 -5.2449803092896624e-02 3.1717644449437532e-01 -4.9066978279440920e-01 + 23 2.8335715541582913e+00 -1.3103495891327928e+00 -1.3894589036862461e+00 + 24 -1.1738278490333338e+00 -4.5963871457169594e+00 -7.5696287075479987e+00 + 25 -8.8708092896852919e-01 6.4112028357891306e+00 5.5520748503912003e+00 + 26 1.3008831370930214e+00 2.7149485745019954e+00 2.5587760376599125e+00 + 27 -1.7161239459786466e+00 -3.3992793762475388e+00 3.0139214727180846e-01 + 28 3.2413851210978728e-01 -1.0452296126623406e+00 1.8127133405971463e+00 + 29 -4.7709944491920773e+00 -2.0540886904734537e+00 2.9398107325473637e+00 +run_vdwl: 50.80967653574212 run_coul: 0 run_stress: ! |2- - 2.2678525097938930e+01 1.2784099465722879e+02 8.7854358412948542e+01 -1.0634323344871795e+01 1.4108052497366335e+01 8.9515364908436243e+00 + 1.6964019257997620e+01 1.3374610459106987e+02 8.5631071281489810e+01 -7.7012382600952538e+00 1.3050799639540994e+01 9.4359891162867768e+00 run_forces: ! |2 - 1 -1.7817873269727535e+00 6.2958320592412083e+00 2.6140480773916126e+00 - 2 -4.4668514450366299e+00 1.8131714921158988e+00 -3.9607614963066364e+00 - 3 -1.8360646410869066e+00 1.3242249407188427e+00 -6.3507884122851603e+00 - 4 3.0092138359786547e-01 2.7395496956815835e-01 -1.0763191332361717e+00 - 5 4.1513500319666843e+00 -3.3813450528795141e-01 -3.0570629049500382e+00 - 6 -1.2260313156327576e+00 -2.8493442951267669e+00 -3.8060524656173294e+00 - 7 -1.3044270874988177e+00 2.8398523334618928e+00 -1.7647525584948087e+00 - 8 -6.2683632958193503e-01 1.3979093255941417e+00 -4.2665185505765928e+00 - 9 -1.9549427106357171e+00 3.4247967137764723e+00 2.4584448055910790e-01 - 10 -2.8933741028250828e+00 1.7423599866923007e+00 2.3222166524863680e-01 - 11 -2.9946611781847885e+00 7.7799079023894357e-01 -1.9660842792388940e+00 - 12 5.6191580163197248e+00 -3.1933819064589040e+00 -5.9496481627234021e-01 - 13 -8.1307257033710965e+00 8.7441296873458327e+00 5.1434628221701804e+00 - 14 -5.7764739992206438e-01 -3.7916450385835008e+00 -1.6242549437078972e+00 - 15 4.3521554990960247e+00 1.5350547261912393e+00 -4.2769795281650569e-01 - 16 3.1094674789710601e+00 -1.1286007702341864e+01 4.4378713310985392e+00 - 17 3.6730722564407965e+00 -1.8174230235240803e+00 7.5054301291157599e-01 - 18 -2.0755971173056276e+00 -5.2810808660261943e-01 2.7831781157151609e+00 - 19 6.1844675625589784e-01 -9.0508801091877344e-01 -1.2260404189643337e+00 - 20 1.0928003864053180e+00 1.7480100531348799e+00 -7.2333813053057794e-01 - 21 2.4344679854458739e+00 -2.7774459023705229e+00 -2.3341327389925390e+00 - 22 1.1690463549067964e+00 -1.5966715112595395e+00 -1.5065928249789802e+00 - 23 8.6972535785731409e-01 -1.8149971317231608e+00 -7.4430485209621311e-01 - 24 3.0914870963050090e-01 1.6741775832908039e+00 3.7805111454740654e+00 - 25 2.5727763210556320e+00 6.4836809086378526e+00 9.3960305698174285e+00 - 26 1.2803074900998423e+00 -7.1054142754679894e-01 -3.2342724777823051e-01 - 27 -4.7655979592968084e-01 -2.6983379944944734e+00 1.6792409122971659e+00 - 28 9.4585460171677649e-01 3.4741640704938903e-01 -6.3920598934117945e-02 - 29 -2.1531924757822534e+00 -6.1154354408188967e+00 4.7540621930938949e+00 + 1 -1.6498742801461725e+00 7.9458366859205753e+00 1.5792641532745644e+00 + 2 -5.1567739460204320e+00 1.1470966082131224e+00 -3.9137726487346503e+00 + 3 -1.3037529243987507e+00 1.7515802619536196e+00 -6.5015904306500776e+00 + 4 2.3122264862833846e+00 -2.1181128556463619e-02 -3.8503095693882400e-01 + 5 4.3167980413755735e+00 -2.5972937929033248e+00 -3.4782104034020627e+00 + 6 -1.4873716936425732e+00 -3.9845987484147591e+00 -3.4020078420460069e+00 + 7 -1.0858797840411460e+00 2.9680464757729768e+00 -3.3459951889330386e-01 + 8 -2.2499092867753534e+00 3.6722853740905297e+00 -6.2992039925451975e+00 + 9 -2.5051919498749875e+00 5.8599502055953874e+00 1.7798228437096324e+00 + 10 -2.6384139663560324e+00 1.1452340221570778e-01 -5.5258524018519473e-01 + 11 -4.0547039006702077e+00 -3.3881108662213716e-01 -1.5314352114227030e+00 + 12 6.4609812433047056e+00 -2.5816365006798168e+00 8.8827344389857288e-01 + 13 -7.6195625131290399e+00 8.9306875852321035e+00 5.1759899355578947e+00 + 14 -9.7114975816841920e-01 -3.2360064980701089e+00 -3.0896803730640281e+00 + 15 3.9168838024715829e+00 1.6977195093117214e+00 -1.1725478539656109e-02 + 16 3.6401235514546242e+00 -1.2790127612257688e+01 3.3138280013947901e+00 + 17 3.4883517437783351e+00 -1.6447419909485159e+00 1.2914229020991159e+00 + 18 -2.4735658124513322e+00 -8.7448278636992738e-01 2.7072570136789476e+00 + 19 7.9917892531956058e-01 -7.8951319068539894e-01 -1.0060255839920997e+00 + 20 1.3100540136254757e+00 1.9788456259986347e+00 -8.6748402949167835e-01 + 21 2.8143134615088328e+00 -2.4640529944205558e+00 -2.9111292713583019e+00 + 22 1.7204998870126813e+00 -1.3961680862721673e+00 -9.9373540602960608e-01 + 23 -6.1595011069318306e-02 -2.3288990259306797e+00 -6.8015637749230851e-01 + 24 -3.8390008193986003e-01 6.1276553447161553e-01 3.6595153343438795e+00 + 25 2.4086934205863688e+00 6.3481567058055166e+00 9.3217643994212285e+00 + 26 2.1374488075798599e+00 4.8638899444764738e-01 -1.2815175455531230e-01 + 27 -4.0743583405522676e-01 -2.4014348666661940e+00 1.6377432524765785e+00 + 28 1.2880709264348227e+00 3.5001180060614900e-01 1.2680051626091057e-01 + 29 -2.5645435679969535e+00 -6.4149464608375721e+00 4.6048427232248912e+00 ... diff --git a/unittest/force-styles/tests/mol-pair-dpd_ext.yaml b/unittest/force-styles/tests/mol-pair-dpd_ext.yaml index 8f07c88667..8025136a78 100644 --- a/unittest/force-styles/tests/mol-pair-dpd_ext.yaml +++ b/unittest/force-styles/tests/mol-pair-dpd_ext.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 3 Nov 2022 -date_generated: Sat Dec 17 15:41:37 2022 +lammps_version: 22 Dec 2022 +date_generated: Sun Dec 25 19:22:01 2022 epsilon: 5e-14 skip_tests: gpu intel kokkos_omp single prerequisites: ! | @@ -26,69 +26,69 @@ natoms: 29 init_vdwl: 33.88964374360757 init_coul: 0 init_stress: ! |2- - 3.8251398030273030e+01 1.0255447218676466e+02 9.1141445555187879e+00 -1.0350255887988475e+02 -7.0174884275309623e+01 4.5716673898956422e+01 + 3.8721701761607356e+01 1.1696478108764401e+02 9.7715466491689718e+00 -1.2233031132550896e+02 -5.3333616040751664e+01 2.4250043733214998e+01 init_forces: ! |2 - 1 5.1498572672938039e+00 2.5703472206602790e+01 1.7551260448073723e+01 - 2 7.3736403442948868e+00 3.7099949433111239e+00 -3.3844562611278484e-01 - 3 -1.0939704157336930e+01 -3.6274831005384645e-02 -8.1581799650508113e+00 - 4 1.0546798203927455e+01 1.7539003794751913e+01 2.9994492538169113e+00 - 5 -1.0410959684004842e+01 -8.1769741369940423e+00 -5.2428230419297304e+00 - 6 9.9608775044461293e+00 -4.9278512001913999e+00 1.3146883289483814e+01 - 7 -6.4030495171728710e+00 -2.5387964373797569e+00 2.0140429133325867e+01 - 8 -4.5778825942774084e+00 -1.5770987190728489e+01 3.5045923269715251e+00 - 9 5.9908999094768181e+00 9.7332307249612149e-01 1.0060357557727691e+01 - 10 2.7253377841634489e+01 6.4127767911930995e+00 -1.0469797066097630e+01 - 11 1.3749322228418571e+01 1.5400413006506499e+01 7.1607935798767386e+00 - 12 -6.3010751860576750e+00 -3.4431826732902140e+00 -3.0942782086470420e+00 - 13 1.2526043516169834e+00 -9.6413955527851645e+00 1.5016970884444614e+01 - 14 1.1042419213961729e+01 -5.8227276839142634e+00 6.4364981814483899e+00 - 15 -2.3331556176574647e+01 3.5884413683136658e+00 -2.2544724990921903e+01 - 16 3.9618823632071987e+00 -3.2474498067579329e+00 -4.3843237827057759e+00 - 17 -3.0200667842357154e-01 -6.3764313595509456e+00 -7.0583460110929517e+00 - 18 1.1841351438192627e-01 1.9750953739057945e+01 -6.3192848067375609e+00 - 19 -5.6904071384394239e+00 -6.2917569004872265e+00 -1.1963208647112367e+01 - 20 -1.3902583843563816e+01 3.7924595629285376e+00 -2.9993634867248482e+00 - 21 1.1848803003107719e+01 3.8650194494042944e+00 -2.3931072468635392e+01 - 22 -6.8146144816873973e+00 -1.3419042942351584e+01 1.2608309005638453e+01 - 23 -3.0518458239020978e+00 7.1721772279611506e-01 3.9148450134713979e+00 - 24 9.4548676747643761e+00 -1.3834207645939959e+01 8.9087479013148609e+00 - 25 -7.7451277963340663e+00 -4.1099570091167834e+00 -1.8454479707717809e+01 - 26 -3.4603945899098898e+00 6.5339997484084289e-01 5.3617857889691987e+00 - 27 -6.0343949080994636e-02 6.6937405037029514e+00 4.7039728955452000e+00 - 28 -1.0240459623627199e+01 -1.0977733595975294e+00 -5.2443794968109296e+00 - 29 -4.4717521801392479e+00 -1.0065407405815222e+01 -1.3121879538108483e+00 -run_vdwl: 33.88366119853999 + 1 2.4930503590658422e+00 2.5896467541950948e+01 1.7066719639810280e+01 + 2 7.2218184875605154e+00 4.0118474768900940e+00 3.9148752387098462e-01 + 3 -1.3718937971166866e+01 3.3663692712079825e+00 -1.0002397393817580e+01 + 4 1.4129900517191322e+01 2.0841809718643809e+01 2.1496952682542894e+00 + 5 -9.1592517923752084e+00 -8.7069983022617787e+00 -6.4770992312005378e+00 + 6 1.1487008871157888e+01 -5.4527764487267900e+00 1.0366004661799398e+01 + 7 -6.9164125212993373e+00 -4.3457009981018500e+00 2.3866493326606818e+01 + 8 -9.2588973433326593e+00 -2.0177635469398975e+01 -1.5459187941167674e-01 + 9 5.1981959232620465e+00 1.9181071109834809e+00 9.4218879563250155e+00 + 10 3.0963985883350077e+01 6.1733422189068090e+00 -1.1651277139840694e+01 + 11 1.1064837240050146e+01 1.2512308799243666e+01 9.2766682780203453e+00 + 12 -4.1933575316438532e+00 -5.4041519538103513e+00 -2.9651635586686478e+00 + 13 1.4448423926315290e+00 -1.1598828585554811e+01 1.7872110510392563e+01 + 14 1.4041395848949428e+01 -1.9144098150621751e+00 3.8834189923714968e+00 + 15 -2.5418121937070769e+01 4.5950625488041901e+00 -2.3022770656806731e+01 + 16 3.1067204202140193e+00 -2.5129628946108156e+00 -1.5685706186906980e+00 + 17 1.5286683878859970e+00 -5.8564959085258241e+00 -3.7262997164039899e+00 + 18 6.6573224685000665e-01 1.7992555059946493e+01 -4.4953901874227862e+00 + 19 -6.0567006406601447e+00 -5.7678443905134351e+00 -1.3564439652712728e+01 + 20 -1.4083609073811175e+01 5.0269457320661983e+00 -3.2220271004392624e+00 + 21 1.1493857891260330e+01 5.1838819835693544e+00 -2.4761465713300559e+01 + 22 -5.4996365784593300e+00 -1.3035244495988657e+01 1.4248427810986449e+01 + 23 -4.0118786152827752e+00 -9.8544325773187125e-01 3.1051194527885806e+00 + 24 1.1421813288254940e+01 -1.4516553892048988e+01 1.0751816010329824e+01 + 25 -8.2673026983370388e+00 -2.5413619339944948e+00 -1.8840667646664016e+01 + 26 -4.9051653013974841e+00 -2.3284885417241663e-01 3.9049056189004441e+00 + 27 -8.9967933776645825e-01 8.7247259833416848e+00 2.8183470672422848e+00 + 28 -9.4518096089847532e+00 -1.2138644372841427e+00 -3.3026733872164056e+00 + 29 -4.4210668060962348e+00 -1.1980301807767344e+01 -1.3682682351024567e+00 +run_vdwl: 33.88359640474668 run_coul: 0 run_stress: ! |2- - 7.2919626053823890e+01 -2.7828917811551634e+01 1.7105017219881199e+02 3.0943069573372640e+01 -7.1432642261763988e+01 -1.2423392355535769e+02 + 7.7502974767926531e+01 -3.6134254026370506e+01 1.7185635411587106e+02 3.9508519853807577e+01 -8.7615365372620147e+01 -1.1977887281620620e+02 run_forces: ! |2 - 1 -1.4131674111536896e+01 -4.5307079930500205e+00 8.8553170111222954e+00 - 2 9.7772519012144627e+00 -7.6753209435892327e+00 2.2165445353219000e+00 - 3 3.7354251012742399e+00 4.0730926756541947e+00 -3.4731926524620276e+00 - 4 7.2336492368034024e+00 -1.6827826351167969e+00 2.4945502098538519e-01 - 5 -4.3208562921092657e+00 -5.5451228090627991e-01 1.7538935171390541e+01 - 6 -8.3623630071114459e+00 1.7132133728504200e+00 -1.4483310247648838e+01 - 7 1.3918955131102539e+01 2.0323073565411327e+01 -4.6282942080091303e+00 - 8 -1.0941054848703045e+01 1.2916076627428636e+01 2.5488491345468905e+01 - 9 1.0995769286479902e+01 -2.4561111179657743e+01 -3.6357241561659825e+00 - 10 6.5122254777210760e+00 -1.2205976065057740e+01 1.1048755663112694e+01 - 11 -9.6577339174027999e-01 -9.4121594793376318e+00 1.6872461982647906e+00 - 12 -1.2853351435795478e+01 -1.1661998374857859e+01 -9.6884410568153889e+00 - 13 -5.2341025813260380e+00 1.1186034190928794e+01 -7.3388432189309469e+00 - 14 1.8453686911180207e+00 3.6876241694906810e+01 -2.8491295602169469e+01 - 15 -5.9000405433533087e+00 1.8431521708956367e+01 -5.0964756582037101e+00 - 16 -1.9197033780653729e+01 2.0406043852115205e+00 2.7992914925840413e+00 - 17 -1.5914439243318078e+01 -1.2435145215277640e+01 2.0341321938884189e+01 - 18 1.4803582904257356e+01 -2.9511497655979561e+01 1.0215040560028893e+01 - 19 -1.0050999695673788e+01 6.1119983636964630e+00 -1.8429833349500644e+01 - 20 1.6443044975845829e+01 5.6146973572456416e+00 -9.2115937932282925e+00 - 21 1.2855031803629835e+01 -9.7066942571904633e+00 -3.9784057469393721e+00 - 22 5.5797621796998231e-01 1.4133831403887775e+01 5.3841248185420332e+00 - 23 1.3941797775857969e+01 -2.3195798716544669e+00 6.5317589855023881e+00 - 24 1.5442539735846905e-01 -1.4026916313486044e+01 6.4523748450131935e+00 - 25 1.5139211468268925e+00 8.9557892936032921e+00 -4.5731126870932428e+00 - 26 -2.9127736379450397e-01 -3.1195378063665529e+00 -4.9279042022816117e+00 - 27 1.1993002939972692e+00 -6.1439848849293170e+00 7.8038589020770974e+00 - 28 -2.0803097319420392e+00 -4.2219766348896366e+00 3.5494508593346126e+00 - 29 -5.2444493143993327e+00 1.1393726951565744e+01 -1.2205540768184314e+01 + 1 -1.3721889675174415e+01 -7.7620191071581983e+00 1.2742683057950616e+01 + 2 1.0081428839684900e+01 -8.1629534854859198e+00 1.5964541031023816e+00 + 3 3.3885831040294692e+00 3.0827983709189097e+00 -4.2710609185003792e+00 + 4 8.5989209610072734e+00 1.2565646669016031e+00 2.5408494178425514e+00 + 5 -6.0314586501034713e+00 -2.0631127711543238e+00 1.6621527539883047e+01 + 6 -1.2039166104103284e+01 4.4568523815374190e+00 -1.6296280408980270e+01 + 7 1.0913831745192716e+01 1.8896161308081695e+01 -5.6046739932115743e+00 + 8 -1.1050889004988186e+01 1.1441689038129132e+01 2.6545758968414184e+01 + 9 1.9520637760065210e+01 -2.4809872101412786e+01 -4.1964886331295146e+00 + 10 2.9870981237391474e+00 -4.6645083991201961e+00 1.2263010784598540e+01 + 11 1.6187447646432618e+00 -1.1158379823604884e+01 5.1617464853387611e+00 + 12 -1.2163560209542082e+01 -1.3075635475821205e+01 -1.0269407597959574e+01 + 13 -7.7055578900932016e+00 1.1928828176385800e+01 -8.7121016194109622e+00 + 14 2.3567004992420424e+00 3.6969620720092074e+01 -2.8505692070526969e+01 + 15 -4.2005878374197581e+00 1.8718401828649469e+01 -7.1432707551787349e+00 + 16 -2.0332139833445169e+01 2.7269649721871287e+00 -3.2531192028815892e-01 + 17 -1.6022378502352542e+01 -1.4940509539821889e+01 2.1240705183165694e+01 + 18 1.5378201715757893e+01 -2.7408376352584860e+01 9.4564803182674204e+00 + 19 -1.2019401003280619e+01 2.6074401671980016e+00 -1.5879427675376117e+01 + 20 1.7836814418383216e+01 7.0153251260282534e+00 -1.1002401853523262e+01 + 21 1.3296339251453327e+01 -9.7320607997807436e+00 -1.8946654941403327e+00 + 22 7.4965335499860730e-01 1.3790126930877824e+01 4.1396704960505488e+00 + 23 1.3308857667189576e+01 -1.9507322056364560e+00 5.6925176898480725e+00 + 24 4.1971179014225113e-01 -1.0740992948139196e+01 6.6206160765051854e+00 + 25 3.4368508396284492e-01 7.0709454374090237e+00 -5.2981356832571693e+00 + 26 6.1352323690274468e-01 -4.5203274641998803e+00 -4.3705395498231070e+00 + 27 1.5258597135783023e+00 -7.0088670342657959e+00 7.0740571861341994e+00 + 28 -2.1951340399368151e+00 -3.6548931421543327e+00 3.4550694842716405e+00 + 29 -5.4564292795332676e+00 1.1691521525944339e+01 -1.1381688618066732e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-dpd_ext_tstat.yaml b/unittest/force-styles/tests/mol-pair-dpd_ext_tstat.yaml index 2fcc640df5..70c063877a 100644 --- a/unittest/force-styles/tests/mol-pair-dpd_ext_tstat.yaml +++ b/unittest/force-styles/tests/mol-pair-dpd_ext_tstat.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 3 Nov 2022 -date_generated: Sat Dec 17 15:38:51 2022 +lammps_version: 22 Dec 2022 +date_generated: Sun Dec 25 19:22:01 2022 epsilon: 5e-14 skip_tests: gpu intel kokkos_omp single prerequisites: ! | @@ -26,69 +26,69 @@ natoms: 29 init_vdwl: 0 init_coul: 0 init_stress: ! |2- - 1.4574717693624876e+01 7.1252528106646366e+01 -1.6499215979159636e+01 -9.8805551174702813e+01 -6.2984101792184553e+01 4.6320747972221476e+01 + 1.5045021424959131e+01 8.5662837007525681e+01 -1.5841813885509445e+01 -1.1763330362032706e+02 -4.6142833557626695e+01 2.4854117806480048e+01 init_forces: ! |2 - 1 5.5624629707449236e+00 2.5267482418430543e+01 1.7455837636840936e+01 - 2 7.9890787589586321e+00 2.7334159704033394e+00 -4.4912609353132571e-01 - 3 -1.0425196835647425e+01 -2.6562178960112570e-01 -8.1895349238880719e+00 - 4 1.1707962985567560e+01 1.7218327488030280e+01 3.1325087294733294e+00 - 5 -9.3643110515778645e+00 -8.4559142280632553e+00 -5.6302526571777651e+00 - 6 1.0350319600938580e+01 -4.9631857700500754e+00 1.3208365081950475e+01 - 7 -5.6912844039900792e+00 -2.4251805995355227e+00 2.0613962020942797e+01 - 8 -4.5743413938317756e+00 -1.5518230536801214e+01 3.4794587310078304e+00 - 9 5.9805709630208952e+00 1.3393459078961725e+00 9.3707724473467930e+00 - 10 2.7103956409229447e+01 6.6911270479325857e+00 -1.0493307270086415e+01 - 11 1.3722558978526875e+01 1.6234489016866654e+01 7.3386067316565002e+00 - 12 -6.7120137869989485e+00 -3.2968581748914079e+00 -3.0247094646845269e+00 - 13 3.2316909876695732e-01 -9.4124994191809961e+00 1.5011498933843111e+01 - 14 1.0495738409782213e+01 -5.5134092504499392e+00 7.0159261877859711e+00 - 15 -2.4305376000963623e+01 3.5756649720635800e+00 -2.2527734458099950e+01 - 16 3.7161542095471747e+00 -2.8731595277798254e+00 -4.6050579724152074e+00 - 17 -6.4799969742913088e-01 -5.7421866394270609e+00 -7.7264558967425989e+00 - 18 -1.1907278574919933e-01 1.9026950648555808e+01 -5.6288253648040598e+00 - 19 -5.7140919018073539e+00 -7.0170551648043977e+00 -1.0910882421346086e+01 - 20 -1.4281381337219004e+01 3.0171248283637091e+00 -2.3009386215245646e+00 - 21 1.1633764023235113e+01 4.1353445865936145e+00 -2.3739758259468601e+01 - 22 -7.0623936613061824e+00 -1.2888281677363311e+01 1.3088657381724337e+01 - 23 -3.6007151432280211e+00 1.1354615843908720e+00 4.2600301124271356e+00 - 24 9.3346802233065116e+00 -1.4080250767719038e+01 8.5162255140264609e+00 - 25 -7.8427474971079656e+00 -4.7754637246776079e+00 -1.9403747740982496e+01 - 26 -3.7391228412677413e+00 1.9606663508176359e-01 4.7881550102383477e+00 - 27 1.0563289436921391e-01 6.9013112204358711e+00 4.5648539408008304e+00 - 28 -9.8360983166008218e+00 -7.1739355098872948e-01 -5.4182461340713486e+00 - 29 -4.1099028712689627e+00 -9.5274215037112846e+00 -1.7962811812418344e+00 + 1 2.9056560625169610e+00 2.5460477753778704e+01 1.6971296828577486e+01 + 2 7.8372569022242633e+00 3.0352685039823109e+00 2.8080705645244464e-01 + 3 -1.3204430649477361e+01 3.1370223126122370e+00 -1.0033752352654837e+01 + 4 1.5291065298831425e+01 2.0521133411922182e+01 2.2827547439107096e+00 + 5 -8.1126031599482289e+00 -8.9859383933309989e+00 -6.8645288464485734e+00 + 6 1.1876450967650335e+01 -5.4881110185854620e+00 1.0427486454266052e+01 + 7 -6.2046474081165428e+00 -4.2320851602576148e+00 2.4340026214223752e+01 + 8 -9.2553561428870186e+00 -1.9924878815471693e+01 -1.7972547537536965e-01 + 9 5.1878669768061236e+00 2.2841299463835321e+00 8.7323028459441137e+00 + 10 3.0814564450945038e+01 6.4516924756462934e+00 -1.1674787343829475e+01 + 11 1.1038073990158450e+01 1.3346384809603823e+01 9.4544814298001079e+00 + 12 -4.6042961325851337e+00 -5.2578274554115474e+00 -2.8955948147061346e+00 + 13 5.1540713978150254e-01 -1.1369932451950643e+01 1.7866638559791060e+01 + 14 1.3494715044769913e+01 -1.6050913815978500e+00 4.4628469987090824e+00 + 15 -2.6391941761459744e+01 4.5822861525541079e+00 -2.3005780123984778e+01 + 16 2.8609922665539909e+00 -2.1386726156327081e+00 -1.7893048084001308e+00 + 17 1.1826753688804374e+00 -5.2222511884019385e+00 -4.3944096020536358e+00 + 18 4.2824594671888061e-01 1.7268551969444356e+01 -3.8049307454892825e+00 + 19 -6.0803854040280765e+00 -6.4931426548306055e+00 -1.2512113426946451e+01 + 20 -1.4462406567466369e+01 4.2516109975013672e+00 -2.5236022352389775e+00 + 21 1.1278818911387724e+01 5.4542071207586762e+00 -2.4570151504133772e+01 + 22 -5.7474157580781160e+00 -1.2504483231000384e+01 1.4728776187072329e+01 + 23 -4.5607479346086981e+00 -5.6719939613711612e-01 3.4503045517443187e+00 + 24 1.1301625836797076e+01 -1.4762597013828064e+01 1.0359293623041419e+01 + 25 -8.3649223991109363e+00 -3.2068686495553185e+00 -1.9789935679928700e+01 + 26 -5.1838935527553343e+00 -6.9018219393149705e-01 3.3312748401695922e+00 + 27 -7.3370249431625123e-01 8.9322967000746072e+00 2.6792281124979147e+00 + 28 -9.0474483019583740e+00 -8.3348462867534279e-01 -3.4765400244768228e+00 + 29 -4.0592174972259478e+00 -1.1442315905663408e+01 -1.8523614625334448e+00 run_vdwl: 0 run_coul: 0 run_stress: ! |2- - 4.9266460967642843e+01 -5.9111413750583637e+01 1.4545481800287564e+02 3.5635963940478575e+01 -6.4251320017736717e+01 -1.2363508335441071e+02 + 5.3849769896276577e+01 -6.7416696588913751e+01 1.4626103460919609e+02 4.4201416163169895e+01 -8.0434015731861223e+01 -1.1918004082659748e+02 run_forces: ! |2 - 1 -1.3719442909413937e+01 -4.9666156334765059e+00 8.7599181534335386e+00 - 2 1.0391174870901938e+01 -8.6507911270806890e+00 2.1056097628746766e+00 - 3 4.2495251233698275e+00 3.8437663925916445e+00 -3.5045009657490156e+00 - 4 8.3932351062524155e+00 -2.0030337673750402e+00 3.8272790802088474e-01 - 5 -3.2757253735836840e+00 -8.3325031298511232e-01 1.7152252455143778e+01 - 6 -7.9733082813698939e+00 1.6777392958375097e+00 -1.4421849525714798e+01 - 7 1.4630307032129375e+01 2.0436521539550192e+01 -4.1549025034832399e+00 - 8 -1.0937454887747506e+01 1.3168617760103691e+01 2.5463421161558834e+01 - 9 1.0985589841094063e+01 -2.4195564454330718e+01 -4.3241673350660701e+00 - 10 6.3630015399831850e+00 -1.1927897676460454e+01 1.1025310238302538e+01 - 11 -9.9220745946968036e-01 -8.5794641759877450e+00 1.8650992727478291e+00 - 12 -1.3263925601780343e+01 -1.1515905270341566e+01 -9.6187877981563581e+00 - 13 -6.1625444464780745e+00 1.1413958091348704e+01 -7.3441718444905773e+00 - 14 1.3001579943448509e+00 3.7185212706389123e+01 -2.7912385686771604e+01 - 15 -6.8717194465009470e+00 1.8419025200600061e+01 -5.0795914343055593e+00 - 16 -1.9442609578275103e+01 2.4147187716181118e+00 2.5786155289050487e+00 - 17 -1.6260303719465991e+01 -1.1801162696943075e+01 1.9673377485657529e+01 - 18 1.4566204321128769e+01 -3.0235234907022587e+01 1.0905297377717281e+01 - 19 -1.0074685751023591e+01 5.3873018678994198e+00 -1.7378513715604424e+01 - 20 1.6064584839990744e+01 4.8406903684848972e+00 -8.5147142504480531e+00 - 21 1.2639813979842121e+01 -9.4362927696862950e+00 -3.7870406042380140e+00 - 22 3.1017290337441961e-01 1.4664671892692001e+01 5.8641592626050061e+00 - 23 1.3393222536146498e+01 -1.9013710469117922e+00 6.8765390626419194e+00 - 24 3.4310818063008952e-02 -1.4273017541160232e+01 6.0598981914849865e+00 - 25 1.4161064695435657e+00 8.2913896919499308e+00 -5.5215547745837821e+00 - 26 -5.6962178521803175e-01 -3.5765106637569533e+00 -5.5013272233283974e+00 - 27 1.3653624914977991e+00 -5.9363949579710917e+00 7.6647361174567505e+00 - 28 -1.6762592783918939e+00 -3.8420052862466951e+00 3.3757261594299082e+00 - 29 -4.8829613489439101e+00 1.1930898708671284e+01 -1.2689180476040610e+01 + 1 -1.3309656754358469e+01 -8.1979166637237615e+00 1.2647283872887678e+01 + 2 1.0695341710421234e+01 -9.1384276586239395e+00 1.4855222505271728e+00 + 3 3.9026963828306340e+00 2.8534691627635240e+00 -4.3023765426677043e+00 + 4 9.7585022503950629e+00 9.3631233330666186e-01 2.6741276387815249e+00 + 5 -4.9863319703644144e+00 -2.3418574193975501e+00 1.6234851849963423e+01 + 6 -1.1650111510443729e+01 4.4213788201612445e+00 -1.6234820163517423e+01 + 7 1.1625179619728314e+01 1.9009608128363283e+01 -5.1312857911479188e+00 + 8 -1.1047289775525231e+01 1.1694228240334212e+01 2.6520689615927708e+01 + 9 1.9510460786861312e+01 -2.4444316705453286e+01 -4.8849282093600301e+00 + 10 2.8378736138016003e+00 -4.3864202823058696e+00 1.2239562358512856e+01 + 11 1.5923108854827921e+00 -1.0325701351502117e+01 5.3396099447537368e+00 + 12 -1.2574133755992262e+01 -1.2929537920456502e+01 -1.0199751041818242e+01 + 13 -8.6340014193102803e+00 1.2156749728275322e+01 -8.7174313441007278e+00 + 14 1.8114928992688253e+00 3.7278587788949260e+01 -2.7926797439949841e+01 + 15 -5.1722657772639904e+00 1.8705905977416897e+01 -7.1263877249737213e+00 + 16 -2.0577710703532265e+01 3.1010845200366850e+00 -5.4598592505111854e-01 + 17 -1.6368244201619927e+01 -1.4306528430595499e+01 2.0572763423002375e+01 + 18 1.5140812385170182e+01 -2.8132119888567701e+01 1.0146722867774383e+01 + 19 -1.2043071245068489e+01 1.8827513028536753e+00 -1.4828092549355722e+01 + 20 1.7458350852550527e+01 6.2413207121366172e+00 -1.0305528351606435e+01 + 21 1.3081128741486914e+01 -9.4616687186166928e+00 -1.7033029425065231e+00 + 22 5.0184364285931649e-01 1.4320973581647326e+01 4.6197067394845437e+00 + 23 1.2760284113266881e+01 -1.5325208899195477e+00 6.0372977372879841e+00 + 24 2.9958698731868005e-01 -1.0987090124179106e+01 6.2281313401957235e+00 + 25 2.4587937933262927e-01 6.4065399579550508e+00 -6.2465781359868524e+00 + 26 3.3517685351344051e-01 -4.9772985981555387e+00 -4.9439544848460999e+00 + 27 1.6919190053508253e+00 -6.8012792900925856e+00 6.9349354228892004e+00 + 28 -1.7910825256065177e+00 -3.2749199759655738e+00 3.2813435087443383e+00 + 29 -5.0949404705535892e+00 1.2228693663355504e+01 -1.1865327923844278e+01 ... diff --git a/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml b/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml index 2619c97e0b..444f1e0ab0 100644 --- a/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml +++ b/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml @@ -1,6 +1,6 @@ --- -lammps_version: 10 Feb 2021 -date_generated: Fri Feb 26 23:08:44 2021 +lammps_version: 3 Nov 2022 +date_generated: Sat Dec 17 13:40:39 2022 epsilon: 5e-14 skip_tests: gpu intel kokkos_omp single prerequisites: ! | @@ -26,69 +26,69 @@ natoms: 29 init_vdwl: 0 init_coul: 0 init_stress: ! |- - -4.6687539855295086e+01 4.9351871918169586e+01 1.9462073390484221e+01 1.1522898817888347e+00 2.6715868685014787e+01 3.0212103324046076e+01 + -5.4488141611208846e+01 5.0425007684368474e+01 1.9121784971844043e+01 -3.5879769699801449e+00 3.0108651077592590e+01 3.1601901966734758e+01 init_forces: ! |2 - 1 -7.2328456924427584e+00 5.7940882979878516e+00 -1.9113458994953860e+00 - 2 -4.7012552053477972e+00 2.6790433622112029e+00 1.3635054923932115e+00 - 3 6.7026840921825519e+00 -5.9676736223445852e+00 -3.3915830059988763e+00 - 4 6.7720348606807050e+00 4.4897514073361894e-01 7.3699294700173423e-01 - 5 2.2641402851829380e+00 -3.0068528179815801e-01 -7.0405550435704589e-01 - 6 3.8060724417554281e-01 2.6748465545886400e+00 -5.7964182766309769e+00 - 7 -2.2133732408803938e-01 -6.9774772305119797e+00 2.5264591006359773e+00 - 8 2.4465313596787006e-01 4.6326099237548796e-02 -6.5548290876933113e-01 - 9 4.6008975462626109e+00 4.0741970716807616e+00 -2.6046982182064569e+00 - 10 1.3105173187870238e+00 -4.2815681824719514e+00 -3.4031103728174159e+00 - 11 8.6105544885335550e-01 -6.2190550613015629e+00 8.2127965805063419e-01 - 12 -5.2306627073584071e+00 6.1558020734960950e+00 1.5159055020244949e-02 - 13 -2.7417536790402499e+00 4.3217599539828084e+00 3.5954257245416121e+00 - 14 -5.9590226706683529e+00 2.6364375602318019e-01 6.4280529689211257e+00 - 15 5.3060104549347393e+00 -3.5896971016923067e+00 1.6530175660965871e+00 - 16 -5.0488486467589757e+00 2.3817820556776698e-02 -1.8345561896126288e+00 - 17 3.0232227817807069e+00 -5.6139986964704991e-01 3.2862426659496424e-01 - 18 -3.1264281718723121e+00 -4.1924022873627225e+00 5.9512680247918723e+00 - 19 -4.3407167757777054e-01 5.8428103842327390e+00 -6.0433393810444853e+00 - 20 2.3026133842723451e+00 2.9552056159787593e-02 -7.4952789772228434e-01 - 21 -7.7473655187022250e-01 7.7388893262883784e-01 6.2736158342296552e-02 - 22 1.6603364866966335e+00 -2.9367801261543445e+00 -2.3342260342469818e+00 - 23 -1.6699329114530093e+00 -1.3088087271620072e+00 -7.9172253827715888e-01 - 24 1.7900804065908333e+00 1.6304805621017786e+00 2.3038915888846510e+00 - 25 -1.9674546833730522e-01 1.0510983853497511e+00 1.4541486874270233e+00 - 26 -8.8313762566712167e-02 1.4804367928896129e+00 2.5513639280965590e+00 - 27 -1.2490320852115100e+00 -1.9737520890838323e+00 7.8565948584169509e-01 - 28 2.9789779555230393e+00 3.8088456373801565e+00 -2.3195005779078426e+00 - 29 -1.5228448472974749e+00 -2.7903133017106532e+00 1.9619821524466814e+00 + 1 -7.6357941668123104e+00 6.8892584779285500e+00 -1.1027921155503866e+00 + 2 -5.0930076357004017e+00 3.1874868163348284e+00 1.0662232686489794e+00 + 3 5.1398307253756714e+00 -7.4414134723946619e+00 -2.8269545474883158e+00 + 4 8.4713034058034715e+00 1.2499784819793238e+00 1.7541136137423243e+00 + 5 2.8717149411351244e+00 -5.1403891952375824e-02 -2.2442744450125276e+00 + 6 1.2461773286324702e+00 1.4019250682641902e+00 -5.9072566384647018e+00 + 7 -4.9932604943641229e-01 -7.4058315511215991e+00 5.9565324192205393e-01 + 8 2.8353698891208601e+00 -5.7660227162626887e-01 -2.9072425926288920e-01 + 9 3.7139953925755864e+00 5.7851095682403226e+00 -1.8537611316108353e+00 + 10 1.8300403019228182e+00 -2.5431146793048720e+00 -5.9153560492918000e+00 + 11 6.3993975225773125e-01 -5.3338198971059070e+00 1.6466521237276965e+00 + 12 -7.6894361051207065e+00 6.2189529348042010e+00 1.4806934066602921e+00 + 13 -3.2256976572577170e+00 4.7984493521358411e+00 3.8225599692281582e+00 + 14 -6.0220587223986479e+00 1.8607014220097087e-01 7.2167935354079429e+00 + 15 4.8284197597882299e+00 -5.6149941174838736e+00 1.2209366552160552e+00 + 16 -3.9914151267446796e+00 -2.0571423143449632e+00 -1.6455934611445420e+00 + 17 2.9100412099623734e+00 -1.0796486582280967e-01 1.5035323664046843e-01 + 18 -2.4743495275458276e+00 -3.6500716232835240e+00 6.1846952992687623e+00 + 19 -5.7104568502585928e-01 5.8026784017564994e+00 -6.4204712235183292e+00 + 20 1.7875087473939488e+00 -4.7264662544317115e-01 -6.0582332972533126e-01 + 21 -9.2045104214693807e-01 8.0844589602500405e-01 -5.3339408995657867e-01 + 22 2.7048839098326583e+00 -2.5307759405895620e+00 -1.4995483875068769e+00 + 23 -2.5687658443123187e+00 -1.7493698761229561e+00 -1.0302699367183883e+00 + 24 2.3630077775470149e+00 9.1027421894871619e-01 3.0338811725036763e+00 + 25 -8.9855492384026114e-01 1.3204043245707475e+00 8.0232996301489723e-01 + 26 4.0568321980062404e-02 1.9313371968216786e+00 2.4731930688896604e+00 + 27 8.3309998377557859e-01 -1.7840371387442175e+00 1.8989437727458425e+00 + 28 1.2938159156310900e+00 4.3272250408611566e+00 -3.4036146921126775e+00 + 29 -1.9198148763926151e+00 -3.4984076555312669e+00 1.9328119797473688e+00 run_vdwl: 0 run_coul: 0 run_stress: ! |2- - 2.4294890492962999e+01 3.0347325682966968e+01 3.3820201867786089e+01 -7.1105145407394744e+01 -3.5810693265581229e+01 4.3483684612321461e+01 + 3.2245298702199896e+01 3.4060239270094257e+01 4.0119160940850151e+01 -7.5081867352837406e+01 -3.9900264259818456e+01 4.3649932939245197e+01 run_forces: ! |2 - 1 -3.5547855575570111e+00 4.0287093684262114e+00 -3.9869645340884801e+00 - 2 -3.4493541354285702e+00 9.0642805501380508e+00 4.7388958769792158e+00 - 3 2.1895616374799748e-01 8.7321671206312459e+00 9.1138305051058843e-01 - 4 4.0454725776111961e-01 1.1703825070353404e+00 1.4277276437467361e+00 - 5 3.0836945546572569e-02 -6.3338891074957600e+00 2.0556931620779189e+00 - 6 5.2049045911099254e+00 -3.6946697560174835e+00 -8.3534127639509101e+00 - 7 -7.8387806180394759e-01 -4.3841559354291073e+00 1.9271443633409984e+00 - 8 -2.1556872088183845e-01 -1.9081189969060461e+00 2.2019550032145827e+00 - 9 1.6263303460860108e+00 -4.3714904472485632e+00 6.6163769327397326e-01 - 10 -7.4675899614036663e+00 4.1823518367578707e+00 2.8891805669669477e+00 - 11 -9.1059932159297263e-01 -2.2661895638947338e+00 -1.1543544444219824e+00 - 12 9.4058428289210614e+00 -2.5968139783935786e+00 -5.3500027307520048e-01 - 13 5.9138904151835652e+00 -1.2562008243524563e+00 -2.3294348371173941e+00 - 14 2.0646879566692116e+00 5.9041586885258601e-01 -1.3733700322276128e+00 - 15 3.8374784910105875e-02 -2.8326258645669506e+00 -2.8927477810003452e+00 - 16 -5.3239770591399713e+00 8.9328312197975523e-01 2.7598521055662952e+00 - 17 -3.9540055528974118e+00 1.4357468212883817e+00 3.4721582095959200e+00 - 18 -3.0279611313340724e+00 1.2681073034400807e+00 -1.1503209559626970e+00 - 19 -1.9239678902706352e+00 -1.3242134762883913e+00 4.4911356430445117e+00 - 20 -1.2623991049252579e+00 -2.1960965962407810e+00 9.1988403548467634e-01 - 21 4.3082688438050791e+00 -1.1420444331518340e+00 -3.2727837285152765e+00 - 22 2.5209084474771229e-02 5.3116215226482488e-01 -8.5735240307672556e-01 - 23 2.7289139734873071e+00 -3.9899287773647423e+00 -4.0853667579875497e+00 - 24 1.0926031561365961e+00 1.2988189830146233e+00 4.2022394276776094e+00 - 25 -2.2885914839897685e+00 2.9633916090002344e+00 3.4649649113986380e+00 - 26 -2.6664626977409487e+00 -2.8815741087188123e+00 -5.2586580088091219e+00 - 27 1.1757585471555640e+00 1.6420797748418081e+00 -7.9517257143923448e-01 - 28 4.7550022255629969e+00 6.8091435471752524e+00 -2.8253787377246828e+00 - 29 -2.1649864415918119e+00 -3.4320286987770263e+00 2.7464661365186007e+00 + 1 -3.6398586406786109e+00 4.7930342605055687e+00 -2.9540187438093484e+00 + 2 -3.1353308397791313e+00 9.8500293293706811e+00 4.2503411353677869e+00 + 3 -2.6746317422778271e-01 7.9384676565402774e+00 2.4342343369484434e+00 + 4 -8.8087602095411888e-01 2.0092663214515678e+00 1.1780591753965752e+00 + 5 -8.3025085390880271e-01 -5.3936470968293113e+00 1.7557638532452331e+00 + 6 6.7245898668033108e+00 -6.7038213431220726e+00 -1.0561891011568994e+01 + 7 -5.6858575197059980e-01 -4.4359190082106581e+00 2.9140456018998697e+00 + 8 -2.2768746919741218e+00 -1.8610505795844727e+00 2.4874382300783910e+00 + 9 1.9113008559727696e+00 -4.6682420448997251e+00 1.9089581380238199e+00 + 10 -6.7756703234609246e+00 6.0014047770701726e+00 9.0001101165474018e-01 + 11 -9.0442193708256891e-01 -1.6107490607301371e+00 -4.3778146507274585e-01 + 12 1.0211245684369029e+01 -4.3944296804206884e+00 -8.4013014930768315e-01 + 13 7.7056136038485681e+00 -1.5611525017025496e+00 -2.7199855794967691e+00 + 14 2.1734083216210824e+00 1.2575623059503380e+00 -3.1621339135631659e+00 + 15 -3.9802916924350940e-01 -2.3155643807145467e+00 -2.5833218276668477e+00 + 16 -6.4250996575687642e+00 6.1402285589022632e-01 4.4400514235213926e+00 + 17 -3.3751504767400125e+00 9.3393510794945223e-01 3.4107394730130198e+00 + 18 -3.2048836125801219e+00 1.0743341980647441e+00 -1.0071672289860831e+00 + 19 -2.0306798306173262e+00 -1.4128718464277576e+00 4.4519482475982501e+00 + 20 -9.7874784186078856e-01 -1.9136551645615227e+00 8.1588229520508382e-01 + 21 5.8786180977185651e+00 -4.1127509858446576e-01 -2.6606861478559494e+00 + 22 4.9702818663417508e-01 8.7360537104127234e-01 -1.3252789801620966e+00 + 23 6.8675244621349552e-01 -5.0631516012533337e+00 -4.2295458240572037e+00 + 24 4.6916776224570372e-01 6.1171242399131232e-01 3.9878743606420262e+00 + 25 -1.6712169044067000e+00 3.1754424033832356e+00 3.8619466416484221e+00 + 26 -2.6603908622285277e+00 -2.4065081900513103e+00 -5.4412348554799506e+00 + 27 1.1268245761233717e+00 1.7912256492447938e+00 -8.6281553700268343e-01 + 28 4.8276263081266206e+00 6.7368709838568721e+00 -2.7652424733968410e+00 + 29 -2.1886451203942792e+00 -3.5088760472179699e+00 2.7539398131833051e+00 ...